/* ==========================================================================
   Al-Khechen Official Portal - Premium Masterpiece Design
   الموقع الرسمي لسماحة الشيخ حسين الخشن
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #1e5e3a;
    --primary-dark: #134228;
    --primary-light: #2c8553;
    --primary-soft: #f0f7f3;
    --accent-gold: #c99632;
    --accent-gold-dark: #aa7a1f;
    --accent-gold-soft: #fcf6ea;
    --bg-page: #eef2f0;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #dbe4dd;
    --border-light: #edf3ee;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 14px rgba(19, 66, 40, 0.07);
    --shadow-hover: 0 8px 22px rgba(19, 66, 40, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body.modern-body {
    font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    text-align: right;
    color: var(--text-main);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Full-page decorative background — Islamic geometric pattern on sides */
    background-color: #d5dfd8;
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(30,94,58,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 0%, rgba(201,150,50,0.07) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            rgba(30,94,58,0.03) 0px,
            rgba(30,94,58,0.03) 1px,
            transparent 1px,
            transparent 22px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(201,150,50,0.02) 0px,
            rgba(201,150,50,0.02) 1px,
            transparent 1px,
            transparent 22px
        );
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.site-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   Header Banner & Calligraphy
   ========================================================================== */
.site-header-banner {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Calm tones taken from the banner's left (beige) and right (pale green) edges */
    background: linear-gradient(to right, #e4dfcf, #eef0e8 50%, #e9ebe1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border-bottom: 1px solid var(--border-color);
}

/* Wide screens: fill the sides by stretching the banner's outermost pixel column
   (left edge → left half, right edge → right half), so the image continues seamlessly */
.header-banner-ambient {
    position: absolute;
    inset: 0;
    filter: blur(12px);
    z-index: 1;
    pointer-events: none;
}

.header-banner-ambient::before,
.header-banner-ambient::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background-image: var(--banner-img);
    background-repeat: no-repeat;
    /* 1172px-wide image × 1172 → one source column spans the whole half */
    background-size: 117200% 100%;
}

/* Opaque under the banner (600px = half its max width), fading out toward the screen edge */
.header-banner-ambient::before {
    left: 0;
    background-position: 0 0;
    -webkit-mask-image: linear-gradient(to left, #000 600px, transparent);
    mask-image: linear-gradient(to left, #000 600px, transparent);
}

.header-banner-ambient::after {
    right: 0;
    background-position: 100% 0;
    -webkit-mask-image: linear-gradient(to right, #000 600px, transparent);
    mask-image: linear-gradient(to right, #000 600px, transparent);
}

.header-banner-content {
    position: relative;
    z-index: 2;
}

.header-banner-link {
    display: block;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 0;
}

.header-main-banner-img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.08));
    /* Soften the left/right edges into the stretched sides */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
}

/* ==========================================================================
   Green Ticker & Apps Bar
   ========================================================================== */
.topbar-green {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 60%, var(--primary-light) 100%);
    color: #ffffff;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--accent-gold);
    box-shadow: 0 3px 10px rgba(19, 66, 40, 0.2);
    width: 100%;
}

.topbar-green .site-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding-top: 4px;
    padding-bottom: 4px;
    gap: 15px;
}

.topbar-news {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    gap: 12px;
}

.topbar-news-badge {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: #ffffff;
    padding: 4px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(201, 150, 50, 0.4);
}

/* News ticker — the track holds the list twice; sliding it right by 50% (one copy) loops seamlessly */
.news-ticker {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.news-ticker-track {
    display: flex;
    width: max-content;
    /* duration is set from the list width in include/_head.php (constant speed) */
    animation: news-ticker-scroll var(--ticker-duration, 80s) linear infinite;
}

.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}

.news-ticker-group {
    display: flex;
    flex-shrink: 0;
    white-space: nowrap;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
}

.news-ticker-group a {
    color: #ffffff;
}

.news-ticker-group a:hover {
    color: #ffe8a3;
    text-decoration: underline;
}

.news-ticker-group i {
    color: var(--accent-gold);
    margin-left: 4px;
}

.news-ticker-sep {
    color: var(--accent-gold);
    margin: 0 16px;
}

@keyframes news-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(50%); }
}

