/*
Theme Name: Wahar Magazine
Theme URI: http://example.com/wahar
Author: Antigravity
Author URI: http://example.com
Description: A premium Kurdish Sorani magazine theme with Dark/Light mode support.
Version: 2.0
Text Domain: wahar
*/

/* ============================ */
/* Local Fonts - IBM Plex Sans Arabic */
/* ============================ */

/* ibm-plex-sans-arabic-300 - arabic */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 300;
    src: url('assets/fonts/ibm-plex-sans-arabic-v14-arabic-300.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-sans-arabic-regular - arabic */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 400;
    src: url('assets/fonts/ibm-plex-sans-arabic-v14-arabic-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-sans-arabic-500 - arabic */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 500;
    src: url('assets/fonts/ibm-plex-sans-arabic-v14-arabic-500.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* ibm-plex-sans-arabic-700 - arabic */
@font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 700;
    src: url('assets/fonts/ibm-plex-sans-arabic-v14-arabic-700.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

:root {
    /* Dark Theme Default - Warm orange tone from waves */
    --bg-body: #140d05;
    --bg-card: #1d140a;
    --bg-header: rgba(29, 20, 10, 0.75);
    /* Translucent */
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;

    /* New Accent Color */
    --accent: #FA9801;
    --accent-hover: #ffaa33;
    --cat-color: #bcada1;
    /* Muted taupe for Dark Mode */

    --border-color: rgba(255, 255, 255, 0.08);
    /* Subtle border */
    /* Soft layered shadow */
    --header-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 10px 40px -5px rgba(0, 0, 0, 0.3);

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-pill: 50px;
}

/* Light Mode Overrides */
[data-bs-theme="light"] body {
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    /* Translucent White */
    --text-primary: #121212;
    --text-secondary: #555555;
    --cat-color: #675D4D;
    /* The requested darker, non-orange color */
    --border-color: rgba(0, 0, 0, 0.08);
    --header-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
    padding-bottom: 50px;
}

/* Robust Sticky Header */
header {
    position: sticky;
    top: 0;
    z-index: 1030;
    /* Above content, below overlays */
    overflow-anchor: none;
    /* Prevent Chrome scroll anchoring issues */
    transition: transform 0.3s ease;
}

/* Floating Header */
.floating-header {
    margin-top: 0;
    background-color: var(--bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 5px;
    box-shadow: var(--header-shadow);
    border-top: 5px solid #fa9700;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled .floating-header {
    margin-top: 2px;
    padding: 0px 30px;
    border-radius: 0 0 12px 12px;
}

/* Logo Scaling - Reduce container height to shrink header */
.brand-logo {
    display: flex;
    width: 120px;
    height: 100px;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled .brand-logo {
    height: 40px;
    /* Slink height */
    width: 60px;
}

/* Logo Visibility Logic */
.logo-dark {
    display: none;
}

[data-bs-theme="dark"] .logo-light {
    display: none;
}

[data-bs-theme="dark"] .logo-dark {
    display: block;
}

.main-logo-img {
    max-height: 100px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

header.scrolled .main-logo-img {
    max-height: 35px;
}

header.scrolled .header-main {
    margin-top: 0px !important;
}

@media (max-width: 991.98px) {
    .floating-header {
        padding: 10px 20px;
        margin-top: 10px;
    }

    header.scrolled .floating-header {
        padding: 5px 15px;
        margin-top: 0;
    }

    .brand-logo {
        width: 80px;
        height: 60px;
    }

    header.scrolled .brand-logo {
        height: 35px;
        width: auto;
    }

    .main-logo-img {
        max-height: 60px;
        max-width: 80px;
    }

    header.scrolled .main-logo-img {
        max-height: 30px;
    }

    /* Mobile Header Alignment (User Requested) */
    .floating-header .col-auto {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
        /* Gap between logo and buttons */
    }

    .floating-header .col {
        padding: 0;
        /* Reset padding */
    }

    .header-actions {
        justify-content: center;
        width: 100%;
    }

    .header-top {
        justify-content: flex-start !important;
        width: 100%;
    }

    .top-left {
        justify-content: flex-start !important;
        width: 100%;
    }
}

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

/* Header Top - Use opacity and transform for smooth collapse */
.header-top {
    font-size: 0.9rem;
    color: var(--text-secondary);
    height: 40px;
    overflow: visible;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    position: relative;
    z-index: 1;
}

header.scrolled .header-top {
    height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.header-divider {
    border-color: rgba(0, 0, 0, 0.54);
    opacity: 0.4;
    margin: 0 0 3px 0;
    margin: 0;
    height: 1px;
    transition: all 0.3s ease;
}

header.scrolled .header-divider {
    display: none;
}

/* Brand & Nav */
.brand-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.brand-logo span {
    letter-spacing: -1px;
}

/* Social Links in Header */
.social-links {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.social-links a {
    color: var(--text-secondary);
    transition: color 0.2s;
    font-size: 1.1rem;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--accent);
}

/* Collapsible Search (Desktop) */
.search-collapsible-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-collapsible {
    width: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: var(--bg-body);
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    margin-right: -40px;
    /* Overlap button slightly for unified look */
    padding-right: 40px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
}

.search-collapsible-wrapper.active .search-box-collapsible {
    width: 280px;
    opacity: 1;
    pointer-events: auto;
    border-color: var(--accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding-left: 15px;
}

.search-collapsible-wrapper.active #desktop-search-toggle {
    color: var(--accent);
    border-color: var(--accent);
    z-index: 2;
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    height: 100%;
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
}

.search-btn:hover {
    color: var(--accent);
}

/* Language Switcher (Top Row) */
.lang-switcher-top {
    position: relative;
    z-index: 1060;
}

.lang-trigger {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.lang-trigger:hover {
    color: var(--accent);
}

.lang-trigger .active-lang-name {
    font-weight: 700;
    color: var(--text-primary);
}

.lang-switcher-top .dropdown-menu {
    background-color: var(--bg-header) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-color) !important;
    min-width: 140px;
    margin-top: 10px !important;
    z-index: 1061 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
}

[dir="rtl"] .lang-switcher-top .dropdown-menu {
    left: auto;
    right: 0;
}

.lang-switcher-top .dropdown-item {
    color: var(--text-primary) !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
}

.lang-switcher-top .dropdown-item:hover {
    background-color: rgba(250, 152, 1, 0.1) !important;
    color: var(--accent) !important;
}

.lang-switcher-top .dropdown-item.active {
    background-color: var(--accent) !important;
    color: #fff !important;
}

/* Redefining header-top for mobile visibility */
@media (max-width: 767.98px) {
    .header-top {
        padding-bottom: 5px;
    }

    .top-left {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Icon Buttons (Theme, Bookmark) */
.icon-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}



/* Cards & Content */
.flat-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-img-placeholder {
    height: 200px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 1.5rem;
}

.badge-cat {
    background-color: rgba(250, 152, 1, 0.1);
    /* transparent orange */
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}




/* ============================ */
/* Mobile Search Toggle Styles  */
/* ============================ */

/* Hide desktop search on mobile */
@media (max-width: 991.98px) {
    .search-box-wrapper.d-none-mobile {
        display: none !important;
    }

    #mobile-search-toggle {
        display: flex !important;
    }
}

/* Mobile Search Container (Hidden by default) */
.mobile-search-container {
    display: none;
    padding: 15px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-search-container .search-input {
    border-bottom: 1px solid var(--border-color);
}

/* ============================ */
/* Max Mega Menu Theme Overrides */
/* ============================ */

/* Reset backgrounds and borders to be transparent */
.nav-menu .mega-menu-wrap,
.nav-menu .mega-menu-wrap .mega-menu,
.nav-menu .mega-menu-wrap .mega-menu-link {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Match theme font and colors */
.nav-menu .mega-menu-link {
    color: var(--text-primary) !important;
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    transition: color 0.3s ease !important;
    padding: 0 15px !important;
    line-height: normal !important;
    height: auto !important;
}

/* Hover and Active states */
.nav-menu .mega-menu-link:hover,
.nav-menu .mega-menu-link:focus,
.nav-menu .mega-menu-item.mega-current-menu-item>a.mega-menu-link,
.nav-menu .mega-menu-item.mega-current-menu-parent>a.mega-menu-link {
    color: var(--accent) !important;
    background: transparent !important;
}

/* Indicators (arrows) */
.nav-menu .mega-indicator {
    color: var(--text-secondary) !important;
    margin-right: 5px !important;
}

.nav-menu .mega-menu-link:hover .mega-indicator {
    color: var(--accent) !important;
}

/* Sub-menu styling */
.nav-menu .mega-sub-menu {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--header-shadow) !important;
    padding: 10px 0 !important;
}

.nav-menu .mega-sub-menu .mega-menu-link {
    font-weight: 400 !important;
    font-size: 0.9rem !important;
}

/* ============================ */
/* Home Hero Grid (Bootstrap)   */
/* ============================ */

.home-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.home-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.card-link {
    text-decoration: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.card-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.home-card:hover .card-img {
    filter: brightness(0.9);
}

.card-body-content {
    padding: 15px;
    flex-grow: 1;
}

.entry-title {
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s;
    font-weight: 700;
    font-size: 1.1rem;
    /* Slightly smaller default */
}

.home-card:hover .entry-title {
    color: var(--accent);
}

/* Featured Main Layout */
.card-featured-main {
    height: 400px;
}

.card-featured-main .card-image-wrap {
    aspect-ratio: auto;
    height: 100%;
    min-height: 400px;
    max-height: 400px;
}

/* Side card in first row - match featured card height */
.card-side-first-row {
    height: 400px;
}

.card-overlay-content {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 15px 30px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-featured-main .entry-title {
    font-size: 1.1rem;
    /* Matched to others */
    color: #fff;
    margin-bottom: 8px !important;
}

.card-overlay-content .date {
    color: #ddd;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.9;
    color: #eee;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons and Meta */
.bookmark-btn-round {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    z-index: 5;
}

.bookmark-btn-mini {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
    z-index: 10;
}

[dir="rtl"] .bookmark-btn-mini {
    left: auto;
    right: 10px;
}

.home-card:hover .bookmark-btn-mini,
.related-post-card:hover .bookmark-btn-mini,
.youtube-card:hover .bookmark-btn-mini,
.video-card:hover .bookmark-btn-mini {
    opacity: 1;
}

.bookmark-btn-round:hover,
.bookmark-btn-mini:hover,
.bookmark-btn-round.active,
.bookmark-btn-mini.active {
    color: var(--accent);
    transform: scale(1.1);
}

.bookmark-btn-mini.active {
    opacity: 1;
}

/* Ensure bookmark buttons are visible on active state for all card types */
.related-post-card .bookmark-btn-mini.active,
.youtube-card .bookmark-btn-mini.active,
.video-card .bookmark-btn-mini.active {
    opacity: 1;
}

.bookmark-item {
    transition: background-color 0.2s;
}

.bookmark-item:hover {
    background-color: var(--border-color) !important;
}

.bookmark-item a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.bookmark-item:hover a {
    color: var(--accent);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.badge-cat,
.badge-cat a {
    color: var(--cat-color) !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

.badge-cat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Featured card badge - refined background */
.card-featured-main .badge-cat,
.card-featured-main .badge-cat a {
    color: #fff !important;
    background-color: var(--cat-color);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
}

.card-body-content .badge-cat {
    margin-bottom: 8px;
}

/* Single post category badge - Orange button style */
.badge-cat-single {
    background-color: var(--accent) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.badge-cat-single:hover {
    background-color: var(--accent-hover) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 152, 1, 0.3);
}

/* Single post entry-header - Not sticky */
.site-main .entry-header {
    position: static !important;
}

/* Single post title - Slightly larger */
.single-article-content .entry-header .entry-title,
.site-main .entry-header .entry-title {
    font-size: 2.25rem;
    line-height: 1.3;
}

/* Single post meta buttons */
.entry-meta .views-btn {
    cursor: default;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.entry-meta .bookmark-btn-single {
    border-color: var(--accent);
    color: var(--accent);
    transition: all 0.3s ease;
}

.entry-meta .bookmark-btn-single:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(250, 152, 1, 0.3);
}

.entry-meta .bookmark-btn-single.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.entry-meta .bookmark-btn-single.active i {
    font-weight: 900;
}

/* Social Share Buttons */
.social-share-buttons {
    margin-top: 1rem;
}

.social-share-btn {
    transition: all 0.3s ease;
    border-width: 1px;
    font-weight: 500;
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.6);
}

[data-bs-theme="dark"] .social-share-btn {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
}

[data-bs-theme="dark"] .social-share-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.social-share-icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .social-share-icon:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.social-share-icon.copied {
    background-color: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
    color: rgba(40, 167, 69, 0.8);
}

.social-share-fb:hover,
.social-share-x:hover,
.social-share-whatsapp:hover,
.social-share-telegram:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.8);
}

[data-bs-theme="dark"] .social-share-fb:hover,
[data-bs-theme="dark"] .social-share-x:hover,
[data-bs-theme="dark"] .social-share-whatsapp:hover,
[data-bs-theme="dark"] .social-share-telegram:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 991.98px) {

    .single-article-content .entry-header .entry-title,
    .site-main .entry-header .entry-title {
        font-size: 1.875rem;
    }
}

@media (max-width: 575.98px) {

    .single-article-content .entry-header .entry-title,
    .site-main .entry-header .entry-title {
        font-size: 1.5rem;
    }
}

/* Specific adjustments for different screen sizes */
@media (max-width: 991.98px) {
    .card-featured-main .entry-title {
        font-size: 1.5rem;
    }

    .card-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}

/* ============================ */
/* Social & YouTube Section     */
/* ============================ */

.social-youtube-section {
    background: linear-gradient(180deg, rgba(100, 181, 246, 0.04) 0%, rgba(100, 181, 246, 0.08) 50%, rgba(100, 181, 246, 0.04) 100%);
    border-radius: 0;
    margin-top: 5rem !important;
    padding: 0;
    position: relative;
    width: 100%;
}

.social-youtube-section>.container {
    padding-top: min(10rem, 15vw);
    padding-bottom: min(10rem, 15vw);
}

.section-bordered-title h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 5px;
}

.title-accent-line {
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 2px;
}

.btn-view-all {
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-view-all:hover {
    color: var(--accent-hover);
    transform: translateX(-5px);
}

/* Social Blocks */
.social-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 25px;
    border-radius: var(--radius-md);
    text-decoration: none !important;
    color: #fff !important;
    min-width: 180px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.social-block i {
    font-size: 1.5rem;
}

.social-info {
    display: flex;
    flex-direction: column;
}

.social-info .platform {
    font-weight: 800;
    font-size: 0.95rem;
}

.social-block.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-block.facebook {
    background-color: #1877F2;
}

.social-block.twitter {
    background-color: #000000;
}

.social-block.telegram {
    background-color: #0088cc;
}

.social-block.youtube {
    background-color: #FF0000;
}

.social-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* YouTube Cards */
.youtube-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
}

.youtube-thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.youtube-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.play-icon-circle {
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 20px rgba(250, 152, 1, 0.5);
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.youtube-card:hover .play-overlay {
    opacity: 1;
}

.youtube-card:hover .play-icon-circle {
    transform: scale(1);
}

.youtube-card:hover .youtube-img {
    filter: brightness(0.9);
}

.youtube-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.youtube-title {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.hover-accent:hover {
    color: var(--accent) !important;
}

/* Slick Customization */
.youtube-slick-carousel .slick-track {
    display: flex !important;
}

.youtube-slick-carousel .slick-slide {
    height: inherit !important;
}

.youtube-slick-carousel .slick-list {
    margin: 0 -10px;
}

.slick-prev,
.slick-next {
    width: 40px;
    height: 40px;
    background: var(--bg-card) !important;
    border-radius: 50% !important;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.slick-prev:before,
.slick-next:before {
    color: var(--accent) !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 7 Free" !important;
    font-weight: 900 !important;
    font-size: 18px !important;
    opacity: 1 !important;
    display: block !important;
    line-height: 1 !important;
}

.slick-prev {
    left: -10px;
}

.slick-next {
    right: -10px;
}

/* LTR: chevron-left for prev, chevron-right for next */
.slick-prev:before {
    content: "\f053" !important;
    /* fa-chevron-left */
}

.slick-next:before {
    content: "\f054" !important;
    /* fa-chevron-right */
}

/* RTL: Reverse the arrows */
[dir="rtl"] .slick-prev:before {
    content: "\f054" !important;
    /* fa-chevron-right */
}

[dir="rtl"] .slick-next:before {
    content: "\f053" !important;
    /* fa-chevron-left */
}

@media (max-width: 768px) {
    .social-block {
        width: 100%;
        justify-content: center;
    }
}

/* ============================ */
/* Layered Category Blocks      */
/* ============================ */

.category-block-layered {
    position: relative;
    overflow: visible;
    margin-top: 3.5rem !important;
    margin-bottom: 3.5rem !important;
}

.category-block-layered.is-book-block {
    background: linear-gradient(180deg, rgba(100, 181, 246, 0.04) 0%, rgba(100, 181, 246, 0.1) 50%, rgba(100, 181, 246, 0.04) 100%);
    padding-top: min(10rem, 15vw);
    padding-bottom: min(10rem, 15vw);
    padding-left: 0;
    padding-right: 0;
    margin-top: 5rem !important;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    position: relative;
    border: none;
}

.shape-divider {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
    pointer-events: none;
}

.shape-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

.shape-divider .shape-fill {
    fill: var(--bg-body);
    /* Matches the parent section background */
}

.shape-divider-top {
    top: 0;
}

.shape-divider-bottom {
    bottom: 0;
    transform: rotate(180deg);
}

/* Ensure the overlap container stays centered even if section is full-width */
.is-book-block .cat-posts-overlap-container {
    padding-bottom: 2rem;
    position: relative;
    z-index: 5;
}

.cat-cover-header {
    height: 350px;
    /* Reduced from 400px */
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    position: relative;
}

.cat-posts-overlap-container {
    margin-top: -160px;
    /* Increased overlap for a much closer look (~45% overlap) */
    position: relative;
    z-index: 5;
    padding: 0 3rem;
    /* Create inset look */
}

.cat-title a i {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cat-title a:hover i {
    transform: translateX(-8px);
    opacity: 1;
}

.cat-title {
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.cat-description {
    font-size: 0.95rem;
    max-width: 600px;
}

/* Book Carousel Specifics */
.book-slick-carousel {
    margin-bottom: 60px;
    /* Space for dots */
}

.book-slick-carousel .slick-track {
    display: flex !important;
}

.book-slick-carousel .slick-slide {
    height: inherit !important;
    display: flex !important;
}

.book-slick-carousel .slick-slide>div {
    width: 100%;
    height: 100%;
}

.book-slick-carousel .slick-dots {
    bottom: -40px;
}

.book-slick-carousel .slick-dots li button:before {
    color: var(--accent);
    font-size: 10px;
    opacity: 0.3;
}

.book-slick-carousel .slick-dots li.slick-active button:before {
    color: var(--accent);
    opacity: 1;
}

/* Ensure cards in this section look crisp on the overlap */
.cat-posts-overlap-container .home-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-card);
}

.cat-posts-overlap-container .home-card:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
}

/* Responsive category sections */
@media (max-width: 991.98px) {
    .cat-cover-header {
        height: 350px;
    }

    .cat-posts-overlap-container {
        margin-top: -30px;
    }

    .cat-title {
        font-size: 2rem;
    }

    .book-slick-carousel .slick-dots {
        bottom: -30px;
    }

    .social-youtube-section>.container {
        padding-top: 6rem !important;
        padding-bottom: 6rem !important;
    }

    .category-block-layered.is-book-block {
        padding-top: 6rem !important;
        padding-bottom: 6rem !important;
    }
}

@media (max-width: 768px) {
    .cat-posts-overlap-container {
        padding: 0 1rem;
    }
}

/* Top Articles Section */
.top-articles-section {
    padding: 2rem 0;
    overflow: hidden;
}

.top-article-item {
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    /* Reserve space for border */
    transition: all 0.3s ease;
}

.top-article-item:hover {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.rank-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--border-color);
    /* Subtle default */
    line-height: 1;
    min-width: 30px;
    text-align: center;
    transition: color 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    /* Cleaner number font */
}

/* RTL Support - Rank */
[dir="rtl"] .rank-number {
    margin-right: 0 !important;
    margin-left: 1rem !important;
    /* me-3 equivalent */
}

[dir="rtl"] .article-thumb {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

.top-article-item:hover .rank-number {
    color: var(--accent);
}

.article-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    /* Slightly softer */
    background: #eee;
}

.article-thumb img {
    transition: transform 0.5s ease;
}

.top-article-item:hover .article-thumb img {
    transform: scale(1.1);
}

.article-content .entry-title {
    font-weight: 700;
    line-height: 1.3;
    font-size: 1rem;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.article-content .entry-title,
.article-content .entry-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-article-item:hover .article-content .entry-title {
    color: var(--accent);
}

.text-accent {
    color: var(--accent);
}

/* Ranked Colors (Gold, Silver, Bronze for 1, 2, 3) */
/* 1st Place - Gold */
.col-lg-3:nth-child(1) .rank-number {
    color: #FFD700;
    opacity: 0.8;
}

/* 2nd Place - Silver */
.col-lg-3:nth-child(2) .rank-number {
    color: #C0C0C0;
    opacity: 0.8;
}

/* 3rd Place - Bronze */
.col-lg-3:nth-child(3) .rank-number {
    color: #CD7F32;
    opacity: 0.8;
}

@media (max-width: 767.98px) {
    .article-thumb {
        width: 70px;
        height: 70px;
    }

    .rank-number {
        font-size: 2rem;
    }
}

/* ============================ */
/* Archive & Single Page Styles */
/* ============================ */

/* Archive Header */
.archive-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    /* Lower than header */
}

/* Bookmarks Offcanvas Stacking */
.offcanvas {
    z-index: 1100 !important;
    /* Ensure it covers the sticky header (1030) */
}

.archive-description p {
    margin-bottom: 0;
}

/* Pagination */
.posts-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 4px;
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none !important;
    font-weight: 700;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* Hide empty pagination links (prev/next on first/last pages) */
.posts-pagination .page-numbers.prev:empty,
.posts-pagination .page-numbers.next:empty,
.posts-pagination .page-numbers.prev:not([href]),
.posts-pagination .page-numbers.next:not([href]),
.nav-links .page-numbers.prev:empty,
.nav-links .page-numbers.next:empty {
    display: none !important;
}

/* Hide prev/next links that only contain whitespace or are effectively empty */
.nav-links .page-numbers.prev:only-child:has(:empty),
.nav-links .prev.page-numbers:has(i:empty) {
    display: none !important;
}

.posts-pagination .page-numbers.current,
.posts-pagination .page-numbers:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.posts-pagination .page-numbers.dots {
    background: transparent !important;
    color: var(--text-secondary);
    cursor: default;
}

/* Single Post */
.single-article-content .lead-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.single-article-content p {
    margin-bottom: 1.5rem;
}

/* Blockquotes in content */
.single-article-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-body);
    font-style: italic;
    font-size: 1.2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

[dir="rtl"] .single-article-content blockquote {
    border-left: none;
    border-right: 4px solid var(--accent);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Tags */
.tags-links .btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.tags-links .btn-outline-secondary:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Author Box */
.author-box {
    border: 1px solid var(--border-color);
}

/* Sidebar Widget */
.widget-title {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title .title-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--accent);
}

[dir="rtl"] .widget-title .title-line {
    left: auto;
    right: 0;
}

.hover-accent:hover {
    color: var(--accent) !important;
}

/* Related Post Cards (Sidebar) */
.related-post-card .transition-transform {
    transition: transform 0.5s ease;
}

.related-post-card:hover .transition-transform {
    transform: scale(1.05);
}

.transition-colors {
    transition: color 0.3s ease;
}

.related-post-card .badge {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Footer Menu */
.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

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

.footer-menu-list a {
    font-size: 0.9rem;
    color: var(--text-muted, #6c757d);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-menu-list a:hover {
    color: var(--accent-color, #fa9700) !important;
}

/* 
=============================================
   DEMO: Orange Header Code (Easy to Remove)
============================================= 
*/

.orange-toggle-icon {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    /* Half fade orange, half fade grey */
    background: linear-gradient(90deg, rgba(250, 152, 1, 0.8) 50%, rgba(128, 128, 128, 0.5) 50%);
    border: 1px solid rgba(128, 128, 128, 0.2);
}

/* State: Header Orange Mode */
body.header-orange-mode .floating-header {
    background-color: #FA9801 !important;
    /* Main Orange */
    backdrop-filter: none !important;
    border-color: #e08e0b !important;
    box-shadow: 0 4px 20px rgba(250, 152, 1, 0.3) !important;
}

/* Adjust text colors for readability on orange bg */
body.header-orange-mode .floating-header .brand-logo,
body.header-orange-mode .floating-header .brand-logo span,
body.header-orange-mode .floating-header .nav-menu .mega-menu-link,
body.header-orange-mode .floating-header .icon-btn,
body.header-orange-mode .floating-header .lang-trigger,
body.header-orange-mode .floating-header .lang-trigger span,
body.header-orange-mode .floating-header .header-top,
body.header-orange-mode .floating-header .social-links a,
body.header-orange-mode .floating-header .slogan {
    color: #ffffff !important;
}

/* Adjust button borders and backgrounds */
body.header-orange-mode .floating-header .icon-btn {
    border-color: rgba(255, 255, 255, 0.4) !important;
    background-color: transparent !important;
}

body.header-orange-mode .floating-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

/* Handle dropdowns/search specifically if needed */
body.header-orange-mode .search-collapsible-wrapper.active #desktop-search-toggle {
    color: #fff !important;
    border-color: #fff !important;
}

/* Make dividers ligher */
body.header-orange-mode .header-divider {
    border-color: rgba(255, 255, 255, 0.3) !important;
    opacity: 1 !important;
}

/* 
=============================================
   END DEMO CODE
============================================= 
*/

/* ============================ */
/* Back to Top Button           */
/* ============================ */

.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(250, 152, 1, 0.3);
    font-size: 1.2rem;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(250, 152, 1, 0.4);
}

.back-to-top-btn:active {
    transform: translateY(-2px);
}

[dir="rtl"] .back-to-top-btn {
    left: auto;
    right: 30px;
}

@media (max-width: 767.98px) {
    .back-to-top-btn {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    [dir="rtl"] .back-to-top-btn {
        left: auto;
        right: 20px;
    }
}

/* ============================ */
/* Cookie Banner                */
/* ============================ */

.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    max-width: 350px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1040;
    padding: 12px 15px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

.cookie-banner-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cookie-banner-text {
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
}

.cookie-accept-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    align-self: flex-start;
}

.cookie-accept-btn:hover {
    color: var(--accent-hover);
}

[dir="rtl"] .cookie-banner {
    right: auto;
    left: 20px;
}

[dir="rtl"] .cookie-accept-btn {
    text-align: right;
}

@media (max-width: 767.98px) {
    .cookie-banner {
        bottom: 15px;
        left: 15px;
        max-width: 250px;
        padding: 10px 12px;
    }

    .cookie-banner-text {
        font-size: 0.7rem;
    }

    .cookie-accept-btn {
        font-size: 0.7rem;
    }

    [dir="rtl"] .cookie-banner {
        left: auto;
        right: 15px;
    }
}

/* ============================ */
/* Single Post Header Section   */
/* ============================ */
.single-post-header-section {
    background: linear-gradient(180deg, rgba(100, 181, 246, 0.04) 0%, rgba(100, 181, 246, 0.08) 50%, rgba(100, 181, 246, 0.04) 100%);
    position: relative;
    width: 100%;
    padding-top: min(6rem, 8vw);
    padding-bottom: 140px;
    margin-bottom: 0;
    overflow: hidden;
}

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

.single-post-header-section .shape-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
    pointer-events: none;
}

.single-post-header-section .shape-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 120px;
}

.single-post-header-section .shape-fill {
    fill: var(--bg-body);
}

@media (max-width: 991.98px) {
    .single-post-header-section {
        min-height: 45vh;
    }

    .single-post-header-content {
        padding-top: min(3rem, 5vw);
        padding-bottom: min(3rem, 5vw);
    }
}

/* Footer Logo */
.footer-logo-link {
    display: inline-block;
}

.footer-logo {
    max-height: 40px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer-logo-link:hover .footer-logo {
    opacity: 1;
}

.footer-logo-light {
    display: block;
}

.footer-logo-dark {
    display: none;
}

[data-bs-theme="dark"] .footer-logo-light,
body:not([data-bs-theme="light"]) .footer-logo-light {
    display: none;
}

[data-bs-theme="dark"] .footer-logo-dark,
body:not([data-bs-theme="light"]) .footer-logo-dark {
    display: block;
}

/* Accent Outline Button */
.btn-outline-accent {
    border-color: var(--accent);
    color: var(--accent);
    background-color: transparent;
}

.btn-outline-accent:hover {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-outline-accent:focus,
.btn-outline-accent:active {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(250, 152, 1, 0.25);
}

.btn-outline-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}