/* magazine_v3.css — CARNET VIVANT / PREMIUM V3 */

/* ============================================================
 * VARIABLES (Thème Clair & Mode Sombre)
 * Violet Royal et Typographie élégante
 * ============================================================ */
:root {
    /* Violet Royal Profond */
    --v3-accent: #6d28d9;
    --v3-accent-hover: #5b21b6;
    --v3-accent-soft: rgba(109, 40, 217, 0.1);

    --font-serif: "Lora", serif;
    --font-sans: "Montserrat", sans-serif;
    --v3-max-width: 1280px;

    --v3-bg: #fbfaf9;
    --v3-surface: #ffffff;
    --v3-text: #2c2c2c;
    --v3-link: #8b5cf6;
    --v3-text-mut: #777777;
    --v3-border: #eaeaea;
    --v3-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

html[data-theme="dark"], html.theme-dark {
    /* Violet clair pour la lisibilité sur fond sombre */
    --v3-accent: #a78bfa;
    --v3-accent-hover: #c4b5fd;
    --v3-accent-soft: rgba(167, 139, 250, 0.15);

    --v3-bg: #121212;
    --v3-surface: #1e1e1e;
    --v3-text: #e0e0e0;
    --v3-link: #c4b5fd;
    --v3-text-mut: #999999;
    --v3-border: #333333;
    --v3-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.mg-v3-page {
    background-color: var(--v3-bg);
    color: var(--v3-text);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: clip;
}

/* ---------------------------------------------------
 * SÉCURITÉ : Empêche le scroll horizontal indésirable
 * ---------------------------------------------------
.v3-page-container {
    overflow-x: hidden;
    width: 100%;
}
*/
/* ============================================================
 * HERO & BREADCRUMBS (STARK EDITORIAL ALIGNÉ À GAUCHE)
 * Violet Royal et Typographie élégante préservés
 * ============================================================ */
.v3-hero-header {
    position: relative;
    height: 75vh;
    min-height: 550px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alignement à gauche */
    text-align: left;            /* Texte à gauche */
    color: #fff;
    overflow: hidden;
}

.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;
    /* Dégradé latéral pour garantir une lecture parfaite à gauche */
    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%);
    z-index: 2;
    pointer-events: none;
}

.v3-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: var(--v3-max-width, 1280px);
    margin: 0 auto;
    padding: 0 40px;
    margin-top: 40px;
}

/* BREADCRUMBS STARK */
.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;
    flex-wrap: wrap;
    gap: 10px;
}
.v3-breadcrumbs-stark a { color: #fff; text-decoration: none; transition: color 0.2s; }
.v3-breadcrumbs-stark a:hover { color: var(--v3-accent); /* Violet Royal ! */ }
.v3-bc-sep { font-size: 1.2rem; color: var(--v3-accent); line-height: 1; } /* Chevron Violet Royal */

/* KICKER / TAG */
.v3-hero-tags { margin-bottom: 20px; }
.v3-kicker-stark {
    display: inline-block;
    background: var(--v3-accent); /* Violet Royal ! */
    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 : pur Stark */
}

/* TITRE BOOSTÉ */
.v3-title-stark {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    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 signature en Violet Royal */
.v3-title-stark::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 80px;
    height: 4px;
    background: var(--v3-accent); /* Violet Royal ! */
}

/* DESCRIPTION SOUS-TITRE */
.v3-desc-stark {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 0 30px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* META DATA (Date, auteur, etc) */
.v3-hero-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 850px;
}
.v3-meta-left { display: flex; flex-wrap: wrap; gap: 15px; opacity: 0.9; }
.v3-meta-sep { width: 4px; height: 4px; background: #fff; border-radius: 50%; opacity: 0.5; margin: auto 0; }
.v3-meta-right { display: flex; gap: 10px; }

/* Boutons d'actions */
.v3-share-btn, .v3-copy-link {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 0; /* Zéro arrondi */
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font-sans);
    font-weight: 700;
}
.v3-share-btn:hover, .v3-copy-link:hover {
    background: var(--v3-accent); /* Violet Royal ! */
    border-color: var(--v3-accent);
}

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

/* ============================================================
 * LAYOUT GRID & SIDEBAR
 * ============================================================ */
.v3-grid-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    max-width: var(--v3-max-width);
    margin: 0 auto;
    gap: 70px;
    padding: 40px 40px; /* Moins éloigné du haut ! (avant c'était 60px) */
}
.v3-main-content { max-width: 780px; justify-self: end; width: 100%; }
.v3-sidebar { border-left: 1px solid var(--v3-border); padding-left: 40px; }

