/*
 * Main Stylesheet for News Theme V2
 * This file contains all the primary styling, including the responsive grid,
 * typography, component styles, and accessibility improvements.
 *
 * Version updated to reflect the original theme's visual identity.
 */

/*--------------------------------------------------------------
# 1.0 - Configuration & Globals
--------------------------------------------------------------*/

/* --- Font Imports --- */
/* Google Fonts chargées via critical-css.php pour de meilleures performances */

/* --- Variables ---
 * Les variables (--color-*, --soft-*, --card-gap, --font-*) sont désormais
 * définies dans le Design System : assets/css/design-system/tokens.css
 * (source unique de vérité, chargé avant ce fichier). Les anciens noms y sont
 * conservés comme alias des tokens --senego-*. Ne plus déclarer de :root ici.
 */

/* --- Normalize & Base Body --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll on body */
}

/* Responsive Sidebar Management - Remplace la logique JavaScript pour de meilleures performances */
@media (max-width: 767px) {
    #secondary-left,
    #secondary,
    .featured-ad-area {
        display: none !important;
    }

    .home-content-area {
        display: block !important;
    }

    .site-main {
        width: 100% !important;
    }
}

@media (min-width: 768px) {
    #secondary-left,
    #secondary,
    .featured-ad-area {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (min-width: 768px) {
    .mobile-mobile{
        display: none;
    }
}

/*--------------------------------------------------------------
# 2.0 - Accessibility
--------------------------------------------------------------*/
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/*--------------------------------------------------------------
# 3.0 - Layout & Grid System
--------------------------------------------------------------*/
.container {
    max-width: 1312px;
    width: 92%;
    margin-left: auto;
    margin-right: auto;
}
.site-main {
    flex-grow: 1;
}
#content {
    margin-top: var(--spacing-unit);
}

/* Default layout for archive, single, etc. */
.standard-content-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 1);
}

/* 3-column layout specifically for the homepage */
.home-content-area {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    background-color: transparent;
    padding: var(--spacing-unit) 0;
    width: 100%;
}
.home-content-area > *:not(#secondary-left):not(.site-main):not(.widget-area) {
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-basis: 0 !important;
    flex-grow: 0 !important;
}

@media (min-width: 992px) {
    .standard-content-area {
        grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
        background-color: transparent;
        padding: 0;
    }
    .standard-content-area > .site-main {
        background-color: transparent;
        padding: 0;
    }
    .home-content-area {
        grid-template-columns: 300px 1fr 380px;
    }
}

@media (max-width: 991px) {
    .container {
        width: 100%;
    }
    /* Gouttière mobile/tablette sur le conteneur de contenu principal (#content) :
       le contenu ne colle plus aux bords → les arrondis des cartes restent visibles.
       Cible #content (pas tous les .container) pour ne pas décaler le header. */
    #content.container {
        padding-left: var(--senego-mobile-gutter);
        padding-right: var(--senego-mobile-gutter);
    }
    .standard-content-area, .home-content-area {
        display: block;
    }
    .home-content-area .widget-area-left,
    .home-content-area .widget-area,
    .standard-content-area .widget-area {
        display: none;
    }
}

