/* ---------------------------------------------------------------------------
   /bridges — bridge openings

   Read most often in a car, one-handed, deciding which way to drive. So the
   next opening is the largest thing on each card and the state is carried by a
   word as well as a colour: "Road closed" has to survive being glanced at in
   sunlight, and colour alone fails both that and anyone colour-blind.
   --------------------------------------------------------------------------- */

.bridge-page { padding-bottom: 2rem; }

.bridge-head h1 { margin-bottom: .25rem; }

.bridge-summary {
    margin: 0 0 1.25rem;
    font-size: 1.0625rem;
    line-height: 1.5;
}

.bridge-list {
    display: grid;
    gap: 1rem;
}

.bridge-card {
    padding: 1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-left-width: 4px;
    border-radius: .5rem;
    background: var(--surface, #fff);
}

.bridge-card--open        { border-left-color: #609D31; }
.bridge-card--soon        { border-left-color: #F07A35; }
.bridge-card--closed      { border-left-color: #B32952; }
.bridge-card--unscheduled { border-left-color: var(--border, #cbd5e1); }

.bridge-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .5rem;
}

.bridge-card-head h3 { margin: 0; font-size: 1.125rem; }

.bridge-side {
    font-size: .8125rem;
    color: var(--muted, #64748b);
}

.bridge-state {
    margin-left: auto;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

.bridge-state--open        { background: #e8f5e0; color: #3d6b1e; }
.bridge-state--soon        { background: #fdeade; color: #8a4415; }
.bridge-state--closed      { background: #fbe3ea; color: #7d1c39; }
.bridge-state--unscheduled { background: var(--surface-2, #f1f5f9); color: var(--muted, #64748b); }

.bridge-next {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem;
    margin: 0 0 .75rem;
}

.bridge-next-label {
    font-size: .8125rem;
    color: var(--muted, #64748b);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.bridge-next-time {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.bridge-tomorrow,
.bridge-direction {
    padding: .1rem .45rem;
    border-radius: .25rem;
    background: var(--surface-2, #f1f5f9);
    font-size: .75rem;
}

.bridge-countdown { color: var(--muted, #475569); }

.bridge-next--none { color: var(--muted, #64748b); font-style: italic; }

/* Wide content scrolls inside its own box; the page body never scrolls sideways. */
.bridge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    display: block;
    overflow-x: auto;
}

.bridge-table th,
.bridge-table td {
    padding: .35rem .5rem;
    text-align: left;
    border-bottom: 1px solid var(--border, #e2e8f0);
    white-space: nowrap;
}

.bridge-table thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted, #64748b);
}

/* Openings already past stay on the page — the whole day's schedule is the
   point — but recede, so the eye lands on what is still coming. */
.bridge-row--passed { opacity: .45; }

.bridge-captains { margin-top: .75rem; font-size: .875rem; }
.bridge-captains > summary { cursor: pointer; color: var(--link, #0369a1); }

.bridge-captains-grid {
    margin: .5rem 0 0;
    display: grid;
    gap: .35rem;
}

.bridge-captains-grid > div {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: .5rem;
}

.bridge-captains-grid dt { color: var(--muted, #64748b); }
.bridge-captains-grid dd { margin: 0; }

.bridge-note {
    margin-top: 1.5rem;
    font-size: .8125rem;
    color: var(--muted, #64748b);
    line-height: 1.55;
}

@media (max-width: 480px) {
    .bridge-captains-grid > div { grid-template-columns: 1fr; gap: 0; }
    .bridge-state { margin-left: 0; }
}

/* ---------------------------------------------------------------------------
   On-demand bridges

   Queen Emma has no timetable, so it gets no countdown and no large time —
   there is nothing to count down to, and a big number on the card would imply
   otherwise. Neutral rather than green/amber/red: "open on demand" is not a
   state a driver acts on the way "road closed in 5 minutes" is.
   --------------------------------------------------------------------------- */

.bridge-card--ondemand { border-left-color: #4f6d8f; }

.bridge-state--ondemand { background: #e6edf5; color: #33506e; }

.bridge-next--ondemand { align-items: baseline; }

.bridge-ondemand-text { color: var(--muted, #475569); }

.bridge-hours {
    margin: 0 0 .75rem;
    font-size: .875rem;
    color: var(--muted, #475569);
}

.bridge-notes {
    margin: 0 0 .75rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--muted, #475569);
}
