/* Page Transports — famille « Atlas 2 » de la carte (maquettes validées le 11/11/2026).
 * Sections séparées par des filets fins, sans encadrés. Couleurs de lignes : plan TRANSTU. */
:root {
  --tg-bg: #F7F5F0; --tg-paper: #FFFFFF; --tg-ink: #14171C; --tg-muted: #646B78; --tg-rule: #E4E0D7;
  --tg-chip: #ECE9E2; --tg-blue: #1660D6; --tg-bluefill: #1C6EF2; --tg-tint: #E9F0FB; --tg-ground: #EFEBE2;
  --tg-sel: #14171C; --tg-seltext: #FFFFFF; --tg-shadow: rgba(0,0,0,.12);
  --tg-bus: #3A4556; --tg-metro: #007C40; --tg-tgm: #0058A4;
  color-scheme: light;
}
:root[data-theme=night] {
  --tg-bg: #121418; --tg-paper: #1A1E24; --tg-ink: #F2F4F7; --tg-muted: #9AA3B2; --tg-rule: #2B313C;
  --tg-chip: #242A33; --tg-blue: #7FB0FF; --tg-bluefill: #3D82F5; --tg-tint: #1D2A3D; --tg-ground: #1B1F25;
  --tg-sel: #E7E9ED; --tg-seltext: #14181D; --tg-shadow: rgba(0,0,0,.5);
  --tg-bus: #5B6880; --tg-metro: #1E8A54; --tg-tgm: #2F73C4;
  color-scheme: dark;
}
html, body.tg { margin: 0; background: var(--tg-bg); }
body.tg { color: var(--tg-ink); font: 15px/1.4 Inter, "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; font-feature-settings: 'tnum'; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
.tg *, .tg *::before, .tg *::after { box-sizing: border-box; }
.tg h1, .tg h2, .tg p, .tg ol { margin: 0; padding: 0; }
.tg ol { list-style: none; }
.tg a { color: var(--tg-blue); text-decoration: none; }
.tg button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tg :focus-visible { outline: 2px solid var(--tg-bluefill); outline-offset: 2px; border-radius: 6px; }
[dir=rtl] .tg-flip { transform: scaleX(-1); }

/* Barre du haut : retour intelligent, serré contre la zone sûre */
.tg-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; min-height: 44px;
  padding: env(safe-area-inset-top) 12px 0; background: color-mix(in srgb, var(--tg-bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); }
.tg-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-inline-end: 8px; color: var(--tg-blue) !important; font-weight: 600 !important; font-size: 16px !important; }
.tg-desk-title, .tg-desk-search, .tg-desk-tabs { display: none !important; }
.tg-top-end { margin-inline-start: auto; }
.tg-iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--tg-blue); }
.tg-body { padding: 0 20px 40px; }
.tg-nav:empty, .tg-list:empty, .tg-detail:empty { display: none; }

