/* ==========================================================================
   Base : la charte, la grille et les composants réutilisables du site.

   Ce fichier ne connaît aucune partie du site (ni l'accueil, ni ses onglets) :
   il se copie tel quel dans un autre projet, où seul le bloc « 1. Charte » change.
   Le style propre à chaque partie est dans site.css, chargé après celui-ci.

   Sommaire :
     1. Charte : polices, couleurs, espacements
     2. Base : remise à zéro, textes, liens, accessibilité, icônes
     3. Mise en page : .wrap, .stack, .section
     4. Grille : .cols (colonnes)
     5. Composants : titres, boutons, cartes, textes mis en forme, vidéo, agrandissement
        des photos, messages, champs de formulaire, image à venir
     6. Préférences du visiteur : animations réduites

   Tailles d'écran, les mêmes dans tout le site (dans une requête média, on écrit la
   valeur telle quelle : les variables CSS n'y fonctionnent pas) :
     1279 px : ordinateur à écran moyen ; 960 px : tablette ; 720 px : téléphone.
   Couleurs : les variables de « 1. Charte » (--navy, --yellow…), remplacées site par site
   par la clé colors de data/site.php. Mise en page : flex, jamais grid.
   Code sous licence : usage réservé au site livré, copie et revente interdites (voir LICENCE.md).
   ========================================================================== */

/* ---------- 1. Charte */

@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/source-sans-3-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/source-sans-3-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy: #0E2A47;
  --navy-dark: #0A1F36;
  --navy-line: #1E3A58;
  --yellow: #F2B705;
  --yellow-soft: #FFFBEA;
  --teal: #0B7F8A;
  --teal-light: #6FD3DC;
  --sand: #F6F4EF;
  --line: #E3DFD6;
  --ink: #1B1F24;
  --muted: #4A5561;
  --pale: #D5DCE4;
  --pale-2: #E6ECF1;
  --grey: #9AA8B6;
  --white: #FFFFFF;
  --cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --sans: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: clamp(56px, 9vw, 104px);
}

/* ---------- 2. Base */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--yellow); color: var(--navy); padding: 8px 14px; font-weight: 700; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Icônes (Lucide, voir icon() dans app/helpers.php) : taille du texte, couleur du texte */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

@media (max-width: 720px) {
  body { font-size: 16px; }
}

/* ---------- 3. Mise en page */

/* Largeur du contenu, centré, avec ses marges sur les côtés ; --narrow : colonne de lecture */
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap--narrow { max-width: 860px; }
/* Éléments empilés, espacés de 40 px (titres de la section, puis son contenu) */
.stack { display: flex; flex-direction: column; gap: 40px; }
/* Section de page, avec ses marges en haut et en bas ; --sand : fond sable. Titres d'une section :
   surtitre et titre (.section__titles), à côté d'un lien éventuel (.section__head) */
.section { padding-top: var(--pad); padding-bottom: var(--pad); }
.section--sand { background: var(--sand); }
.section__head { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: flex-end; justify-content: space-between; }
.section__titles { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }

/* ---------- 4. Grille

   <div class="cols cols--3"> : 2, 3 ou 4 colonnes (cols--2, cols--3, cols--4) sur ordinateur,
   2 sur tablette et 1 sur téléphone, avec un écart de 32 px (à changer par partie :
   style="--gap: 24px" ou dans sa section de site.css). Chaque élément enfant est une colonne ;
   une dernière ligne incomplète garde des colonnes de la même largeur que les autres. */

.cols { --gap: 32px; display: flex; flex-wrap: wrap; gap: var(--gap); }
.cols > * { flex: 0 0 100%; min-width: 0; }
.cols--2 > * { flex-basis: calc((100% - var(--gap)) / 2); }
.cols--3 > * { flex-basis: calc((100% - 2 * var(--gap)) / 3); }
.cols--4 > * { flex-basis: calc((100% - 3 * var(--gap)) / 4); }

@media (max-width: 960px) {
  .cols--3 > *, .cols--4 > * { flex-basis: calc((100% - var(--gap)) / 2); }
}
@media (max-width: 720px) {
  .cols > * { flex-basis: 100%; }
}

/* ---------- 5. Composants */

/* Titres et textes : surtitre (.kicker, avec un trait : .kicker--bar et .kicker__bar), titre de
   section (.h2), texte d'introduction (.lead), mot surligné en jaune (.hl, .hl-strong), lien
   souligné en jaune (.link-underline). --light : sur fond sombre */
.kicker { display: flex; gap: 12px; align-items: center; font-family: var(--cond); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: 16px; color: var(--teal); }
.kicker--light { color: var(--teal-light); }
.kicker__bar { width: 32px; height: 4px; background: var(--yellow); flex: none; }
.h2 { font-family: var(--cond); font-weight: 800; font-size: clamp(34px, 4.4vw, 52px); line-height: 1; text-transform: uppercase; color: var(--navy); text-wrap: balance; }
.h2--light { color: var(--white); }
.lead { font-size: 19px; line-height: 1.65; text-wrap: pretty; }
.hl { box-shadow: inset 0 -8px 0 var(--yellow); }
.hl-strong { box-shadow: inset 0 -0.28em 0 var(--yellow); }
.link-underline { display: inline-flex; align-items: center; gap: 8px; font-family: var(--cond); font-weight: 700; font-size: 19px; text-transform: uppercase; color: var(--navy); border-bottom: 3px solid var(--yellow); padding-bottom: 2px; }
.link-underline:hover { text-decoration: none; color: var(--teal); }

