/* ──────────────────────────────────────────────────────────────────────────
   SUBO Entertainment — feuille de style unique.
   Reprend les tokens du système design « Le bureau d'enquête » de
   l'application Portrait-robot (lib/theme.dart) : marine institutionnel +
   papier crème, thème clair uniquement.

   Typographie : les trois familles de la charte (Zilla Slab pour les titres,
   Manrope pour le corps, IBM Plex Mono pour les métadonnées), **auto-hébergées**
   en woff2 dans assets/fonts/. Elles ne sont PAS chargées depuis Google Fonts :
   l'appel au CDN transmettrait l'adresse IP du visiteur à Google sans base
   légale, ce qui serait incohérent pour un site dont l'objet est la conformité.
   Sous-ensemble « latin » uniquement (couvre le français, œ compris) — 93 Ko.
   Licence OFL 1.1 pour les trois familles, cf. assets/fonts/LICENCES.md.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Polices de la charte « bureau d'enquête » ────────────────────────── */

@font-face {
  font-family: "Zilla Slab";
  src: url("fonts/zilla-slab-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Zilla Slab";
  src: url("fonts/zilla-slab-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  /* Manrope est une police variable : un seul fichier couvre 400 → 800. */
  font-family: "Manrope";
  src: url("fonts/manrope-var.woff2") format("woff2-variations"),
       url("fonts/manrope-var.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --marine: #2e4b6e;
  --marine-fonce: #22374f;
  --marine-encre: #16273a;
  --marine-clair: #d6e3f5;
  --creme: #f2ecdf;
  --papier: #f7f6f2;
  --surface: #fbfaf6;
  --surface-container: #f0eee8;
  --texte: #1c2b3d;
  --texte-doux: #4e5c6c;
  --trait: #c6cdd4;
  --trait-fort: #7c8a99;
  --ocre: #8a5a17;
  --ocre-clair: #f5e3c2;
  --erreur: #ba1a1a;

  /* Titres : Zilla Slab (slab serif) — replis serif si la police n'a pas chargé. */
  --serif: "Zilla Slab", Georgia, "Iowan Old Style", "Times New Roman", serif;
  /* Corps : Manrope. */
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Métadonnées seulement (accroches, datations, empreintes) — jamais le corps. */
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;

  --r-bouton: 10px;
  --r-carte: 14px;
  --largeur: 72ch;
}

/* ── Base ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--texte);
  font: 400 17px/1.65 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--texte); line-height: 1.25; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.15rem + .9vw, 1.7rem); margin: 2.2em 0 .6em; }
h3 { font-size: 1.12rem; margin: 1.8em 0 .4em; }

p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: .35em; }

a { color: var(--marine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--marine-encre); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--marine);
  outline-offset: 2px;
  border-radius: 3px;
}

hr { border: 0; border-top: 1px solid var(--trait); margin: 2.4em 0; }

code, .mono { font-family: var(--mono); font-size: .92em; }

strong { font-weight: 700; }

img { max-width: 100%; height: auto; }

.saut-contenu {
  position: absolute; left: -9999px; top: 0;
  background: var(--marine); color: #fff; padding: .7em 1.1em; z-index: 10;
}
.saut-contenu:focus { left: .5rem; top: .5rem; }

/* ── Grille « bureau d'enquête » ──────────────────────────────────────── */

.quadrille {
  background-color: var(--surface);
  background-image:
    linear-gradient(rgba(46, 75, 110, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 75, 110, .07) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ── En-tête ──────────────────────────────────────────────────────────── */

.entete {
  background: var(--marine-fonce);
  color: var(--creme);
  border-bottom: 3px solid var(--marine-encre);
}
.entete__interieur {
  max-width: 68rem; margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center;
}
.marque {
  font-family: var(--mono);
  font-size: .82rem; font-weight: 500; letter-spacing: .125em; text-transform: uppercase;
  color: var(--creme); text-decoration: none; margin-right: auto; white-space: nowrap;
}
.marque:hover { color: #fff; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
.nav a {
  color: var(--creme); text-decoration: none; font-size: .95rem;
  padding: .25rem 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--creme); }
.nav a[aria-current="page"] { border-bottom-color: var(--ocre-clair); color: #fff; }

/* ── Mise en page ─────────────────────────────────────────────────────── */

.enveloppe { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

main { display: block; }

.section { padding: 3rem 0; }
.section--fond { background: var(--surface); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }

.texte { max-width: var(--largeur); }

.heros { padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--trait); }
.heros__accroche {
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .125em;
  text-transform: uppercase; color: var(--texte-doux); margin: 0 0 1rem;
}
.heros__chapeau { font-size: 1.18rem; color: var(--texte-doux); max-width: 60ch; }

/* ── Cartes ───────────────────────────────────────────────────────────── */

.cartes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); padding: 0; list-style: none; margin: 1.5rem 0 0; }
.carte {
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--r-carte); padding: 1.25rem 1.35rem;
}
.carte h3 { margin: 0 0 .35em; font-size: 1.05rem; }
.carte p { margin: 0; color: var(--texte-doux); font-size: .97rem; }

/* ── Encadrés ─────────────────────────────────────────────────────────── */

.encart {
  border-left: 4px solid var(--marine);
  background: var(--marine-clair);
  padding: 1rem 1.25rem; border-radius: 0 var(--r-bouton) var(--r-bouton) 0;
  margin: 1.5rem 0;
}
.encart--attention { border-left-color: var(--ocre); background: var(--ocre-clair); }
.encart > :last-child { margin-bottom: 0; }

.aparte { font-size: .93rem; color: var(--texte-doux); }

/* ── Tableau d'identité (mentions légales) ────────────────────────────── */

.identite { border-collapse: collapse; width: 100%; max-width: var(--largeur); margin: 1.5rem 0; }
.identite th, .identite td {
  text-align: left; vertical-align: top;
  padding: .6rem .75rem; border-bottom: 1px solid var(--trait); font-size: .97rem;
}
.identite th { width: 15rem; font-weight: 700; color: var(--texte-doux); }
@media (max-width: 34rem) {
  .identite th, .identite td { display: block; width: auto; border-bottom: 0; padding: .15rem .25rem; }
  .identite td { padding-bottom: .8rem; border-bottom: 1px solid var(--trait); }
}

/* ── Boutons ──────────────────────────────────────────────────────────── */

.bouton {
  display: inline-block; border: 1px solid var(--marine); border-radius: var(--r-bouton);
  background: var(--marine); color: #fff; text-decoration: none;
  font: 700 .97rem/1.2 var(--sans); padding: .75rem 1.3rem; cursor: pointer;
}
.bouton:hover { background: var(--marine-encre); border-color: var(--marine-encre); color: #fff; }
.bouton--discret { background: transparent; color: var(--marine); }
.bouton--discret:hover { background: var(--marine-clair); color: var(--marine-encre); }

/* ── Formulaire ───────────────────────────────────────────────────────── */

.formulaire { max-width: 42rem; margin-top: 1.5rem; }
.champ { margin-bottom: 1.35rem; }
.champ > label { display: block; font-weight: 700; font-size: .97rem; margin-bottom: .35rem; }
.champ__aide { display: block; font-weight: 400; color: var(--texte-doux); font-size: .88rem; margin-top: .15rem; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: 400 1rem/1.5 var(--sans); color: var(--texte);
  background: #fff; border: 1px solid var(--trait-fort); border-radius: var(--r-bouton);
  padding: .65rem .8rem;
}
textarea { min-height: 11rem; resize: vertical; }

.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.message { padding: 1rem 1.25rem; border-radius: var(--r-bouton); margin-bottom: 1.5rem; }
.message--ok { background: var(--marine-clair); border-left: 4px solid var(--marine); }
.message--ko { background: #ffdad6; border-left: 4px solid var(--erreur); }

/* ── Pages légales ────────────────────────────────────────────────────── */

.legal { padding: 2.75rem 0 3.5rem; }
.legal .texte h2 { border-top: 1px solid var(--trait); padding-top: 1.6rem; }
.legal .texte h2:first-of-type { border-top: 0; padding-top: 0; }

.datation {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .06em;
  color: var(--texte-doux); margin: 0 0 2rem;
}

.empreinte {
  font-family: var(--mono); font-size: .78rem; line-height: 1.6;
  background: var(--surface-container); border: 1px solid var(--trait);
  border-radius: var(--r-bouton); padding: .85rem 1rem; overflow-wrap: anywhere;
}

/* ── Pied de page ─────────────────────────────────────────────────────── */

.pied {
  background: var(--marine-fonce); color: var(--creme);
  margin-top: 3rem; padding: 2.25rem 0 2rem; font-size: .93rem;
}
.pied a { color: var(--creme); }
.pied a:hover { color: #fff; }
.pied__liens { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; padding: 0; margin: 0 0 1.25rem; list-style: none; }
.pied__mention { color: #c8cfd8; margin: 0; font-size: .87rem; }

/* ── Utilitaires ──────────────────────────────────────────────────────── */
/* Peu nombreux et volontairement : ils remplacent les styles en ligne, que la
   politique de sécurité de contenu (CSP) interdit — cf. public/.htaccess. */

.sans-marge-bas { margin-bottom: 0 !important; }
.espace-avant   { margin-top: 1.75rem; }
.espace-section { margin-top: 3rem; }

/* ── Impression (les pages légales doivent s'imprimer proprement) ─────── */

@media print {
  .entete, .pied, .nav, .bouton { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .enveloppe { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .texte { max-width: none; }
}