/* La nouvelle Sidebar gérée intelligemment */
.v3-sidebar-sticky {
    position: sticky;
    top: 20px; /* <-- Colle la sidebar tout en haut (ajuste à 70px si ton menu principal cache le haut) */
    display: flex;
    flex-direction: column;
    gap: 15px; /* <-- Espace fortement réduit entre les blocs (au lieu de 30px) */
}

    /* Gère les petits écrans d'ordinateur avec un scroll fin et élégant */
    max-height: calc(100vh - 90px);
    /*overflow-y: auto;*/
    padding-right: 10px;
    padding-bottom: 20px;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--v3-border) transparent;
}
/* Scrollbar ultra discrète pour Chrome/Safari */
.v3-sidebar-sticky::-webkit-scrollbar { width: 4px; }
.v3-sidebar-sticky::-webkit-scrollbar-track { background: transparent; }
.v3-sidebar-sticky::-webkit-scrollbar-thumb { background-color: var(--v3-border); border-radius: 4px; }

/* ============================================================
 * CORPS DE L'ARTICLE
 * ============================================================ */
.v3-teaser-box {
    margin-bottom: 3.5rem;
    padding: 1.5rem 2rem;
    background: var(--v3-surface);
    border-left: 6px solid var(--v3-accent);
    box-shadow: var(--v3-shadow);
    border-radius: 0 12px 12px 0;
}
.v3-teaser-box p {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.7;
    font-weight: 600;
    color: var(--v3-accent);
    font-style: italic;
    margin: 0;
}

.v3-article-body > .v3-block-p:first-of-type .v3-p::first-letter {
    float: left;
    font-size: 4.8rem;
    line-height: 0.85;
    padding-top: 0.1rem;
    padding-right: 0.6rem;
    color: var(--v3-accent);
    font-family: var(--font-serif);
    font-weight: 900;
}

.v3-article-body {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--v3-text);
}
.v3-block { margin-bottom: 1.8rem; }
.v3-p { margin: 0 0 1.5rem; }

.v3-article-body a {
    color: var(--v3-link); /* On utilise le violet doux */
    text-decoration: underline;
    text-decoration-thickness: 1px; /* Plus fin pour le côté Premium */
    text-underline-offset: 3px;
    text-decoration-color: rgba(139, 92, 246, 0.3); /* Soulignement très discret */
    font-weight: 500; /* Un peu moins "lourd" que 600 */
    transition: all 0.2s ease;
}

.v3-article-body a:hover {
    color: var(--v3-accent); /* Devient Violet Royal au survol */
    text-decoration-color: var(--v3-accent);
    text-decoration-thickness: 2px; /* Le soulignement s'épaissit au survol */
    background: var(--v3-accent-soft); /* Petit effet de surbrillance très léger */
    border-radius: 2px;
}

.v3-h2 { font-family: var(--font-sans); font-size: 1.8rem; font-weight: 800; margin: 3.5rem 0 1.5rem; color: var(--v3-text); letter-spacing: -0.02em; }
.v3-h3 { font-family: var(--font-sans); font-size: 1.4rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--v3-text); }

.v3-list { margin: 1rem 0 2rem; padding-left: 2rem; font-family: var(--font-sans); }
.v3-list li { margin-bottom: 0.8rem; }

.v3-figure { margin: 2.5rem 0; border-radius: 12px; overflow: hidden; box-shadow: var(--v3-shadow); background: var(--v3-surface); }
.v3-figure.is-wide { margin-left: -50px; margin-right: -50px; width: calc(100% + 100px); max-width: none; }
.v3-figure.is-bleed { margin-left: calc(-50vw + 50%); width: 100vw; max-width: none; border-radius: 0; }
.v3-figure img { width: 100%; display: block; }
.v3-caption { font-family: var(--font-sans); font-size: 0.9rem; color: var(--v3-text-mut); padding: 12px; text-align: center; border-top: 1px solid var(--v3-border); }
.v3-cap-cred { opacity: 0.7; margin-left: 10px; font-size: 0.8rem; }

.v3-duo-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 2.5rem 0; }
.v3-duo-item { border-radius: 12px; overflow: hidden; box-shadow: var(--v3-shadow); }
.v3-duo-item img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4/3; }

