/* ==========================================================
   Fayngo : page Transports (transports.html, en/transportation.html, générée par scripts/build-pages.mjs)
   Chargé après city.css, dont il reprend la base (obsidienne, ivoire, safran), la ligne de vérification et l'appel final.
   Le mode choisi rallume le relief : seuls ses lieux restent allumés ; le cyan ne marque que la ligne Al Boraq et le départ choisi.
   ========================================================== */

body.tr ::selection { background: var(--c-saffron); color: var(--c-obsidian); }

/* ---------- Ouverture : le texte et le choix du mode, puis le relief ---------- */
.tr-hero { position: relative; isolation: isolate; padding-top: calc(var(--header-h) + 24px); background: var(--c-obsidian); }
.tr-hero__copy { position: relative; z-index: 2; }
.tr-hero h1 { font-size: clamp(3rem, 7.4vw, 6rem); line-height: .94; letter-spacing: -.035em; margin: 0; max-width: 9ch; }
.tr-hero__lede { margin: 16px 0 0; max-width: 34ch; font-size: 1.1875rem; line-height: 1.5; }
.tr-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; background: var(--c-surface-1); }
.tr-mode { display: grid; place-items: center; min-height: 52px; padding: 0 12px; font: 600 1.0625rem/1 var(--font-text); color: var(--c-ivory); transition: background .25s var(--ease-out), color .25s var(--ease-out); }
.tr-mode:hover { background: var(--c-surface-2); }
.tr-mode.is-on, .tr-mode[aria-selected="true"] { background: var(--c-saffron); color: var(--c-obsidian); }
.tr-mode:focus-visible { outline-offset: -3px; outline-color: var(--c-ivory); }
.tr-mode.is-on:focus-visible, .tr-mode[aria-selected="true"]:focus-visible { outline-color: var(--c-obsidian); }

.tr-hero__map { margin: 16px 0 0; }
.tr-hero__stage { aspect-ratio: 780 / 902; }
.tr-still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-hero__map figcaption { padding: 12px 24px 0; font-size: .8125rem; line-height: 1.45; color: var(--c-ivory-2); }
.tr-hero__note { color: var(--c-ivory); }
.tr-hero__checked { display: none; }
.tr-hero__map figcaption a { text-decoration: underline; }
/* Étiquettes : les codes d'aéroport et les villes en lettres de la marque */
.tr .city-map__labels a, .tr .city-map__labels span { font: 600 1rem/1.1 var(--font-display); }
.tr .city-map__labels [data-kind="iata"] { font-size: 1.1875rem; letter-spacing: .02em; }
.tr .city-map__labels .is-focus { color: var(--c-cyan); }
.tr .city-map__labels { transition: opacity .35s ease; }
.tr-hero.is-moving .city-map__labels { opacity: 0; transition-duration: .12s; }

/* ---------- Panneaux par mode ---------- */
.tr-panel, .tr-stay { padding-block: clamp(64px, 8vw, 120px); scroll-margin-top: var(--header-h); }
.tr-panel + .tr-panel { border-top: 1px solid var(--c-surface-2); }
.tr-stay { background: var(--c-surface-1); }
.tr-panel__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(32px, 6vw, 96px); align-items: start; }
.tr-panel__inner > :not(.tr-panel__lead):not(.tr-outs) { grid-column: 1 / -1; }
.tr-panel__lead p { max-width: 44ch; margin: 0; }
.tr-panel__lead .home-link { margin-top: 8px; }
body.tr .tr-sub { margin: 64px 0 20px; }

