/* ==========================================================================
   RAMADAN 2027 - THEME PREMIUM REVISITÉ
   ========================================================================== */

/* Variables CSS - Palette nocturne Premium & Nuancée */
:root {
    /* Couleurs principales */
    --color-primary: #071324; /* Bleu nuit encore plus profond pour le fond principal */
    --color-secondary: #0d1f3b; /* Bleu plus clair pour les cartes et sections alternées */
    --color-tertiary: #142b4d; /* Bleu intermédiaire pour bordures/hover */
    
    /* Accents */
    --color-accent: #D9B340; /* Or premium doux (moins saturé) */
    --color-accent-hover: #F6D365;
    
    /* Textes */
    --color-text: #F8F9FA; /* Ivoire très clair pour le corps */
    --color-text-muted: #A3B1C6; /* Gris bleuté pour les textes secondaires */
    --color-text-inverse: #071324;
    
    /* Feedback */
    --color-success: #28a745;
    --color-warning: #ffc107;
    
    /* Typographie */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Playfair Display', 'Georgia', serif; /* Plus élégant */

    /* Espacements (Aérés mais pas excessifs) */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3.5rem; /* Réduit par rapport à l'ancien 4rem */
    --spacing-xl: 5rem; /* Réduit par rapport à l'ancien 6rem */

    /* Bordures & Ombres */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --border-subtle: 1px solid rgba(255, 255, 255, 0.08);
    --border-accent: 1px solid rgba(217, 179, 64, 0.3);
    
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.2);
    --shadow-card: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.4);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   RESET & BASE (Mobile First)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-primary);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 1.05rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

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

a:hover, a:focus {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Typographie des titres */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: #FFFFFF;
    line-height: 1.25;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { 
    font-size: 1.7rem; 
    margin-top: var(--spacing-lg); 
    border-bottom: 2px solid rgba(217, 179, 64, 0.2);
    padding-bottom: 0.5rem;
    display: inline-block;
    max-width: 100%;
}
h3 { font-size: 1.4rem; margin-top: var(--spacing-md); }

@media (min-width: 768px) {
    h1 { font-size: 2.6rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.6rem; }
}

p {
    margin-bottom: var(--spacing-sm);
}

ul, ol {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-md);
}

li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1240px; /* Plus large comme demandé */
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.section {
    padding: var(--spacing-lg) 0;
}

/* Sections alternées pour casser la monotonie */
.section-alt {
    background-color: var(--color-secondary);
    border-top: var(--border-subtle);
    border-bottom: var(--border-subtle);
}

/* Grille Editoriale pour pages internes */
.editorial-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

/* Contenu principal restreint en largeur pour la lecture */
.editorial-content {
    max-width: 800px;
    min-width: 0; /* Essentiel pour empêcher le dépassement sur mobile */
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

@media (min-width: 1024px) {
    .editorial-layout {
        grid-template-columns: minmax(0, 1fr) 350px;
    }
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    background-color: rgba(7, 19, 36, 0.95); /* Plus sombre */
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: var(--border-subtle);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--color-accent);
    font-weight: 700;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Menu Hamburger */
.menu-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--color-text);
    position: relative;
    transition: var(--transition);
}
.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    left: 0;
    transition: var(--transition);
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }
.menu-toggle.is-active .hamburger { background-color: transparent; }
.menu-toggle.is-active .hamburger::before { transform: rotate(45deg); top: 0; }
.menu-toggle.is-active .hamburger::after { transform: rotate(-45deg); bottom: 0; }

.main-nav {
    display: none;
    position: absolute;
    top: 75px;
    left: 0;
    width: 100%;
    background-color: var(--color-secondary);
    border-bottom: var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.main-nav.is-open {
    display: block;
}

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

.nav-list li a {
    display: block;
    padding: 15px var(--spacing-md);
    color: var(--color-text);
    text-decoration: none;
    border-bottom: var(--border-subtle);
    font-size: 1.1rem;
}

@media (min-width: 1024px) {
    .menu-toggle { display: none; }
    .main-nav {
        display: block !important;
        position: static;
        width: auto;
        background: transparent;
        border: none;
        box-shadow: none;
    }
    .nav-list {
        display: flex;
        gap: 20px;
        align-items: center;
    }
    .nav-list li a {
        padding: 5px;
        border: none;
        font-size: 1rem;
        position: relative;
    }
    .nav-list li a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: var(--color-accent);
        transition: var(--transition);
    }
    .nav-list li a:hover::after,
    .nav-list li a.active::after {
        width: 100%;
    }
    .nav-list li a:hover {
        text-decoration: none;
        color: var(--color-accent);
    }
}