.v3-blockquote {
    margin: 3rem 0;
    padding: 2.5rem;
    background: var(--v3-surface);
    border-radius: 12px;
    box-shadow: var(--v3-shadow);
    text-align: center;
    border: 1px solid var(--v3-border);
}
.v3-quote-icon { font-size: 2rem; color: var(--v3-accent); opacity: 0.3; margin-bottom: 15px; }
.v3-blockquote p { font-size: 1.4rem; font-style: italic; font-weight: 600; margin: 0; }
.v3-blockquote footer { margin-top: 15px; font-family: var(--font-sans); font-weight: 700; font-size: 0.9rem; color: var(--v3-text-mut); text-transform: uppercase; }

.v3-callout { margin: 2rem 0; padding: 1.5rem; background: var(--v3-surface); border-radius: 12px; border: 1px solid var(--v3-border); border-left: 4px solid var(--v3-accent); box-shadow: var(--v3-shadow); }
.v3-callout-label { font-family: var(--font-sans); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: var(--v3-text-mut); margin-bottom: 8px; }
.v3-callout-text { font-family: var(--font-sans); font-size: 1rem; }

.v3-partner-block { margin: 3rem 0; padding: 2rem; background: var(--v3-accent-soft); border-radius: 16px; border: 1px solid var(--v3-accent); }
.v3-partner-badge { display: inline-block; font-family: var(--font-sans); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--v3-accent); margin-bottom: 15px; letter-spacing: 1px; }
.v3-partner-body { display: flex; gap: 20px; align-items: center; }
.v3-partner-logo { width: 100px; height: auto; border-radius: 8px; background: #fff; padding: 10px; border: 1px solid var(--v3-border); }
.v3-partner-title { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 800; margin: 0 0 5px; color: var(--v3-text); }
.v3-partner-desc { font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.5; color: var(--v3-text-mut); margin: 0 0 15px; }
.v3-btn-outline { display: inline-block; padding: 8px 16px; border: 2px solid var(--v3-accent); color: var(--v3-accent); font-family: var(--font-sans); font-weight: 700; border-radius: 8px; text-decoration: none; transition: 0.2s; }
.v3-btn-outline:hover { background: var(--v3-accent); color: #fff; }

.v3-ad-inline { margin: 3rem 0; text-align: center; background: var(--v3-surface); padding: 20px; border-radius: 12px; border: 1px solid var(--v3-border); }
.v3-ad-badge { display: block; font-family: var(--font-sans); font-size: 0.75rem; text-transform: uppercase; color: var(--v3-text-mut); margin-bottom: 10px; }
.v3-ad-inline iframe { width: 100%; height: 250px; border: none; border-radius: 8px; }

.v3-signature { margin-top: 4rem; text-align: right; border-top: 2px dashed var(--v3-border); padding-top: 2rem; font-family: var(--font-sans); }
.v3-sig-role { display: block; font-size: 0.8rem; font-weight: 800; color: var(--v3-text-mut); text-transform: uppercase; letter-spacing: 1px; }
.v3-sig-name { font-size: 1.2rem; color: var(--v3-text); border-bottom: 2px solid var(--v3-accent); padding-bottom: 2px; }
.v3-sig-name a { color: inherit; text-decoration: none; }
.v3-sig-for { font-size: 0.9rem; color: var(--v3-text-mut); margin-left: 5px; }
.v3-sig-context { display: block; font-size: 0.9rem; color: var(--v3-text-mut); margin-top: 5px; }

/* ============================================================
 * WIDGETS SIDEBAR
 * ============================================================ */
.v3-widget-label { display: inline-block; font-family: var(--font-sans); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--v3-text-mut); margin-bottom: 10px; }
/* Titres des widgets moins espacés */
.v3-widget-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px; /* <-- Avant c'était 20px */
    color: var(--v3-text);
    display: inline-block;
    border-bottom: 3px solid var(--v3-accent);
    padding-bottom: 4px;
}

.ch-v3-random-list { display: flex; flex-direction: column; gap: 15px; }
.ch-v3-random-card { display: flex; gap: 12px; text-decoration: none; color: inherit; align-items: center; background: var(--v3-surface); padding: 10px; border-radius: 10px; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--v3-border); }
.ch-v3-random-card:hover { transform: translateY(-3px); box-shadow: var(--v3-shadow); border-color: var(--v3-accent); }
.ch-v3-random-img { width: 70px; height: 70px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.ch-v3-random-img img { width: 100%; height: 100%; object-fit: cover; }
.ch-v3-random-title { font-family: var(--font-sans); font-weight: 700; font-size: 0.9rem; line-height: 1.35; color: var(--v3-text); }
.ch-v3-random-card:hover .ch-v3-random-title { color: var(--v3-accent); }

/* Bloc Newsletter affiné */
.v3-widget-newsletter {
    background: var(--v3-surface);
    padding: 15px; /* <-- Avant c'était 25px */
    border-radius: 12px;
    border: 1px solid var(--v3-border);
    box-shadow: var(--v3-shadow);
}
.v3-widget-newsletter p {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--v3-text-mut);
    margin: 0 0 10px 0; /* <-- Rapproche le texte du bouton */
}
/* Bouton affiné */
.v3-cta-btn {
    display: block;
    background: var(--v3-accent-soft);
    border: 1px solid var(--v3-accent);
    color: var(--v3-accent);
    text-align: center;
    padding: 8px; /* <-- Bouton moins haut (avant 12px) */
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font-sans);
    font-weight: 800;
    margin-top: 5px;
    transition: 0.2s;
}
.v3-cta-btn:hover {
    background: var(--v3-accent);
    color: #fff;
}