@media (max-width: 720px) {
  .lead { font-size: 18px; }
}

/* Boutons : .btns regroupe les boutons ; .btn--yellow, --navy, --outline ; --sm : petit */
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--cond); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .04em; padding: 15px 28px; border: 2px solid transparent; line-height: 1.1; cursor: pointer; text-align: center; transition: background .15s, color .15s; }
.btn:hover { text-decoration: none; }
.btn--yellow { background: var(--yellow); color: var(--navy); }
.btn--yellow:hover { background: #FFC933; color: var(--navy); }
.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-dark); color: var(--white); }
.btn--outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn--sm { font-size: 19px; padding: 10px 18px; }
.btn[disabled] { opacity: .6; cursor: wait; }

@media (max-width: 720px) {
  .btns .btn { flex: 1 1 auto; }
}

/* Carte : image, titre, texte (et un lien .link-underline, si besoin), à placer dans des
   colonnes (.cols). <article class="card"><img class="card__img"><h3 class="card__title">… */
.card { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.card__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card__title { font-family: var(--cond); font-weight: 700; font-size: 24px; line-height: 1.1; text-transform: uppercase; color: var(--navy); }
.card__text { font-size: 17px; line-height: 1.55; color: var(--muted); }

/* Fil d'Ariane, et texte mis en forme dans l'admin (.prose : titres, listes, tableaux) */
.breadcrumb { font-size: 15px; color: var(--muted); }
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { font-family: var(--cond); font-weight: 700; font-size: 26px; text-transform: uppercase; color: var(--navy); margin: 36px 0 12px; }
.prose h3 { font-family: var(--cond); font-weight: 700; font-size: 21px; color: var(--navy); margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 16px; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

/* Vidéo YouTube : image et bouton « lecture », puis lecteur chargé au clic (site.js) */
.video { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video__link { position: absolute; inset: 0; display: block; }
.video__img { width: 100%; height: 100%; object-fit: cover; }
.video__play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(0,0,0,.35); transition: transform .15s; }
.video__play svg { width: 34px; height: 34px; margin-left: 4px; }
.video__link:hover .video__play { transform: scale(1.08); }
.video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .video { margin: 0 0 14px; }

@media (max-width: 720px) {
  .video__play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

/* Photo affichée en grand, par-dessus la page, au clic sur un lien data-lightbox (site.js) */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,31,54,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 82vh; width: auto; object-fit: contain; }
.lightbox__caption { color: var(--white); font-family: var(--cond); font-size: 20px; text-transform: uppercase; text-align: center; }
.lightbox__close, .lightbox__nav { position: absolute; background: none; border: 0; color: var(--white); font-size: 42px; line-height: 1; cursor: pointer; padding: 10px 16px; }
.lightbox__close { top: 10px; right: 10px; }
.lightbox__prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 6px; top: 50%; transform: translateY(-50%); }

/* Messages après l'envoi d'un formulaire sans JavaScript */
.flash { padding: 14px 0; font-weight: 600; }
.flash--success { background: #E4F4E8; color: #1D5B2E; }
.flash--error { background: #FBE6E4; color: #8A1F14; }

/* Champs de formulaire : .form, lignes de champs (.form__row ; --3 : trois listes), champ
   (.field : libellé et saisie ; --check : case à cocher), bas du formulaire et message d'envoi */
.form { display: flex; flex-direction: column; gap: 18px; }
.form__title { font-family: var(--cond); font-weight: 800; font-size: 28px; text-transform: uppercase; color: var(--navy); }
.form__row { display: flex; flex-wrap: wrap; gap: 18px; }
.form__row > .field { flex: 1 1 220px; min-width: 0; }
/* 3 listes : sur une ligne si elles tiennent, sinon 2 puis 1, qui garde une demi-largeur */
.form__row--3 > .field { flex-basis: 170px; max-width: calc(50% - 9px); }
.form__row--3 > .field:only-child { max-width: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 16px; color: var(--navy); }
.field em, .form__note em { color: #B4231A; font-style: normal; }
.field input, .field select, .field textarea { width: 100%; border: 1.5px solid #C9C3B6; background: var(--white); padding: 12px 14px; font-size: 17px; border-radius: 0; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(242,183,5,.45); }
.field.has-error input, .field.has-error textarea { border-color: #B4231A; }
.field__error { color: #B4231A; font-size: 15px; font-weight: 600; }
.field--check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; color: var(--muted); line-height: 1.45; }
.field--check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--navy); }
.form__foot { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.form__note { font-size: 14px; color: var(--muted); }
.form__status:empty { display: none; }
.form__status { padding: 14px 16px; font-weight: 600; }
.form__status.is-ok { background: #E4F4E8; color: #1D5B2E; }
.form__status.is-error { background: #FBE6E4; color: #8A1F14; }

@media (max-width: 449px) {
  .form__row--3 > .field { max-width: none; }
}

/* Image à venir (aucune photo envoyée) : fond rayé, icône et texte */
.placeholder { width: 100%; height: 100%; min-height: 200px; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #ECE8DF 0 12px, #E3DFD6 12px 24px); color: var(--muted); font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.placeholder .icon { width: 40px; height: 40px; opacity: .55; }

/* ---------- 6. Préférences du visiteur */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
