/* trains.css: the train page (/treni, pages/trains.php, chat #484, 18 Oct 2026). The board itself uses the flight board classes (.fb) of site.css. */
.trn-search { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: .7rem; align-items: end; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.trn-search label { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.trn-search select { font: inherit; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.trn-search .btn { height: 46px; }
.trn-swap { height: 46px; width: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--sea-dark); }
.trn-results h3 { margin: 1.5rem 0 .3rem; font-size: 1.25rem; }
.trn-res { list-style: none; margin: .6rem 0 1rem; padding: 0; display: grid; gap: .6rem; }
.trn-res li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center; }
.trn-res-main p { margin: 0; }
.trn-res-main .fb-time { display: inline-block; min-width: 4.6rem; }
.trn-res-main .fb-old { font-size: .82rem; }
.trn-res-meta { margin: 0; color: var(--muted); font-size: .88rem; text-align: right; line-height: 1.9; }

.trn-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 1.1rem; }
.trn-line { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .5rem; }
.trn-line h3 { margin: 0; font-size: 1.2rem; }
.trn-tag { margin: 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sea-dark); }
.trn-desc { margin: 0; color: var(--muted); font-size: .94rem; }
/* the stations of a line, a dotted strip */
.trn-strip { list-style: none; margin: .5rem 0 .3rem; padding: 0 0 0 .2rem; display: flex; flex-wrap: wrap; gap: .25rem 0; font-size: .88rem; }
.trn-strip li { display: inline-flex; align-items: center; }
.trn-strip li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sea); margin-right: .35rem; flex: none; }
.trn-strip li:not(:last-child)::after { content: ""; width: 14px; height: 2px; background: var(--line); margin: 0 .35rem; }
.trn-strip li.is-minor { color: var(--muted); font-size: .8rem; }
.trn-strip li.is-minor::before { width: 6px; height: 6px; background: #b8c4c7; }
.trn-strip a { font-weight: 650; text-decoration: none; }
.trn-strip a:hover { text-decoration: underline; }
.trn-pair { margin: .7rem 0 0; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
h3.trn-pair { font-size: .9rem; margin: 0; }
.trn-trips { list-style: none; margin: .2rem 0 0; padding: 0; display: grid; gap: .3rem; }
.trn-trips li { display: grid; grid-template-columns: auto auto auto 1fr auto; gap: .45rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--line); }
.trn-trips .fb-time { font-size: .98rem; }
.trn-arrow { color: var(--muted); }
.trn-arr { color: var(--muted); font-weight: 600; }
.trn-meta { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-trips .st { font-size: .74rem; }
.trn-none { margin: .3rem 0; }

.trn-doors { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.trn-doors .door { padding: 1.1rem 1.2rem; }
.trn-doors h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.08rem; margin: 0; }
.trn-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--sea-soft); color: var(--sea-dark); display: grid; place-items: center; flex: none; }
.trn-next { margin: .5rem 0; gap: .35rem; }
.trn-next li { grid-template-columns: 50px 1fr; gap: .4rem; }
.trn-next .fb-time { font-size: .96rem; }
.trn-next div { font-size: .9rem; }
.trn-next .st { font-size: .7rem; padding: .12rem .45rem; margin-left: .2rem; }

.trn-bin { display: inline-grid; place-items: center; min-width: 2.2rem; padding: .15rem .45rem; border-radius: 8px; border: 1px dashed #b8c4c7; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trn-bin.is-live { border: 1px solid var(--sea-deep); background: var(--sea-deep); color: #fff; }
.trn-bin.is-none { border-color: transparent; }
.trn-fb .fb-no b { font-weight: 700; }
.trn-tmr-s { display: none; }
.trn-near { margin-top: 1.4rem; }
.trn-near .note { margin-bottom: .5rem; }
.trn-near .chip { font-size: .85rem; padding: .35rem .75rem; }

@media (max-width: 800px) {
  .trn-search { grid-template-columns: 1fr auto; }
  .trn-search label:nth-of-type(1), .trn-search label:nth-of-type(2) { grid-column: 1; }
  .trn-swap { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .trn-search .btn { grid-column: 1 / -1; }
  .trn-res li { grid-template-columns: 1fr; }
  .trn-res-meta { text-align: left; }
}
@media (max-width: 700px) {
  .trn-bin { min-width: 1.7rem; max-width: 100%; padding: .12rem .25rem; font-size: .82rem; white-space: normal; text-align: center; line-height: 1.1; }   /* "16 AV" goes on two lines */
  .trn-fb { table-layout: fixed; }   /* the columns share the phone width: the place wraps, nothing pushes the page sideways */
  .trn-fb th:nth-child(1) { width: 4.4rem; }
  .trn-fb th:nth-child(3) { width: 2.9rem; font-size: 0; }   /* "Binario" does not fit: the badge says it */
  .trn-fb th:nth-child(5) { width: 5.6rem; }
  .trn-fb .fb-time { font-size: .95rem; }
  .trn-fb .trn-tmr-l { display: none; }
  .trn-fb .trn-tmr-s { display: inline; }
  .trn-fb td:first-child, .trn-fb th:first-child { padding-left: .6rem; }
  .trn-fb td:last-child, .trn-fb th:last-child { padding-right: .5rem; }
}
@media (max-width: 420px) {
  .trn-trips li { grid-template-columns: auto auto auto 1fr; }
  .trn-trips .st { grid-column: 1 / -1; justify-self: start; }
}
