/* Agility Click & Run — feuille de style unique du site.
 *
 * Une seule feuille, ecrite a la main, chargee en une requete. Le site actuel
 * en charge sept, plus une police chez Google et une bibliotheque d'icones chez
 * jsDelivr : trois domaines tiers pour afficher une liste de parcours.
 *
 * La palette est celle du logo, relevee sur l'image : marine #023f70, rouge
 * #bd0526, gris #edeeef. Pas de mode sombre : les plans de parcours sont des
 * dessins au trait sur fond blanc, ils seraient illisibles inverses.
 */

/* Manrope est la police de l'application. Elle est ici en une seule graisse :
 * les titres. Le texte courant prend la police du systeme — celle que
 * l'appareil affiche le mieux, et qui ne coute aucun telechargement. */
@font-face {
  font-family: "Manrope";
  src: url("/actifs/polices/manrope-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --marine: #023f70;
  --marine-fonce: #012c4f;
  --marine-clair: #e6edf3;
  --rouge: #bd0526;
  --gris: #edeeef;
  --encre: #14212b;
  --encre-doux: #566573;
  --bord: #dde2e7;
  --fond: #ffffff;
  --rayon: 12px;
  --titre: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ombre: 0 1px 2px rgba(1, 44, 79, .06), 0 4px 16px rgba(1, 44, 79, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--texte);
  font-size: 16px;
  line-height: 1.6;
  color: var(--encre);
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { font-family: var(--titre); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.85rem, 1.2rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--marine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rouge); }
img { max-width: 100%; height: auto; }

.dedans { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

.saut {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--marine); padding: .6rem 1rem; border-radius: 0 0 var(--rayon) 0;
}
.saut:focus { left: 0; }

/* Visible pour un lecteur d'ecran, invisible a l'oeil : les etiquettes de
 * champ qui feraient doublon avec ce qui est deja lisible autour. */
.cache-visuel {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

:where(a, button, summary, input, label):focus-visible {
  outline: 3px solid var(--rouge); outline-offset: 2px; border-radius: 4px;
}

/* --- En-tete ---------------------------------------------------------- */

.entete { background: var(--marine); color: #fff; position: sticky; top: 0; z-index: 40; }
.entete-barre { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }

.marque {
  display: flex; align-items: center; gap: .55rem; margin-right: auto;
  font-family: var(--titre); font-weight: 700; font-size: 1.02rem;
  color: #fff; text-decoration: none; letter-spacing: -.02em;
}
.marque:hover { color: #fff; }

/* Le logo officiel est un carre de 1000 px : la palissade en haut, le nom de
 * la marque en bas. Le nom est deja ecrit a cote, en texte — le repeter en
 * image a 38 px n'en ferait qu'une tache illisible. On ne montre donc que la
 * palissade, en recadrant le fichier PAR LE CSS plutot qu'en le decoupant :
 * l'image reste l'originale, sans reencodage ni perte, et elle sert aussi
 * d'icone d'onglet.
 *
 * Le cadrage a ete releve sur l'image elle-meme, pixel par pixel : le dessin
 * occupe x 63-940 et y 126-699, et son fond est exactement #023f70 — la meme
 * marine que la barre, si bien que le raccord ne se voit pas.
 *   echelle = 66.4 / 1000                     hauteur affichee 38 px
 *   largeur = 877 x echelle = 58 px           decalage = -63 et -126 x echelle */
.signe { display: block; width: 58px; height: 38px; overflow: hidden; position: relative; flex: none; }
.signe img { position: absolute; left: -4.2px; top: -8.4px; width: 66.4px; height: 66.4px; max-width: none; }

.nav { display: flex; align-items: center; gap: .35rem; }
/* Le « > » n'est pas decoratif : il empeche ces trois regles d'atteindre les
 * liens du selecteur de langue, qui vivent plus bas dans le meme <nav> mais
 * sur un fond BLANC. Sans lui, « .nav a[aria-current] » l'emporte sur
 * « .langues li a » (0,2,1 contre 0,1,2) et peint la langue courante en blanc
 * sur blanc — elle disparait. */
.nav > a {
  color: #fff; text-decoration: none; padding: .45rem .7rem; border-radius: 8px;
  font-size: .94rem; white-space: nowrap;
}
.nav > a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav > a[aria-current] { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; }

.langues { position: relative; margin-left: .3rem; }
.langues > summary {
  list-style: none; cursor: pointer; padding: .45rem .7rem; border-radius: 8px;
  font-size: .94rem; border: 1px solid rgba(255, 255, 255, .35);
}
.langues > summary::-webkit-details-marker { display: none; }
.langues > summary::after { content: " ▾"; }
.langues ul {
  position: absolute; right: 0; top: calc(100% + .4rem); margin: 0; padding: .3rem;
  list-style: none; background: #fff; border-radius: var(--rayon);
  box-shadow: 0 8px 28px rgba(1, 44, 79, .22); min-width: 9.5rem;
}
.langues li a { display: block; color: var(--marine); padding: .4rem .6rem; border-radius: 7px; }
.langues li a:hover { background: var(--marine-clair); color: var(--marine); }
/* La langue courante se signale par la graisse et un fond leger. On ne touche
 * pas a sa COULEUR : elle doit rester celle du contexte, qui n'est pas la meme
 * au bureau (menu blanc) et sur telephone (tiroir sur fond marine). */
.langues li a[aria-current] { font-weight: 700; background: rgba(2, 63, 112, .09); }
@media (max-width: 800px) { .langues li a[aria-current] { background: rgba(255, 255, 255, .18); } }

/* Le menu se replie sans une ligne de JavaScript : une case a cocher cachee
 * porte l'etat, le label lui sert de bouton. Sur le site actuel le tiroir
 * mobile ne s'ouvrait jamais — il dependait d'un script qui ne repondait pas. */
.ouvrir-menu { position: absolute; opacity: 0; pointer-events: none; }
.bouton-menu { display: none; cursor: pointer; padding: .55rem .4rem; }
.bouton-menu span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

@media (max-width: 800px) {
  .bouton-menu { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: .8rem; gap: .1rem; }
  .ouvrir-menu:checked ~ .nav { display: flex; }
  .nav a { padding: .65rem .7rem; }
  .langues { margin: .4rem 0 0; }
  .langues ul { position: static; box-shadow: none; background: rgba(255, 255, 255, .1); }
  .langues li a { color: #fff; }
  .langues li a:hover { background: rgba(255, 255, 255, .18); color: #fff; }
}

/* --- Bandeau d'accueil ------------------------------------------------ */

/* La couleur de fond est posee AVANT le degrade, et non a la place : un
 * degrade est une image, et une image peut ne pas peindre — impression,
 * mode economie de donnees, rendu partiel. Sans cette ligne, le texte blanc
 * du bandeau se retrouverait alors sur du blanc. */
.hero { background-color: var(--marine); background-image: linear-gradient(160deg, var(--marine) 0%, var(--marine-fonce) 100%); color: #fff; padding: 3.5rem 0 3.75rem; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p { color: #dbe4ec; font-size: 1.08rem; max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.bouton {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--titre); font-weight: 700; font-size: .97rem;
  padding: .8rem 1.35rem; border-radius: 999px; text-decoration: none;
  border: 2px solid transparent; cursor: pointer;
}
.bouton-plein { background: var(--rouge); color: #fff; }
.bouton-plein:hover { background: #9d0420; color: #fff; }
.bouton-clair { border-color: rgba(255, 255, 255, .6); color: #fff; }
.bouton-clair:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.bouton-sobre { border-color: var(--bord); color: var(--marine); background: #fff; }
.bouton-sobre:hover { border-color: var(--marine); color: var(--marine); }

.chiffres { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 2.4rem; }
.chiffre b { display: block; font-family: var(--titre); font-size: 2rem; line-height: 1; }
.chiffre span { color: #b9cbdb; font-size: .88rem; }

/* --- Sections --------------------------------------------------------- */

.section { padding: 3rem 0; }
.section-gris { background: var(--gris); }
.section-entete { max-width: 62ch; margin-bottom: 1.8rem; }
.section-entete p { color: var(--encre-doux); }

.cartes { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }

.carte {
  background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.carte:hover { box-shadow: var(--ombre); transform: translateY(-2px); color: inherit; }
.carte-image { aspect-ratio: 4 / 3; background: var(--gris); display: block; width: 100%; object-fit: contain; }
.carte-corps { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.carte-titre { font-family: var(--titre); font-weight: 700; font-size: 1rem; line-height: 1.25; margin: 0; }
.carte-meta { color: var(--encre-doux); font-size: .84rem; margin: 0; }
.carte-bas { margin-top: auto; }

.etiquettes { display: flex; flex-wrap: wrap; gap: .35rem; }
.etiquette {
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  padding: .18rem .5rem; border-radius: 999px; background: var(--marine-clair); color: var(--marine);
  white-space: nowrap;
}
.etiquette-pleine { color: #fff; }

/* --- Bibliotheque : filtres + resultats -------------------------------- */

.biblio { display: grid; gap: 1.6rem; padding: 1.8rem 0 3rem; grid-template-columns: 1fr; }
@media (min-width: 950px) { .biblio { grid-template-columns: 270px 1fr; align-items: start; } }

.filtres {
  background: #fff; border: 1px solid var(--bord); border-radius: var(--rayon); padding: 0;
}
@media (min-width: 950px) { .filtres { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; } }

.filtres > summary {
  cursor: pointer; padding: .85rem 1rem; font-family: var(--titre); font-weight: 700;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.filtres > summary::-webkit-details-marker { display: none; }
.filtres > summary::after { content: "▾"; transition: transform .15s; }
.filtres[open] > summary::after { transform: rotate(180deg); }
@media (min-width: 950px) { .filtres > summary { border-bottom: 1px solid var(--bord); } }

.filtres-corps { padding: .2rem 1rem 1rem; }
.groupe-filtre { padding: .9rem 0; border-bottom: 1px solid var(--bord); }
.groupe-filtre:last-child { border-bottom: 0; }
.groupe-filtre > h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-doux); margin-bottom: .55rem; }
.groupe-filtre .aide { font-size: .78rem; color: var(--encre-doux); margin: -.3rem 0 .5rem; }

.choix { display: flex; flex-wrap: wrap; gap: .35rem; }
.choix label {
  display: inline-flex; align-items: center; gap: .3rem; cursor: pointer;
  font-size: .86rem; padding: .3rem .6rem; border: 1px solid var(--bord);
  border-radius: 999px; background: #fff; user-select: none;
}
.choix input { position: absolute; opacity: 0; width: 0; height: 0; }
.choix label:has(input:checked) { background: var(--marine); border-color: var(--marine); color: #fff; font-weight: 600; }
.choix label:has(input:focus-visible) { outline: 3px solid var(--rouge); outline-offset: 2px; }
.choix label img { width: 18px; height: 18px; object-fit: contain; }
.choix label:has(input:checked) img { filter: brightness(0) invert(1); }

.paire { display: flex; gap: .6rem; }
.paire label { flex: 1; font-size: .8rem; color: var(--encre-doux); }
.paire input, .filtres select, .filtres input[type="search"] {
  width: 100%; margin-top: .2rem; padding: .45rem .55rem; font: inherit; font-size: .9rem;
  border: 1px solid var(--bord); border-radius: 8px; background: #fff; color: inherit;
}

.barre-resultats {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--bord);
}
.compte { font-family: var(--titre); font-weight: 700; font-size: 1.05rem; }
.barre-resultats .droite { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.lien-effacer { background: none; border: 0; font: inherit; font-size: .88rem; color: var(--rouge); cursor: pointer; text-decoration: underline; padding: 0; }

.vide { text-align: center; padding: 3rem 1rem; color: var(--encre-doux); }
.centre { text-align: center; margin-top: 2rem; }

/* --- Fiche d'un parcours ---------------------------------------------- */

.fiche { display: grid; gap: 2rem; padding: 1.8rem 0 3rem; }
@media (min-width: 900px) { .fiche { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } }

.fil { font-size: .86rem; color: var(--encre-doux); margin-bottom: 1rem; }
.fil a { color: var(--encre-doux); }

.plan { border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; background: var(--gris); }
.plan img { display: block; width: 100%; }

.faits { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--bord); }
.faits li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--bord); font-size: .95rem; }
.faits dt, .faits .cle { color: var(--encre-doux); }
.faits .val { font-weight: 600; text-align: right; }

.pictos { display: flex; flex-wrap: wrap; gap: .5rem; }
.picto { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--bord); border-radius: 999px; padding: .25rem .6rem .25rem .3rem; font-size: .85rem; text-decoration: none; color: inherit; }
.picto:hover { border-color: var(--marine); color: var(--marine); }
.picto img { width: 24px; height: 24px; object-fit: contain; }

/* --- Prose (articles, calendrier) ------------------------------------- */

.prose { max-width: 68ch; }
.prose img { border-radius: var(--rayon); margin: 1.2rem 0; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--marine-clair); color: var(--encre-doux); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--rayon); }

.evenement { border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.1rem 1.2rem; background: #fff; }
.evenement + .evenement { margin-top: .9rem; }
.evenement h3 { margin-bottom: .3rem; }
.evenement .quand { font-family: var(--titre); font-weight: 700; color: var(--rouge); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.evenement .ou { color: var(--encre-doux); font-size: .92rem; margin: .2rem 0 0; }
.evenement details { margin-top: .6rem; }
.evenement summary { cursor: pointer; font-size: .9rem; color: var(--marine); }
.evenement .prose { font-size: .93rem; margin-top: .6rem; }
.passe { opacity: .62; }

/* La carte des concours, accueillie dans un cadre.
 *
 * Elle pese 673 Ko : chargee d'emblee sur l'accueil, elle retarderait tout le
 * reste. « loading="lazy" » la fait attendre que le visiteur descende jusqu'a
 * elle — et la plupart n'iront jamais si loin. */
.cadre-carte {
  border: 1px solid var(--bord); border-radius: var(--rayon);
  overflow: hidden; background: var(--gris); height: var(--h, 500px);
}
.cadre-carte iframe { display: block; width: 100%; height: 100%; border: 0; }
.carte-lien { margin: .7rem 0 0; font-size: .92rem; }
@media (max-width: 700px) { .cadre-carte { height: min(var(--h, 500px), 74vh); } }

.note {
  background: var(--marine-clair); border-radius: var(--rayon);
  padding: .8rem 1rem; font-size: .92rem; margin-bottom: 1.5rem; color: var(--marine-fonce);
}

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

.pied { background: var(--marine-fonce); color: #cfdae4; margin-top: 3rem; padding: 2.5rem 0 2rem; font-size: .92rem; }
.pied-grille { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.pied a { color: #fff; }
.pied a:hover { color: var(--gris); }
.pied-marque { font-family: var(--titre); font-weight: 700; color: #fff; font-size: 1.05rem; margin-bottom: .3rem; }
.pied-titre { font-family: var(--titre); font-weight: 700; color: #fff; margin-bottom: .5rem; }
.pied-liens { display: flex; gap: 1rem; flex-wrap: wrap; }
.pied-langues { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }

@media print {
  .entete, .pied, .filtres, .saut { display: none; }
  body { font-size: 12pt; }
}
