/* HOME — Article vedette (featured) + Débats du jour (popular). Chargé is_home(). Extrait de main.css. */
/* --- 6.2 Featured Posts Section --- */
.featured-section {
    margin-bottom: calc(var(--spacing-unit) * 2);
}
.featured-grid {
    display: grid;
    /* 3 colonnes : Tendances (gauche) | Vedette (centre, ~60%) | Pub (droite) */
    grid-template-columns: 250px minmax(0, 1fr) 340px;
    gap: var(--senego-space-lg);
    align-items: start;
}
.featured-main-article {
    background: transparent;
    border: none;
    padding: 0;
}
.featured-image-container {
    position: relative;
    margin-bottom: 1rem;
    border-radius: var(--soft-radius);
    overflow: hidden;
}
/*.featured-image-container .attachment-news-theme-featured {*/
/*    width: 100%;*/
/*}*/
.featured-image-container .post-thumbnail, .featured-image-container .attachment-news-theme-featured  {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.featured-image-container a, .featured-image-container picture {
    width: 100%;
}
.featured-image-container a:hover .post-thumbnail {
    transform: scale(1.05);
}
/* Badge catégorie migré vers le Design System :
   <span class="senego-badge senego-badge--overlay"> (cf. components.css). */
.featured-main-article .entry-header {
    margin-bottom: 0.5rem;
}
.featured-main-article .entry-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 0;
}
.featured-main-article .entry-title a {
    color: var(--color-text);
    text-decoration: none;
}
.featured-main-article .entry-title a:hover {
    color: var(--color-primary);
}
.featured-main-article .entry-meta {
    font-size: 0.9rem;
    color: var(--color-meta);
    margin-top: 0.5rem;
}
.featured-main-article .entry-summary {
    color: var(--senego-color-muted);
    font-size: 1rem;
}
/* Méta de la vedette (date · commentaires) */
.featured-main-article .featured-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--senego-space-sm);
    margin-top: var(--senego-space-sm);
    font-family: var(--senego-font-base);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--senego-color-meta);
}
.featured-main-article .featured-meta__sep { opacity: .55; }
.featured-ad-area {
    display: flex;
    justify-content: center;
    position: sticky;
    top: 90px; /* reste visible sous le header */
}

