﻿/* ============================================
   BASE & TYPOGRAPHY
   ============================================ */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 0;
    color: #332f86;
    font-family: 'Cairo', sans-serif;
    background-color: #f4f4f4ee;
}

.bg-light {
    --bs-bg-opacity: 1;
    background-color: #332f8630 !important;
}

/* ============================================
   PUBLIC WEBSITE LAYOUT
   ============================================ */

body.public-body {
    background: #fff;
    color: #2d2d2d;
    font-family: 'Cairo', sans-serif;
    margin: 0;
}

/* Header / Navbar */
.public-header {
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 1030;
}

    .public-header .navbar {
        padding: 0.6rem 0;
    }

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

    .public-brand .brand-logo {
        width: 52px;
        height: 52px;
        object-fit: contain;
        border-radius: 8px;
    }

    .public-brand .brand-text {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .public-brand .brand-name-top {
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        color: #332f86;
    }

    .public-brand .brand-name-bottom {
        font-size: 0.65rem;
        font-weight: 500;
        color: #888;
        letter-spacing: 0.04em;
    }

.public-header .navbar-nav .nav-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #444;
    padding: 0.5rem 0.85rem;
    transition: color 0.2s;
    letter-spacing: 0.01em;
}

    .public-header .navbar-nav .nav-link:hover,
    .public-header .navbar-nav .nav-link.active {
        color: #332f86;
    }

.public-header .dropdown-menu {
    border: 1px solid #e8eaed;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    padding: 0.5rem;
    min-width: 200px;
}

.public-header .dropdown-item {
    font-size: 0.875rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    color: #444;
    transition: all 0.15s;
}

    .public-header .dropdown-item:hover {
        background: #f0effc;
        color: #332f86;
    }

.public-header .navbar-toggler {
    border-color: #e0e0e0;
    font-size: 1rem;
}

/* Main content */
.public-main {
    min-height: calc(100vh - 200px);
}

/* Footer */
.public-footer {
    background: #1e1c5e;
    color: rgba(255,255,255,0.75);
    margin-top: 4rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    padding: 2px;
}

.footer-brand .fw-bold {
    color: #fff;
}

.footer-desc {
    color: rgba(255,255,255,0.55) !important;
}

.footer-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-links a {
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        font-size: 0.88rem;
        transition: color 0.2s;
    }

        .footer-links a:hover {
            color: #fff;
        }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   PUBLIC PAGE COMPONENTS
   ============================================ */

/* Page hero banner */
.page-hero {
    background: linear-gradient(135deg, #332f86 0%, #1e1c5e 100%);
    color: #fff;
    padding: 3.5rem 0 3rem;
    margin-bottom: 3rem;
}

    .page-hero h1 {
        font-size: 2rem;
        font-weight: 800;
        margin: 0;
    }

    .page-hero .breadcrumb-item {
        color: rgba(255,255,255,0.65);
        font-size: 0.85rem;
    }

        .page-hero .breadcrumb-item.active {
            color: rgba(255,255,255,0.9);
        }

        .page-hero .breadcrumb-item + .breadcrumb-item::before {
            color: rgba(255,255,255,0.4);
        }

/* Content page wrapper */
.content-page {
    padding: 0 0 4rem;
}

.content-page-body {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    border: 1px solid #e8eaed;
}

/* Item cards (for Events, VoiceOfSudan, TrainingCenter) */
.items-grid {
    padding-bottom: 4rem;
}

.item-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

    .item-card:hover {
        box-shadow: 0 8px 28px rgba(51,47,134,0.12);
        transform: translateY(-3px);
        border-color: #c9c7e8;
    }

.item-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e1c5e;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.item-card-excerpt {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
    flex: 1;
}

.item-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f2f5;
    background: #fafbff;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #aaa;
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
        display: block;
    }

.mission-description img {
    max-width: 100%;
    height: auto;
}

.entry-title {
    font-size: 50px;
}

.sections {
    max-height: 350px !important;
    object-fit: cover !important
}

.description-preview {
    max-height: 80px; /* يتحكم بعدد الأسطر */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* عدد الأسطر */
    -webkit-box-orient: vertical;
}