/*--------------------------------------------------------------
# 4.0 - Typography & Base Elements
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    /* Identité minuscule (sentence case) — plus d'uppercase global sur les titres.
       Les petites étiquettes/badges qui doivent rester en capitales déclarent
       leur propre text-transform (cf. .senego-badge, .senego-tag, category). */
    text-transform: none;
    line-height: 1.3;
    margin: calc(var(--spacing-unit) * 1.5) 0 var(--spacing-unit);
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p { margin: 0 0 var(--spacing-unit); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover, a:focus {
    color: var(--color-secondary);
    text-decoration: underline;
}

ul, ol {
    margin: 0 0 var(--spacing-unit) var(--spacing-unit);
    padding-left: var(--spacing-unit);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}
.post-thumbnail img, .entry-content img {
    margin: 0 auto;
    border-radius: 5px;
}
.entry-content iframe{
    max-width: 100%;
    margin: 0 auto;
    display: block;

}

.entry-content iframe[src*="youtube.com"],
.entry-content iframe[src*="youtu.be"] {
    max-width: 100%;
    max-height: 450px;
    margin: 0 auto;
    display: block;
}

hr {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin: calc(var(--spacing-unit) * 2) 0;
}

/*--------------------------------------------------------------
# 5.0 - Header & Navigation (Corrected and Final)
--------------------------------------------------------------*/
.site-header {
    /* position, top, height, z-index gérés dans critical CSS */
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* --- 5.1 Top Bar (Redesigned) --- */
.top-bar {
    background-color: var(--color-top-bar-bg);
    color: var(--color-top-bar-text);
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}
.top-bar .container {
    display: flex;
    justify-content: flex-end; /* Align all items to the right */
    align-items: center;
}

/* --- 5.2 Main Navigation Bar --- */
.main-navigation-container {
    background-color: #ffffff;
    border-bottom: 3px solid var(--color-primary);
}
.main-navigation-container .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem;
    margin: 5px auto;
    gap: 1rem;
}

/* --- 5.3 Drawer Menu (Mobile) --- */
.drawer-toggle {
    background: none; border: none; cursor: pointer; color: var(--color-primary);
    padding: 0.5rem; display: flex; align-items: center; justify-content: center;
}
.drawer-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 1998;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out;
}
.drawer-menu-overlay.is-visible { opacity: 1; visibility: visible; }

.drawer-menu {
    position: fixed; top: 0; left: 0; width: 320px; max-width: 85%;
    height: 100%; background-color: var(--color-bg-alt);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15); z-index: 1999;
    transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
}
.drawer-menu.is-open { transform: translateX(0); }
.drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border);
}
.drawer-title { margin: 0; font-family: 'Source Sans 3', system-ui, sans-serif; font-size: 1.3rem; }
.drawer-close { background: none; border: none; cursor: pointer; padding: 5px; color: var(--color-primary); }
.drawer-content { padding: 1rem; overflow-y: auto; }
ul.drawer-navigation { list-style: none; margin: 0; padding: 0; }
ul.drawer-navigation li a {
    display: block; padding: 0.9rem 1rem; color: #333;
    border-radius: 5px; transition: background-color 0.2s, color 0.2s;
    font-weight: 500; font-size: 1rem;
    text-decoration: none;
}
ul.drawer-navigation li a:hover,
ul.drawer-navigation .current-menu-item > a {
    background-color: var(--color-primary); color: #fff;
}

/* --- 5.4 Desktop Navigation --- */
/* .desktop-navigation display géré dans critical CSS */

/* --- 5.5 Dynamic Search Form --- */
.search-form-container { position: relative; }
.search-form { display: flex; align-items: center; }
.search-toggle {
    display: block; /* Visible by default, hidden by media query */
    background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--color-primary);
    position: relative; width: 40px; height: 40px;
}
.search-submit {
    background: none; border: none; cursor: pointer; color: var(--color-primary);
    display: flex; align-items: center; transition: color 0.2s;
}
.search-submit:hover { color: var(--color-primary); }

.site-branding {
    background-color: #ffffff;
}

/* =============================================================
   DESKTOP STYLES - @media (min-width: 992px)
   ============================================================= */
@media (min-width: 992px) {
    .main-navigation-container .container {
        display: flex;
        justify-content: space-between;
    }
    .site-branding {
        flex-shrink: 0;
        max-width: 180px;
        border-radius: 0.4rem;
    }
    .site-branding img {
        max-width: 100%;
        height: auto;
    }
    /* .menu-toggle-wrapper display géré dans critical CSS */

    .desktop-navigation {
        display: flex;
        justify-content: center;
        align-items: center;
        flex: 1;
        min-width: 0;
    }
    #primary-menu-desktop a:hover,
    #primary-menu-desktop .current-menu-item > a {
        background-color: var(--color-primary);
        color: #fff;
    }

    .search-toggle { display: none; } /* Hide mobile search toggle */
    .search-form-container {
        position: relative;
    }
    .search-form {
        position: static;
    }
    .search-field {
        border: 1px solid var(--color-border);
        background-color: var(--color-bg-subtle);
        border-radius: 25px;
        padding: 0.6rem 3rem 0.6rem 1.5rem;
        width: 200px;
        font-size: 0.9rem;
        transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
    }
    .search-field:focus {
        width: 280px;
        background-color: #fff;
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.2);
    }
    .search-submit {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        padding: 0.5rem;
    }
}