/* ===== Colonne gauche : Sujets tendance (ai-editor) ===== */
.trending {
    position: sticky;
    top: 90px;
    background: var(--senego-color-surface);
    border: 1px solid var(--senego-color-border-soft);
    border-radius: var(--senego-radius-sm);
    padding: 14px 14px 4px;
}
.trending__head { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.trending__flame { font-size: 15px; line-height: 1; }
.trending__title {
    margin: 0;
    font-family: var(--senego-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: none;
    color: var(--senego-color-heading);
}
.trending__list { list-style: none; margin: 0; padding: 0; }
.trending__item { border-top: 1px solid var(--senego-color-border-soft); }
.trending__item:first-child { border-top: none; }
.trending__link { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; text-decoration: none; }
.trending__rank {
    flex: 0 0 auto;
    width: 24px;
    text-align: center;
    font-family: var(--senego-font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    color: var(--senego-color-border-strong);
}
.trending__link:hover .trending__rank { color: var(--senego-color-primary); }
.trending__body { min-width: 0; }
.trending__label {
    display: block;
    font-family: var(--senego-font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--senego-color-heading);
}
.trending__link:hover .trending__label { color: var(--senego-color-primary); }
.trending__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.72rem; line-height: 1; }
.trending__cat { color: var(--senego-color-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.trending__count { color: var(--senego-color-muted); }

@media (max-width: 991px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    /* Vedette en premier, puis tendances, puis pub */
    .featured-main-article { order: 1; }
    .trending { order: 2; position: static; }
    .featured-ad-area { order: 3; position: static; margin-top: var(--senego-space-md); }
    .featured-main-article .entry-title {
        font-size: 1.8rem;
    }
}

/* --- 6.3 Popular Posts Section (Débats du jour) --- */
.popular-posts-section {
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: 28px 0 32px;
}
/* En-tête « Débats du jour » : composant DS .senego-section-head (cf. components.css). */
.popular-posts-slider {
    position: relative;
    /* Aligné sur la vedette et le reste du contenu (plus de retrait 20px orphelin). */
    padding: 0;
}
.popular-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.popular-post-card {
    background: var(--senego-color-surface);
    border: 1px solid var(--senego-color-border-soft);
    border-radius: var(--senego-radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--senego-shadow-sm);
    transition: transform var(--senego-transition), box-shadow var(--senego-transition);
}
.popular-post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--senego-shadow-md);
}
.popular-post-thumbnail {
    position: relative;
}
.popular-post-thumbnail a {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.popular-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.popular-post-card:hover .popular-post-thumbnail img {
    transform: scale(1.06);
}
.popular-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--senego-color-primary), var(--senego-color-accent));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(230, 57, 0, 0.35);
    z-index: 2;
}
.popular-post-content {
    padding: var(--senego-space-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: var(--senego-space-sm);
}
.popular-post-cat {
    align-self: flex-start;
    font-family: var(--senego-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--senego-color-primary);
    text-decoration: none;
}
.popular-post-cat:hover { color: var(--senego-color-primary-dark); }
.popular-post-title {
    font-family: var(--senego-font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popular-post-title a {
    color: var(--senego-color-heading);
    text-decoration: none;
    transition: color var(--senego-transition);
}
.popular-post-title a:hover {
    color: var(--senego-color-primary);
}
.popular-post-meta {
    margin-top: auto;
}
.comment-count {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--senego-color-accent);
    background: var(--senego-color-surface-subtle);
    padding: 3px 10px;
    border-radius: var(--senego-radius-pill);
}
.comment-count svg {
    width: 14px;
    height: 14px;
}
.slider-nav {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transition: opacity 0.2s, visibility 0.2s, box-shadow 0.2s;
    color: #333;
}
.slider-nav:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.slider-nav.prev { left: 4px; }
.slider-nav.next { right: 4px; }
.slider-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 767px) {
    .popular-posts-section {
        border-radius: 0;
        padding: 20px 0 24px;
    }
    .popular-posts-slider {
        padding: 0;
    }
    .slider-nav {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .slider-nav.prev { left: 4px; }
    .slider-nav.next { right: 4px; }
    .popular-posts-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding: 4px 16px 12px;
        scrollbar-width: none;
    }
    .popular-posts-grid::-webkit-scrollbar {
        display: none;
    }
    .popular-post-card {
        flex: 0 0 75%;
        scroll-snap-align: start;
    }
}
@media (min-width: 768px) and (max-width: 1200px) {
    .popular-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1201px) {
    .slider-nav {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}



/* === Featured desktop (hero overlay) — déplacé de core.css (modularité) === */
@media (min-width: 992px) {
    /* =============================================================
       PREMIUM FEATURED SECTION (Hero Overlay Style)
       Inspired by: Awwwards editorial grids, Ahmad Shadeed overlay
       techniques, cinematic gradient with easing stops
       ============================================================= */

    /* Section container — 3 colonnes séparées (pas de carte unique).
       PAS d'overflow:hidden ici : il casserait le position:sticky des colonnes. */
    .featured-section {
        padding: 0;
        margin-bottom: 2rem;
    }

    /* Grid 2 colonnes : Vedette (gauche, large) | Sujets d'actu (droite). Plus de pub ici. */
    .featured-grid {
        grid-template-columns: minmax(0, 1fr) 300px !important;
        gap: var(--senego-space-lg) !important;
        align-items: start !important;
    }

    /* --- Hero article: overlay style --- */
    .featured-main-article {
        position: relative;
        max-width: none;
    }

    .featured-image-container {
        position: relative;
        margin-bottom: 0 !important;
        border-radius: var(--senego-radius-lg) !important;
        aspect-ratio: 16/9;
        overflow: hidden;
        box-shadow: var(--senego-shadow-md);
    }

    .featured-image-container a {
        display: block;
        width: 100%;
        height: 100%;
    }

    /* Dégradé continu sur TOUTE la hauteur : léger voile dès le haut, qui s'assombrit
       progressivement (easing, sans zone plate) jusqu'à 0.9 en bas → aucune coupure,
       fort contraste du titre sans ombre. */
    .featured-image-container a::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.08) 25%,
            rgba(0, 0, 0, 0.16) 42%,
            rgba(0, 0, 0, 0.28) 55%,
            rgba(0, 0, 0, 0.42) 66%,
            rgba(0, 0, 0, 0.60) 78%,
            rgba(0, 0, 0, 0.80) 90%,
            rgba(0, 0, 0, 0.90) 100%
        );
        z-index: 1;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* Badge catégorie (DS .senego-badge--overlay) : version desktop élevée. */
    .featured-image-container .senego-badge--overlay {
        top: 1.2rem;
        left: 1.2rem;
        background: var(--senego-color-primary);
        color: #fff;
        padding: 0.3rem 1rem;
        border-radius: 10px;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        z-index: 3;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

    /* Title moves ON TOP of the image */
    .featured-main-article .entry-header {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 2rem 1.8rem 1.6rem;
        z-index: 2;
        margin-bottom: 0;
    }

    /* Kicker catégorie (façon Yahoo : petite légende JUSTE au-dessus du titre,
       plus le badge dans le coin). Orange Senego pour l'identité. */
    .featured-main-article .featured-kicker {
        display: inline-block;
        margin: 0 0 0.45rem;
        padding: 0.18rem 0.55rem;
        background: var(--senego-color-primary);   /* pastille orange = lisible sur le noir */
        font-family: var(--senego-font-heading);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: #fff;                               /* texte blanc sur la pastille */
        border-radius: var(--senego-radius-xs);
    }

    .featured-main-article .entry-title {
        font-size: clamp(1.5rem, 2.2vw, 1.95rem);   /* ~30px façon Yahoo */
        line-height: 1.2;
        letter-spacing: -0.02em;                     /* titre serré (Yahoo -0.6px) */
        margin: 0;
        font-weight: 600;                            /* ~550 Yahoo (Public Sans 600) */
        text-transform: none !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;                       /* max 3 lignes comme Yahoo */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .featured-main-article .entry-title a {
        color: #fff !important;
        font-weight: 600;
        text-decoration: none !important;
        /* Aucune ombre : c'est le dégradé profond qui porte le contraste (comme Yahoo). */
    }

    .featured-main-article .entry-title a:hover {
        color: var(--senego-color-primary) !important;
    }

    /* Méta sur l'overlay sombre : texte clair */
    .featured-main-article .featured-meta {
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }

    /* Hover: subtle zoom on image */
    .featured-image-container a:hover img,
    .featured-image-container a:hover .attachment-news-theme-featured {
        transform: scale(1.04);
    }

    .featured-image-container img,
    .featured-image-container .attachment-news-theme-featured {
        transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    /* --- Ad area: colonne droite sticky, propre --- */
    .featured-ad-area {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding: 0;
        /* position:sticky + top hérités de la règle de base */
    }

    /* Label "PUBLICITÉ" already added by PHP — no ::before needed */
}

/* === Featured responsive mobile (déplacé de core.css) === */
@media (max-width: 767px) {
    /* ================================================================
       FEATURED ARTICLE - Hero Card Style
       ================================================================ */
    .featured-section {
        padding: 0;
        margin-bottom: 0;
        background: transparent;
    }

    /* IMPORTANT : grille à 1 colonne (PAS flex). La base .featured-grid a
       align-items:start ; en display:flex colonne, ça empêche l'étirement des
       enfants → la vedette se réduisait à la largeur de l'image et se collait à
       gauche, UNIQUEMENT sur Chrome/Blink mobile (WebKit étirait quand même).
       En grid 1fr, align-items:start n'agit que sur l'axe vertical → pleine
       largeur garantie sur tous les navigateurs. */
    .featured-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--senego-space-md);
    }
    /* Vedette en premier, puis les sujets d'actu (la pub est masquée sur mobile). */
    .featured-main-article { order: 1; }
    /* Marge basse pour ne pas coller la pub située juste en dessous sur mobile */
    .trending { order: 2; margin-bottom: var(--senego-space-xl); }

    .featured-main-article {
        position: relative;
        max-width: 100%;
        overflow: hidden;
        border-radius: 0;
    }

    .featured-image-container {
        position: relative;
        margin-bottom: 0;
        border-radius: var(--senego-radius-lg);
        aspect-ratio: 3/2 !important;   /* proportion Yahoo (plus cinématographique) */
        width: 100%;
    }

    /* Dégradé continu sur toute la hauteur (easing, sans coupure) */
    .featured-image-container::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.08) 25%,
            rgba(0, 0, 0, 0.16) 42%,
            rgba(0, 0, 0, 0.28) 55%,
            rgba(0, 0, 0, 0.42) 66%,
            rgba(0, 0, 0, 0.60) 78%,
            rgba(0, 0, 0, 0.80) 90%,
            rgba(0, 0, 0, 0.90) 100%
        );
        pointer-events: none;
        z-index: 1;
    }

    .featured-main-article .entry-header {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px var(--mobile-padding);
        z-index: 2;
        margin-bottom: 0;
    }

    /* Kicker catégorie au-dessus du titre (façon Yahoo) */
    .featured-main-article .featured-kicker {
        display: inline-block;
        margin: 0 0 6px;
        padding: 2px 8px;
        background: var(--senego-color-primary);
        font-family: var(--senego-font-heading);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: #fff;
        border-radius: var(--senego-radius-xs);
    }

    .featured-main-article .entry-title {
        font-size: 1.25rem;        /* 20px façon Yahoo */
        line-height: 1.25;
        letter-spacing: -0.02em;   /* serré comme Yahoo */
        margin: 0;
        font-weight: 600;
        color: #fff !important;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        /* pas d'ombre : le dégradé profond porte le contraste */
    }

    .featured-main-article .entry-title a {
        color: #fff !important;
        font-weight: 600;
        text-decoration: none;
    }
    .featured-main-article .featured-meta {
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
        font-size: 0.8rem;
        margin-top: 6px;
    }

    .senego-badge--overlay {
        position: absolute;
        top: 12px;
        left: 12px;
        background-color: var(--color-primary);
        color: #fff;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        z-index: 2;
        letter-spacing: 0.5px;
    }

    .featured-ad-area {
        display: none !important;
    }
}