/* Sites externes : une ligne par site, le domaine annoncé avant de partir */
.tr-outs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-surface-2); }
.tr-out { position: relative; padding: 20px 4px 18px; border-bottom: 1px solid var(--c-surface-2); transition: background .2s ease; }
.tr-out:not(.tr-out--off):hover { background: var(--c-surface-1); }
.tr-out:focus-within { outline: 3px solid var(--c-saffron); outline-offset: 2px; }
.tr-out .stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.tr-out .stretched:focus-visible { outline: none; }
.tr-out__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
body.tr .tr-out__name { margin: 0; font: 600 1.625rem/1.1 var(--font-display); letter-spacing: -.01em; }
.tr-out__go { display: grid; justify-items: end; gap: 2px; min-width: 0; text-align: right; }
.tr-out__head > :first-child { min-width: 0; }
.tr-out__leave { font-size: .8125rem; color: var(--c-ivory-2); }
.tr-out__domain { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--c-saffron); overflow-wrap: anywhere; }
.tr-out__icon { width: 18px; height: 18px; transition: transform .2s var(--ease-out); }
.tr-out:hover .tr-out__icon { transform: translate(2px, -2px); }
.tr-out--off .tr-out__go { font-size: .875rem; color: var(--c-ivory-2); }
.tr-out__what { margin: 8px 0 0; max-width: 56ch; }
.tr-out__warn { color: var(--c-ivory-2); font-size: .9375rem; }
.tr-out__meta { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-size: .875rem; color: var(--c-ivory-2); }
.tr-out__meta a { color: var(--c-ivory); text-decoration: underline; text-underline-offset: 3px; }
.tr-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--c-ivory); }
.tr-tag::before { content: ""; width: 9px; height: 9px; flex: none; }
.tr-tag--official::before { background: var(--c-emerald-text); }
.tr-tag--third-party::before { border: 1.5px solid var(--c-ivory-2); border-radius: 50%; }

/* Train : la ligne Al Boraq et les villes avec une gare */
.tr-fact { margin-top: 40px; padding: 22px 22px 18px; background: var(--c-surface-1); max-width: 760px; }
.tr-fact p { margin: 0; }
.tr-fact__line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px !important; font: 600 1.125rem/1.3 var(--font-display); }
.tr-line { width: 28px; height: 3px; background: var(--c-cyan); }
.tr-places { list-style: none; margin: 0 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
.tr-places li { display: grid; gap: 2px; padding: 16px 0 14px; border-top: 1px solid var(--c-surface-2); }
.tr-places a { font: 600 1.75rem/1.1 var(--font-display); letter-spacing: -.01em; }
.tr-places a:hover { color: var(--c-saffron); }
.tr-places span { font-size: .9375rem; color: var(--c-ivory-2); }

/* Avion : un code par aéroport, en grand */
.tr-airports { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); }
.tr-airports li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--c-surface-2); }
.tr-iata { font: 600 2.25rem/1 var(--font-display); letter-spacing: .02em; color: var(--c-copper); }
.tr-airport { margin: 0; font-weight: 600; }
.tr-src { margin-left: 6px; font-size: .8125rem; font-weight: 400; color: var(--c-ivory-2); text-decoration: underline; }
.tr-served { margin: 4px 0 0; }
.tr-served a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(242, 231, 213, .4); }
.tr-served a:hover { text-decoration-color: currentColor; }
.tr-served span:not(.tr-sep) { font-variant-numeric: tabular-nums; color: var(--c-ivory-2); }
.tr-sep { color: var(--c-ivory-2); }

