/* ============================================================================
 * INDEX MEDIA V3 — STARK ÉDITORIAL & SMOOTH REVEAL
 * ZERO ARRONDIS / LIGNES DROITES / ALIGNEMENTS PARFAITS
 * ============================================================================ */

/* ============================================================================
 * CONFIGURATION GLOBALE
 * ============================================================================ */
:root {
    --pepites-orange: #ff6233;
    --stark-border: rgba(127, 127, 127, 0.3);
    --stark-bg-alt: rgba(127, 127, 127, 0.05);
}

/* ============================================================================
 * CORRECTION FOND DE PAGE GLOBAL (POUR LE MODE SOMBRE)
 * ============================================================================ */
body.v3-page-index {
    background-color: var(--v3-bg);
    color: var(--v3-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.stark-editorial * {
    border-radius: 0 !important;
}

/* ============================================================================
 * SECTION HERO (STARK & ALIGNÉ À GAUCHE COMME LES CHRONIQUES)
 * ============================================================================ */
.v3-index-hero {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center; /* Centrage vertical */
    justify-content: flex-start; /* Alignement à gauche ! */
    text-align: left; /* Texte à gauche ! */
    color: #fff;
    padding-top: 80px;
    border-bottom: 1px solid var(--stark-border);
}

.v3-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.v3-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v3-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    /* Dégradé plus sombre à gauche pour garantir la lisibilité du texte */
    background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 50%, rgba(0,0,0,0.8) 100%);
}

.v3-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: var(--v3-max-width, 1280px);
    margin: 0 auto;
    padding: 0 40px; /* Alignement parfait avec la grille en dessous */
}

/* BREADCRUMBS */
.v3-breadcrumbs-stark {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
}
.v3-breadcrumbs-stark a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}
.v3-breadcrumbs-stark a:hover {
    color: var(--pepites-orange);
}
.v3-bc-sep {
    font-size: 1.2rem;
    color: var(--pepites-orange); /* Chevron orange signature */
    line-height: 1;
}

/* KICKER / TAG (Carré Orange Brutalist) */
.v3-hero-tags {
    margin-bottom: 20px;
}
.v3-kicker-stark {
    display: inline-block;
    background: var(--pepites-orange);
    color: #fff;
    padding: 6px 14px;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0; /* Zéro arrondi ! */
}

/* TITRE BOOSTÉ */
.v3-title-stark {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: relative;
    display: inline-block;
}
/* Soulignement orange racé type "Chroniques" */
.v3-title-stark::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 80px;
    height: 4px;
    background: var(--pepites-orange);
}

/* DESCRIPTION */
.v3-desc-stark {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 700px;
    margin: 0; /* Aligné à gauche, plus de margin auto */
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    .v3-hero-content {
        padding: 0 20px;
    }
    .v3-title-stark {
        font-size: 2.5rem;
    }
}

/* ============================================================================
 * BARRE DE FILTRES
 * ============================================================================ */
.v3-filter-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(var(--v3-surface-rgb, 255, 255, 255), 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--stark-border);
    padding: 15px 0;
}

html[data-theme="dark"] .v3-filter-bar,
html.theme-dark .v3-filter-bar {
    background: rgba(18, 18, 18, 0.95);
}

.v3-filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: var(--v3-max-width, 1280px);
    margin: 0 auto;
    padding: 0 20px;
}

.v3-filter-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--v3-text-mut);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.v3-filter-btn:hover {
    color: var(--v3-text);
}

.v3-filter-btn.is-active {
    border: 1px solid var(--v3-text);
    color: var(--v3-text);
    background: var(--stark-bg-alt);
}

/* ============================================================================
 * GRILLE D'ARTICLES (BRUTALIST / INSPIRATION)
 * ============================================================================ */
.v3-media-grid-section {
    padding: 60px 20px;
    background: var(--v3-bg);
}

.v3-grid-container {
    max-width: var(--v3-max-width, 1280px);
    margin: 0 auto;
}

.v3-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* --- Cartes Articles --- */
.v3-card-stark {
    background: var(--v3-surface);
    border: 1px solid var(--stark-border);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

.v3-card-stark:hover {
    border-color: var(--pepites-orange);
}

.v3-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* --- Image et Badge (Tag) --- */
.v3-card-img-wrap {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-bottom: 1px solid var(--stark-border);
}

.v3-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v3-card-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: #000;
    color: #fff;
    padding: 6px 12px;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

html[data-theme="dark"] .v3-card-tag,
html.theme-dark .v3-card-tag {
    background: #fff;
    color: #000;
}

/* --- Corps de la carte (Textes) --- */
.v3-card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.v3-card-meta {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--v3-text-mut);
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Signature intégrée au titre */
.v3-card-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    line-height: 1.3;
    margin: 0 0 15px 0;
    color: var(--v3-text);
}

