/* =============================================================================
   Accueil en fond sombre, sur smartphone seulement (15 novembre 2026, demande de Rémi)
   -----------------------------------------------------------------------------
   Chargée par index.php avec le même media que la version mobile (≤ 800 px de large,
   ou ≤ 599 px de haut) : l'ordinateur ne change pas. Le blanc devient la nuit #15161a,
   tout ce qui était sombre passe en blanc ; cinq couleurs se règlent ici :
   ========================================================================== */

/* Hauteur de la barre d'état à rattraper, SEULEMENT dans le site installé (PWA, barre translucide). Dans Safari,
   env(safe-area-inset-top) ne vaut pas toujours 0 (vu au retour du shop vers la home, 15-11-2026 : header décalé
   d'une soixantaine de pixels) alors que la page y commence déjà sous l'heure : on ne s'y fie donc qu'en PWA. */
:root { --haut-pwa: 0px; }
@media (display-mode: standalone) { :root { --haut-pwa: env(safe-area-inset-top, 0px); } }
html.pwa:root { --haut-pwa: env(safe-area-inset-top, 0px); }

:root:root:root {
    --sombre-fond: #15161a;
    --sombre-carte: #05276b;        /* la carte ancienne du hero, le bateau, la souris (choix de Rémi) */
    --sombre-logo: #0061ff;         /* « Sartine » dans le logo */
    --sombre-logo-texte: #f5f6fa;   /* « Studio graphique » dans le logo */
    --sombre-accent: #0060ff;       /* « Studio graphique » du titre et les autres accents (choix de Rémi) */
    --onde-reflet-1: #0061ff;       /* les deux reflets de l'onde du logo (js/logo-prisme.js) : ton sur ton, dans le bleu du mot, */
    --onde-reflet-2: #0052d9;       /* sans aucun clair (version 3 de la planche, choix de Rémi du 15-11-2026) */

    --white: var(--sombre-fond) !important;
    --black: #f5f6fa !important;
    --hero-responsive: #f5f6fa !important;
    --hc-encre: var(--sombre-carte) !important;
    --hero-color: var(--sombre-accent) !important;
    --infuse-color: #692aec !important;   /* le projet Infuse : son violet #4f00f5 s'éclaircit sur le fond sombre (choix de Rémi) */
    --jo-color: #7660e2 !important;   /* JO : #625798 trop sourd sur la nuit (choix de Rémi, 15-11-2026) */
}
html, body { background: var(--sombre-fond) !important; }

/* titres en blanc, leur deuxième ligne dans l'accent (la carte a désormais sa couleur à elle) */
html body #info .title, html body .sous-hero .title { color: #f5f6fa !important; }
html body #info .title .highlight, html body .sous-hero .title .highlight { color: var(--sombre-accent) !important; }