.text-preview {
    max-width: 400px;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* عدد الأسطر */
    -webkit-box-orient: vertical;
}

    .text-preview img {
        display: none; /* نخفي الصور في الاندكس */
    }

/* تنسيق محتوى الوصف */
/*.description-content {
    line-height: 1.8;
}

    .description-content img {
        float: right;*/ /* تجعل الصورة على اليمين */
/*margin-left: 20px;*/ /* مسافة بين النص والصورة */
/*margin-bottom: 10px;*/ /* مسافة أسفل الصورة */
/*max-width: 200px;*/ /* تحديد حجم الصورة */
/*height: auto;
        object-fit: cover;
    }*/

.description-content img,
.description-content video {
    max-width: 300px;
    float: right;
    margin-left: 20px;
}


/* ================================
   HOMEPAGE SECTION LAYOUT
================================ */
.home-section {
    margin-bottom: 3.5rem;
}

.section-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 0 1.1rem;
    border-bottom: 2px solid #f0f0f8;
    margin-bottom: 0;
}

.section-accent-bar {
    display: inline-block;
    width: 5px;
    height: 28px;
    background: linear-gradient(180deg, #332f86 0%, #6c63ff 100%);
    border-radius: 3px;
    flex-shrink: 0;
}

.section-heading-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e1c5e;
    letter-spacing: 0.02em;
    margin: 0;
}

.view-all-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: #332f86;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.32rem 1rem;
    border: 1.5px solid rgba(51,47,134,0.4);
    border-radius: 20px;
    transition: all 0.2s;
    white-space: nowrap;
}

    .view-all-link:hover {
        background: #332f86;
        color: #fff;
        border-color: #332f86;
    }

/* ================================
   HERO CAROUSEL SLIDES
================================ */
.slide-img-wrap {
    position: relative;
    overflow: hidden;
    height: 440px;
    background: #1e1c5e;
}

    .slide-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 7s ease;
    }

.carousel-item.active .slide-img-wrap img {
    transform: scale(1.04);
}

.slide-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient( to top, rgba(10,8,60,0.88) 0%, rgba(10,8,60,0.55) 30%, rgba(10,8,60,0.15) 60%, transparent 100% );
    pointer-events: none;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding-bottom: 2.5rem;
}

[dir="rtl"] .slide-caption .container {
    text-align: right;
}

.slide-category-tag {
    display: inline-block;
    background: #332f86;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.22rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.slide-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-excerpt {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.82);
    margin-bottom: 1rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    /* Hide any nested HTML tags that might be in rich text descriptions */
    .slide-excerpt img,
    .slide-excerpt iframe,
    .slide-excerpt table {
        display: none;
    }

.slide-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.45);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.42rem 1.1rem;
    border-radius: 22px;
    text-decoration: none;
    transition: all 0.22s;
}

    .slide-read-btn:hover {
        background: #fff;
        color: #332f86;
        border-color: #fff;
    }

/* Custom carousel controls */
.carousel-ctrl-btn {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    transition: all 0.2s;
}

    .carousel-ctrl-btn:hover {
        background: rgba(255,255,255,0.28);
        border-color: rgba(255,255,255,0.7);
    }

.carousel-control-prev,
.carousel-control-next {
    width: auto;
    opacity: 1 !important;
    padding: 0 1.25rem;
    align-items: flex-start;
    padding-top: 1.5rem;
}

/* Pill indicators */
.home-section .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.45);
    transition: all 0.3s;
    margin: 0 4px;
    flex-shrink: 0;
}

    .home-section .carousel-indicators button.active {
        background: #fff;
        width: 26px;
        border-radius: 4px;
    }

/* ================================
   ARTICLE LIST BELOW CAROUSEL
================================ */

/* 2-column grid of horizontal article cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-left: 1px solid #eef0f8;
    border-right: 1px solid #eef0f8;
    margin-top: 0;
}

/* Each article card — image left, text right */
.article-card-h {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid #eef0f8;
    border-right: 1px solid #eef0f8;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s;
    align-items: flex-start;
}

    .article-card-h:nth-child(even) {
        border-right: none;
    }

    .article-card-h:hover {
        background: #f7f7fc;
        color: inherit;
        text-decoration: none;
    }