@media (prefers-reduced-motion: reduce) {
    .news-ticker-track {
        animation: none;
    }
}

.topbar-apps-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.app-btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-btn-mini:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-nav-wrapper {
    background: #ffffff;
    border-bottom: 3px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.main-navbar {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    gap: 2px;
}

.nav-item {
    position: relative;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 13px 9px;
    color: #1e293b;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-link .dropdown-arrow {
    font-size: 0.65rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.navbar-social-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.social-icon-btn-green {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-color) !important;
    font-size: 0.92rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.social-icon-btn-green:hover {
    background: var(--primary-color);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(30, 94, 58, 0.25);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    min-width: 240px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-hover);
    border-top: 3px solid var(--primary-color);
    list-style: none;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.nav-item:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.dropdown-link:last-child {
    border-bottom: none;
}

.dropdown-link:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
    padding-right: 24px;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 10px;
    cursor: pointer;
}

/* ==========================================================================
   Main Layout — White content strip centered on decorated background
   ========================================================================== */
.main-layout {
    flex: 1;
    padding: 0;
    width: 100%;
    position: relative;
}

/* White-ish inner content area with side shadows */
.main-layout > .site-container {
    background: var(--bg-page);
    box-shadow: 0 0 40px rgba(0,0,0,0.08),
                inset 0 0 0 1px rgba(30,94,58,0.05);
    padding-top: 28px;
    padding-bottom: 56px;
}

.layout-grid-2col {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 28px;
    align-items: start;
    width: 100%;
}

@media (min-width: 1400px) {
    .layout-grid-2col {
        grid-template-columns: 370px 1fr;
        gap: 32px;
    }
}

/* Inner pages (no sidebar): content takes the full width */
.layout-grid-2col.layout-grid-full {
    grid-template-columns: 1fr;
}

.content-main-area {
    min-width: 0;
}

/* Sidebar on the right (first column in RTL); content stays first in the HTML */
.sidebar-unified-area {
    order: -1;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 70px;
    align-self: start;
}

/* ==========================================================================
   Widgets & Cards
   ========================================================================== */
.widget-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
}

.widget-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(30,94,58,0.25);
}

.widget-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 70%, var(--primary-light) 100%);
    color: #ffffff;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.98rem;
    font-weight: 800;
    border-bottom: 2px solid var(--accent-gold);
}

.widget-header i {
    color: var(--accent-gold);
    margin-left: 8px;
    font-size: 1.05rem;
}

.widget-body {
    padding: 16px;
}

.app-promo-card {
    background: linear-gradient(135deg, #e8f3ec, #d6eadf);
    border: 1px solid #c3dcc9;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.app-promo-title {
    font-size: 0.97rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.app-promo-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
}

.app-store-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-store-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff !important;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.btn-store-badge:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(30, 94, 58, 0.3);
    color: #ffffff !important;
}

.search-form-modern {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.search-form-modern:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 94, 58, 0.12);
}

.search-input-modern {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
}

.search-btn-modern {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 9px 16px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: background 0.2s ease;
}

.search-btn-modern:hover {
    background: var(--accent-gold);
}

.video-responsive-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000000;
}

.video-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Hewar / Q&A in Sidebar */
.hewar-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.btn-hewar {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    text-align: center;
    transition: var(--transition);
}

.btn-hewar-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(30, 94, 58, 0.25);
}

.btn-hewar-primary:hover {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(201, 150, 50, 0.3);
}

.btn-hewar-secondary {
    background: #eef5f1;
    color: var(--primary-dark);
    border: 1.5px solid var(--border-color);
}

.btn-hewar-secondary:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-color: var(--primary-light);
}

.hewar-mini-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.hewar-mini-item {
    border-bottom: 1px dashed #cfe0d4;
    padding-bottom: 11px;
}

.hewar-mini-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hewar-mini-q {
    font-size: 0.87rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 5px;
    line-height: 1.5;
}