/* le menu reste blanc (sur mobile, hero-carte.css le mettait à la couleur de la carte) */
html body .site-header.site-header .nav-item { color: #f5f6fa; }

/* header transparent (15-11-2026) : pas de voile sous le menu, le jeu Space Miaou s'enchaîne sur la même nuit */
html body .site-header::before { display: none !important; }

/* iPhone, Safari 26 (15-11-2026) : un élément fixe PLEINE LARGEUR collé en haut de l'écran est « échantillonné »
   par Safari, qui peint alors un fond plein sous l'heure et derrière le header (c'est ce que Rémi voyait sur
   la home et pas sur le brief, où le header n'est pas fixe). Le header ne fait donc plus de boîte : le logo et
   le menu deviennent deux éléments fixes séparés, chacun loin de la pleine largeur, et Safari laisse la barre
   transparente. Même place qu'avant (padding 30 px, menu centré sur la hauteur du logo, 120 × 53 px). */
@media (max-width: 800px) {
    html body .site-header.site-header { display: contents; }
    html body .site-header.site-header > .header-logo,
    html body .site-header.site-header > .header-nav {
        position: fixed; top: calc(30px + var(--haut-pwa)); z-index: 300;   /* site installé (PWA) : sous l'heure */
        transition: transform .45s cubic-bezier(.4, 0, .2, 1), opacity .35s ease;
    }
    html body .site-header.site-header > .header-logo { left: 30px; }
    html body .site-header.site-header > .header-nav { right: 30px; height: 53px; display: flex; align-items: center; }
    /* masqué à partir du book (js/sartine.js pose .header-cache sur le header) */
    html body .site-header.site-header.header-cache > * { transform: translateY(calc(-120px - var(--haut-pwa))); opacity: 0; pointer-events: none; }
}

/* le logo du header : deux couleurs réglables */
html body .site-header.site-header .header-logo #poisson path { fill: var(--sombre-logo) !important; }
/* dans le book, le temps que le header s'efface : « Sartine » prend la couleur du projet à l'écran
   (ex. le vert de Jeunesse 2027), comme sur ordinateur (15-11-2026, demande de Rémi ; variable posée par js/sartine.js) */
html body .site-header.site-header:not(.over-hero) .header-logo #poisson path { fill: var(--logo-projet, var(--sombre-logo)) !important; }
html body .site-header.site-header .header-logo #texte path { fill: var(--sombre-logo-texte) !important; }

/* Le loader et le banc de poissons : chaque poisson garde sa nuance, dans une gamme qui part du bleu de l'accent
   (#0060ff) vers le bleu de la carte #05276b (img/loader/sombre/, dix nuances ; choix de Rémi du 15-11-2026, version 2 de la planche) */
html body .fish img[src$="loader001.svg"] { content: url(../img/loader/sombre/loader001.svg?v=2026-11-15b); }
html body .fish img[src$="loader002.svg"] { content: url(../img/loader/sombre/loader002.svg?v=2026-11-15b); }
html body .fish img[src$="loader003.svg"] { content: url(../img/loader/sombre/loader003.svg?v=2026-11-15b); }
html body .fish img[src$="loader004.svg"] { content: url(../img/loader/sombre/loader004.svg?v=2026-11-15b); }
html body .fish img[src$="loader005.svg"] { content: url(../img/loader/sombre/loader005.svg?v=2026-11-15b); }
html body .fish img[src$="loader006.svg"] { content: url(../img/loader/sombre/loader006.svg?v=2026-11-15b); }
html body .fish img[src$="loader007.svg"] { content: url(../img/loader/sombre/loader007.svg?v=2026-11-15b); }
html body .fish img[src$="loader008.svg"] { content: url(../img/loader/sombre/loader008.svg?v=2026-11-15b); }
html body .fish img[src$="loader009.svg"] { content: url(../img/loader/sombre/loader009.svg?v=2026-11-15b); }
html body .fish img[src$="loader010.svg"] { content: url(../img/loader/sombre/loader010.svg?v=2026-11-15b); }

/* Les pictos dessinés en sombre passent en blanc : flèche du CTA « démarrer un brief », Instagram et flèche
   « retour en haut » du pied de page. Les flèches des liens vers les sites (« découvrez le site ») suivent --black. */
html body .btn-brief img,
html body footer img,
html body .fleche img { filter: invert(1) brightness(1.15) !important; }
html body .footer-admin-logo { color: #f5f6fa; }

/* Boutons d'appel (CTA) en fond sombre : états inversés (demande de Rémi, 15 novembre 2026). Au repos, aplat bleu
   #0061ff et texte blanc ; au survol ou au toucher, le contour blanc d'origine sur fond transparent.
   (En fond clair, c'était l'inverse : contour au repos, aplat #4f00f5 au survol.) */
html body .btn-brief, html body .btn-submit {
    background-color: #0061ff !important; border-color: transparent !important; color: #ffffff !important;
}
html body .btn-brief img { filter: invert(1) brightness(1.15) !important; }
html body .btn-brief:hover, html body .btn-brief:focus-visible, html body .btn-brief:active,
html body .btn-submit:hover, html body .btn-submit:focus-visible, html body .btn-submit:active {
    background-color: transparent !important; border: 1px solid #f5f6fa !important; color: #f5f6fa !important;
}

/* Site installé (PWA, barre d'état translucide, 15-11-2026) : la page commence sous l'heure, et tout (hero, carte,
   book) remontait de la hauteur de la barre d'état par rapport à Safari. On rend à la page la géométrie de Safari :
   elle commence juste sous l'heure (main décalé, arrêts du défilement juste sous l'heure) et les panneaux plein écran perdent
   cette hauteur ; en défilant, le contenu passe sous l'heure. --haut-pwa vaut 0 dans Safari : rien n'y change. */
@media (max-width: 800px), (max-height: 599px) {
    html { scroll-padding-top: var(--haut-pwa); }
    html body main { padding-top: var(--haut-pwa); }
    html body .hero-grid, html body .sous-hero {
        height: calc(100lvh - var(--haut-pwa));
        min-height: calc(100lvh - var(--haut-pwa));
    }
}
/* pas de barre Safari dans le site installé : rien à remonter (--barre = 100lvh - 100svh y valait ~54 px) */
@media (display-mode: standalone) { :root:root { --barre: 0px; } }
html.pwa:root { --barre: 0px; }