/* Route : le tableau des temps depuis un départ */
.tr-board__head { display: flex; justify-content: space-between; align-items: end; gap: 16px 32px; flex-wrap: wrap; margin: 64px 0 20px; }
body.tr .tr-board__head .tr-sub { margin: 0; }
.tr-board__from { color: var(--c-saffron); }
.tr-select { display: grid; gap: 6px; font-size: .875rem; color: var(--c-ivory-2); }
.tr-select select {
  appearance: none; min-height: 48px; min-width: 240px; padding: 0 44px 0 16px; border: 1px solid rgba(242, 231, 213, .28); border-radius: 0;
  background: var(--c-surface-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E3A72F' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
  color: var(--c-ivory); font: 500 1rem/1 var(--font-text); cursor: pointer;
}
.tr-select select:hover { border-color: var(--c-ivory-2); }
.tr-select select:focus-visible { outline: 3px solid var(--c-saffron); outline-offset: 2px; }
body.tr .table-wrap { background: none; border-radius: 0; box-shadow: none; }
.tr-table { min-width: 0; font-variant-numeric: tabular-nums; }
.tr-table th, .tr-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--c-surface-2); font-size: 1rem; background: none; }
.tr-table thead th { font-size: .875rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--c-ivory-2); }
.tr-table tbody th { font: 600 1.25rem/1.2 var(--font-display); text-transform: none; letter-spacing: -.01em; }
.tr-table tbody th a:hover { color: var(--c-saffron); }
.tr-table td { white-space: nowrap; color: var(--c-ivory-2); }
.tr-table td:last-child { color: var(--c-ivory); font-weight: 600; text-align: right; padding-right: 0; }
.tr-table thead th:last-child { text-align: right; padding-right: 0; }
.tr-table tbody tr { position: relative; transition: background .2s ease; }
/* Toute la ligne du tableau mène à la ville */
.tr-table tbody th a::after { content: ""; position: absolute; inset: 0; }
.tr-table tbody tr:focus-within { outline: 3px solid var(--focus, var(--c-saffron)); outline-offset: -3px; }
.tr-table tbody th a:focus-visible { outline: none; }
.tr-table tbody tr:hover { background: var(--c-surface-1); }
.tr-table.is-sorting tbody { animation: tr-rows .45s var(--ease-out); }
@keyframes tr-rows { from { opacity: .2; transform: translateY(6px); } }
.tr-note { margin: 12px 0 0; font-size: .875rem; color: var(--c-ivory-2); }