/* ============================================================
 * GALLERY MASONRY-LIKE
 * ============================================================ */
.v3-gallery { margin-top: 5rem; padding: 3rem; background: var(--v3-surface); border-radius: 16px; box-shadow: var(--v3-shadow); border: 1px solid var(--v3-border); }
.v3-gallery-header { text-align: center; margin-bottom: 2rem; }
.v3-gallery-title { font-family: var(--font-serif); font-size: 2.2rem; margin: 0 0 5px; color: var(--v3-text); }
.v3-gallery-meta { font-family: var(--font-sans); display: flex; justify-content: center; gap: 15px; font-size: 0.9rem; font-weight: 700; color: var(--v3-text-mut); text-transform: uppercase; }

.v3-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; }
.v3-gallery-item { position: relative; border: none; padding: 0; cursor: pointer; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--v3-border); }
.v3-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.v3-thumb-overlay { position: absolute; inset: 0; background: rgba(109, 40, 217, 0.6); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; color: #fff; font-size: 1.5rem; }
.v3-gallery-item:hover img { transform: scale(1.08); }
.v3-gallery-item:hover .v3-thumb-overlay { opacity: 1; }

/* ============================================================
 * MOBILE RESPONSIVE
 * ============================================================ */
@media (max-width: 1024px) {
    .v3-grid-layout { grid-template-columns: 1fr; padding: 40px 20px; gap: 50px; }
    .v3-hero-header { height: auto; padding: 100px 0 60px; }
    .v3-figure.is-wide, .v3-figure.is-bleed { margin-left: 0; width: 100%; border-radius: 12px; }
    .v3-sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--v3-border); padding-top: 40px; }
    .v3-sidebar-sticky { position: static; max-height: none; overflow-y: visible; padding-right: 0; }
    .v3-main-content { justify-self: stretch; max-width: 100%; }
    .v3-partner-body { flex-direction: column; text-align: center; }
    .v3-gallery { padding: 1.5rem; }
    .v3-duo-container { grid-template-columns: 1fr; }
}

/* ============================================================
 * OUTIL DE DÉBOGAGE : LE TRACEUR ROUGE
 * Décommente ce bloc pour voir quel élément dépasse de l'écran
 * (provoquant le scroll horizontal sur mobile).
 * ============================================================ */
/*
 * {
 *  outline: 1px solid rgba(255, 0, 0, 0.6) !important;
 } *
 */

/* ============================================================
 * MODALE NEWSLETTER V3
 * ============================================================ */
.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.7);
    backdrop-filter: blur(4px); /* Petit effet flou très moderne */
}

.v3-nl-modal-content {
    position: relative;
    z-index: 10001;
    background: var(--v3-surface);
    padding: 10px; /* Le widget de la newsletter a déjà ses propres marges */
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: v3-modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.v3-nl-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--v3-surface);
    border: 1px solid var(--v3-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-text-mut);
    cursor: pointer;
    z-index: 10002;
    transition: all 0.2s;
    box-shadow: var(--v3-shadow);
}

.v3-nl-modal-close-btn:hover {
    color: var(--v3-accent);
    border-color: var(--v3-accent);
    transform: translateY(-2px);
}

@keyframes v3-modal-pop {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Style des flèches Lightbox */
.v3-lb-arrow:hover {
    background: var(--v3-accent) !important;
    transform: translateY(-50%) scale(1.1) !important;
    box-shadow: 0 0 20px var(--v3-accent-soft);
}

.v3-lb-img {
    transition: opacity 0.2s ease-in-out;
}

/* Masquer les flèches sur petit mobile pour laisser la place à l'image */
@media (max-width: 600px) {
    .v3-lb-arrow {
        width: 45px !important;
        height: 45px !important;
        background: rgba(0,0,0,0.5) !important;
    }
}
