/* Carnet de voyage — 4 thèmes commutables (Magazine / Immersif / Carte / Minimal).
   Palette pilotée par variables ; structure ajustée par thème via [data-ct].
   Lightbox : gallery.css (chargé à part). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.jv-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg);
    color: var(--ink);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Palettes par thème ===== */
[data-ct="editorial"] {
    --bg: #f5efe3; --card: #fffdf9; --ink: #2b2018; --muted: #8a7d6d; --accent: #c0532f;
    --line: #e7ddcd; --serif: 'Fraunces', Georgia, serif; --hero-bg: #f5efe3; --hero-ink: #2b2018;
}
[data-ct="immersif"] {
    --bg: #08080a; --card: #111118; --ink: #f3f3f7; --muted: #9aa0b0; --accent: #ffb878;
    --line: #20212c; --serif: 'Fraunces', Georgia, serif; --hero-bg: #08080a; --hero-ink: #fff;
}
[data-ct="carte"] {
    --bg: #eef2f5; --card: #ffffff; --ink: #1f2733; --muted: #6b7a8a; --accent: #c0532f;
    --line: #e2e8ef; --serif: 'Fraunces', Georgia, serif; --hero-bg: #ffffff; --hero-ink: #1f2733;
}
[data-ct="minimal"] {
    --bg: #ffffff; --card: #ffffff; --ink: #141414; --muted: #9a9a9a; --accent: #141414;
    --line: #efefef; --serif: 'Inter', sans-serif; --hero-bg: #ffffff; --hero-ink: #141414;
}

/* ===== Barre de progression ===== */
.jv-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; transition: width 0.1s linear; }