/* =============================================================
   MOBILE STYLES - @media (max-width: 991px)
   ============================================================= */
@media (max-width: 991px) {

    .site-header {
        height: 84px;
    }
    .main-navigation-container .container {
        display: grid;
        grid-template-columns: auto 1fr auto;
    }
    .site-branding {
        justify-self: left; /* Center logo between hamburger and search */
        max-width: 150px;
        border-radius: 0.2rem;
    }
    .site-branding img {
        max-width: 100%;
        height: auto;
    }
    .menu-toggle-wrapper { justify-self: start; }

    .desktop-navigation { display: none; }
    .search-form { display: none; }

    .search-toggle .icon {
        position: absolute; top: 50%; left: 50%;
        transform: translate(-50%, -50%);
        transition: opacity 0.3s ease, transform 0.3s ease;
        stroke-width: 2.5;
    }
    .search-toggle .icon-close { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
    .search-form-container.is-active .search-toggle .icon-search { opacity: 0; transform: translate(-50%, -50%) rotate(-90deg); }
    .search-form-container.is-active .search-toggle .icon-close { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }

    .search-form-container .search-form {
        display: flex;
        position: absolute;
        top: calc(100% + 10px); right: 0rem;
        background: var(--color-bg-alt);
        padding: 10px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        border-radius: 8px;
        width: calc(100vw - 2rem);
        z-index: 1011;
        opacity: 0; visibility: hidden; transform: translateY(-15px);
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;

    }
    .search-form-container.is-active .search-form {
        opacity: 1; visibility: visible; transform: translateY(0);
        transition-delay: 0s;
    }
    .search-field { width: 100%; font-size: 1.1rem; padding: 1rem 3.5rem 1rem 1.5rem; border-radius: 25px; }
    .search-submit { right: 8px; top: 50%; transform: translateY(-50%); position: absolute; padding: 2rem; }
}

/*--------------------------------------------------------------
# 6.0 - Content Sections & Modules
--------------------------------------------------------------*/

/* --- 6.1 Section Headers --- */
.section-header {
    margin-bottom: var(--spacing-unit);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
}
.section-header .section-title {
    margin: 0;
    font-size: 1.5rem;
}

/*--------------------------------------------------------------
# 7.0 - Content Area (Archive, Single, Page)
--------------------------------------------------------------*/

/* --- 7.1 Archive & Blog Post Cards --- */
/* Cartes d'articles : design déplacé dans components/card-article.css
   (chargé sur home/archive/recherche). Doublon retiré ici pour alléger main.css. */
.entry-meta {
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--color-meta);
}
/* (.post-card mobile + summary/footer : voir components/card-article.css) */

/*--------------------------------------------------------------
# 12.0 - Footer
--------------------------------------------------------------*/
.site-footer {
    padding: calc(var(--spacing-unit) * 2) 0;
    margin-top: calc(var(--spacing-unit) * 2);
    background-color: #1d1d1d;
    font-size: 0.9rem;
    color: #ccc;
}
.site-footer a {
    color: #fff;
}
@media (max-width: 767px) {
}

/*--------------------------------------------------------------
# 14.0 - App Promo Popup
--------------------------------------------------------------*/
body.popup-is-active {
    overflow: hidden; /* Block page scroll */
}

