/* Infos trafic : thermomètres de ligne, alertes, état du réseau sur l'accueil. Complète site.css. */

.trafic-outils { display: grid; gap: 14px; margin-bottom: 22px; }

/* Maintenant / À venir : un interrupteur à deux positions, pas deux puces. */
.segments { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; justify-self: start; padding: 3px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--outline); }
.segments button { font: inherit; font-size: 0.88rem; font-weight: 700; padding: 7px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-2); cursor: pointer; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.segments .n { font-weight: 600; color: var(--fg-2); }

.groupe + .groupe { margin-top: 30px; }
.groupe-titre { font-size: 1.05rem; letter-spacing: 0.01em; color: var(--fg-2); margin-bottom: 12px; font-weight: 800; }
.groupe-liste { display: grid; gap: 14px; }
.groupe.calmes .groupe-liste { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }

.ligne-trafic { scroll-margin-top: calc(var(--barre) + 12px); }
.ligne-trafic.calme { padding: 16px 18px 12px; }
.ligne-tete { display: flex; align-items: center; gap: 12px; }
.ligne-trafic:not(.calme) .ligne-tete { align-items: flex-start; }
.ligne-nom { min-width: 0; flex: 1; }
.ligne-nom h3 { font-size: 1.02rem; line-height: 1.25; }
.ligne-trafic:not(.calme) .ligne-nom { display: grid; gap: 6px; justify-items: start; }
.ligne-trafic.calme .ligne-nom h3 { font-size: 0.95rem; }

