/* Traction électrique — feuille de style commune
   Direction « quai de gare suisse » : blanc dominant, encre anthracite,
   rouge en signal ponctuel, bleu de signalétique, jaune « horaire des départs » en touche. */

:root {
  --papier: #ffffff;
  --papier-2: #f6f6f6;
  --trait: #dcdcdc;
  --trait-fort: #b4b4b4;
  --encre: #212121;
  --encre-2: #545454;
  --encre-3: #6b6b6b;
  --rouge: #eb0000;
  --rouge-fonce: #c60018;
  --bleu-quai: #2d327d;
  --bleu-quai-clair: #eceef7;
  --jaune-horaire: #fff3b0;
  --largeur: 72rem;
  --police: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", "Liberation Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--encre);
  background: var(--papier);
  border-top: 4px solid var(--rouge);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu-quai); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--rouge-fonce); }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -0.01em; }
[hidden] { display: none !important; }

.sauter { position: absolute; left: -999rem; top: 0.5rem; background: var(--encre); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.sauter:focus { left: 1rem; }
.enveloppe { max-width: var(--largeur); margin: 0 auto; padding-inline: 1.25rem; }

/* ---------- En-tête ---------- */
.entete { border-bottom: 1px solid var(--trait); }
.entete .enveloppe { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; padding-block: 0.5rem; }
.marque { display: flex; align-items: center; gap: 0.75rem; color: var(--encre); text-decoration: none; }
.marque:hover { color: var(--encre); }
.marque svg { flex: none; }
.marque strong { display: block; font-size: 1.05rem; }
.marque strong + span { display: block; font-size: 0.8rem; color: var(--encre-3); }
.langues { display: flex; border: 1px solid var(--trait-fort); }
.langues a, .langues span { padding: 0.3rem 0.65rem; font-size: 0.8rem; font-weight: 700; text-decoration: none; color: var(--encre-2); }
.langues > * + * { border-left: 1px solid var(--trait-fort); }
.langues [aria-current] { background: var(--encre); color: var(--papier); }
.langues a:hover { background: var(--papier-2); color: var(--encre); }
.langues .absente { color: var(--encre-3); font-weight: 400; }

.fil { font-size: 0.85rem; color: var(--encre-3); padding-top: 0.9rem; }
.fil ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.fil li + li::before { content: "›"; margin-inline: 0.45rem; color: var(--trait-fort); }
.fil a { color: var(--encre-2); }

.avis { margin-top: 1rem; padding: 0.6rem 0.9rem; border-left: 4px solid var(--trait-fort); background: var(--papier-2); font-size: 0.9rem; color: var(--encre-2); }

/* ---------- Ouverture (accueil) ---------- */
.ouverture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2.5rem; align-items: end; padding-block: 3rem 2.5rem; border-bottom: 1px solid var(--trait); }
.surtitre { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--encre-3); margin: 0 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.surtitre::before { content: ""; flex: none; width: 0.6rem; height: 0.6rem; background: var(--rouge); border-radius: 50%; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 1rem; font-weight: 700; }
.chapeau { font-size: 1.1rem; color: var(--encre-2); max-width: 34rem; margin: 0 0 1.75rem; }
.chiffres { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--encre); }
.chiffres li { padding: 0.6rem 1.25rem 0 0; margin-right: 1.25rem; font-size: 0.85rem; color: var(--encre-3); }
.chiffres b { display: block; font-size: 1.35rem; color: var(--encre); line-height: 1.2; }
.dessin { margin: 0; }

/* ---------- Titre de page (chapitres, annexes) ---------- */
.titre-page { display: flex; align-items: center; gap: 1.25rem; padding-block: 1.75rem; border-bottom: 1px solid var(--trait); }
.titre-page h1 { margin: 0; font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.titre-page .surtitre { margin-bottom: 0.35rem; }
.titre-page .maj { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--encre-3); }

/* ---------- Sections ---------- */
.section { padding-top: 2.5rem; }
.section > h2 { font-size: 1.35rem; margin: 0 0 0.25rem; }
.aide { margin: 0 0 1.25rem; color: var(--encre-3); font-size: 0.95rem; }
.prose { max-width: 44rem; }
.prose p { margin: 0 0 0.9rem; }