.hewar-mini-q span {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.hewar-mini-a {
    font-size: 0.83rem;
    color: var(--text-body);
    line-height: 1.6;
    padding-right: 8px;
    border-right: 2px solid var(--accent-gold);
}

/* Books / Slider */
.book-slide-item {
    text-align: center;
    padding: 4px 0;
}

.book-slide-thumb {
    margin: 0 auto 10px auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    max-height: 170px;
    object-fit: cover;
    transition: var(--transition);
}

.book-slide-item:hover .book-slide-thumb {
    transform: scale(1.04);
}

.book-slide-title {
    font-weight: 800;
    font-size: 0.97rem;
    color: var(--primary-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}

.book-slide-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ==========================================================================
   Section Header & Article Cards
   ========================================================================== */
.section-header-modern {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-gold);
}

/* Breadcrumb links sit on the green header — keep them white */
.section-title a {
    color: #ffffff;
}

.section-title a:hover {
    color: var(--accent-gold);
}

.article-row-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    border-right: 4px solid transparent;
    padding: 20px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 22px;
    align-items: center;
    transition: var(--transition);
}

.article-row-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-right-color: var(--primary-color);
}

.article-row-thumb {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: var(--primary-soft);
}

.article-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-row-card:hover .article-row-thumb img {
    transform: scale(1.06);
}

.article-row-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0ede4, #cce0d3);
    color: var(--primary-light);
    font-size: 2.2rem;
}

.article-row-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-row-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--accent-gold-soft), #fff8e6);
    color: var(--accent-gold-dark);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    width: fit-content;
    border: 1px solid rgba(201,150,50,0.22);
}

.article-row-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.45;
    margin-bottom: 8px;
}

.article-row-title a {
    color: var(--primary-dark);
}

.article-row-title a:hover {
    color: var(--accent-gold-dark);
}

.article-row-desc {
    font-size: 0.92rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 14px;
}

.article-row-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}

.btn-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 20px;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(30,94,58,0.2);
}

.btn-readmore:hover {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(201,150,50,0.3);
}

.btn-readmore i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.btn-readmore:hover i {
    transform: translateX(-3px);
}

/* ==========================================================================
   Article Detail
   ========================================================================== */
.article-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 32px;
    margin-bottom: 24px;
}

.article-detail-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1.4;
    margin-bottom: 14px;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-detail-meta-item i {
    color: var(--accent-gold);
}

.article-detail-featured-img {
    margin: 0 0 24px 24px;
    float: right;
    max-width: 320px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
}

.article-detail-content {
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-main);
    /* CMS text can hold long URLs with no spaces — let them wrap on mobile */
    overflow-wrap: anywhere;
}

.article-detail-content iframe,
.article-detail-content video,
.article-detail-content embed,
.article-detail-content table {
    max-width: 100%;
}

.article-detail-content p {
    margin-bottom: 20px;
}

.article-detail-downloads {
    margin: 28px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn-download-file {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff !important;
    font-weight: 800;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(30, 94, 58, 0.25);
    transition: var(--transition);
}

.btn-download-file:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 94, 58, 0.35);
    color: #ffffff !important;
}

/* ==========================================================================
   Modern Forms
   ========================================================================== */
.modern-form-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
}

.form-group-modern {
    margin-bottom: 18px;
}

.form-label-modern {
    display: block;
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control-modern {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: #ffffff;
    color: var(--text-main);
    transition: var(--transition);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 94, 58, 0.12);
}

textarea.form-control-modern {
    min-height: 120px;
    resize: vertical;
}

.btn-submit-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(30, 94, 58, 0.3);
    transition: var(--transition);
}

.btn-submit-modern:hover {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(201, 150, 50, 0.35);
}

.alert-modern {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.alert-success-modern {
    background: #def7ec;
    color: #03543f;
    border: 1px solid #bcf0da;
}

.alert-error-modern {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #fbd5d5;
}

/* ==========================================================================
   Hewar (Q&A) List Styles
   ========================================================================== */
.hewar-qa-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 18px;
    border-right: 5px solid var(--primary-color);
    transition: var(--transition);
}

.hewar-qa-card:hover {
    box-shadow: var(--shadow-hover);
}

.hewar-qa-q,
.hewar-qa-a {
    overflow-wrap: anywhere;
}

/* CKEditor paste leftover saved in some DB answers (absolute, left:-1000px) — widens the page in RTL */
#cke_pastebin {
    display: none !important;
}