/* ==========================================================================
   HERO SECTION (Repensée 2 colonnes Desktop)
   ========================================================================== */
.hero {
    position: relative;
    padding: var(--spacing-xl) 0 var(--spacing-lg) 0;
    background: radial-gradient(circle at top right, var(--color-secondary) 0%, var(--color-primary) 70%);
    overflow: hidden;
    border-bottom: var(--border-subtle);
}

/* Motif subtil géométrique / étoilé */
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="1.5" fill="%23FFFFFF" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="%23FFFFFF" opacity="0.15"/><circle cx="150" cy="80" r="2" fill="%23D9B340" opacity="0.1"/></svg>');
    background-size: 150px;
    z-index: 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
}

.hero-illustration {
    display: none; /* Masqué sur petit mobile */
}

@media (min-width: 900px) {
    .hero {
        padding: var(--spacing-xl) 0;
        text-align: left;
    }
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        gap: var(--spacing-lg);
    }
    .hero-content {
        text-align: left;
    }
    .hero-illustration {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .hero-illustration svg {
        max-height: 350px;
        filter: drop-shadow(0 10px 20px rgba(217, 179, 64, 0.2));
        animation: float 6s ease-in-out infinite;
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.5px;
}
.badge-prev { 
    background-color: rgba(255, 193, 7, 0.15); 
    color: var(--color-warning); 
    border: 1px solid rgba(255, 193, 7, 0.3); 
}
.badge-conf { 
    background-color: rgba(40, 167, 69, 0.15); 
    color: var(--color-success); 
    border: 1px solid rgba(40, 167, 69, 0.3); 
}

/* ==========================================================================
   COUNTDOWN (Moderne)
   ========================================================================== */
.countdown-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}
@media (min-width: 900px) {
    .countdown-wrapper { justify-content: flex-start; }
}

.cd-box {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px;
    min-width: 80px;
    text-align: center;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.cd-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--color-accent);
    opacity: 0.5;
}

.cd-box span {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: #FFF;
    font-family: 'Inter', monospace;
    line-height: 1;
    margin-bottom: 4px;
}