.v3-sig {
    color: var(--pepites-orange);
    font-family: monospace;
    font-weight: 900;
    margin-right: 5px;
}

/* Troncature parfaite à 2 lignes */
.v3-card-desc {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--v3-text-mut);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Footer de la carte (Bouton et Flèche) --- */
.v3-card-footer {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--stark-border);
    background: var(--stark-bg-alt);
    margin-top: auto;
}

.v3-card-footer-text {
    padding: 15px 20px;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--v3-text-mut);
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.v3-card-arrow {
    width: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(127,127,127,0.15);
    border-left: 1px solid var(--stark-border);
    transition: background 0.3s, color 0.3s;
}

.v3-card-stark:hover .v3-card-arrow {
    background: var(--pepites-orange);
    color: #fff;
}

/* ============================================================================
 * GESTION DES EMPLACEMENTS PUBS
 * ============================================================================ */
.v3-ad-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--v3-text-mut);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.v3-ad-inline {
    padding: 20px;
    justify-content: center;
    background: var(--stark-bg-alt);
}

.v3-ad-placeholder {
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(127,127,127,0.1);
    border: 1px dashed var(--stark-border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--v3-text-mut);
}

/* La bannière pub prend toute la ligne */
.v3-ad-banner {
    grid-column: 1 / -1 !important; /* Force à prendre toutes les colonnes */
    width: 100% !important; /* Force la largeur totale */
    display: block !important; /* ⚠️ TRÈS IMPORTANT : Écrase le 'flex' appliqué par le JS */
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--stark-border);
    border-bottom: 1px solid var(--stark-border);
    margin: 20px 0;
    clear: both;
}

.v3-ad-banner iframe {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 auto;
}

.v3-ad-banner-placeholder {
    width: 100%;
    height: 120px;
    background: var(--stark-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text-mut);
}

/* ============================================================================
 * BANNIÈRE NEWSLETTER SLIM (HORIZONTAL) - CORRIGÉ
 * ============================================================================ */
.v3-newsletter-wrapper {
    max-width: var(--v3-max-width, 1280px);
    margin: 0 auto 60px;
    padding: 0 20px;
}

.v3-newsletter-slim {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px 40px;
    /* ON REMET LES BONNES VARIABLES NATURELLES */
    background: var(--v3-surface);
    color: var(--v3-text);
    border: 1px solid var(--stark-border);
    border-left: 4px solid var(--pepites-orange); /* Touche Premium */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

html[data-theme="dark"] .v3-newsletter-slim,
html.theme-dark .v3-newsletter-slim {
    border-color: var(--stark-border);
    border-left: 4px solid var(--pepites-orange);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.v3-nl-slim-text h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin: 0 0 5px 0;
    color: var(--v3-text); /* Corrigé */
}

.v3-nl-slim-text p {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin: 0;
    opacity: 0.8;
    color: var(--v3-text-mut); /* Corrigé */
}

.v3-cta-stark {
    background: var(--pepites-orange);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.v3-cta-stark:hover {
    background: #e04a1b;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .v3-newsletter-slim {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }
    .v3-cta-stark {
        width: 100%;
    }
}

/* ============================================================================
 * CLASSES D'ANIMATION SMOOTH REVEAL
 * ============================================================================ */
.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-item.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
 * MODALE NEWSLETTER (Centrage forcé et Rendu Stark)
 * ============================================================================ */
.v3-nl-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.v3-nl-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.v3-nl-modal-content.stark-modal {
    position: relative;
    z-index: 10001;
    background: var(--v3-surface);
    padding: 10px;
    width: 100%;
    max-width: 500px;
    border: 2px solid var(--stark-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: starkModalPop 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.v3-nl-modal-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 0;
}

html[data-theme="dark"] .v3-nl-modal-close-btn,
html.theme-dark .v3-nl-modal-close-btn {
    background: #121212 !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

.v3-nl-modal-close-btn:hover {
    background: var(--pepites-orange) !important;
    color: #ffffff !important;
    border-color: var(--pepites-orange) !important;
    transform: scale(1.1);
}

@keyframes starkModalPop {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