.hewar-qa-q {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hewar-qa-q-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hewar-qa-a {
    font-size: 0.96rem;
    color: var(--text-body);
    line-height: 1.85;
    background: linear-gradient(135deg, #f7faf8, #eef5f0);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    border-right: 3px solid var(--accent-gold);
}

.hewar-qa-a-badge {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 5px;
    margin-left: 8px;
}

/* ==========================================================================
   Videos / Audio Grid
   ========================================================================== */
.videos-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-item-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.video-item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.video-item-body {
    padding: 16px;
    flex: 1;
}

.video-item-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.4;
    margin-bottom: 6px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: linear-gradient(160deg, #0b2416 0%, var(--primary-dark) 40%, #0d2e1b 100%);
    color: #b8ccbe;
    padding: 48px 0 24px 0;
    margin-top: auto;
    border-top: 4px solid var(--accent-gold);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.012) 0px,
        rgba(255,255,255,0.012) 1px,
        transparent 1px,
        transparent 22px
    );
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: 30px;
    margin-bottom: 32px;
    position: relative;
}

.footer-col h3 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-gold);
    display: inline-block;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #b8ccbe;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-gold);
    padding-right: 6px;
}

.footer-links a i {
    color: var(--accent-gold);
    opacity: 0.7;
    font-size: 0.75rem;
}

/* Social icons row (used in footer) */
.topbar-social {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.88rem;
    color: #88a994;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
}

/* Developer credit — sits opposite the copyright, stacks under it on narrow screens */
.footer-credit {
    font-size: 0.8rem;
    letter-spacing: 0.2px;
}

.footer-credit strong,
.footer-credit a {
    color: #ffffff;
    font-weight: 700;
}

.footer-credit a:hover {
    color: var(--accent-gold);
}

@media (max-width: 768px) {
    .footer-bottom {
        justify-content: center;
    }
}

/* ==========================================================================
   bxSlider Override
   ========================================================================== */
.books-slider-wrapper .bx-wrapper {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    margin: 0 auto !important;
}

.books-slider-wrapper .bx-wrapper .bx-pager {
    display: none;
}

/* ==========================================================================
   Category Page
   ========================================================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.category-item-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.category-item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.category-item-thumb {
    height: 160px;
    overflow: hidden;
    background: linear-gradient(135deg, #e0ede4, #cce0d3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-item-card:hover .category-item-thumb img {
    transform: scale(1.06);
}

.category-item-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-item-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.45;
    margin-bottom: 8px;
}

.category-item-desc {
    font-size: 0.86rem;
    color: var(--text-body);
    line-height: 1.7;
    flex: 1;
    margin-bottom: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1360px) {
    /* No room for the 11 menu items + social icons on one line (icons are also in the footer) */
    .navbar-social-left {
        display: none;
    }
}

/* Hamburger menu below 1200px — keep in sync with the JS check in include/_head.php */
@media (max-width: 1200px) {
    .navbar-social-left {
        display: flex;
    }

    .mobile-nav-toggle {
        display: block;
    }

    /* Open menu drops to its own full-width row under the toggle + social icons */
    .nav-container {
        flex-wrap: wrap;
        row-gap: 0;
    }

    .main-navbar {
        display: none;
        order: 1;
        flex-direction: column;
        align-items: stretch;
        flex-basis: 100%;
        width: 100%;
        background: #ffffff;
        border-top: 1px solid var(--border-color);
    }

    .main-navbar.mobile-active {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-light);
        width: 100%;
        white-space: normal;
    }

    .dropdown-menu {
        min-width: 0;
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background: var(--primary-soft);
        border-radius: 0;
        border-top: none;
        padding-right: 20px;
    }

    .nav-item.mobile-dropdown-open .dropdown-menu {
        display: block;
    }
}

@media (max-width: 1100px) {
    .layout-grid-2col {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 992px) {
    .layout-grid-2col {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .sidebar-unified-area {
        order: 0;
        position: static;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .article-row-card {
        grid-template-columns: 1fr;
    }

    .article-row-thumb {
        height: 180px;
    }

    .article-detail-featured-img {
        float: none;
        max-width: 100%;
        margin: 0 0 16px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .topbar-apps-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .article-detail-card {
        padding: 18px;
    }

    .article-detail-title {
        font-size: 1.35rem;
    }

    .hewar-actions {
        flex-direction: column;
    }

    .videos-grid-modern {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }
}