.cd-box small {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.cd-message {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* ==========================================================================
   BOUTONS & CTA
   ========================================================================== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
@media (min-width: 900px) {
    .btn-group { justify-content: flex-start; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none !important;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
    border: 2px solid var(--color-accent);
    box-shadow: 0 4px 15px rgba(217, 179, 64, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 179, 64, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

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

/* ==========================================================================
   CARTES & GRILLES (Style premium)
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
    background: var(--color-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: var(--border-subtle);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Effet halo subtil sur les cartes */
.card::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(217,179,64,0.03) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(217, 179, 64, 0.2);
}
.card:hover::after { opacity: 1; }

.card-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block;
    background: rgba(217,179,64,0.1);
    padding: 10px;
    border-radius: 50%;
    color: var(--color-accent);
}

.card h3 { 
    margin-top: 0; 
    font-size: 1.25rem; 
    margin-bottom: 8px;
    border: none; 
    padding: 0;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95rem;
}
.card-link::after { content: '→'; transition: transform 0.3s ease; }
.card:hover .card-link::after { transform: translateX(5px); }


/* Sidebar widget */
.widget {
    background: var(--color-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: var(--border-subtle);
}
.widget h3 {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}
.widget-list {
    list-style: none;
    padding: 0;
}
.widget-list li {
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.widget-list li:last-child { border: none; }
.widget-list a { color: var(--color-text-muted); }
.widget-list a:hover { color: var(--color-accent); }

/* ==========================================================================
   RÉPONSE DIRECTE (Featured Snippet / À retenir)
   ========================================================================== */
.featured-snippet {
    background: linear-gradient(to right, rgba(217, 179, 64, 0.08), transparent);
    border-left: 4px solid var(--color-accent);
    padding: 1.5rem;
    margin: var(--spacing-sm) 0 var(--spacing-md) 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 1.15rem;
}
.featured-snippet p:last-child { margin-bottom: 0; }

.box-info {
    background: rgba(255,255,255,0.03);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: var(--spacing-md) 0;
}
.box-info h3 { margin-top: 0; color: var(--color-accent); font-size: 1.2rem; }

/* ==========================================================================
   TABLEAUX (Calendrier)
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-md);
    border: var(--border-subtle);
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background: var(--color-secondary);
}

table caption {
    padding: 10px;
    font-weight: bold;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    caption-side: top;
    text-align: left;
}

table th, table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

table th {
    background-color: rgba(0,0,0,0.2);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

table tr:nth-child(even) {
    background-color: rgba(255,255,255,0.015);
}

table tr:hover td {
    background-color: rgba(217, 179, 64, 0.05);
}

.highlight-row td {
    background-color: rgba(40, 167, 69, 0.1) !important;
    font-weight: bold;
}
.highlight-qadr td {
    background-color: rgba(217, 179, 64, 0.1) !important;
}

/* ==========================================================================
   FAQ ACCORDEON
   ========================================================================== */
.faq-container {
    margin-top: var(--spacing-md);
}

.faq-item {
    margin-bottom: 12px;
    background: var(--color-secondary);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.15rem;
    font-weight: 600;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover { 
    background: rgba(255,255,255,0.02);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px 20px 20px;
    color: var(--color-text-muted);
    font-size: 1rem;
}

.faq-answer[hidden] {
    display: none;
}

/* ==========================================================================
   SOMMAIRE (TOC)
   ========================================================================== */
.toc {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: var(--spacing-md) 0;
    display: inline-block;
    min-width: 250px;
}
.toc p {
    font-weight: bold;
    color: var(--color-accent);
    margin-bottom: 10px;
    font-family: var(--font-heading);
}
.toc ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}
.toc li { margin-bottom: 8px; }
.toc a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.95rem;
}
.toc a:hover { color: var(--color-text); text-decoration: underline; }

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-text); }
.breadcrumb span { color: var(--color-accent); }

/* ==========================================================================
   FORMULAIRES
   ========================================================================== */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 8px; color: var(--color-text); font-weight: 600; }
input, select, textarea {
    width: 100%; padding: 14px;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(217, 179, 64, 0.15);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background-color: #040A14; /* Très sombre */
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer-widget h4 { 
    color: var(--color-text); 
    font-size: 1.1rem;
    margin-bottom: 20px;
    border: none;
}
.footer-widget ul { list-style: none; padding: 0; }
.footer-widget ul li { margin-bottom: 12px; }
.footer-widget ul li a { 
    color: var(--color-text-muted); 
    font-size: 0.95rem;
}
.footer-widget ul li a:hover { color: var(--color-accent); }

.footer-disclaimer {
    background: rgba(255,255,255,0.02);
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border: 1px dashed rgba(255,255,255,0.1);
    margin-top: var(--spacing-md);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (min-width: 768px) {
    .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ==========================================================================
   QUICK NAV (HOMEPAGE)
   ========================================================================== */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: var(--spacing-md);
}
@media (min-width: 768px) {
    .quick-nav {
        grid-template-columns: repeat(6, 1fr);
        background: var(--color-secondary);
        padding: 15px;
        border-radius: var(--radius-md);
        border: var(--border-subtle);
    }
}
.quick-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.quick-nav a:hover {
    background: rgba(217,179,64,0.05);
    border-color: rgba(217,179,64,0.3);
    color: var(--color-accent);
    text-decoration: none;
}

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */
.text-accent { color: var(--color-accent); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* Accessibilité: motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   ACCESSIBILITY & FOCUS
   ========================================================================== */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--color-accent) !important;
    outline-offset: 3px !important;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 10000;
    padding: 12px 24px;
    background: var(--color-accent);
    color: var(--color-text-inverse);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   ADSTERRA AD CONTAINERS (Anti-CLS)
   ========================================================================== */
.adsterra-ad {
    text-align: center;
    margin: var(--spacing-md) auto;
    overflow: hidden;
    display: block;
    width: 100%;
    max-width: 100%;
    background: rgba(255,255,255,0.01);
    border-radius: var(--radius-sm);
    position: relative;
}
.adsterra-ad::before {
    content: 'Advertisement';
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    opacity: 0.6;
    padding: 4px 0;
    text-align: center;
}
.adsterra-ad[data-ad-placement*="banner"] {
    min-height: 100px;
}
.adsterra-ad[data-ad-placement="sidebar"] {
    min-height: 250px;
}
@media (min-width: 768px) {
    .adsterra-ad[data-ad-placement*="banner"] {
        min-height: 100px;
    }
}

/* Legacy ad-container support */
.ad-container {
    text-align: center;
    margin: var(--spacing-md) auto;
    overflow: hidden;
    display: block;
    width: 100%;
    max-width: 100%;
    background: rgba(255,255,255,0.01);
}

/* ==========================================================================
   LANGUAGE SELECTOR
   ========================================================================== */
.lang-selector {
    position: relative;
    z-index: 1002;
}
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
    white-space: nowrap;
}
.lang-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(217, 179, 64, 0.3);
}
.lang-toggle svg {
    transition: transform 0.2s ease;
}
.lang-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}
.lang-current {
    display: none;
}
@media (min-width: 768px) {
    .lang-current {
        display: inline;
    }
}
.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--color-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    min-width: 160px;
    overflow: hidden;
    z-index: 1003;
}
.lang-dropdown-open {
    display: block;
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--color-text-muted);
    text-decoration: none !important;
    font-size: 0.9rem;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.lang-option:last-child {
    border-bottom: none;
}
.lang-option:hover {
    background: rgba(217, 179, 64, 0.05);
    color: var(--color-accent);
}
.lang-option.lang-active {
    color: var(--color-accent);
    background: rgba(217, 179, 64, 0.08);
    font-weight: 600;
}
.lang-name {
    flex: 1;
}

