/* Journey planner page. Builds on stats.css (page, header, back link, message).
   Light theme in a Merseytravel-style navy and yellow. These hex values are an estimate of the brand colours, not read from the
   Merseytravel site (which blocks scripts): change them here and the whole page follows. */
:root {
    --mt-navy: #00305e;        /* headings, links, selected buttons */
    --mt-navy-dark: #002244;
    --mt-yellow: #ffd100;      /* the main action, and accents */
    --mt-yellow-soft: #fff6c9;
    --mt-sky: #eaf2fa;         /* pale panels */
    --mt-rail: #03a749;        /* Merseyrail green, as on the live map */
    --mt-bus: #00305e;
    --mt-ferry: #0b7285;      /* the river */
    --accent: var(--mt-navy);  /* stats.css uses this for the back link */
    --ink: #1c2733; --muted: #5a6877; --line: #dde6ee;
}
body { background: #f7fafc; }
h1 { color: var(--mt-navy); }
header { border-bottom: 4px solid var(--mt-yellow); padding-bottom: 12px; }
.plan { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 8px; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.field .row { display: flex; gap: 6px; }
.plan input { font: inherit; padding: 9px 12px; border: 1px solid #b9c7d4; border-radius: 8px; min-width: 0; width: 100%; background: #fff; color: var(--ink); }
.plan button { font: inherit; padding: 8px 14px; border: 1px solid #b9c7d4; border-radius: 8px; background: #fff; color: var(--mt-navy); cursor: pointer; }
.plan button:hover { background: var(--mt-sky); }
#swap, #here { padding: 8px 10px; }
#swap { align-self: end; }
.field.small { grid-column: auto; }
.modes { display: flex; gap: 8px; grid-column: 1 / -1; }
.modes button { border-radius: 18px; }
.modes button[aria-pressed="true"] { background: var(--mt-sky); border-color: var(--mt-navy); color: var(--mt-navy); font-weight: 700; }
#go { grid-column: 1 / -1; background: var(--mt-yellow); border-color: var(--mt-yellow); color: var(--mt-navy-dark); font-weight: 700; }
#go:hover { background: #ffdc33; }
#go:disabled { opacity: .6; cursor: progress; }
.plan input:focus-visible, .plan button:focus-visible { outline: 2px solid var(--mt-navy); outline-offset: 2px; }

.journey { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; overflow: hidden; }
.journey[open] { border-color: #b9c7d4; }
.journey > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.journey > summary::-webkit-details-marker { display: none; }
.j-times { color: var(--mt-navy); font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.j-meta { color: var(--muted); font-size: .88rem; }
.j-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 12px; font-size: .85rem; font-weight: 700; color: #fff; background: var(--mt-navy); }
.chip.rail { background: var(--mt-rail); } .chip.bus { background: var(--mt-bus); } .chip.ferry { background: var(--mt-ferry); }
.cruise-note { font-style: italic; }
.chip.walk { background: var(--mt-sky); color: var(--mt-navy); font-weight: 600; }
.arrow { color: var(--muted); }
.j-legs { list-style: none; margin: 0; padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.leg { display: grid; grid-template-columns: 52px 1fr; gap: 0 12px; padding: 8px 0 8px 0; border-left: 0; }
.leg .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; padding-top: 1px; }
.leg .what { border-left: 3px solid #c3d0dc; padding-left: 12px; }
.leg.ride-rail .what { border-left-color: var(--mt-rail); } .leg.ride-bus .what { border-left-color: var(--mt-bus); } .leg.ride-ferry .what { border-left-color: var(--mt-ferry); }
.leg .title { font-weight: 600; }
.leg .sub2 { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.leg details summary { cursor: pointer; color: var(--mt-navy); text-decoration: underline; font-size: .85rem; margin-top: 2px; }
.leg details ol { margin: 4px 0 0; padding-left: 20px; font-size: .86rem; color: var(--muted); }
/* Get Me Home / Get Me To Work: big one-tap buttons above the form, and the place editor under them. */
.quick { margin-bottom: 14px; }
.quick-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-go { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; border: 0; border-radius: 10px; background: var(--mt-navy); color: #fff; cursor: pointer; }
.quick-go .q-title { font-size: 1.05rem; font-weight: 700; }
.quick-go small { font-size: .78rem; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-go.unset { background: #fff; color: var(--mt-navy); border: 2px dashed #b9c7d4; }
.quick-go:hover:not(:disabled) { background: var(--mt-navy-dark); color: #fff; }
.quick-go:disabled { opacity: .6; cursor: progress; }
.quick-go:focus-visible { outline: 3px solid var(--mt-yellow); outline-offset: 2px; box-shadow: 0 0 0 5px var(--mt-navy); }
#placesEditor { margin-top: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
#placesEditor summary { cursor: pointer; color: var(--mt-navy); font-weight: 600; padding: 4px 0; }
.place-edit { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 6px; align-items: center; margin: 8px 0; }
.place-edit label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.place-edit input { font: inherit; padding: 8px 10px; border: 1px solid #b9c7d4; border-radius: 8px; min-width: 0; background: #fff; color: var(--ink); }
.place-edit button { font: inherit; padding: 7px 12px; border: 1px solid #b9c7d4; border-radius: 8px; background: #fff; color: var(--mt-navy); cursor: pointer; }
.place-edit .place-clear { padding: 7px 10px; line-height: 1; font-size: 1.1rem; color: var(--muted); }
.place-actions { margin: 8px 0; }
.place-actions button { font: inherit; padding: 8px 22px; border: 1px solid var(--mt-navy); border-radius: 8px; background: var(--mt-navy); color: #fff; cursor: pointer; }
.place-actions button:hover { opacity: .9; }
.place-actions button:disabled { opacity: .6; cursor: progress; }
.place-edit button:hover { background: var(--mt-sky); }
.place-edit input:focus-visible, .place-edit button:focus-visible, .place-actions button:focus-visible, #placesEditor summary:focus-visible { outline: 2px solid var(--mt-navy); outline-offset: 2px; }
@media (max-width: 640px) {
    .place-edit { grid-template-columns: 1fr auto; }
    .place-edit label { grid-column: 1 / -1; margin-bottom: -4px; }
    .place-edit input { grid-column: 1; }
}
@media (max-width: 640px) {
    .plan { grid-template-columns: 1fr auto; }
    .plan .field:nth-of-type(2) { grid-column: 1; }
    #swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* Place suggestions under whichever box is being typed in (positioned by journey.js). */
#placeSuggest { position: absolute; z-index: 3000; background: #fff; border: 1px solid #b9c7d4; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18); max-height: 260px; overflow-y: auto; }
#placeSuggest[hidden] { display: none; }
#placeSuggest button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid #eee; padding: 11px 12px; cursor: pointer; }
#placeSuggest button:last-child { border-bottom: 0; }
#placeSuggest button:hover, #placeSuggest button:focus-visible { background: var(--mt-sky); outline: none; }
#placeSuggest button span { flex: none; font-size: .78rem; color: var(--muted); }
#placeSuggest .ps-note { padding: 11px 12px; font-size: .88rem; color: var(--muted); }

/* View journey on map: a full-screen overlay with a clean map (journeymap.js). */
.j-legs:has(+ .view-map) { padding-bottom: 8px; }
.view-map { display: block; margin: 0 16px 16px; font: inherit; font-weight: 600; color: var(--mt-navy); background: #fff; border: 1px solid #b9c7d4; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.view-map:hover:not(:disabled) { background: var(--mt-sky); }
.view-map:disabled { opacity: .6; cursor: progress; }
.view-map:focus-visible, .jmap-close:focus-visible { outline: 2px solid var(--mt-navy); outline-offset: 2px; }
body.jmap-open { overflow: hidden; }
.jmap-overlay { position: fixed; inset: 0; z-index: 5000; background: rgba(20, 30, 45, .55); display: flex; align-items: stretch; justify-content: center; }
.jmap-box { display: flex; flex-direction: column; width: 100%; background: #fff; }
.jmap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.jmap-legend { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); margin-right: auto; }
.jmap-legend .sw { display: inline-block; width: 22px; height: 0; border-top: 5px solid var(--c); border-radius: 3px; vertical-align: middle; margin-right: 5px; }
.jmap-legend .sw.walk { border-top: 4px dotted var(--c); }
.jmap-close { font: inherit; font-weight: 600; color: var(--mt-navy); background: #fff; border: 1px solid #b9c7d4; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.jmap-close:hover { background: var(--mt-sky); }
.jmap-map { flex: 1; min-height: 0; }
@media (min-width: 800px) {
    .jmap-overlay { padding: 3vh 4vw; }
    .jmap-box { border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
}
