/* Flight Sim Création — pages légales (CGV, mentions légales, confidentialité, crédits) et 404.
   Chargé après /css/site.css. Les retouches de composants existants (.todo, .table) restent limitées à .doc. */

/* ---------- Documents légaux ---------- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.doc-meta { margin: var(--s-5) 0 0; }

/* sommaire latéral collant + corps du document */
.doc-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: var(--s-8); align-items: start; }
.doc-aside { position: sticky; top: calc(var(--header-h) + var(--s-5)); max-height: calc(100vh - var(--header-h) - 2 * var(--s-5)); overflow-y: auto; }
.doc-aside-title { margin: 0 0 var(--s-3); font: 600 var(--fs-xs)/1 var(--f-display); letter-spacing: .14em; color: var(--ink-3); }
.doc-aside ol, .doc-aside ul { margin: 0 0 var(--s-6); padding: 0; list-style: none; border-left: 1px solid var(--rule); }
.doc-aside li + li { margin-top: 0; }
.doc-aside a {
  display: flex;
  gap: var(--s-3);
  margin-left: -1px;
  padding: 6px 0 6px var(--s-4);
  font-size: var(--fs-sm);
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}
.doc-aside a:hover { color: #fff; border-left-color: var(--ink-2); }
.doc-aside a[aria-current="page"] { color: #fff; font-weight: 600; border-left-color: var(--sign); }
.doc-aside a > span { flex: none; font: 400 var(--fs-xs)/1.6 var(--f-mono); color: var(--ink-3); }

/* articles numérotés : numéro en marge, texte à ~70 caractères */
.doc-body { --hang: 64px; }
.clause { max-width: calc(var(--hang) + 31em); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--rule); }
.clause:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.clause h2 { display: grid; grid-template-columns: var(--hang) minmax(0, 1fr); align-items: baseline; font-size: var(--fs-xl); }
.clause-num { justify-self: start; font: 700 var(--fs-sm)/1 var(--f-mono); letter-spacing: .04em; color: var(--sign); }
/* article atteint depuis le sommaire : le numéro devient un panneau de direction */
.clause:target .clause-num { color: var(--sign-ink); background: var(--sign); box-shadow: 0 0 0 5px var(--sign); border-radius: 1px; }
.clause > :not(h2) { margin-left: var(--hang); max-width: 31em; } /* ~70 caractères en Barlow 17 px */
.clause > :last-child { margin-bottom: 0; }
.clause p, .clause li { color: #cdd6e4; }
.clause ol li::marker { font: 400 var(--fs-sm) var(--f-mono); color: var(--ink-3); }
.clause ol, .clause ul { padding-left: 1.6em; }
.clause ul { list-style: square; }
.clause ul li::marker { color: var(--ink-3); }

/* fiche à compléter (mentions légales) */
.fields { margin-block: 0 var(--s-5); border-top: 1px solid var(--rule); }
.fields > div { display: grid; grid-template-columns: 13em minmax(0, 1fr); align-items: baseline; gap: var(--s-1) var(--s-4); padding: 10px 0; border-bottom: 1px solid var(--rule); }
.fields dt { font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.fields dd { margin: 0; line-height: 1.5; }

/* tableaux de texte : on autorise le retour à la ligne */
.doc .table-wrap { margin-bottom: var(--s-5); }
.doc .table th, .doc .table td { white-space: normal; vertical-align: top; line-height: 1.45; }
.doc .table tbody th { width: 46%; font-weight: 500; color: var(--ink); }
.doc .table td { color: #cdd6e4; }

/* champ à compléter par l'éditeur (marqueur « [À COMPLÉTER] » conservé pour la recherche) */
.doc .todo { /* en B612 : le « : » du marqueur ne prend pas une case de Mono */
  padding: 1px 6px;
  font: 400 var(--fs-xs)/1.7 var(--f-ui);
  color: var(--sign);
  background: rgba(255, 194, 26, .07);
  border: 1px dashed rgba(255, 194, 26, .6);
  border-radius: var(--r-1);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- Crédits ---------- */
/* mention d'attribution telle qu'elle doit apparaître, en Barlow (le © de B612 est un exposant minuscule) */
.doc .credit-line { padding: var(--s-2) var(--s-3); font: 500 var(--fs-sm)/1.4 var(--f-text); color: var(--ink); background: var(--black); border-left: 3px solid var(--sign); }
/* chaque police écrite dans sa propre police */
.fonts-table tbody th small { display: block; margin-top: 2px; font: 400 var(--fs-xs)/1.4 var(--f-text); color: var(--ink-2); }
.font-name { font-size: var(--fs-md); color: #fff; }
.font-name--barlow { font: 500 var(--fs-md)/1.3 var(--f-text); }
.font-name--condensed { font: 700 var(--fs-md)/1.3 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.font-name--b612 { font: 400 var(--fs-sm)/1.4 var(--f-ui); }
.font-name--mono { font: 400 var(--fs-sm)/1.4 var(--f-mono); }
/* les photos ont besoin de toute la largeur du document */
.clause--wide { max-width: none; }
.clause--wide > :not(h2) { max-width: none; }
.clause--wide > p { max-width: 31em; }
.doc .photo-credits th, .doc .photo-credits td { vertical-align: middle; }
.doc .photo-credits tbody th { width: auto; }
.photo-credits .pc-thumb { width: 1%; padding-right: 0; }
.photo-credits img { display: block; width: 96px; max-width: none; height: 64px; object-fit: cover; background: var(--night-3); border-radius: var(--r-1); }
.pc-type span { display: block; font-weight: 600; color: #fff; white-space: nowrap; }
.pc-type small { font: 400 var(--fs-xs)/1.4 var(--f-mono); color: var(--ink-3); }
.doc .photo-credits .pc-author { overflow-wrap: anywhere; }
.doc .photo-credits .pc-license, .doc .photo-credits .pc-source { white-space: nowrap; }
@media (max-width: 700px) {
  /* une photo = une fiche : vignette à gauche, texte à droite */
  .photo-credits thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .photo-credits, .photo-credits tbody { display: block; }
  .photo-credits tr { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 2px var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule); }
  .photo-credits tbody tr:last-child { border-bottom: 0; }
  .doc .photo-credits th, .doc .photo-credits td { padding: 0; border: 0; }
  .photo-credits .pc-thumb { grid-row: 1 / span 3; width: auto; }
  .photo-credits .pc-type, .photo-credits .pc-author { grid-column: 2 / -1; }
  .pc-type span { white-space: normal; }
  .photo-credits .pc-author { font-size: var(--fs-xs); }
  .photo-credits .pc-license { grid-column: 2; font-size: var(--fs-xs); }
  .photo-credits .pc-source { grid-column: 3; font-size: var(--fs-xs); }
  .photo-credits td[colspan] { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-aside { position: static; max-height: none; margin-bottom: var(--s-7); padding: var(--s-4) var(--s-5) var(--s-2); background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--r-2); }
  .doc-aside ol { margin-bottom: var(--s-3); }
  .doc-others { display: none; } /* déjà dans le pied de page */
}
@media (max-width: 600px) {
  .doc-body { --hang: 0px; }
  .clause h2 { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s-3); font-size: 24px; }
  .fields > div { grid-template-columns: minmax(0, 1fr); }
  .doc-aside { padding-inline: var(--s-4); }
}

@media print {
  .site-header, .site-footer, .doc-aside, .skip-link { display: none !important; }
  .doc-layout { display: block; }
  .doc * { color: #000 !important; background: none !important; box-shadow: none !important; }
}

/* ---------- 404 : point d'arrêt, entrée interdite ---------- */
.notfound { align-items: center; }
.notfound .nf-radio { display: inline-grid; grid-template-columns: auto minmax(0, 1fr); max-width: 100%; }
.nf-radio b { margin-right: var(--s-4); }

.nf-figure { justify-self: end; width: max-content; max-width: 100%; margin: 0; }
/* panneau d'obligation (blanc sur rouge) accolé au panneau d'emplacement (jaune sur noir) */
.nf-signs { display: flex; gap: 3px; padding: 3px; font: 700 clamp(32px, 9vw, 56px)/1 var(--f-display); letter-spacing: .03em; text-transform: uppercase; background: #000; border-radius: var(--r-3); }
.nf-noentry, .nf-loc { display: flex; align-items: center; padding: .32em .42em .3em; }
.nf-noentry { gap: .32em; color: #fff; background: var(--red); }
.nf-loc { color: var(--sign); box-shadow: inset 0 0 0 .06em #000, inset 0 0 0 .12em var(--sign); }
.nf-noentry-symbol { position: relative; flex: none; width: 1em; height: 1em; border: .1em solid #fff; border-radius: 50%; }
.nf-noentry-symbol::after { content: ""; position: absolute; left: .12em; right: .12em; top: 50%; height: .17em; transform: translateY(-50%); background: #fff; }
/* marquage de point d'attente : deux lignes continues, deux lignes tiretées */
.nf-hold {
  height: 31px;
  margin-top: var(--s-6);
  background:
    linear-gradient(var(--sign), var(--sign)) 0 0 / 100% 4px no-repeat,
    linear-gradient(var(--sign), var(--sign)) 0 9px / 100% 4px no-repeat,
    linear-gradient(90deg, var(--sign) 60%, transparent 0) 0 18px / 30px 4px round no-repeat,
    linear-gradient(90deg, var(--sign) 60%, transparent 0) 0 27px / 30px 4px round no-repeat;
}
.nf-figure figcaption { margin-top: var(--s-3); contain: inline-size; } /* la légende ne doit pas élargir le panneau */

@media (max-width: 900px) {
  .notfound { padding-top: var(--s-7); }
  .nf-figure { order: -1; justify-self: start; margin-bottom: var(--s-4); }
}
@media (max-width: 600px) {
  .notfound .form-actions .btn { flex: 1 1 auto; }
}