.tg-h1 { font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.tg-h1.tg-big { font-size: 32px; letter-spacing: -.03em; margin: 2px 0 14px; }
.tg-meta { color: var(--tg-muted); font-size: 14px; margin-top: 4px; }
.tg-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--tg-chip); color: var(--tg-muted); }
.tg-search input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: none; color: var(--tg-ink); font: 16px/1 inherit; -webkit-appearance: none; appearance: none; }
.tg-search input::placeholder { color: var(--tg-muted); }
.tg-modes { display: flex; gap: 6px; margin: 14px -20px 0; padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.tg-modes::-webkit-scrollbar { display: none; }
.tg-modes button { flex: none; height: 34px; padding: 0 13px; border-radius: 99px; background: var(--tg-chip); font-size: 13.5px; font-weight: 600; }
.tg-modes button[aria-pressed=true] { background: var(--tg-sel); color: var(--tg-seltext); }

.tg-sec { padding: 18px 0 6px; border-top: 1px solid var(--tg-rule); margin-top: 18px; }
.tg-list > .tg-sec:first-child, #tgResults > .tg-sec:first-child, .tg-h1 + .tg-meta + .tg-sec, .tg-h1 + .tg-note + .tg-sec { border-top: 0; margin-top: 8px; }
.tg-sh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tg-sh h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.tg-sh span { font-size: 13px; color: var(--tg-muted); }
.tg-sh a { font-size: 14px; font-weight: 600; }
.tg-metro { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px -4px 0; }
.tg-metro a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

.tg-rows { margin-top: 4px; }
.tg-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-top: 1px solid var(--tg-rule); color: var(--tg-ink) !important; }
.tg-row:first-child { border-top: 0; }
.tg-row.on { background: var(--tg-tint); margin: 0 -12px; padding-inline: 12px; border-radius: 10px; border-top-color: transparent; }
.tg-row.on + .tg-row { border-top-color: transparent; }
.tg-tx { flex: 1; min-width: 0; }
.tg-tx > b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-tx > span { display: block; margin-top: 2px; font-size: 13px; color: var(--tg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-ch { color: var(--tg-muted); opacity: .75; display: inline-flex; min-width: 24px; min-height: 44px; align-items: center; justify-content: center; }
.tg-serve { display: flex !important; flex-wrap: wrap; gap: 4px; margin-top: 4px !important; }

/* Pastilles : métro = rond vert numéroté, TGM = bleu (plan TRANSTU) ; bus et autres = ardoise */
.tg-b { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 32px; height: 24px; padding: 0 7px;
  border-radius: 7px; background: var(--tg-bus); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0; white-space: nowrap; }
.tg-b.lg { min-width: 44px; height: 34px; border-radius: 9px; font-size: 18px; padding: 0 9px; }
.tg-b.sm { min-width: 20px; height: 18px; border-radius: 5px; font-size: 11px; padding: 0 4px; }
.tg-b.tg-metro { background: var(--tg-metro); border-radius: 99px; padding: 0; width: 24px; min-width: 24px; }
.tg-b.tg-metro.lg { width: 38px; min-width: 38px; height: 38px; }
.tg-b.tg-metro.sm { width: 18px; min-width: 18px; }
.tg-b.tg-tgm { background: var(--tg-tgm); }
.tg-b.lg.tg-tgm { font-size: 14px; }

/* Une ligne */
.tg-ltop { padding-top: 6px; }
.tg-lhead { display: flex; align-items: center; gap: 12px; }
.tg-kind { color: var(--tg-muted); font-size: 13.5px; font-weight: 600; }
.tg-ltop .tg-h1 { margin-top: 10px; }
.tg-actions { display: none; gap: 10px; margin-top: 14px; }
.tg-primary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--tg-bluefill); color: #fff !important; font-size: 14px; font-weight: 650; }
.tg-ghost { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; background: var(--tg-chip); font-size: 14px; font-weight: 600; }
.tg-seg { display: flex; padding: 2px; border-radius: 10px; background: var(--tg-chip); margin-top: 14px; }
.tg-seg a { flex: 1; min-height: 32px; display: flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 8px; color: var(--tg-ink) !important; font-size: 13.5px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-seg a.on { background: var(--tg-paper); box-shadow: 0 1px 3px var(--tg-shadow); }
.tg-mapwrap { position: relative; margin: 16px -20px 0; height: 176px; background: var(--tg-ground); }
.tg-mapwrap:has(> a:only-child) { display: none; }
.tg-m { display: block; width: 100%; height: 100%; }
.tg-m-halo { fill: none; stroke: var(--tg-paper); stroke-width: 10; stroke-linejoin: round; stroke-linecap: round; }
.tg-m-line { fill: none; stroke: var(--tg-bus); stroke-width: 5.5; stroke-linejoin: round; stroke-linecap: round; }
.tg-m-metro .tg-m-line { stroke: var(--tg-metro); } .tg-m-tgm .tg-m-line { stroke: var(--tg-tgm); }
.tg-m-dot { fill: var(--tg-paper); stroke: var(--tg-bus); stroke-width: 2; }
.tg-m-end { fill: var(--tg-paper); stroke: var(--tg-bus); stroke-width: 3.5; }
.tg-m-metro :is(.tg-m-dot, .tg-m-end) { stroke: var(--tg-metro); } .tg-m-tgm :is(.tg-m-dot, .tg-m-end) { stroke: var(--tg-tgm); }
.tg-mapbtn { position: absolute; inset-inline-end: 16px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: 99px; background: var(--tg-paper); color: var(--tg-ink) !important; font-size: 14px; font-weight: 650; box-shadow: 0 4px 14px var(--tg-shadow); }
.tg-stopcol { padding-top: 16px; }

.tg-stops { --c: var(--tg-bus); }
.tg-stops.tg-k-metro { --c: var(--tg-metro); } .tg-stops.tg-k-tgm { --c: var(--tg-tgm); }
.tg-stops li { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.tg-stops li > a, .tg-stops li > span:not(.tg-rail) { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-height: 40px; color: var(--tg-ink) !important; font-size: 14.5px; font-weight: 500; }
.tg-stops li.tg-end > a, .tg-stops li.tg-end > span:not(.tg-rail) { font-weight: 700; font-size: 15px; }
.tg-stops small { color: var(--tg-muted); font-size: 12px; font-weight: 500; }
.tg-conn { display: inline-flex; gap: 4px; }
.tg-rail { position: relative; width: 16px; align-self: stretch; flex: none; }
.tg-rail i { position: absolute; inset-inline-start: 5px; width: 6px; top: 0; bottom: 0; background: var(--c); }
.tg-stops li:first-child .tg-rail i { top: 50%; } .tg-stops li:last-child .tg-rail i { bottom: 50%; }
.tg-rail u { position: absolute; inset-inline-start: 2px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 99px; background: var(--tg-paper); border: 3px solid var(--c); }
.tg-end .tg-rail u { inset-inline-start: 0; margin-top: -8px; width: 16px; height: 16px; }
.tg-more .tg-rail i { background: repeating-linear-gradient(var(--c) 0 4px, transparent 4px 8px); }
.tg-more button { min-height: 44px; color: var(--tg-blue); font-weight: 600; font-size: 14px; }

.tg-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--tg-rule); font-size: 12.5px; line-height: 1.45; color: var(--tg-muted); }
.tg-note svg { flex: none; margin-top: 1px; }
.tg-h1 + .tg-note { border-top: 0; padding-top: 0; }
.tg-empty { color: var(--tg-muted); padding: 24px 0; }

/* Tarifs */
.tg-t { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14.5px; }
.tg-t th { text-align: end; font-size: 12px; font-weight: 600; color: var(--tg-muted); padding: 0 0 6px; }
.tg-t td { text-align: end; padding: 10px 0; border-top: 1px solid var(--tg-rule); font-weight: 500; }
.tg-t :is(th, td):first-child { text-align: start; }
.tg-src { color: var(--tg-muted); font-size: 12px; margin-top: 8px !important; }

/* Vues sur téléphone : une seule à la fois */
[data-view=line] .tg-list, [data-view=fares] .tg-list { display: none; }

/* Ordinateur : réseaux | lignes | la ligne ouverte avec son tracé */
@media (min-width: 1024px) {
  .tg-top { padding: 0 24px; height: 68px; border-bottom: 1px solid var(--tg-rule); gap: 18px; }
  .tg-desk-title { display: inline !important; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
  .tg-desk-search { display: flex !important; width: 440px; margin-inline-start: 24px; }
  .tg-desk-tabs { display: flex !important; width: 220px; margin: 0 0 0 auto; }
  [dir=rtl] .tg-desk-tabs { margin: 0 auto 0 0; }
  .tg-desk-tabs a { min-height: 32px; }
  .tg-body { display: grid; grid-template-columns: 272px 408px minmax(0, 1fr); padding: 0; height: calc(100vh - 68px); }
  .tg-nav, .tg-list, .tg-detail { display: block !important; overflow-y: auto; }
  .tg-nav { padding: 18px 12px; border-inline-end: 1px solid var(--tg-rule); }
  .tg-cap { color: var(--tg-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 0 12px 8px !important; }
  .tg-nav a { display: flex; flex-direction: column; justify-content: center; min-height: 50px; padding: 0 12px; border-radius: 10px; color: var(--tg-ink); }
  .tg-nav a b { font-size: 14.5px; font-weight: 600; }
  .tg-nav a span { color: var(--tg-muted); font-size: 12.5px; margin-top: 1px; }
  .tg-nav a.on { background: var(--tg-tint); } .tg-nav a.on b { font-weight: 700; }
  .tg-list { padding: 8px 28px 28px; border-inline-end: 1px solid var(--tg-rule); }
  .tg-list .tg-row { min-height: 50px; }
  .tg-list .tg-ch { display: none; }
  .tg-list .tg-sh h2 { font-size: 17px; }
  .tg-detail { padding: 24px 32px; position: relative; }
  .tg-detail .tg-ltop { display: grid; grid-template-columns: auto 1fr auto; column-gap: 16px; align-items: start; padding-top: 0; }
  .tg-detail .tg-lhead { grid-row: 1 / span 2; }
  .tg-detail .tg-lhead .tg-kind { display: none; }
  .tg-detail .tg-ltop .tg-h1 { margin-top: 0; font-size: 26px; grid-column: 2; }
  .tg-detail .tg-ltop .tg-meta { grid-column: 2; }
  .tg-detail .tg-actions { display: flex; grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .tg-detail .tg-dir { grid-column: 1 / -1; width: 420px; margin-top: 18px; }
  .tg-lbody { display: flex; flex-direction: row-reverse; gap: 28px; margin-top: 22px; }
  [dir=rtl] .tg-lbody { flex-direction: row-reverse; }
  .tg-mapwrap { flex: 1; margin: 0; height: 560px; border-radius: 14px; overflow: hidden; }
  .tg-mapbtn { display: none; }
  .tg-stopcol { width: 300px; flex: none; padding-top: 0; }
  [data-view=line] .tg-list, [data-view=fares] .tg-list { display: block !important; }
}