/* ==========================================================================
   CONSENT BANNER
   ========================================================================== */
.consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--color-secondary);
    border-top: 1px solid rgba(217, 179, 64, 0.2);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
}
.consent-closing {
    animation: slideDown 0.3s ease-in forwards;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}
.consent-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
@media (min-width: 1024px) {
    .consent-inner {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
        padding: var(--spacing-sm) var(--spacing-md);
    }
}
.consent-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.consent-text strong {
    color: var(--color-text);
    display: block;
    margin-bottom: 4px;
}
.consent-text p {
    margin: 0;
    line-height: 1.4;
}
.consent-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.consent-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}
.consent-option input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--color-accent);
}
.consent-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.consent-btn {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    z-index: 9998;
    transition: width 0.1s linear;
    width: 0%;
}

/* ==========================================================================
   RTL SUPPORT (Arabic)
   ========================================================================== */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .header-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-list li a {
    text-align: right;
}

[dir="rtl"] .hero-content {
    text-align: right;
}

@media (min-width: 900px) {
    [dir="rtl"] .hero-grid {
        grid-template-columns: 0.8fr 1.2fr;
    }
    [dir="rtl"] .hero-content {
        text-align: right;
    }
    [dir="rtl"] .countdown-wrapper {
        justify-content: flex-end;
    }
    [dir="rtl"] .btn-group {
        justify-content: flex-end;
    }
}

[dir="rtl"] .breadcrumb {
    text-align: right;
}

[dir="rtl"] .featured-snippet {
    border-left: none;
    border-right: 4px solid var(--color-accent);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

[dir="rtl"] .toc {
    text-align: right;
}

[dir="rtl"] ul, [dir="rtl"] ol {
    padding-left: 0;
    padding-right: var(--spacing-md);
}

[dir="rtl"] .editorial-content {
    text-align: right;
}

[dir="rtl"] .card-link::after {
    content: '←';
}

[dir="rtl"] .card:hover .card-link::after {
    transform: translateX(-5px);
}

[dir="rtl"] .footer-bottom {
    text-align: right;
}

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

/* RTL consent banner */
[dir="rtl"] .consent-inner {
    direction: rtl;
}

/* ==========================================================================
   SOCIAL SHARING
   ========================================================================== */
.share-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: var(--spacing-sm) 0;
    align-items: center;
}
.share-bar-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 600;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-muted);
    text-decoration: none !important;
    font-size: 1rem;
    transition: var(--transition);
}
.share-btn:hover {
    background: rgba(217, 179, 64, 0.1);
    border-color: rgba(217, 179, 64, 0.3);
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .site-header, .site-footer, .consent-banner, .adsterra-ad,
    .ad-container, .lang-selector, .menu-toggle, .reading-progress,
    .share-bar, .quick-nav, .btn-group { display: none !important; }
    body { background: #fff; color: #000; font-size: 12pt; }
    a { color: #000; text-decoration: underline; }
    h1, h2, h3, h4 { color: #000; }
    .hero { background: none; padding: 1rem 0; }
    .card { border: 1px solid #ccc; break-inside: avoid; }
}