/* ---------- Plaque de quai ---------- */
.plaque { display: inline-grid; place-items: center; flex: none; min-width: 2.4rem; height: 2.4rem; padding-inline: 0.35rem; background: var(--bleu-quai); color: #fff; font-weight: 700; font-size: 1.1rem; border-radius: 2px; }
.plaque.grande { min-width: 3.6rem; height: 3.6rem; font-size: 1.75rem; }
.plaque.fichier { background: var(--papier); color: var(--encre-2); border: 1px solid var(--trait-fort); font-size: 0.66rem; letter-spacing: 0.04em; }

/* ---------- Liste façon tableau d'horaire ---------- */
.horaire { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--encre); }
.horaire li { border-bottom: 1px solid var(--trait); }
.horaire a { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.7rem 0.25rem; text-decoration: none; color: var(--encre); }
.horaire a:hover { background: var(--papier-2); color: var(--encre); }
.horaire a:hover .titre { text-decoration: underline; text-decoration-color: var(--rouge); }
.horaire .titre { font-weight: 600; }
.horaire .detail { font-size: 0.85rem; color: var(--encre-3); text-align: right; }
.etiquette { display: inline-block; font-style: normal; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; border: 1px solid var(--trait-fort); padding: 0 0.3rem; margin-left: 0.35rem; color: var(--encre-2); vertical-align: 0.08em; }

/* ---------- Documents ---------- */
.documents { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--encre); }
.documents li { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 0.7rem 0.25rem; border-bottom: 1px solid var(--trait); }
.documents .nom { font-weight: 600; overflow-wrap: anywhere; }
.documents .poids { font-size: 0.85rem; color: var(--encre-3); white-space: nowrap; }

/* ---------- Recherche d'exercice ---------- */
.recherche { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; background: var(--bleu-quai-clair); border-left: 4px solid var(--bleu-quai); padding: 1.25rem 1.5rem; margin-top: 2.75rem; }
.recherche h2 { font-size: 1.1rem; margin: 0 0 0.25rem; }
.recherche p { margin: 0; color: var(--encre-2); font-size: 0.92rem; }
.recherche label { display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.champ { display: flex; }
.champ input { flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: 0.5rem 0.7rem; border: 1px solid var(--encre-2); border-right: 0; border-radius: 0; background: #fff; }
.champ button { font: inherit; font-weight: 700; padding: 0.5rem 1rem; border: 1px solid var(--bleu-quai); background: var(--bleu-quai); color: #fff; cursor: pointer; border-radius: 0; }
.champ button:hover { background: var(--encre); border-color: var(--encre); }
.resultats { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.92rem; }
.resultats li { padding: 0.3rem 0; border-top: 1px solid rgba(45, 50, 125, 0.18); }
.resultats li:first-child { border-top: 0; }
.resultats a + a { margin-left: 0.8rem; }
.resultats .vide { color: var(--encre-2); }

/* ---------- Colonnes ---------- */
.colonnes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.colonnes h3, .intertitre { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-3); margin: 0 0 0.6rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--trait); }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { padding: 0.3rem 0; }
.liste-simple small { color: var(--encre-3); }
.liste-colonnes { columns: 3 15rem; column-gap: 2rem; }
.liste-colonnes li { break-inside: avoid; }

/* ---------- Tableaux ---------- */
.filtre { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; font-size: 0.9rem; flex-wrap: wrap; }
.filtre input { font: inherit; width: 9rem; padding: 0.35rem 0.5rem; border: 1px solid var(--trait-fort); border-radius: 0; }
.filtre input.large { width: 16rem; max-width: 100%; }
.filtre output { color: var(--encre-3); font-size: 0.85rem; }
.defile { overflow-x: auto; }
table.horaire-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.horaire-table thead th { background: var(--jaune-horaire); text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; padding: 0.55rem 0.75rem; border-top: 2px solid var(--encre); border-bottom: 1px solid var(--encre); white-space: nowrap; }
.horaire-table td, .horaire-table tbody th { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--trait); vertical-align: top; text-align: left; font-weight: 400; }
.horaire-table tbody tr:hover { background: var(--papier-2); }
.horaire-table .num { font-weight: 700; font-size: 1.05rem; width: 4.5rem; white-space: nowrap; }
.horaire-table .num a { color: var(--encre); text-decoration: none; }
.horaire-table .num a:hover { color: var(--rouge-fonce); text-decoration: underline; }
.horaire-table .liens a { display: inline-block; margin: 0 0.9rem 0.1rem 0; }
.horaire-table .vide { color: var(--trait-fort); }
.horaire-table .fort a { font-weight: 700; }
.horaire-table .groupe th { background: var(--papier-2); font-weight: 700; font-size: 0.9rem; border-top: 2px solid var(--encre); }
.horaire-table .coche { text-align: center; width: 3.5rem; }
.horaire-table .discret { color: var(--encre-3); }
.legende { font-size: 0.85rem; color: var(--encre-3); margin-top: 0.75rem; }
.legende dt { font-weight: 700; display: inline; }
.legende dd { display: inline; margin: 0 1.25rem 0 0.3rem; }