/* Sur place */
.tr-local { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tr-local div { padding: 20px 22px; background: var(--c-surface-1); }
.tr-local dt { font: 600 1.25rem/1.2 var(--font-display); margin-bottom: 6px; }
.tr-local dd { margin: 0; }

.tr-policy { margin: 28px 0 0; font-size: .9375rem; color: var(--c-ivory-2); }

/* Avec le script, un seul panneau de mode à la fois */
.tr.has-modes .tr-panel[hidden] { display: none; }
.tr.has-modes .tr-panel + .tr-panel { border-top: 0; }

/* ---------- Grand écran : le texte à gauche, le relief à droite, sur toute la hauteur ---------- */
@media (min-width: 1024px) {
  .tr-hero { display: grid; grid-template-columns: minmax(0, 1fr); min-height: min(100svh, 1000px); padding-top: 0; }
  .tr-hero__map { position: absolute; inset: 0; margin: 0; }
  .tr-hero__stage { position: absolute; inset: 0; aspect-ratio: auto; }
  /* Voile sous le texte, seule exception aux aplats : il ne couvre que la colonne du texte */
  .tr-hero__stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(11, 11, 13, .88) 0%, rgba(11, 11, 13, .6) 30%, rgba(11, 11, 13, 0) 52%); }
  .tr-hero .city-map__labels { z-index: 2; }
  .tr-hero__copy { align-self: center; padding-block: calc(var(--header-h) + 40px) 120px; pointer-events: none; }
  .tr-hero__copy > * { max-width: 460px; pointer-events: auto; }
  .tr-hero__map figcaption { position: absolute; z-index: 3; right: max(24px, calc((100vw - 1200px) / 2 + 24px)); bottom: 14px; max-width: 60ch; padding: 0; text-align: right; }
}
@media (max-width: 1023px) {
  .tr-panel__inner { grid-template-columns: minmax(0, 1fr); }
  .tr-panel__lead { margin-bottom: 28px; }
  .tr-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-airports { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759px) {
  .tr-hero { padding-top: calc(var(--header-h) + 12px); }
  .tr-hero__copy .city-verif { display: none; }
  .tr-hero__checked { display: inline; }
  .tr-hero__relief { display: none; }
  .tr-modes { margin-top: 18px; }
  .tr-hero__map { margin-top: 12px; }
  .tr-hero__stage { aspect-ratio: 390 / 330; }
  .tr-hero__map figcaption { padding-top: 8px; font-size: .75rem; }
  .tr.has-modes .tr-panel { padding-top: 24px; }
  .tr.has-modes .tr-panel > .tr-panel__inner > .tr-panel__lead { order: 2; margin: 24px 0 0; }
  .tr.has-modes .tr-panel > .tr-panel__inner > .tr-outs { order: 1; }
  .tr.has-modes .tr-panel > .tr-panel__inner > :not(.tr-panel__lead):not(.tr-outs) { order: 3; }
  .tr.has-modes .tr-panel .tr-panel__lead h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tr-hero h1 { font-size: clamp(2.75rem, 13vw, 3.5rem); }
  .tr-hero__lede { font-size: 1.0625rem; }
  body.tr .tr-out__name { font-size: 1.375rem; }
  .tr-out__leave { display: none; }
  body.tr .tr-sub { margin-top: 48px; }
  .tr-places { grid-template-columns: minmax(0, 1fr); }
  .tr-places li { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 12px 0; }
  .tr-places a { font-size: 1.5rem; }
  .tr-airports li { grid-template-columns: 72px 1fr; gap: 12px; }
  .tr-iata { font-size: 1.875rem; }
  .tr-local { grid-template-columns: minmax(0, 1fr); }
  .tr-select, .tr-select select { width: 100%; }
  .tr-table th, .tr-table td { padding-right: 10px; }
  .tr-table tbody th { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tr-mode, .tr-out, .tr-out__icon, .tr .city-map__labels { transition: none; }
  .tr-table.is-sorting tbody { animation: none; }
}
@media (max-width: 759px) {
  .tr .city-map__labels a { font-size: 1.0625rem; margin-top: -22px; padding: 12px 6px; min-height: 44px; }
  .tr .city-map__labels [data-kind="iata"] { font-size: 1.1875rem; }
  /* Route : 18 lieux dans un petit cadre, les noms un cran plus petits */
  .tr-hero[data-mode="road"] .city-map__labels a { font-size: .9375rem; }
  .tr-hero[data-mode="road"] .tr-hero__stage { aspect-ratio: 390 / 440; }
}

/* Étiquette déplacée au-dessus ou en dessous de son point : un trait la relie au point (--lead : décalage vertical) */
.tr .city-map__labels a[data-lead]::before {
  content: ""; position: absolute; left: -4px; width: 1px; background: rgba(242, 231, 213, .55);
  top: calc(50% + min(0px, var(--lead) * -1)); height: calc(max(var(--lead), var(--lead) * -1));
}
.tr .city-map__labels a[data-lead].is-left::before { left: auto; right: -4px; }
/* Contraste élevé (couleurs forcées) : le mode choisi garde une marque visible */
@media (forced-colors: active) {
  .tr-mode.is-on, .tr-mode[aria-selected="true"] { outline: 3px solid Highlight; outline-offset: -3px; text-decoration: underline; }
}

/* Toute la ligne d'une gare mène à la ville */
.tr-places li { position: relative; }
.tr-places a::after { content: ""; position: absolute; inset: 0; }
.tr-places li:focus-within { outline: 3px solid var(--focus, var(--c-saffron)); outline-offset: 2px; }
.tr-places a:focus-visible { outline: none; }

/* Rangée des 18 destinations (téléphone, mode Route) : tout reste trouvable sans encombrer la carte */
.tr-pick { display: none; }
@media (max-width: 759px) {
  .tr.has-modes .tr-hero[data-mode="road"] .tr-pick {
    display: flex; gap: 6px; overflow-x: auto; padding: 10px 24px 2px; scrollbar-width: none; scroll-padding-inline: 24px;
  }
  .tr-pick::-webkit-scrollbar { display: none; }
  .tr-pick__btn {
    flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 0; cursor: pointer;
    background: var(--c-surface-1); color: var(--c-ivory); font: 500 .9375rem/1 var(--font-text); white-space: nowrap;
  }
  .tr-pick__btn[aria-pressed="true"] { background: var(--c-saffron); color: var(--c-obsidian); font-weight: 600; }
}
@media (forced-colors: active) { .tr-pick__btn[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: -3px; } }