/* Thumbnail */
.article-thumb {
    width: 110px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #d8d8e8;
    position: relative;
}

    .article-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.35s ease;
    }

.article-card-h:hover .article-thumb img {
    transform: scale(1.06);
}

/* Text content */
.article-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.article-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: #332f86;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.article-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e1c5e;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.18s;
}

.article-card-h:hover .article-title {
    color: #332f86;
}

.article-text {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    /* Hide any HTML elements inside the short description */
    .article-text img,
    .article-text iframe,
    .article-text figure,
    .article-text table {
        display: none;
    }

/* Responsive: single column on small screens */
@media (max-width: 576px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-card-h {
        border-right: none;
    }
}

/* ================================
   PARTNERS SECTION
================================ */
.partners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
}

.partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    background: #fff;
    width: 140px;
    transition: box-shadow 0.2s, transform 0.2s;
}

    .partner-card:hover {
        box-shadow: 0 6px 20px rgba(51, 47, 134, 0.12);
        transform: translateY(-3px);
    }

    .partner-card img {
        width: 100px;
        height: 60px;
        object-fit: contain;
        filter: grayscale(30%);
        transition: filter 0.2s;
    }

    .partner-card:hover img {
        filter: grayscale(0%);
    }

.partner-placeholder {
    width: 110px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0fa;
    border-radius: 8px;
    color: #332f86;
    font-size: 2rem;
}

.partner-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    text-decoration: none;
}

a.partner-name:hover {
    color: #332f86;
    text-decoration: underline;
}

/* ================================
   LEGACY SECTION-BLOCK (keep for compatibility)
================================ */
.section-block {
    min-height: auto;
    position: relative;
}

    .section-block .carousel-item img {
        height: 440px;
        object-fit: cover;
        width: 100%;
    }

/* ================================
   CENTER BOTTOM SCROLL ARROW
================================ */
.scroll-down-btn {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #4742a2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 15px 30px rgba(0,0,0,0.35);
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

    .scroll-down-btn:hover {
        transform: translateX(-50%) scale(1.15);
    }

    .scroll-down-btn:active {
        transform: translateX(-50%) scale(0.95);
    }

    .scroll-down-btn svg {
        width: 22px;
        height: 22px;
        stroke: #fff;
    }

/* ================================
   BOUNCE ANIMATION
================================ */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(8px);
    }

    60% {
        transform: translateX(-50%) translateY(4px);
    }
}

/*Buttons */
.btn-primary {
    color: #fff;
    background-color: #332f86;
    border-color: #332f86;
}

    .btn-primary:hover {
        color: #fff;
        background-color: #231e87;
        border-color: #231e87;
    }

.btn-outline-primary {
    --bs-btn-color: #332f86;
    --bs-btn-border-color: #332f86;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #332f86;
    --bs-btn-hover-border-color: #332f86;
    --bs-btn-focus-shadow-rgb: 13, 110, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #332f86;
    --bs-btn-active-border-color: #332f86;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #332f86;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #332f86;
    --bs-gradient: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #3f3b92;
}

.navbar-light .navbar-nav .nav-link:focus, .navbar-light .navbar-nav .nav-link:hover {
    color: #332f86;
}

.navbar-light .navbar-nav .nav-link {
    color: #332f86;
}

.dropdown-item:focus, .dropdown-item:hover {
    color: #332f86;
    background-color: var(--bs-dropdown-link-hover-bg);
}

.text-secondary {
    --bs-text-opacity: 1;
    color: rgb(61 65 67) !important;
}

.carousel-caption {
    position: absolute;
    right: 15%;
    bottom: 1.25rem;
    left: 15%;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    color: #fff !important;
    text-align: center;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.5);
}

@media (max-width: 991.98px) {
    .nav-search-box.open {
        width: 220px;
    }
}

@media (max-width: 575.98px) {
    .admin-search-box.open {
        width: 200px;
    }
}

/* ================================
   SUMMERNOTE EDITOR FIX
================================ */

.note-editor .note-editing-area .note-editable {
    font-family: 'Cairo', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow: auto !important;
    position: relative !important;
}