/* Le statut dit toujours un mot : la couleur n'est qu'un renfort. */
.statut { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; background: var(--surface-1); color: var(--fg-2); }
.statut::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.statut.normal { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.statut.perturbee, .statut.prevu { background: color-mix(in srgb, var(--alerte) 18%, var(--surface)); color: var(--alerte); }
.statut.interrompue { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }

/* Le thermomètre : une piste à la couleur de la ligne, un point par arrêt. */
.thermo { position: relative; margin: 38px 10px 30px; --rouge: var(--danger); --ambre: #b87800; }
.thermo.compact { margin: 18px 10px 28px; }
:root[data-theme="sombre"] .thermo { --ambre: #ffd23f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .thermo { --ambre: #ffd23f; } }
.piste { position: relative; height: 8px; border-radius: 4px; background: var(--c); }
.thermo.compact .piste { height: 6px; }
.troncon { position: absolute; top: 0; bottom: 0; }
.troncon.ferme { background: repeating-linear-gradient(135deg, var(--rouge) 0 5px, color-mix(in srgb, var(--rouge) 35%, var(--surface)) 5px 9px); }
.troncon.prevu { background: repeating-linear-gradient(135deg, var(--ambre) 0 5px, color-mix(in srgb, var(--ambre) 35%, var(--surface)) 5px 9px); }

.arret {
  position: absolute;
  top: 50%;
  width: clamp(4px, calc(100% / var(--n) * 0.55), 11px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--c);
}
.arret.terminus { width: 14px; background: var(--c); box-shadow: 0 0 0 3px var(--surface); }
.arret.ferme, .arret.prevu, .arret.concerne { width: 10px; z-index: 2; }
.arret.ferme { background: var(--rouge); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rouge); }
.arret.prevu { background: var(--ambre); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ambre); }
.arret.concerne { background: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

.etiquettes { position: absolute; inset: 0; pointer-events: none; }
.etiquette-arret { position: absolute; white-space: nowrap; font-size: 0.78rem; line-height: 1.2; transform: translateX(-50%); max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }
.etiquette-arret.gauche { transform: none; }
.etiquette-arret.droite { transform: translateX(-100%); }
.etiquette-arret.bas { top: 22px; color: var(--fg-2); font-weight: 600; }
.etiquette-arret.haut { bottom: 22px; font-weight: 800; }
.etiquette-arret.haut.etage2 { bottom: 42px; }
.etiquette-arret.haut.ferme { color: var(--rouge); }
.etiquette-arret.haut.prevu { color: var(--ambre); }
.thermo.compact .etiquette-arret { font-size: 0.74rem; }

.alertes { display: grid; gap: 10px; margin-top: 6px; }
.alerte { padding: 14px 16px; border-radius: 16px; background: var(--surface-1); }
.alerte.perturbation { background: color-mix(in srgb, var(--danger) 8%, var(--surface-1)); }
.alerte.recurrente { background: color-mix(in srgb, var(--alerte) 10%, var(--surface-1)); }
.alerte-entete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.alerte-entete strong { font-size: 0.98rem; }
.effet { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); }
.effet.interrompu, .effet.non_desservi { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.alerte.recurrente .effet.non_desservi, .alerte.recurrente .effet.interrompu, .effet.deviation, .effet.horaires { background: color-mix(in srgb, var(--alerte) 18%, var(--surface)); color: var(--alerte); }
.alerte-meta { margin-top: 4px; }
.alerte .message { margin-top: 8px; color: var(--fg-2); font-size: 0.93rem; }
.alerte .message p + p { margin-top: 6px; }
.alerte details { margin-top: 8px; }
.alerte summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; color: var(--accent); }

/* Accueil : l'état du réseau d'un coup d'oeil. */
.trafic-puces { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.trafic-puce { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--outline); color: var(--fg); font-weight: 700; font-size: 0.86rem; }
.trafic-puce:hover { text-decoration: none; border-color: var(--accent); }
.trafic-puce .point { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.trafic-puce.perturbee .point { background: var(--alerte); }
.trafic-puce.interrompue .point { background: var(--danger); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trafic-live { display: grid; gap: 8px; margin-bottom: 18px; max-width: 70ch; }
.trafic-live a { display: flex; gap: 10px; align-items: baseline; color: var(--fg); }
.trafic-live a:hover { text-decoration: none; }
.trafic-live a:hover .texte { text-decoration: underline; }

/* Le schéma vertical : la piste à gauche, un arrêt par rangée, les correspondances à droite. */
.schema-v { --rouge: var(--danger); --ambre: #b87800; margin: 4px 0 6px; }
:root[data-theme="sombre"] .schema-v { --ambre: #ffd23f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .schema-v { --ambre: #ffd23f; } }
.v-liste { list-style: none; margin: 0; padding: 0; }
.v-liste > li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; min-height: 34px; }
.rail { position: relative; align-self: stretch; }
/* Deux moitiés de voie : au-dessus et au-dessous du point, chacune peut être ouverte, fermée, annoncée ou absente (terminus). */
.rail::before, .rail::after { content: ""; position: absolute; left: 50%; width: 4px; margin-left: -2px; background: var(--c); }
.rail::before { top: 0; bottom: 50%; }
.rail::after { top: 50%; bottom: 0; }
.rail.h-vide::before, .rail.b-vide::after { display: none; }
.rail.h-ferme::before, .rail.b-ferme::after { background: repeating-linear-gradient(to bottom, var(--rouge) 0 5px, transparent 5px 9px); }
.rail.h-prevu::before, .rail.b-prevu::after { background: repeating-linear-gradient(to bottom, var(--ambre) 0 5px, transparent 5px 9px); }
.rail .pt { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--c); z-index: 1; }
.v-arret.terminus .pt { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: var(--c); box-shadow: 0 0 0 3px var(--surface); }
.v-arret.ferme .pt { background: var(--surface); box-shadow: inset 0 0 0 3px var(--rouge); }
.v-arret.ferme .pt::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 2px; background: var(--rouge); transform: rotate(45deg); }
.v-arret.prevu .pt { box-shadow: inset 0 0 0 3px var(--ambre); }
.v-arret.concerne .pt { box-shadow: inset 0 0 0 3px var(--accent); }
.v-nom { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 0; font-size: 0.93rem; line-height: 1.25; }
.v-arret.terminus .v-nom { font-weight: 800; }
.v-arret.ferme .texte { color: var(--rouge); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.v-etat { font-size: 0.7rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--fg-2); }
.v-arret.ferme .v-etat { color: var(--rouge); }
.v-arret.prevu .v-etat { color: var(--ambre); }
.v-arret.concerne .v-etat { color: var(--accent); }
.v-corr { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 150px; }
.v-replie { min-height: 30px; }
.v-replie .rail::before, .v-replie .rail::after { background: repeating-linear-gradient(to bottom, var(--c) 0 3px, transparent 3px 7px); }
.v-replie.ferme .rail::before { background: var(--rouge); }
.v-replie button, .v-tout { font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--fg-2); background: transparent; border: 0; padding: 4px 0; cursor: pointer; justify-self: start; }
.v-replie button:hover, .v-tout:hover { color: var(--accent); text-decoration: underline; }
.v-tout { margin: 6px 0 0 38px; color: var(--accent); }
.v-bus { min-height: 30px; }
.v-puces { display: flex; flex-wrap: wrap; gap: 4px; grid-column: 2 / -1; }
.bus-puce { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 0.78rem; font-weight: 800; line-height: 1; padding: 5px 9px; border: 0; border-radius: 999px; background: var(--c); color: var(--encre, #fff); cursor: pointer; font-variant-numeric: tabular-nums; }
.bus-puce.sens-retour { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 2px var(--c); }
.bus-puce .sens { font-size: 0.6rem; }
.bus-puce.choisi { outline: 2px solid var(--fg); outline-offset: 2px; }
.sens-legende { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 0.76rem; color: var(--fg-2); margin: 8px 0 4px; }
.ligne-trafic, .groupe, .groupe-liste { min-width: 0; }
.v-corr { gap: 6px; }