/* ===== Porte d'entrée : demande un pseudo au premier accès ===== */
.jv-gate {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 1.2rem;
    background:
        radial-gradient(900px 520px at 22% 18%, rgba(255,184,120,.16), transparent 60%),
        radial-gradient(1000px 620px at 80% 28%, rgba(91,71,170,.42), transparent 62%),
        radial-gradient(1200px 760px at 50% 36%, #3b2d6e, #08080a 78%);
    color: #f3f3f7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.jv-gate-card {
    width: 100%; max-width: 26rem;
    padding: 2rem 1.6rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
    backdrop-filter: blur(10px);
}
.jv-gate-emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 0.4rem; }
.jv-gate-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.6rem; line-height: 1.15; margin: 0 0 0.5rem; }
.jv-gate-sub { margin: 0 0 1.4rem; color: #c8cad8; font-size: 0.95rem; line-height: 1.5; }
.jv-gate-form { display: flex; flex-direction: column; gap: 0.6rem; }
.jv-gate-input {
    width: 100%; padding: 0.7rem 1rem; font-size: 1rem;
    color: #f3f3f7; background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
    text-align: center;
}
.jv-gate-input:focus { outline: none; border-color: #ffb878; }
.jv-gate-btn {
    padding: 0.7rem 1.2rem; font-size: 0.98rem; font-weight: 700; cursor: pointer;
    color: #1a1206; background: #ffb878; border: none; border-radius: 999px;
    transition: opacity 0.12s;
}
.jv-gate-btn:hover { opacity: 0.9; }
.jv-gate-btn-ghost {
    color: #f3f3f7; background: transparent;
    border: 1px solid rgba(255,255,255,.22);
}
.jv-gate-btn-ghost:hover { background: rgba(255,255,255,.08); opacity: 1; }
.jv-gate-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.jv-gate-actions .jv-gate-btn { flex: 1 1 auto; }
.jv-gate-err { margin: 0.2rem 0 0; color: #ffb1a0; font-size: 0.85rem; min-height: 1em; }

/* ===== Barre supérieure + sélecteur ===== */
.jv-topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.6rem 1rem;
    background: color-mix(in srgb, var(--card) 86%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.jv-topbar-brand { font-weight: 700; font-size: 0.98rem; display: flex; align-items: center; gap: 0.4rem; }
/* Sélecteur de thème : masqué par défaut, déployé au clic sur le bouton 🎨
   (comportement uniforme desktop + mobile). Quand ouvert, il apparaît sur
   une 2e ligne centrée de la topbar. */
.jv-theme {
    display: none; gap: 0.25rem; order: 3; flex-basis: 100%; justify-content: center;
    background: color-mix(in srgb, var(--ink) 7%, transparent);
    padding: 0.2rem; border-radius: 999px;
}
.jv-topbar.is-theme-open .jv-theme { display: flex; }
.jv-theme-short { display: none; }
.jv-theme-toggle { display: inline-flex; }
.jv-theme-toggle[aria-expanded="true"] { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.jv-theme-btn {
    border: 0; cursor: pointer; font: inherit; font-size: 0.76rem; font-weight: 600;
    color: var(--muted); background: transparent; padding: 0.32rem 0.62rem; border-radius: 999px;
    transition: background-color 0.15s, color 0.15s;
}
.jv-theme-btn:hover { color: var(--ink); }
.jv-theme-btn.is-active { background: var(--accent); color: #fff; }
.jv-prive-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.8rem;
    font-size: 0.8rem; font-weight: 600; color: var(--muted); text-decoration: none;
    border: 1px solid var(--line); border-radius: 999px; background: var(--bg); white-space: nowrap;
}
.jv-prive-btn:hover { color: var(--ink); border-color: var(--accent); }
.jv-topbar-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.jv-parcours-btn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.jv-parcours-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.jv-pseudo-btn { cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600; }
.jv-pseudo-btn .jv-pseudo-btn-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jv-alertes-btn { color: #fff; background: var(--accent); border-color: var(--accent); }
.jv-alertes-btn:hover { opacity: 0.88; }

/* ===== Hero ===== */
.jv-hero { position: relative; overflow: hidden; text-align: center; padding: 3rem 1.4rem 2.6rem; background: var(--hero-bg); color: var(--hero-ink); }
.jv-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 6vw, 3.2rem); line-height: 1.05; margin: 0.3rem 0 0.4rem; letter-spacing: -0.01em; }
.jv-hero p { margin: 0 auto; max-width: 34rem; font-size: clamp(0.98rem, 2.4vw, 1.15rem); color: var(--muted); }
.jv-hero-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.2rem; }
.jv-chip { font-size: 0.78rem; font-weight: 600; padding: 0.34rem 0.8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: color-mix(in srgb, var(--ink) 4%, transparent); }
/* L'indicateur de défilement n'a de sens que dans le hero plein écran (Immersif) ;
   masqué ailleurs où le hero est court (sinon il chevauche les puces). */
.jv-scrollcue { display: none; }
[data-ct="immersif"] .jv-scrollcue { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 1.4rem; opacity: 0.75; animation: jv-bounce 1.8s ease-in-out infinite; pointer-events: none; }
.jv-scrollcue::before { content: "Découvrir"; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8; }
@keyframes jv-bounce { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,7px); } }

/* Immersif : chips en verre dépoli, cue plus lumineux. */
[data-ct="immersif"] .jv-chip { color: #eceefb; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08); backdrop-filter: blur(8px); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
[data-ct="immersif"] .jv-scrollcue { color: var(--accent); opacity: 0.9; }

/* ===== Fil des jours ===== */
.jv-main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3.5rem; }

/* Carte (cachée hors thème carte) */
#jv-map { display: none; margin-bottom: 2rem; }
.jvm-head { text-align: center; margin-bottom: 0.6rem; }
.jvm-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 0; }
.jvm-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.9rem; }
.jvm-leaflet { position: relative; height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 12px 30px -22px rgba(0,0,0,.45); background: #e8edf0; }
.jvm-inset { position: absolute; right: 10px; top: 10px; width: 148px; z-index: 500; border-radius: 10px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 5px 16px rgba(0,0,0,.4); background: #e8edf0; }
.jvm-inset-lbl { font: 700 10px 'Inter', sans-serif; color: var(--accent); background: #fff; padding: 4px 6px; text-align: center; letter-spacing: 0.02em; }
.jvm-inset-map { height: 104px; }
.jvm-leaflet .leaflet-control-attribution { font-size: 9px; }
.jvm-mk span { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); color: var(--accent); font: 700 12px 'Inter', sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform 0.12s; }
.jvm-mk:hover span { transform: scale(1.12); }
.jvm-mk.act span { background: var(--accent); color: #fff; }
.jvm-frame { background: linear-gradient(160deg, #f3efe4, #e9efe6); border: 1px solid #e0ddd0; border-radius: 16px; overflow: hidden; box-shadow: inset 0 1px 0 #fff, 0 12px 30px -22px rgba(0,0,0,.45); }
.jvm-frame svg { display: block; width: 100%; height: auto; }
.jvm-route { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: 0.85; }
.jvm-fly { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 3 4; opacity: 0.7; }
.jvm-pin circle { fill: #fff; stroke: var(--accent); stroke-width: 2; cursor: pointer; transition: r 0.15s; }
.jvm-pin text { font: 700 9px 'Inter', sans-serif; fill: var(--accent); text-anchor: middle; pointer-events: none; }
.jvm-pin .jvm-lbl { font: 600 8.5px 'Inter', sans-serif; fill: #5b6b7d; }
.jvm-pin.act circle { fill: var(--accent); }
.jvm-pin.act text { fill: #fff; }
.jvm-pin.act .jvm-lbl { fill: var(--accent); }
.jvm-pin:hover circle, .jvm-pin:focus circle { r: 11; outline: none; }

/* ===== Carte d'un jour (structure commune) ===== */
.d {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
    margin: 0 0 2rem; box-shadow: 0 16px 38px -24px rgba(15,23,42,.4), 0 2px 8px rgba(15,23,42,.05);
    opacity: 0; transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.d.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .d { opacity: 1; transform: none; transition: none; } }

.d-media { position: relative; }
.d-cover-empty { position: relative; overflow: hidden; min-height: clamp(180px, 36vw, 250px); background-size: cover; background-position: center; }
.d-cover-empty::after { content: attr(data-emoji); position: absolute; right: -0.12em; bottom: -0.28em; font-size: clamp(6rem, 22vw, 10rem); line-height: 1; opacity: 0.2; pointer-events: none; }
.d-cover-gal { margin: 0; display: block; }
.d-cover-item { position: relative; margin: 0; overflow: hidden; }
.d .gallery-item img { display: block; width: 100%; opacity: 0; transition: opacity 0.5s ease, transform 0.5s ease; }
.d .gallery-item img.gallery-img-loaded { opacity: 1; }
.d-cover-item img { aspect-ratio: 16/9; object-fit: cover; cursor: pointer; }
.d-cover-item:hover img { transform: scale(1.03); }
/* Vidéos (clips courts) : vignette (poster) comme une photo + badge ▶ ; clic → lightbox */
.gallery-item.is-video { position: relative; cursor: pointer; }
.gallery-item.is-video .video-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 54px; height: 54px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.55); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; padding-left: 3px; pointer-events: none;
    transition: background 0.2s ease, transform 0.2s ease;
}
.gallery-item.is-video:hover .video-badge { background: rgba(0, 0, 0, 0.78); transform: translate(-50%, -50%) scale(1.08); }
/* Lecteur en grand dans le lightbox */
.gallery-lightbox-video { background: #000; max-width: 92vw; max-height: 86vh; width: auto; height: auto; }

.d-head { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 1.6rem 1.3rem 1.1rem; display: flex; flex-direction: column; gap: 0.28rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.5) 28%, rgba(0,0,0,.24) 55%, rgba(0,0,0,.08) 78%, transparent 100%); pointer-events: none; }
.d-chip { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; opacity: 0.92; }
.d-draft { align-self: flex-start; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: #d97706; border-radius: 999px; padding: 0.18rem 0.6rem; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.d-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.08; margin: 0; text-shadow: 0 2px 16px rgba(0,0,0,.4); }
.d-loc { font-size: 0.85rem; font-weight: 500; opacity: 0.96; }
.d-meteo {
    align-self: flex-start; pointer-events: auto;
    position: relative; z-index: 3;
    display: inline-flex; align-items: center; gap: 0.55rem;
    font: inherit; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.01em;
    color: #fff; opacity: 0.94;
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px; padding: 0.22rem 0.72rem; margin-top: 0.15rem;
    cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(2px);
    -webkit-tap-highlight-color: rgba(255,255,255,.15);
}
.d-meteo * { pointer-events: none; } /* évite qu'un span/svg enfant ne capte le tap sans bubbler proprement */
.d-meteo:hover, .d-meteo:focus-visible { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.4); transform: translateY(-1px); outline: none; }
.d-meteo .d-spark { display: block; }

.d-body { padding: 1.4rem 1.6rem 1.5rem; }
.d-recit { font-size: 1.05rem; line-height: 1.78; color: var(--muted); }
.d-recit p { margin: 0 0 0.85rem; } .d-recit p:last-child { margin-bottom: 0; }
.d-recit strong { color: var(--ink); }
.d-extra { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; margin-top: 1.1rem; }
.d-extra .gallery-item { position: relative; margin: 0; overflow: hidden; border-radius: 6px; background: var(--line); }
.d-extra .gallery-item img { aspect-ratio: 1/1; object-fit: cover; cursor: pointer; }
.d-extra .gallery-item:hover img { transform: scale(1.06); }
.d-extra figcaption { position: absolute; inset: auto 0 0 0; padding: 0.6rem 0.5rem 0.35rem; font-size: 0.72rem; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.65), transparent); opacity: 0; transition: opacity 0.2s; }
.d-extra .gallery-item:hover figcaption { opacity: 1; }

/* ===== ÉDITORIAL : lettrine ===== */
[data-ct="editorial"] .jv-hero::before { content: ""; position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); width: 54px; height: 3px; background: var(--accent); border-radius: 2px; }
[data-ct="editorial"] .d-recit p:first-of-type::first-letter { font-family: var(--serif); font-weight: 600; font-size: 3.1em; line-height: 0.78; float: left; margin: 0.04em 0.1em 0 0; color: var(--accent); }

/* ===== MINIMAL : titre au-dessus, sans scrim ===== */
[data-ct="minimal"] .d { border: 0; box-shadow: none; border-radius: 0; margin-bottom: 3.4rem; background: transparent; }
[data-ct="minimal"] .d-media { display: flex; flex-direction: column; }
[data-ct="minimal"] .d-head { position: static; order: -1; color: var(--ink); background: none; padding: 0 0 0.9rem; gap: 0.15rem; }
[data-ct="minimal"] .d-chip { color: var(--ink); opacity: 1; }
[data-ct="minimal"] .d-title { font-family: 'Inter', sans-serif; font-weight: 600; letter-spacing: -0.01em; text-shadow: none; font-size: 1.5rem; }
[data-ct="minimal"] .d-loc { color: var(--muted); }
[data-ct="minimal"] .d-meteo { color: var(--ink); opacity: 1; background: transparent; border-color: var(--line); }
[data-ct="minimal"] .d-meteo:hover, [data-ct="minimal"] .d-meteo:focus-visible { background: var(--card); }
[data-ct="minimal"] .d-cover-item img, [data-ct="minimal"] .d-cover-empty { border-radius: 3px; aspect-ratio: 3/2; }
[data-ct="minimal"] .d-cover-empty { min-height: 0; }
[data-ct="minimal"] .d-body { padding: 1.1rem 0 0; }
[data-ct="minimal"] .d-extra { border-radius: 0; }

/* ===== CARTE : afficher la carte ===== */
[data-ct="carte"] #jv-map { display: block; }

/* ===== IMMERSIF : scènes plein écran ===== */
[data-ct="immersif"] body, [data-ct="immersif"] .jv-main { max-width: none; }
[data-ct="immersif"] .jv-main { max-width: none; padding: 0; }
[data-ct="immersif"] .jv-hero {
    min-height: 88vh; display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(900px 520px at 22% 18%, rgba(255,184,120,.16), transparent 60%),
        radial-gradient(1000px 620px at 80% 28%, rgba(91,71,170,.42), transparent 62%),
        radial-gradient(1200px 760px at 50% 36%, #3b2d6e, #08080a 78%);
}
/* Aurores : deux nappes floues qui dérivent lentement, donnent de la profondeur. */
[data-ct="immersif"] .jv-hero::before {
    content: ""; position: absolute; inset: -20%; z-index: 0; pointer-events: none;
    background:
        radial-gradient(420px 420px at 30% 35%, rgba(255,184,120,.20), transparent 60%),
        radial-gradient(520px 520px at 72% 60%, rgba(120,90,220,.28), transparent 62%);
    filter: blur(20px); opacity: .9;
    animation: jv-aurora 22s ease-in-out infinite alternate;
}
/* Vignette + grain fin + fondu vers le noir de la 1ʳᵉ scène. */
[data-ct="immersif"] .jv-hero::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 30%, transparent 55%, rgba(0,0,0,.55) 100%),
        linear-gradient(to bottom, transparent 70%, #08080a 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
[data-ct="immersif"] .jv-hero h1,
[data-ct="immersif"] .jv-hero p,
[data-ct="immersif"] .jv-hero-meta { position: relative; z-index: 1; }
[data-ct="immersif"] .jv-scrollcue { z-index: 1; }
@keyframes jv-aurora {
    0%   { transform: translate3d(-3%, -2%, 0) scale(1); }
    100% { transform: translate3d(3%, 2%, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    [data-ct="immersif"] .jv-hero::before { animation: none; }
}
[data-ct="immersif"] .jv-hero h1 {
    font-size: clamp(2.4rem, 7vw, 3.8rem);
    text-shadow: 0 2px 40px rgba(120,90,220,.45), 0 1px 3px rgba(0,0,0,.5);
}
[data-ct="immersif"] .jv-hero p { color: #c8cad8; }

/* Puce compte à rebours : mise en avant via l'accent. */
.jv-chip-cd { color: #fff; background: var(--accent); border-color: transparent; font-weight: 700; }
[data-ct="immersif"] .jv-chip-cd {
    color: #1a1206; background: var(--accent); backdrop-filter: none;
    box-shadow: 0 4px 18px rgba(255,184,120,.35);
    animation: jv-pulse 2.6s ease-in-out infinite;
}
@keyframes jv-pulse {
    0%,100% { box-shadow: 0 4px 18px rgba(255,184,120,.30); }
    50%     { box-shadow: 0 4px 26px rgba(255,184,120,.55); }
}
@media (prefers-reduced-motion: reduce) {
    [data-ct="immersif"] .jv-chip-cd { animation: none; }
}
[data-ct="immersif"] .d { border: 0; border-radius: 0; margin: 0; box-shadow: none; background: #08080a; }
/* Immersif : la scène est visible d'emblée ; l'apparition se fait via le fondu du voile noir sur le média. */
[data-ct="immersif"] .d { opacity: 1; transform: none; transition: none; }
[data-ct="immersif"] .d-media { height: 86vh; min-height: 520px; }
/* Fondu du noir vers l'image quand la scène entre à l'écran (voile sur sa propre couche GPU). */
[data-ct="immersif"] .d-media::after { content: ""; position: absolute; inset: 0; background: #08080a; opacity: 1; transition: opacity 0.9s ease-in-out; pointer-events: none; z-index: 2; will-change: opacity; }
[data-ct="immersif"] .d.is-in .d-media::after { opacity: 0; }
[data-ct="immersif"] .d-cover-gal, [data-ct="immersif"] .d-cover-item { height: 100%; }
[data-ct="immersif"] .d-cover-item img { height: 100%; aspect-ratio: auto; }
[data-ct="immersif"] .d-cover-empty { height: 86vh; min-height: 520px; }
[data-ct="immersif"] .d-head { padding: 1.6rem 1.5rem 2rem; }
[data-ct="immersif"] .d-title { font-size: clamp(2rem, 7vw, 3.2rem); }
[data-ct="immersif"] .d-body { max-width: 680px; margin: 0 auto; color: var(--ink); padding: 1.8rem 1.5rem 3rem; }
[data-ct="immersif"] .d-recit { color: #cfd2dd; }

/* ===== États ===== */
.jv-vide, .jv-erreur { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.jv-vide-emoji { font-size: 3.4rem; margin-bottom: 0.6rem; }
.jv-vide-titre { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--ink); margin: 0 0 0.4rem; }
.jv-vide-texte { margin: 0 auto; max-width: 26rem; line-height: 1.6; }
.jv-footer { text-align: center; padding: 1.6rem 1rem 2.6rem; font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
[data-ct="immersif"] .jv-footer { background: #08080a; }
.jv-version {
    cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 600;
    color: var(--muted); background: color-mix(in srgb, var(--ink) 6%, transparent);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 0.18rem 0.6rem; transition: color 0.15s, border-color 0.15s;
}
.jv-version:hover { color: var(--ink); border-color: var(--accent); }

/* ===== Modale changelog ===== */
.jv-chg-overlay {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
}
.jv-chg-overlay[hidden] { display: none; }
body.jv-chg-open { overflow: hidden; }
.jv-chg-card {
    width: 100%; max-width: 40rem; max-height: 86vh;
    display: flex; flex-direction: column;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
    overflow: hidden;
}
.jv-chg-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    padding: 1rem 1.2rem; border-bottom: 1px solid var(--line);
}
.jv-chg-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.jv-chg-close {
    cursor: pointer; font: inherit; font-size: 1rem; font-weight: 600;
    color: var(--muted); background: transparent; border: 1px solid var(--line);
    border-radius: 999px; width: 2rem; height: 2rem; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.jv-chg-close:hover { color: var(--ink); border-color: var(--accent); }
.jv-chg-body {
    padding: 1rem 1.3rem 1.4rem; overflow-y: auto; -webkit-overflow-scrolling: touch;
    line-height: 1.55; font-size: 0.92rem;
}
.jv-chg-body h2 { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 1.3rem 0 0.4rem; color: var(--accent); }
.jv-chg-body h2:first-child { margin-top: 0.2rem; }
.jv-chg-body h3 { font-size: 0.88rem; font-weight: 700; margin: 0.9rem 0 0.3rem; color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.jv-chg-body ul { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; }
.jv-chg-body li { margin: 0.18rem 0; color: var(--muted); }
.jv-chg-body li strong { color: var(--ink); font-weight: 600; }
.jv-chg-body p { margin: 0.4rem 0; color: var(--muted); }
.jv-chg-body hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.jv-chg-body a { color: var(--accent); }
.jv-chg-plain { white-space: pre-wrap; font-family: inherit; margin: 0; }

/* ===== Modale météo ===== */
.jv-mt-overlay {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
}
.jv-mt-overlay[hidden] { display: none; }
body.jv-mt-open { overflow: hidden; }
.jv-mt-card {
    width: 100%; max-width: 34rem; max-height: 86vh;
    display: flex; flex-direction: column;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.55);
    overflow: hidden;
}
.jv-mt-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    padding: 1rem 1.2rem; border-bottom: 1px solid var(--line);
}
.jv-mt-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.jv-mt-close {
    cursor: pointer; font: inherit; font-size: 1rem; font-weight: 600;
    color: var(--muted); background: transparent; border: 1px solid var(--line);
    border-radius: 999px; width: 2rem; height: 2rem; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.jv-mt-close:hover { color: var(--ink); border-color: var(--accent); }
.jv-mt-body { padding: 1rem 1.3rem 1.2rem; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.jv-mt-stats {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.5rem; margin-bottom: 1rem;
}
.jv-mt-stat {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem;
    padding: 0.55rem 0.75rem; background: var(--line-soft, rgba(120,120,120,.08));
    border: 1px solid var(--line); border-radius: 10px;
}
.jv-mt-stat-em { font-size: 1.1rem; line-height: 1; }
.jv-mt-stat-v { font-weight: 700; color: var(--ink); font-size: 0.95rem; line-height: 1.2; }
.jv-mt-stat-l { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.jv-mt-section { margin: 0.4rem 0 0.9rem; }
.jv-mt-section h3 { font-size: 0.78rem; font-weight: 700; margin: 0 0 0.35rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.jv-mt-chart { width: 100%; height: auto; display: block; }
.jv-mt-grid { stroke: var(--line); stroke-width: 0.6; }
.jv-mt-yaxis, .jv-mt-xaxis { font-size: 9px; fill: var(--muted); }
.jv-mt-yaxis { text-anchor: end; }
.jv-mt-xaxis { text-anchor: middle; }
.jv-mt-line { fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jv-mt-line-temp { stroke: #ef4444; }
.jv-mt-line-wind { stroke: #0ea5e9; }
.jv-mt-area { fill: rgba(239, 68, 68, 0.15); stroke: none; }
.jv-mt-bar { fill: #0ea5e9; opacity: 0.85; }
.jv-mt-src { font-size: 0.72rem; color: var(--muted); text-align: right; margin: 0.4rem 0 0; }
.jv-mt-src a { color: inherit; text-decoration: underline; }

/* ===== Abonnement / alerting « nouvelles photos » ===== */
.jv-subscribe {
    max-width: 34rem; margin: 2.6rem auto 0; padding: 1.8rem 1.6rem;
    text-align: center; background: var(--card); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: 0 18px 40px -30px rgba(0,0,0,.5);
    scroll-margin-top: 5rem; /* ne pas passer sous la topbar sticky au clic « 🔔 Alertes » */
}
.jv-subscribe h2 { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0 0 0.4rem; color: var(--ink); }
.jv-subscribe > p { margin: 0 auto 1.1rem; max-width: 26rem; color: var(--muted); font-size: 0.94rem; line-height: 1.5; }
.jv-sub-form { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.jv-sub-form input[type="email"] {
    flex: 1 1 14rem; min-width: 0; padding: 0.62rem 0.9rem; font-size: 0.95rem;
    color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
}
.jv-sub-form input[type="email"]:focus { outline: none; border-color: var(--accent); }
.jv-sub-form button {
    flex: 0 0 auto; padding: 0.62rem 1.2rem; font-size: 0.92rem; font-weight: 600; cursor: pointer;
    color: #fff; background: var(--accent); border: none; border-radius: 999px; transition: opacity 0.12s;
}
.jv-sub-form button:hover { opacity: 0.88; }
.jv-sub-alt { margin: 0.9rem 0 0; font-size: 0.82rem; color: var(--muted); }
.jv-sub-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.jv-sub-alt a:hover { text-decoration: underline; }
/* Immersif : la zone .jv-main est full-bleed sans fond peint → on la noircit
   pour ne pas laisser apparaître un bandeau blanc autour du bloc d'abonnement. */
[data-ct="immersif"] .jv-main { background: #08080a; }
[data-ct="immersif"] .jv-subscribe {
    background: #111118; border-color: rgba(255,255,255,.10);
    margin: 0 auto; padding: 3rem 1.6rem 3.4rem; border-radius: 0; border-left: 0; border-right: 0;
    max-width: none;
}
[data-ct="immersif"] .jv-subscribe > * { max-width: 34rem; margin-left: auto; margin-right: auto; }
[data-ct="immersif"] .jv-sub-form input[type="email"] { background: #08080a; border-color: rgba(255,255,255,.14); }

@media (max-width: 480px) {
    .d-body { padding: 1.1rem 1.1rem 1.2rem; }
    .d-extra { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    /* En mobile, sélecteur plus compact + libellés courts (comportement de
       repli commun défini plus haut). */
    .jv-theme { gap: 0.15rem; padding: 0.15rem; }
    .jv-theme-btn { padding: 0.28rem 0.55rem; font-size: 0.72rem; }
    .jv-theme-full { display: none; }
    .jv-theme-short { display: inline; }
    .jv-sub-form button { flex: 1 1 100%; }

    /* Topbar compacte : réduit paddings et gaps, masque les libellés textuels
       des boutons pour ne garder que les emojis (les libellés restent lisibles
       via aria-label / title pour l'accessibilité). */
    .jv-topbar { padding: 0.3rem 0.5rem; gap: 0.3rem; }
    .jv-topbar-brand { font-size: 0.85rem; }
    .jv-topbar-brand-text { display: none; }
    .jv-topbar-actions { gap: 0.25rem; }
    .jv-prive-btn { padding: 0.3rem 0.45rem; font-size: 0.78rem; gap: 0.2rem; }
    .jv-prive-btn .jv-btn-text { display: none; }
    .jv-pseudo-btn .jv-pseudo-btn-name { max-width: 6rem; }
}

/* ===== Bouton flottant « Revenir en haut » ===== */
.jv-back-top {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    width: 3rem; height: 3rem;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 1px solid var(--line);
    border-radius: 999px; cursor: pointer;
    background: var(--accent); color: #fff;
    font-size: 1.35rem; line-height: 1; font-weight: 700;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.jv-back-top:hover { transform: translateY(-2px); }
.jv-back-top[hidden] { display: none; }