.app-promo-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-promo-popup.is-hidden {
    opacity: 0;
    visibility: hidden;
    /* display:none retire totalement la popup du rendu tant qu'elle est masquée.
       Sans cela, la règle de base (display:flex, opacity:1) + la transition 0.3s
       animaient un fondu de sortie à CHAQUE chargement = clignotement visible
       sur desktop et mobile. La popup étant toujours dans le DOM et masquée par
       défaut, display:none garantit zéro affichage avant son ouverture par le JS. */
    display: none;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* backdrop-filter removed for CPU performance */
}

.popup-content {
    position: relative;
    background: #fff;
    padding: 2rem;
    border-radius: var(--soft-radius);
    text-align: center;
    max-width: 90%;
    width: 340px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.app-promo-popup.is-hidden .popup-content {
    transform: scale(0.9);
}

.close-popup-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--senego-color-border);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    color: var(--senego-color-meta);
}
.close-popup-btn:hover {
    background: #ccc;
}

.popup-logo {
    max-width: 120px;
    margin: 0 auto 1rem;
}

.popup-title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}

.popup-description {
    font-size: 1rem;
    color: var(--color-meta);
    margin-bottom: 1.5rem;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popup-button {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-radius: 8px;
    color: #fff;
    transition: opacity 0.2s;
}
.popup-button:hover {
    opacity: 0.9;
}

.popup-button.ios-button {
    background-color: #000;
}
.popup-button.android-button {
    background-color: #000;
}

.store-icon {
    width: 30px;
    height: 30px;
    margin-right: 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Icône App Store iOS avec le logo Apple officiel */
.store-icon.ios {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"/></svg>');
}

/* Icône Google Play Store avec le logo Play officiel */
.store-icon.android {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z"/></svg>');
}

.button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.button-label {
    font-size: 0.8rem;
    opacity: 0.8;
}
.store-name {
    font-size: 1.2rem;
    font-weight: 700;
}

/*--------------------------------------------------------------
# 16.0 - Utilities
--------------------------------------------------------------*/
#infinite-scroll-trigger { height: 50px; width: 100%; }
.loader { display: none; text-align: center; padding: var(--spacing-unit); }
.loader.is-loading { display: block; }

/* Load More Button (after auto-scroll stops) */
.load-more-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 24px auto;
    padding: 14px 24px;
    background: var(--color-primary, var(--senego-color-primary));
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.load-more-btn:hover {
    background: var(--senego-color-primary-dark);
    transform: translateY(-1px);
}
.load-more-btn:disabled {
    background: #ccc;
    cursor: wait;
    transform: none;
}
.load-more-btn:active {
    transform: translateY(0);
}

/*--------------------------------------------------------------
# MOBILE REDESIGN 2026 - Merged from mobile-redesign.css
--------------------------------------------------------------*/
/*
 * Mobile Redesign 2026 - Senego.com
 * Modern news mobile experience
 * Only active on screens <= 767px
 * Overrides main.css mobile styles
 */

/* =================================================================
   MOBILE ONLY - All styles wrapped in max-width: 767px
   ================================================================= */
@media (max-width: 767px) {

    /* --- CSS Variables Override --- */
    /* Variables mobile (--mobile-*, --card-shadow) déplacées dans
       design-system/tokens.css (source unique). */

    /* --- Base & Body --- */
    body {
        background-color: #f5f5f5;
        font-size: 15px;
        line-height: 1.6;
        -webkit-text-size-adjust: 100%;
    }

    #content {
        margin-top: 0;
        padding: 0;
        width: 100%;
    }

    .container {
        width: 100%;
        padding: 0;
    }

    /* --- Header Redesign --- */
    .site-header {
        height: auto;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .top-bar {
        padding: 4px 12px;
        font-size: 0.75rem;
    }

    .top-bar .container {
        justify-content: space-between;
    }

    .main-navigation-container {
        min-height: 48px !important;
        height: 48px;
    }

    .main-navigation-container .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        padding: 0 12px;
        margin: 0 auto;
    }

    .site-branding {
        max-width: 130px;
        border-radius: 4px;
        flex-shrink: 0;
    }

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

    .drawer-toggle {
        padding: 8px;
    }

    .search-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    /* --- Drawer Menu Enhancement --- */
    .drawer-menu {
        width: 300px;
        max-width: 85%;
    }

    .drawer-header {
        padding: 16px 20px;
        background: var(--color-primary);
    }

    .drawer-title {
        color: #fff;
        font-size: 1.1rem;
    }

    .drawer-close {
        color: #fff;
    }

    ul.drawer-navigation li a {
        padding: 14px 16px;
        font-size: 0.95rem;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
    }

    ul.drawer-navigation li:last-child a {
        border-bottom: none;
    }

    /* ================================================================
       ARTICLE CARDS - Complete Redesign (Vertical Stack)
       ================================================================ */
    .section-header {
        padding: 0 var(--mobile-padding) 8px;
        margin-bottom: var(--mobile-gap);
        border-bottom-width: 3px;
    }

    .section-header .section-title {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }

    /* ================================================================
       HOME CONTENT AREA
       ================================================================ */
    .home-content-area {
        display: block !important;
        padding: 0;
        gap: 0;
        background: transparent;
    }

    .site-main {
        width: 100% !important;
        background: transparent;
        padding: 0;
    }

    /* Section Derniers Articles header */
    .site-main > .section-header {
        background: #fff;
        padding: 12px var(--mobile-padding) 8px;
        margin-bottom: 0;
    }

    .mobile-mobile {
        background: #fff;
        padding: 8px 0;
    }

    /* ================================================================
       FOOTER - Mobile Optimized
       ================================================================ */
    .site-footer {
        padding: 24px var(--mobile-padding);
        margin-top: 0;
    }

    /* ================================================================
       ARCHIVE / SEARCH PAGES
       ================================================================ */
    .standard-content-area {
        padding: 0;
    }

    .standard-content-area .site-main {
        padding: 0;
        background: transparent;
    }

    .page-header {
        padding: 16px var(--mobile-padding);
        background: #fff;
        margin-bottom: 2px;
    }

    .page-header .page-title {
        font-size: 1.4rem;
        margin: 0 0 8px;
    }

    .page-header .archive-description,
    .page-header .taxonomy-description {
        font-size: 0.85rem;
        color: var(--senego-color-meta);
        line-height: 1.5;
    }

    .page-header .taxonomy-description p {
        margin: 0;
    }

    /* Search results page */
    .search-results .page-header .page-title {
        font-size: 1.2rem;
    }

    /* ================================================================
       INFINITE SCROLL
       ================================================================ */
    #infinite-scroll-trigger {
        height: 30px;
    }

    .loader {
        padding: 16px;
        font-size: 0.85rem;
        color: #999;
    }

    /* ================================================================
       404 PAGE
       ================================================================ */
    .error-404 {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 60vh;
        padding: var(--mobile-padding);
        background: #fff;
    }

    .error-content {
        text-align: center;
        max-width: 320px;
    }

    .error-404-title {
        font-size: 5rem;
        font-weight: 900;
        color: var(--color-primary);
        margin: 0;
        line-height: 1;
    }

    .error-404 .page-title {
        font-size: 1.4rem !important;
        margin: 8px 0 12px;
    }

    .error-message {
        font-size: 0.9rem;
        color: var(--senego-color-meta);
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .error-404 .search-form {
        margin-bottom: 16px;
    }

    /* Bouton 404 migré vers le Design System : <a class="senego-btn senego-btn--primary">
       (cf. components.css). L'ancienne règle .error-404 .button-primary est supprimée. */

    /* ================================================================
       STATIC PAGES
       ================================================================ */
    .page .site-main {
        padding: var(--mobile-padding);
        background: #fff;
    }

    .page .entry-title {
        font-size: 1.4rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .page .entry-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    /* ================================================================
       UTILITIES & OVERRIDES
       ================================================================ */

    /* Typography refinements */
    h1, h2, h3, h4, h5, h6 {
        text-transform: none;
    }

    /* App promo popup on mobile */
    .popup-content {
        width: 92%;
        max-width: 340px;
        padding: 1.5rem;
        border-radius: var(--mobile-radius);
    }

    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }

    /* Touch targets minimum 44px - only for standalone buttons/nav links */
    .drawer-toggle,
    .search-toggle,
    .drawer-navigation a,
    .share-button,
    .popup-content a,
    button[type="submit"] {
        min-height: 44px;
    }

    /* Taboo ad wrapper */
    .taboolaAdWrapper {
        padding: 8px;
    }

}

/* --- Desktop (992px+): proper 3-column grid, no overlap --- */
@media (min-width: 992px) {

    /* Proper CSS Grid layout — sidebars fixées à 340px (pour pubs/widgets ≥300px
       padding compris), colonne centrale = espace restant (~552px sur site 1312px). */
    .home-content-area {
        display: grid !important;
        grid-template-columns: 340px minmax(0, 1fr) 340px !important;
        gap: 24px !important;
        overflow: clip;
    }

    /* Force sidebars to stay within their grid cells */
    /* overflow: clip (not hidden) to allow position: sticky inside */
    .home-content-area #secondary-left,
    .home-content-area .widget-area-left {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 340px;
        overflow: clip;
    }

    .home-content-area #secondary,
    .home-content-area > .widget-area:not(.widget-area-left) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 340px;
        overflow: clip;
    }

    /* Main content respects its grid cell */
    .home-content-area .site-main {
        min-width: 0;
        overflow: hidden;
    }

    /* Cartes d'articles (hero + compactes) : design déplacé dans
       components/card-article.css (chargé sur home/archive/recherche après main.css).
       Ne rien remettre ici pour éviter les doublons et les conflits !important. */

    /* Widgets inside narrower sidebars: prevent overflow */
    .home-content-area .widget {
        overflow: hidden;
        word-wrap: break-word;
    }

}

