/* ============================================================
   Académie Cyber XV — socle « éditorial blanc »
   Page blanche de magazine, encre noire, une seule couleur d'accent
   (l'orange de la marque, assombri pour se lire sur blanc).
   Partagé par l'accueil, le registre, le studio et les conditions.
============================================================ */

:root {
  --fond: #fbfaf7;
  --papier: #ffffff;
  --fond-fonce: #f1efe9;
  --encre: #121212;
  --encre-douce: #4d4a45;    /* données secondaires seulement (dates, unités) */
  --accent: #c2410c;         /* 5,1:1 sur le fond : lisible en texte */
  --filet: rgb(18 18 18 / 0.13);
  --filet-fort: rgb(18 18 18 / 0.3);

  --f-titre: 'Newsreader', Georgia, 'Times New Roman', serif;
  --f-texte: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;

  --marge: clamp(24px, 5vw, 64px);
  --largeur: 1240px;
  --entete: 68px;
  --courbe: cubic-bezier(.2, .7, .2, 1);
  --ombre-objet: 0 30px 60px -36px rgb(0 0 0 / .35);

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--entete) + env(safe-area-inset-top) + 12px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--f-texte);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-titre); font-weight: 400; letter-spacing: -0.01em; }
em { font-style: italic; color: var(--accent); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.lien-evitement {
  position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--encre); color: var(--fond); text-decoration: none;
}
.lien-evitement:focus { top: calc(12px + env(safe-area-inset-top)); color: var(--fond); }

.cadre {
  width: 100%;
  max-width: calc(var(--largeur) + 2 * var(--marge));
  margin-inline: auto;
  padding-inline: max(var(--marge), env(safe-area-inset-left)) max(var(--marge), env(safe-area-inset-right));
}

/* Petite étiquette : numéro de section, nature d'une annonce, libellé d'un chiffre. */
.etiquette {
  font-family: var(--f-texte);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
  color: var(--accent);
}

.titre-chapitre {
  font-size: clamp(2.4rem, 5.4vw, 4.6rem);
  line-height: 1.02;
  font-weight: 300;
  text-wrap: balance;
}

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

.entete {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: var(--fond);
  border-bottom: 1px solid var(--filet);
}
.entete-ligne { height: var(--entete); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.marque {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  min-height: 44px;
  font-family: var(--f-titre);
  font-size: 1.32rem;
  text-decoration: none;
  white-space: nowrap;
}
.marque em { font-style: normal; }
.marque:hover { color: var(--encre); }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 30px); }
.nav a:not(.bouton) { font-size: .95rem; font-weight: 500; text-decoration: none; padding: 10px 0; }
.nav a:not(.bouton):hover, .nav a[aria-current] { color: var(--accent); }
.entete .ouvrir-tiroir { display: none; }
@media (max-width: 900px) {
  .nav { display: none; }
  .entete .ouvrir-tiroir { display: inline-grid; }
}

/* ---------- Tiroir mobile (à gauche, règle maison) ---------- */

.tiroir {
  position: fixed;
  inset: 0 auto 0 0;
  width: 320px;
  max-width: 85vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: calc(16px + env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  border: 0;
  background: var(--papier);
  color: var(--encre);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(-100%);
  transition: transform .32s var(--courbe), overlay .32s allow-discrete, display .32s allow-discrete;
}
.tiroir:not([open]) { display: none; }
.tiroir[open] { transform: translateX(0); }
@starting-style { .tiroir[open] { transform: translateX(-100%); } }
.tiroir::backdrop { background: rgb(18 18 18 / .4); }
.tiroir-tete { display: flex; align-items: center; justify-content: space-between; }
.tiroir-liens { display: flex; flex-direction: column; }
.tiroir-liens a {
  font-family: var(--f-titre);
  font-size: 1.6rem;
  padding: 12px 0;
  border-bottom: 1px solid var(--filet);
  text-decoration: none;
}
.tiroir-pied { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--encre);
  border-radius: 0;
  background: var(--encre);
  color: var(--fond);
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--courbe), border-color .2s var(--courbe), color .2s var(--courbe);
}
.bouton:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton svg { width: 18px; height: 18px; flex: none; }
.bouton--trait { background: transparent; color: var(--encre); }
.bouton--petit { min-height: 44px; padding: 0 16px; font-size: .9rem; }
.bouton[disabled] { opacity: .55; cursor: progress; }

.bouton-icone {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--filet-fort);
  border-radius: 50%;
  background: transparent;
  color: var(--encre);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s var(--courbe), background-color .2s var(--courbe), color .2s var(--courbe);
}
.bouton-icone:hover { border-color: var(--encre); background: var(--encre); color: var(--fond); }
.bouton-icone svg { width: 20px; height: 20px; }
.bouton-icone--nu { border-color: transparent; }

.picto { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Champs ---------- */

.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ label, .champ .libelle { font-size: .85rem; font-weight: 600; }
.champ input, .champ select, .champ textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--filet-fort);
  border-radius: 0;
  background: transparent;
  font-size: 1rem; /* ≥ 16 px : pas de zoom iOS au focus */
}
.champ textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
.champ select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 28px;
}
.champ input::placeholder, .champ textarea::placeholder { color: #6b675f; } /* 5:1 sur le fond */
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-bottom-color: var(--encre); box-shadow: 0 1px 0 var(--encre); }
.champ.a-erreur input, .champ.a-erreur select, .champ.a-erreur textarea { border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.champ-rangee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
@media (max-width: 560px) { .champ-rangee { grid-template-columns: minmax(0, 1fr); } }

.case { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; line-height: 1.5; cursor: pointer; }
.case input {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--encre);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.case input::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform .15s var(--courbe);
}
.case input:checked { background: var(--encre); }
.case input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.case.a-erreur input { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.message-erreur { font-size: .92rem; font-weight: 500; color: var(--accent); border-left: 2px solid var(--accent); padding-left: 12px; }
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Interrupteur à deux positions (objet de la lettre, vues du registre, studio) */
.bascule { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--filet-fort); max-width: 100%; }
.bascule button {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 6px 16px;
  line-height: 1.2;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background-color .2s var(--courbe), color .2s var(--courbe);
}
.bascule button[aria-pressed='true'] { background: var(--encre); color: var(--fond); }
.bascule button:not([aria-pressed='true']):hover { background: var(--fond-fonce); }
.bascule .compte { font-weight: 500; margin-left: 6px; }

/* Accusé de réception d'un envoi (lettre, demande, dépôt). */
.recu-marque {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--encre);
  color: #fff;
}
.recu-marque svg { width: 28px; height: 28px; }

/* ---------- Pied de page ---------- */

.pied { padding: 28px 0 max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--filet); font-size: .9rem; }
.pied-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.pied-liens a { text-decoration: none; padding: 8px 0; }
.pied-liens a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