/* === Popular (débats du jour) responsive mobile — déplacé de core.css === */
@media (max-width: 767px) {
    /* ================================================================
       POPULAR POSTS (DÉBATS DU JOUR) - Modern Horizontal Cards
       ================================================================ */
    .popular-posts-section {
        margin: 0;
        padding: 16px 0 20px;
    }

    .popular-posts-section .section-header {
        padding: 0 var(--mobile-padding) 10px;
        margin-bottom: 4px;
    }

    .popular-posts-section .section-title {
        font-size: 0.95rem;
        letter-spacing: 0.5px;
    }

    .popular-posts-slider {
        padding: 0;
    }

    .popular-posts-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: var(--mobile-gap);
        padding: 4px var(--mobile-padding) 12px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .popular-posts-grid::-webkit-scrollbar {
        display: none;
    }

    .popular-post-card {
        flex: 0 0 72%;
        scroll-snap-align: start;
        border-radius: var(--mobile-radius);
        overflow: hidden;
        border: none;
        box-shadow: var(--card-shadow);
        background: #fff;
    }

    .popular-post-thumbnail a {
        aspect-ratio: 16/9;
        min-height: auto;
    }

    .popular-post-thumbnail img {
        border-radius: 0;
    }

    .popular-rank {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
        top: 8px;
        left: 8px;
    }

    .popular-post-content {
        padding: 10px 12px 12px;
    }

    .popular-post-title {
        font-size: 0.88rem;
        line-height: 1.35;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 8px;
    }

    .popular-post-meta {
        padding-top: 0;
    }

    .comment-count {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    /* Slider navigation arrows - hidden on mobile (swipe only) */
    .slider-nav {
        display: none !important;
    }
}