/* ==========================================================================
   FOOTER MEGA GRID
   ========================================================================== */
.footer-mega {
    display: grid;
    /* Le footer compte 4 colonnes de contenu (Rubriques, Services, Séries+Radios,
       A propos+Social). On colle la grille au nombre réel pour éviter une colonne
       vide à droite. */
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 30px 0;
    border-bottom: 1px solid #333;
}
.footer-col-title {
    color: #fff;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}
.footer-col-title-sub {
    margin-top: 18px;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col ul li {
    margin: 0;
    padding: 0;
    list-style: none;
}
.footer-col ul a {
    display: block;
    padding: 3px 0;
    color: #999;
    text-decoration: none;
    font-size: 0.82rem;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    transition: color 0.15s;
}
.footer-col ul a:hover {
    color: var(--color-primary, var(--senego-color-primary));
}
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #333;
    color: #ccc;
    transition: background 0.2s, color 0.2s;
}
.footer-social-link:hover {
    background: var(--color-primary, var(--senego-color-primary));
    color: #fff;
}
.footer-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0 10px;
}
.footer-bottom p {
    color: #777;
    font-size: 0.78rem;
    margin: 0;
}
.footer-bottom-logo img {
    opacity: 0.7;
    transition: opacity 0.2s;
}
.footer-bottom-logo:hover img {
    opacity: 1;
}

@media (max-width: 991px) {
    /* 4 colonnes de contenu → grille 2×2 sur tablette (plus propre que 3 cols
       avec une 4ᵉ orpheline sur la 2ᵉ ligne). */
    .footer-mega { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 767px) {
    .footer-mega { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    /* Mobile : 2 colonnes compactes (au lieu de 1 col qui faisait un footer
       interminable). Gap et tailles réduits pour tenir jusqu'à ~320px. */
    .footer-mega { grid-template-columns: repeat(2, 1fr); gap: 14px 12px; padding: 24px 0; }
    .footer-col-title { font-size: 0.78rem; margin-bottom: 8px; }
    .footer-col-title-sub { margin-top: 14px; }
    .footer-col ul a { font-size: 0.78rem; padding: 2px 0; }
    .footer-social { gap: 8px; flex-wrap: wrap; }
    .footer-social-link { width: 32px; height: 32px; }
}
