/*
 * LA PAGINA DEI COLLEGAMENTI, rifatta il 08/10/2026.
 *
 * Tutto sotto .cl2, con selettori «html body .cl2 ...» come la scheda treno
 * (scheda.css): pesano piu' della veste di stazione senza !important.
 * Il modulo e' un biglietto; i viaggi un elenco a righe con quattro zone
 * (orari, treno, giorni, puntualita') che sul telefono si impilano in tre.
 */

/* ---- il biglietto */
html body .cl2 .cl2-form {
    display: grid; gap: 12px; margin: 0 0 24px; padding: 16px;
    background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: var(--r-lg, 14px);
}
html body .cl2 .cl2-tratta { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
html body .cl2 .cl2-quando { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
html body .cl2 .cl2-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; position: relative; }
html body .cl2 .cl2-f > span {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .7rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--rm-muted);
}
html body .cl2 .cl2-f > span small { font-weight: 400; letter-spacing: .02em; text-transform: none; margin-left: 4px; }
html body .cl2 .cl2-f .form-control { min-height: 46px; font-size: 1rem; }
html body .cl2 .cl2-f-da .form-control, html body .cl2 .cl2-f-a .form-control { font-weight: 600; }
html body .cl2 .cl2-f .ac-box { top: auto; bottom: auto; margin-top: 2px; z-index: 30; }
html body .cl2 .cl2-inv {
    width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; border: 1px solid var(--rm-line); background: var(--rm-bg, transparent);
    color: var(--rm-muted); font-size: 1.15rem; cursor: pointer;
    transition: transform 160ms ease-out, color 160ms ease, border-color 160ms ease;
}
html body .cl2 .cl2-inv:hover { color: var(--rm-ink); border-color: var(--rm-brand); }
html body .cl2 .cl2-inv:active { transform: scale(.94); }
html body .cl2 .cl2-inv:focus-visible { outline: 2px solid var(--rm-brand); outline-offset: 2px; }
html body .cl2 .cl2-vai { min-height: 46px; padding-inline: 22px; justify-content: center; }
@media (max-width: 640px) {
    /* Da e A uno sotto l'altro, il pulsante d'inversione sul bordo destro
       a cavallo dei due campi, come sulle app dei biglietti. */
    html body .cl2 .cl2-tratta { grid-template-columns: minmax(0, 1fr); position: relative; }
    html body .cl2 .cl2-inv { position: absolute; right: 10px; top: 50%; transform: translateY(-14%); z-index: 2; width: 40px; height: 40px; background: var(--rm-surface); }
    html body .cl2 .cl2-inv:active { transform: translateY(-14%) scale(.94); }
    html body .cl2 .cl2-f-da .form-control, html body .cl2 .cl2-f-a .form-control { padding-right: 58px; }
    html body .cl2 .cl2-quando { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    html body .cl2 .cl2-vai { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { html body .cl2 .cl2-inv { transition: none; } }

/* ---- la testa dei risultati */
html body .cl2 .cl2-testa { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 4px 0 6px; }
html body .cl2 .cl2-testa h2 { margin: 0; font-size: var(--rm-h2, 1.5rem); text-wrap: balance; }
html body .cl2 .cl2-ritorno {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .76rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
    color: var(--rm-brand) !important; white-space: nowrap;
}
html body .cl2 .cl2-ritorno:hover { text-decoration: underline; }
html body .cl2 .cl2-conta { color: var(--rm-muted); margin: 0 0 8px; max-width: 72ch; }
html body .cl2 .cl2-conta strong { color: var(--rm-ink); }
html body .cl2 .cl2-fioco { color: var(--rm-muted); font-size: .84rem; }
html body .cl2 .cl2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html body .cl2 .bl-coll-fonte { max-width: 80ch; }

/* ---- l'elenco */
html body .cl2 .cl2-col, html body .cl2 .cl2-v {
    display: grid; grid-template-columns: 250px minmax(0, 1.25fr) minmax(0, 1fr) 215px; gap: 8px 24px;
}
html body .cl2 .cl2-col {
    margin: 18px 0 0; padding: 0 16px 8px; border-bottom: 1px solid var(--rm-line);
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .66rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--rm-muted);
}
html body .cl2 .cl2-col span:last-child { text-align: right; }
html body .cl2 .cl2-lista { list-style: none; margin: 0 0 18px; padding: 0; }
html body .cl2 .cl2-v {
    align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rm-line);
    transition: background-color 160ms ease;
}
html body .cl2 .cl2-v:hover { background: var(--rm-surface); }
html body .cl2 .cl2-v-cambio { box-shadow: inset 3px 0 0 rgba(var(--rm-brand-rgb, 21, 123, 255), .55); }

/* gli orari: partenza, la durata sul filo, arrivo */
html body .cl2 .cl2-ore { display: grid; grid-template-columns: auto minmax(56px, 1fr) auto; align-items: center; gap: 10px; }
html body .cl2 .cl2-ora {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.12rem; font-weight: 800;
    color: var(--rm-ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
html body .cl2 .cl2-dur { display: grid; justify-items: center; gap: 3px; min-width: 0; }
html body .cl2 .cl2-dur-t, html body .cl2 .cl2-dur-n {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .68rem; color: var(--rm-muted);
    white-space: nowrap; line-height: 1;
}
html body .cl2 .cl2-dur-t { color: var(--rm-ink); font-weight: 700; }
html body .cl2 .cl2-dur-l { position: relative; width: 100%; height: 2px; border-radius: 2px; background: var(--rm-line); }
html body .cl2 .cl2-dur-l::before, html body .cl2 .cl2-dur-l::after {
    content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%;
    transform: translateY(-50%); background: var(--rm-surface); border: 2px solid var(--rm-muted);
}
html body .cl2 .cl2-dur-l::before { left: -3px; }
html body .cl2 .cl2-dur-l::after { right: -3px; border-color: var(--rm-brand); }
html body .cl2 .cl2-v-cambio .cl2-dur-n { color: var(--rm-brand); font-weight: 700; }

/* il treno, o i treni con la sosta in mezzo */
html body .cl2 .cl2-treni { display: grid; gap: 4px; min-width: 0; }
html body .cl2 .cl2-treno { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
html body .cl2 .cl2-codice {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 800; font-size: .98rem;
    color: var(--rm-amber) !important; text-decoration: none;
}
html body .cl2 .cl2-codice:hover { text-decoration: underline; }
html body .cl2 .cl2-rotta { font-size: .8rem; color: var(--rm-muted); text-transform: uppercase; letter-spacing: .02em; min-width: 0; overflow-wrap: anywhere; }
html body .cl2 .cl2-gamba { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .78rem; color: var(--rm-muted); }
html body .cl2 .cl2-sosta {
    margin: 0 0 0 6px; padding: 1px 0 1px 12px; border-left: 2px dashed var(--rm-line);
    font-size: .78rem; color: var(--rm-muted);
}
html body .cl2 .cl2-sosta a { color: var(--rm-ink) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* i giorni */
html body .cl2 .cl2-giorni { display: grid; gap: 2px; min-width: 0; }
html body .cl2 .cl2-g { color: var(--rm-ink); font-weight: 600; font-size: .92rem; }

/* la puntualita': cifra, barra, ritardo tipico */
html body .cl2 .cl2-punt { display: grid; gap: 4px; justify-items: end; text-align: right; min-width: 0; }
html body .cl2 .cl2-pct { font-size: .8rem; color: var(--rm-muted); }
html body .cl2 .cl2-pct b {
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.05rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
html body .cl2 .cl2-barra { display: block; width: 100%; max-width: 150px; height: 4px; border-radius: 4px; background: var(--rm-line); overflow: hidden; }
html body .cl2 .cl2-barra i { display: block; height: 100%; border-radius: 4px; background: currentColor; }
html body .cl2 .cl2-punt .cl2-fioco { font-size: .76rem; }
html body .cl2 .cl2-punt .cl2-fioco b { font-family: "JetBrains Mono", ui-monospace, monospace; }

@media (max-width: 991px) {
    html body .cl2 .cl2-col, html body .cl2 .cl2-v { grid-template-columns: 220px minmax(0, 1fr) 200px; }
    html body .cl2 .cl2-col span:nth-child(3) { display: none; }
    html body .cl2 .cl2-giorni { grid-column: 2; grid-row: 2; }
    html body .cl2 .cl2-punt { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 640px) {
    /* Sul telefono gli orari fanno da titolo della riga; sotto il treno, e
       in fondo giorni e puntualita' affiancati. Tre blocchi, non sette. */
    html body .cl2 .cl2-col { display: none; }
    html body .cl2 .cl2-v {
        grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 4px;
        grid-template-areas: "ore ore" "treni treni" "giorni punt";
    }
    html body .cl2 .cl2-v-cambio { padding-left: 12px; }
    html body .cl2 .cl2-ore { grid-area: ore; }
    html body .cl2 .cl2-treni { grid-area: treni; }
    html body .cl2 .cl2-giorni { grid-area: giorni; grid-column: auto; grid-row: auto; align-self: end; }
    html body .cl2 .cl2-punt { grid-area: punt; grid-column: auto; grid-row: auto; align-self: end; }
    html body .cl2 .cl2-barra { width: 96px; }
    html body .cl2 .cl2-ora { font-size: 1.2rem; }
    html body .cl2 .cl2-g { font-size: .86rem; }
}

/* ---- come si legge: chiuso, per chi vuole */
html body .cl2 .cl2-come { margin: 0 0 24px; border: 1px solid var(--rm-line); border-radius: var(--r-lg, 14px); padding: 0 16px; }
html body .cl2 .cl2-come summary { cursor: pointer; padding: 12px 0; font-weight: 700; color: var(--rm-ink); list-style-position: inside; }
html body .cl2 .cl2-come[open] summary { border-bottom: 1px solid var(--rm-line); margin-bottom: 12px; }
html body .cl2 .cl2-come p { max-width: 78ch; font-size: .92rem; }
html body .cl2 .cl2-come[open] { padding-bottom: 14px; }

/* ---- la pagina senza ricerca */
html body .cl2 .cl2-cosa {
    list-style: none; margin: 0 0 28px; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px;
}
html body .cl2 .cl2-cosa li { padding: 2px 0 2px 14px; border-left: 2px solid var(--rm-brand); color: var(--rm-muted); font-size: .92rem; line-height: 1.5; }
html body .cl2 .cl2-cosa b { color: var(--rm-ink); }
html body .cl2 .cl2-esempi h2 { font-size: var(--rm-h2, 1.5rem); margin: 0 0 4px; }
html body .cl2 .cl2-es-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 14px; }
html body .cl2 .cl2-es {
    display: grid; gap: 3px; padding: 12px 14px; text-decoration: none;
    background: var(--rm-surface); border: 1px solid var(--rm-line); border-radius: 12px;
    transition: border-color 160ms ease, transform 160ms ease-out;
}
html body .cl2 .cl2-es:hover { border-color: var(--rm-brand); }
html body .cl2 .cl2-es:active { transform: scale(.98); }
html body .cl2 .cl2-es-da { font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--rm-muted) !important; }
html body .cl2 .cl2-es-a { font-weight: 700; color: var(--rm-ink) !important; }
html body .cl2 .cl2-es-a span { color: var(--rm-brand); }

/* Il colore del marchio, non --rm-accent: quello e' il verde di «in orario»
   (vedi la separazione del 01/10), e un link verde si leggeva come uno stato. */
html body .cl2 .cl2-punt .cl2-fioco { white-space: nowrap; }

/* I treni dell'orario ufficiale mai visti passare (08/10/2026): il numero senza
   link, perche' una scheda non ce l'hanno ancora, e una targhetta che lo dice. */
html body .cl2 .cl2-codice-muto { color: var(--rm-ink) !important; opacity: .85; }
html body .cl2 .cl2-uff {
    display: inline-block; padding: 0 6px; border-radius: 4px; border: 1px solid var(--rm-line);
    font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .66rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--rm-brand);
}