/* ---------- Navigation entre pages ---------- */
.suite { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--encre); margin-top: 3rem; }
.suite a { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 0.25rem; text-decoration: none; color: var(--encre); }
.suite a:hover { background: var(--papier-2); }
.suite .suivant { justify-content: flex-end; text-align: right; grid-column: 2; border-left: 1px solid var(--trait); }
.suite small { display: block; color: var(--encre-3); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Galerie (albums) ---------- */
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.5rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.galerie figure { margin: 0; }
.galerie img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--trait); }
.galerie figcaption { font-size: 0.88rem; color: var(--encre-2); margin-top: 0.4rem; }

/* ---------- Personnes ---------- */
.personnes { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.personnes img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--trait); }
.personnes b { display: block; margin-top: 0.4rem; }
.personnes span { font-size: 0.88rem; color: var(--encre-3); }

/* ---------- Livres ---------- */
.livres { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.livres li { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.livres img { border: 1px solid var(--trait); }
.livres b { display: block; }

/* ---------- Fiche détaillée ---------- */
.fiche-bandeau { margin: 1.5rem 0 0; }
.fiche-bandeau img { max-height: 3.5rem; width: auto; }
.fiche-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.fiche-photos img { width: 100%; height: 100%; max-height: 22rem; object-fit: cover; border: 1px solid var(--trait); }
.variante { padding-top: 2.5rem; }
.variante > h2 { font-size: 1.35rem; margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--encre); }
.variante-grille { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; }
.donnees { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.donnees th, .donnees td { text-align: left; vertical-align: top; padding: 0.4rem 0.5rem 0.4rem 0; border-bottom: 1px solid var(--trait); }
.donnees th { font-weight: 400; color: var(--encre-3); width: 45%; }
.schema { margin: 1.25rem 0 0; }
.schema img { border: 1px solid var(--trait); background: #fff; }
.credit { margin-top: 2rem; font-size: 0.85rem; color: var(--encre-3); }

/* ---------- Pied de page ---------- */
.pied { margin-top: 4rem; border-top: 1px solid var(--trait); background: var(--papier-2); font-size: 0.87rem; color: var(--encre-2); }
.pied .enveloppe { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-block: 2rem; }
.pied h2 { margin: 0 0 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-3); }
.pied p, .pied ul { margin: 0; padding: 0; list-style: none; }
.pied a { color: var(--encre-2); }

/* ---------- Adaptation ---------- */
@media (max-width: 860px) {
  .ouverture, .recherche, .variante-grille { grid-template-columns: 1fr; }
  .dessin { order: -1; }
  .colonnes, .pied .enveloppe { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 560px) {
  .horaire a { grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.25rem 0.8rem; }
  .horaire .detail { grid-column: 2; text-align: left; }
  .documents li { grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.15rem 1rem; }
  .documents .poids { grid-column: 2; }
  .suite { grid-template-columns: 1fr; }
  .suite .suivant { grid-column: 1; border-left: 0; border-top: 1px solid var(--trait); }
  .titre-page { align-items: flex-start; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@media print {
  body { border-top: 0; font-size: 10.5pt; }
  .entete .langues, .sauter, .filtre, .recherche, .suite, .pied, .dessin { display: none !important; }
  a { color: inherit; text-decoration: none; }
  .horaire-table thead th { background: none; }
  .plaque { background: none; color: var(--encre); border: 1px solid var(--encre); }
}

.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
