/*
 * travel.css — the Travel page (travel.html) and the page each trip gets (trip.html).
 * A night-flight map on warm paper: Fraunces for titles, Lato for text, DM Mono for data.
 */

.tv {
    --paper: #f6f2ea;
    --paper-2: #efe9dd;
    --card: #fffdf8;
    --ink: #1b2130;
    --ink-2: #4a5163;
    --muted: #8a8474;
    --line: #e2d9c8;
    --navy: #0c1626;
    --navy-2: #14243b;
    --land: #1d2e49;
    --land-line: #2e4466;
    --amber: #e9b04c;
    --amber-soft: #f5d591;
    --coral: #ff7d5c;
    --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --hand: 'Northwell', 'Fraunces', cursive;          /* the handwriting of the name in the top bar, used sparingly */
    --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    min-height: calc(100vh - 51px);
    background:
        radial-gradient(1200px 500px at 85% -10%, rgba(233, 176, 76, .13), transparent 60%),
        var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.55;
}

.tv *, .tv *::before, .tv *::after { box-sizing: border-box; }
.tv a { color: inherit; }
.tv a:hover, .tv a:focus { color: inherit; text-decoration: none; }
.tv h1, .tv h2, .tv h3, .tv p, .tv ul { margin: 0; padding: 0; }
.tv ul { list-style: none; }

.tv-wrap {
    width: min(1480px, 100% - 48px);
    margin: 0 auto;
    padding: 44px 0 72px;
}

/* ---------- two-column layout ---------- */

.tv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

.tv-stage {
    position: sticky;
    top: calc(var(--nav-h) + 28px);
}

/* ---------- heading ---------- */

.tv-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
}

.tv-eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}

.tv-title {
    margin-top: 10px !important;
    font-family: var(--serif);
    font-size: clamp(40px, 4.6vw, 68px);
    font-weight: 400;
    font-variation-settings: 'opsz' 144;
    line-height: 1.02;
    letter-spacing: -.02em;
}

.tv-title em {
    font-style: italic;
    font-weight: 300;
    color: #b9781c;
}

/* one handwritten word in the title */
.tv-title em.tv-hand { margin-left: .06em; font-family: var(--hand); font-size: 1.3em; font-style: normal; font-weight: 400; letter-spacing: 0; line-height: .6; }

.tv-flag { width: 20px; height: 15px; margin-right: 7px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(27, 33, 48, .12); vertical-align: -2px; }

.tv-title .w {
    display: inline-block;
    opacity: 0;
    transform: translateY(.5em) rotate(2deg);
    animation: tv-rise .9s cubic-bezier(.2, .8, .2, 1) forwards;
    animation-delay: calc(var(--i) * 90ms + 80ms);
}

@keyframes tv-rise {
    to { opacity: 1; transform: none; }
}

/* ---------- stats ---------- */

.tv-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 34px;
    margin: 22px 0 22px !important;
}

.tv-stat { min-width: 64px; }

.tv-stat__num {
    display: block;
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tv-stat__label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- map ---------- */

.tvmap {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(120% 90% at 50% 0%, var(--navy-2), var(--navy) 70%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 30px 60px -30px rgba(12, 22, 38, .55);
    color: #e9eef7;
    user-select: none;
    -webkit-user-select: none;
}

.tvmap__canvas {
    position: relative;
    aspect-ratio: 1000 / 522;          /* the map file's own shape (Mercator, 56°S to 76°N) */
}

.tvmap__svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    cursor: default;
}

.tvmap.is-zoomed .tvmap__svg { cursor: grab; touch-action: none; }
.tvmap.is-dragging .tvmap__svg { cursor: grabbing; }

.tvmap__grat {
    fill: none;
    stroke: rgba(255, 255, 255, .055);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.tvmap__lands path {
    fill: var(--land);
    stroke: var(--land-line);
    stroke-width: .6;
    vector-effect: non-scaling-stroke;
    transition: fill .5s ease;
}

.tvmap__lands path:hover { fill: #284063; }

.tvmap__lands path.is-transit {
    fill: #315f6d;
    stroke: #78aeb9;
}

.tvmap__lands path.is-transit:hover { fill: #3c7484; }

.tvmap__lands path.is-visited {
    fill: #b98a35;
    stroke: #f0cd86;
    transition-delay: var(--d, 0ms);
}

.tvmap__lands path.is-visited:hover { fill: #cf9c3f; }
.tvmap__lands path.is-hot { fill: var(--amber) !important; }

/* arcs */
.tvmap__arc {
    fill: none;
    stroke: var(--amber-soft);
    stroke-width: 1.2;
    stroke-linecap: round;
    opacity: .5;
    transition: opacity .45s ease;
}

.tvmap.has-active .tvmap__arc { opacity: .16; }

.tvmap__trace {
    fill: none;
    stroke: #fff3d6;
    stroke-width: 2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(246, 205, 122, .9));
    pointer-events: none;
}

.tvmap__comet {
    fill: #fff;
    filter: drop-shadow(0 0 6px #ffd98a);
    pointer-events: none;
    opacity: 0;
}

/* pins */
.tvmap__pin { cursor: pointer; }

.tvmap__pin-ring {
    fill: none;
    stroke: var(--coral);
    stroke-width: 1.4;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.tvmap__pin-dot {
    fill: var(--coral);
    stroke: #fff;
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), fill .3s;
}

.tvmap__pin-hit { fill: transparent; }

.tvmap__pin:hover .tvmap__pin-dot,
.tvmap__pin.is-active .tvmap__pin-dot { transform: scale(1.45); fill: #fff; stroke: var(--coral); }

.tvmap__pin--transit .tvmap__pin-dot { fill: #65bdca; stroke: #e8fbff; }
.tvmap__pin--transit .tvmap__pin-ring { stroke: #65bdca; }
.tvmap__pin--transit:hover .tvmap__pin-dot,
.tvmap__pin--transit:focus .tvmap__pin-dot { transform: scale(1.45); fill: #e8fbff; stroke: #65bdca; }

.tvmap__pin.is-active .tvmap__pin-ring { animation: tv-ping 2s ease-out infinite; }

@keyframes tv-ping {
    0% { opacity: .9; transform: scale(1); }
    100% { opacity: 0; transform: scale(4.2); }
}

.tvmap__pin.is-pop .tvmap__pin-dot { animation: tv-pop .5s cubic-bezier(.3, 1.7, .5, 1) backwards; animation-delay: var(--d, 0ms); }

@keyframes tv-pop {
    from { transform: scale(0); }
}

.tvmap__home-dot { fill: #fff; stroke: none; }
.tvmap__home-ring { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 1.2; }

/* labels / tooltip */
.tvmap__label,
.tvmap__tip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    padding: 4px 9px 5px;
    border-radius: 999px;
    background: rgba(255, 253, 248, .96);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    opacity: 0;
    transition: opacity .25s ease;
}

.tvmap__labels { position: absolute; inset: 0; pointer-events: none; }

.tvmap__label small,
.tvmap__tip small { margin-left: 5px; font-weight: 400; color: var(--ink-2); }

.tvmap__label.is-on, .tvmap__tip.is-on { opacity: 1; }

.tvmap__label--transit {
    color: #16434d;
    box-shadow: 0 0 0 1px rgba(101, 189, 202, .55), 0 6px 18px -6px rgba(0, 0, 0, .6);
}

.tvmap__label--home {
    background: transparent;
    color: rgba(255, 255, 255, .75);
    box-shadow: none;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: 1;
}

/* controls */
.tvmap__ctrl {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tvmap__btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    background: rgba(12, 22, 38, .6);
    color: #dfe7f3;
    font: 400 18px/1 var(--mono);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background .2s, border-color .2s, transform .2s;
}

.tvmap__btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .35); }
.tvmap__btn:active { transform: scale(.94); }
.tvmap__btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.tvmap__btn svg { width: 15px; height: 15px; vertical-align: -2px; }

.tvmap__legend {
    position: absolute;
    left: 14px;
    top: 12px;
    z-index: 2;
    display: flex;
    gap: 14px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(233, 238, 247, .62);
    pointer-events: none;
}

.tvmap__legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 2px;
    background: #b98a35;
    box-shadow: 0 0 0 1px #f0cd86 inset;
    vertical-align: -1px;
}

.tvmap__legend i.transit { background: #315f6d; box-shadow: 0 0 0 1px #78aeb9 inset; }
.tvmap__legend i.pin { border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1.5px #fff inset; }

/* the "now showing" strip */
.tvmap__now {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 62px;
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(8, 15, 27, .55);
}

.tvmap__now-body { flex: 1; min-width: 0; }

.tvmap__now-title {
    overflow: hidden;
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tvmap__now-sub {
    overflow: hidden;
    font-size: 13px;
    color: rgba(233, 238, 247, .68);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tvmap__now-go {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    color: #fff !important;
    font-size: 17px;
    line-height: 1;
    transition: background .25s, border-color .25s, transform .25s;
}

.tvmap__now-go:hover { background: var(--amber); border-color: var(--amber); color: var(--navy) !important; transform: translateX(3px); }

.tvmap__now.is-swap .tvmap__now-body { animation: tv-swap .45s cubic-bezier(.2, .8, .2, 1); }

@keyframes tv-swap {
    from { opacity: 0; transform: translateY(8px); }
}

/* ---------- right column ---------- */

.tv-tabs {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, .7);
}

.tv-tab {
    padding: 7px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font: 700 13px/1.2 'Lato', sans-serif;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .25s, color .25s;
}

.tv-tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.tv-tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.tv-list { margin-top: 26px; }

.tv-year {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 30px 0 12px !important;
    font-family: var(--hand);
    font-size: 54px;
    font-weight: 400;
    line-height: .9;
    color: var(--ink);
}

.tv-group + .tv-group { margin-top: 30px; }
.tv-group .tv-year { margin-top: 0 !important; }

.tv-year::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-top: 10px;
    background: var(--line);
}

.tv-group--home { margin-top: 44px !important; }
.tv-group--home .tv-year { color: #b9781c; }

/* trip card */
.tv-trip {
    position: relative;
    padding: 0 0 16px 30px;
}

.tv-trip::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.tv-trip__dot {
    position: absolute;
    left: 0;
    top: 20px;
    width: 13px;
    height: 13px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    background: var(--paper);
    transition: border-color .3s, background .3s, box-shadow .3s;
}

.tv-trip.is-active .tv-trip__dot {
    border-color: var(--coral);
    background: var(--coral);
    box-shadow: 0 0 0 5px rgba(255, 125, 92, .18);
}

.tv-trip__card {
    display: block;
    position: relative;
    padding: 15px 20px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s;
}

.tv-trip.is-active .tv-trip__card { border-color: #d8c49a; box-shadow: 0 18px 34px -24px rgba(27, 33, 48, .5); }
a.tv-trip__card:hover { transform: translateY(-2px); box-shadow: 0 20px 36px -24px rgba(27, 33, 48, .55); }

.tv-trip__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.tv-trip__title {
    min-width: 0;
    font-family: var(--serif);
    font-size: 23px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.tv-trip__month {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.tv-trip__cities { margin-top: 5px !important; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.tv-trip__cities .tv-city { white-space: nowrap; }
.tv-trip__cities i { margin-right: 5px; font-style: normal; }

.tv-trip__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #9a6212;
}

.tv-trip__more::after {
    content: "→";
    transition: transform .3s;
}

a.tv-trip__card:hover .tv-trip__more::after { transform: translateX(4px); }

/* by-place view */
.tv-cont {
    margin: 30px 0 12px !important;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}

.tv-cont:first-child { margin-top: 4px !important; }

.tv-places {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.tv-place {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s, box-shadow .3s;
}

.tv-place:hover, .tv-place:focus-visible {
    transform: translateY(-3px);
    border-color: #d8c49a;
    box-shadow: 0 18px 30px -22px rgba(27, 33, 48, .5);
    outline: none;
}

.tv-place__flag .tv-flag { width: 34px; height: 25.5px; margin: 0; border-radius: 4px; }

.tv-place__name {
    margin-top: 8px;
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 500;
    line-height: 1.2;
}

.tv-place__cities { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.tv-place__cities span { color: var(--muted); }

.tv-empty {
    padding: 40px 24px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    text-align: center;
    color: var(--muted);
}

.tv-foot {
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* ---------- narrower screens ---------- */

/* One column: the heading scrolls away and the map alone stays pinned above the list. */
@media (max-width: 1080px), (max-height: 700px) {
    .tv-layout { display: block; }
    .tv-stage { display: contents; }
    .tv-mapdock { position: sticky; top: var(--nav-h); z-index: 5; margin: 0 -10px 18px; padding: 8px 10px 0; background: var(--paper); }
    .tv-mapdock .tvmap { box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 18px -16px rgba(12, 22, 38, .55); }
}

/* With the map pinned above the list, each year's heading pins right under it until its trips have gone by. */
@media (max-width: 1080px), (max-height: 700px) {
    .tv-year {
        position: sticky;
        top: var(--tv-dock, 0px);
        z-index: 4;
        margin: 0 -10px 4px !important;
        padding: 24px 10px 8px;
        background: linear-gradient(var(--paper) 84%, rgba(246, 242, 234, 0));
    }
}

/* Tablets: the trips sit two to a row under each year instead of one long column. */
@media (min-width: 641px) and (max-width: 1080px) {
    .tv-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; align-items: stretch; }
    .tv-trip { display: flex; padding: 0 0 14px; }
    .tv-trip::before, .tv-trip__dot { display: none; }
    .tv-trip__card { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
    .tv-trip__more { margin-top: auto; padding-top: 8px; }
}

/* Short windows (landscape phones): a pinned map would leave no room to read. */
@media (max-height: 620px) {
    .tv-mapdock { position: static; }
}

@media (max-width: 640px) {
    .tv-wrap { width: calc(100% - 28px); padding: 26px 0 56px; }
    .tv-stats { gap: 8px 22px; margin: 16px 0 16px !important; }
    .tv-stat__num { font-size: 24px; }
    .tvmap { border-radius: 16px; }
    .tvmap__legend { display: none; }
    .tvmap__ctrl { top: 8px; right: 8px; gap: 4px; }
    .tvmap__btn { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
    .tvmap__now { min-height: 0; padding: 8px 12px; gap: 10px; }
    .tvmap__now-title { font-size: 15px; }
    .tvmap__now-sub { font-size: 12px; }
    .tvmap__now-go { width: 30px; height: 30px; font-size: 15px; }
    .tv-year { font-size: 46px; }
    .tv-trip { padding-left: 24px; }
    .tv-trip__title { font-size: 21px; }
    .tv-foot { flex-direction: column; }
}

/* =====================================================================
   A trip's own page (trip.html)
   ===================================================================== */

.trip-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted) !important;
    transition: color .2s, gap .2s;
}

.trip-back:hover { color: var(--ink) !important; gap: 12px; }

.trip-missing { display: none; padding: 60px 0; font-size: 18px; color: var(--ink-2); }
.trip-missing .trip-back { margin: 18px 0 0; }
.tv--trip.is-missing .trip-missing { display: block; }
.tv--trip.is-missing .trip-hero, .tv--trip.is-missing .trip-stops, .tv--trip.is-missing .trip-nav, .tv--trip.is-missing > .tv-wrap > .trip-back { display: none; }

.trip-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    gap: 48px;
    align-items: center;
}

.trip-title {
    margin-top: 12px !important;
    font-family: var(--serif);
    font-size: clamp(38px, 4.6vw, 68px);
    font-weight: 400;
    font-variation-settings: 'opsz' 144;
    line-height: 1.03;
    letter-spacing: -.02em;
    animation: tv-rise .9s cubic-bezier(.2, .8, .2, 1) backwards .08s;
}

.trip-places { margin-top: 14px; }
.trip-places .tv-trip__cities { margin: 0 !important; font-family: var(--serif); font-size: 21px; font-style: italic; font-weight: 300; line-height: 1.6; }
.trip-places .tv-flag { width: 24px; height: 18px; margin-right: 9px; }

.trip-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 34px;
    margin-top: 26px;
}

.trip-fact__k {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

.trip-fact__v { font-size: 17px; font-weight: 700; }

.trip-hero .tvmap__canvas { aspect-ratio: 16 / 9; }

/* ---------- the route on the map ---------- */

/* zoomed in this far the country fills the frame, so it is only tinted and the route carries the colour */
.tv--trip .tvmap__lands path.is-visited { fill: #2a4369; stroke: #6583b3; }
.tv--trip .tvmap__lands path.is-visited:hover { fill: #314c76; }

.tvleg, .tvkey { --c: rgba(255, 255, 255, .75); }
.tvleg--flight, .tvkey--flight { --c: #ffe6ae; }
.tvleg--train, .tvkey--train { --c: #ff9273; }
.tvleg--road, .tvkey--road { --c: #a6dd85; }
.tvleg--ship, .tvkey--ship { --c: #7ccdfb; }

.tvleg path, .tvkey path { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.tvleg__base { stroke-width: 1.6; opacity: .3; }
.tvleg__mark { stroke-width: 2; transition: opacity .4s ease, stroke-width .25s; }

/* flight: a dashed arc */
:is(.tvleg--flight, .tvkey--flight) .tvleg__mark { stroke-dasharray: 1.5 6.5; stroke-width: 2.4; }
/* train: a rail with sleepers */
:is(.tvleg--train, .tvkey--train) .tvleg__base { opacity: 1; stroke-width: 1.5; }
:is(.tvleg--train, .tvkey--train) .tvleg__mark { stroke-width: 7; stroke-dasharray: 1.6 6; stroke-linecap: butt; }
/* road: a solid lane with a centre line */
:is(.tvleg--road, .tvkey--road) .tvleg__base { opacity: 1; stroke-width: 4.2; }
:is(.tvleg--road, .tvkey--road) .tvleg__mark { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 4 4; stroke-linecap: butt; }
/* ship: dotted waves */
:is(.tvleg--ship, .tvkey--ship) .tvleg__base { opacity: .35; stroke-width: 1.2; }
:is(.tvleg--ship, .tvkey--ship) .tvleg__mark { stroke-width: 2.6; stroke-dasharray: .1 5.2; }
/* anything else: plain dashes */
:is(.tvleg--other, .tvkey--other) .tvleg__mark { stroke-dasharray: 5 5; stroke-width: 1.6; }

.tvleg.is-wait { opacity: 0; }
.tvleg.is-drawing .tvleg__base { opacity: 1; }
.tvleg.is-drawing .tvleg__mark, .tvleg.is-drawing .tvleg__badge { opacity: 0; }
.tvleg.is-active .tvleg__base { opacity: 1; }
.tvleg.is-active { filter: drop-shadow(0 0 5px var(--c)); }

.tvleg__badge { color: var(--c); transition: opacity .4s ease; }
.tvleg__badge circle { fill: var(--navy); stroke: var(--c); stroke-width: 1.3; }

.tvstop .tvmap__pin-dot { fill: #fffdf8; stroke: var(--coral); stroke-width: 2; }
.tvstop--solo .tvmap__pin-dot { fill: var(--coral); stroke: #fff; }
.tvstop__n { fill: var(--navy); font: 700 10.5px/1 'Lato', sans-serif; pointer-events: none; transition: fill .3s; }
.tvstop:hover .tvmap__pin-dot, .tvstop.is-active .tvmap__pin-dot { transform: scale(1.25); fill: var(--coral); stroke: #fff; }
.tvstop:hover .tvstop__n, .tvstop.is-active .tvstop__n { fill: #fff; }
.tvstop--solo .tvmap__pin-ring { animation: tv-ping 2.4s ease-out infinite; }
.tvstop.is-wait { opacity: 0; }
.tvstop.is-pop .tvmap__pin-dot { animation: none; }
.tvstop.is-pop .tvstop__in { transform-box: fill-box; transform-origin: center; animation: tv-pop .5s cubic-bezier(.3, 1.7, .5, 1) backwards; animation-delay: var(--d, 0ms); }

.tvmap__label--stop { padding: 3px 8px 4px; font-size: 12px; }
.tvmap__label--stop.is-fit { opacity: 1; }

.tvmap__legend--route { top: auto; bottom: 12px; flex-wrap: wrap; gap: 6px 16px; right: 14px; }
.tvkey { display: inline-flex; align-items: center; gap: 7px; color: rgba(233, 238, 247, .8); }
.tvkey svg { width: 30px; height: 10px; overflow: visible; }

/* ---------- stops: a line and photos each ---------- */

.tv-icon { width: 16px; height: 16px; flex: none; }

.trip-stops {
    width: min(960px, 100%);
    margin: 64px auto 0;
}

.trip-stop { position: relative; }
.trip-stop__city .tv-flag { width: 26px; height: 19.5px; margin-right: 11px; vertical-align: 0; }

/* several stops: an itinerary, joined by the same kinds of line as on the map */
.trip-stops--route .trip-stop { padding: 0 0 52px 64px; }
.trip-stops--route .trip-stop:last-of-type { padding-bottom: 8px; }

.trip-stop::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 4px;
    bottom: -4px;
    width: 8px;
    --c: var(--line);
}

.trip-stop--solo::before, .trip-stop--next-end::before { display: none; }
.trip-stop--next-none::before { background: repeating-linear-gradient(to bottom, #cfc4ae 0 3px, transparent 3px 9px) center / 2px 100% no-repeat; }
.trip-stop--next-flight::before { --c: #b9781c; background: repeating-linear-gradient(to bottom, var(--c) 0 3px, transparent 3px 11px) center / 2.5px 100% no-repeat; }
.trip-stop--next-train::before { --c: #d2553a; background: linear-gradient(var(--c), var(--c)) center / 2px 100% no-repeat, repeating-linear-gradient(to bottom, var(--c) 0 2px, transparent 2px 9px); }
.trip-stop--next-road::before { --c: #4d8f37; background: repeating-linear-gradient(to bottom, var(--paper) 0 6px, transparent 6px 12px) center / 1px 100% no-repeat, linear-gradient(var(--c), var(--c)) center / 5px 100% no-repeat; }
.trip-stop--next-ship::before { --c: #2c7fb8; background: radial-gradient(circle, var(--c) 1.7px, transparent 2.2px) center top / 8px 9px repeat-y; }

.trip-stop__no {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font: 700 14px/1 'Lato', sans-serif;
    box-shadow: 0 0 0 6px var(--paper);
    transition: background .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}

.trip-stop:hover .trip-stop__no { background: var(--coral); transform: scale(1.08); }

.trip-stop__leg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.trip-stop__leg--flight { color: #9a6212; }
.trip-stop__leg--train { color: #c2452a; }
.trip-stop__leg--road { color: #3f7d2c; }
.trip-stop__leg--ship { color: #1f6fa8; }

.trip-stop__city {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -.01em;
}

.trip-stop__city small { margin-left: 10px; font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }

.trip-stop__note {
    margin-top: 10px !important;
    max-width: 44em;
    font-family: var(--serif);
    font-size: 20px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.5;
    color: #2b3142;
}

/* one stop: the line is the centrepiece */
.trip-stop--solo .trip-stop__note {
    max-width: 30em;
    margin: 0 auto !important;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.4;
    text-align: center;
    text-wrap: balance;
}

.trip-stop--solo .trip-stop__note::before {
    content: "";
    display: block;
    width: 34px;
    height: 2px;
    margin: 0 auto 22px;
    background: var(--amber);
}

.trip-photos { display: grid; gap: 10px; margin-top: 20px; }
.trip-stop--solo .trip-photos { margin-top: 34px; }
.trip-photos--1 { grid-template-columns: minmax(0, 1fr); }
.trip-photos--2, .trip-photos--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-photos--3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.trip-photos--many { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.trip-photo {
    display: block;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px;
    background: var(--paper-2);
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
}

.trip-photos--1 .trip-photo { aspect-ratio: 16 / 9; }
.trip-photos--3 .trip-photo:first-child { grid-row: span 2; }
.trip-photos--3 .trip-photo:not(:first-child) { aspect-ratio: auto; }
.trip-photos--many .trip-photo { aspect-ratio: 1 / 1; }
.trip-photo.is-broken { display: none; }
.trip-photo:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.trip-photo { position: relative; }
.trip-photos--3 { grid-template-rows: repeat(2, minmax(0, 1fr)); }

/* out of the flow, so a photo's own shape never changes the size of its frame */
.trip-photo img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.trip-photo:hover img { transform: scale(1.045); }

.trip-empty {
    padding: 44px 24px 40px;
    border: 1px dashed #d3c8b2;
    border-radius: 18px;
    background:
        repeating-linear-gradient(45deg, transparent 0 14px, rgba(27, 33, 48, .02) 14px 15px),
        rgba(255, 253, 248, .6);
    text-align: center;
}

.trip-stop + .trip-empty { margin-top: 40px; }
.trip-empty p { font-family: var(--serif); font-size: 22px; font-style: italic; font-weight: 300; color: var(--ink); }
.trip-empty small { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }

/* a postage stamp with a wavy postmark */
.trip-empty__stamp {
    position: relative;
    width: 46px;
    height: 56px;
    margin: 0 auto 18px;
    border: 2px dashed #cdbf9f;
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(233, 176, 76, .35), rgba(255, 125, 92, .25));
    transform: rotate(-6deg);
}

.trip-empty__stamp::after {
    content: "";
    position: absolute;
    left: 30px;
    top: 14px;
    width: 46px;
    height: 20px;
    background: repeating-linear-gradient(to bottom, var(--muted) 0 1.5px, transparent 1.5px 6px);
    border-radius: 2px;
    opacity: .5;
}

.trip-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: min(960px, 100%);
    margin: 72px auto 0;
}

.trip-nav a {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}

.trip-nav a:hover { transform: translateY(-3px); border-color: #d8c49a; box-shadow: 0 18px 30px -22px rgba(27, 33, 48, .5); }
.trip-nav a.next { text-align: right; grid-column: 2; }
.trip-nav small { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.trip-nav b { font-family: var(--serif); font-size: 20px; font-weight: 500; }

.trip-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background: rgba(8, 13, 22, .93);
    cursor: zoom-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.trip-lightbox.is-on { opacity: 1; pointer-events: auto; }
.trip-lightbox figure { display: flex; flex-direction: column; align-items: center; min-width: 0; max-height: 100%; margin: 0; }

.trip-lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 96px);
    border-radius: 8px;
    transform: scale(.96);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.trip-lightbox.is-on img { transform: none; }
.trip-lightbox figcaption { margin-top: 12px; font-family: var(--mono, monospace); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

.trip-lightbox__nav {
    flex: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s;
}

.trip-lightbox__nav:hover { background: rgba(255, 255, 255, .2); }
.trip-lightbox.is-single .trip-lightbox__nav { visibility: hidden; }

@media (max-width: 1000px) {
    .trip-hero { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .trip-hero .tvmap__canvas { aspect-ratio: 16 / 10; }
    .trip-stops { margin-top: 44px; }
}

@media (max-width: 640px) {
    .trip-back { margin-bottom: 18px; }
    .trip-places .tv-trip__cities { font-size: 18px; }
    .trip-facts { gap: 10px 26px; margin-top: 18px; }
    .trip-hero .tvmap__canvas { aspect-ratio: 4 / 3.3; }
    .tvmap__legend--route { display: flex; left: 10px; bottom: 9px; gap: 4px 12px; font-size: 9.5px; }
    .trip-stops { margin-top: 36px; }
    .trip-stops--route .trip-stop { padding: 0 0 40px 46px; }
    .trip-stop::before { left: 10px; }
    .trip-stop__no { width: 28px; height: 28px; font-size: 12.5px; box-shadow: 0 0 0 5px var(--paper); }
    .trip-stop__city { font-size: 25px; }
    .trip-stop__note { font-size: 17.5px; }
    .trip-photos { gap: 6px; }
    .trip-photos--many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trip-photo { border-radius: 9px; }
    .trip-nav { grid-template-columns: minmax(0, 1fr); margin-top: 48px; }
    .trip-nav a.next { grid-column: auto; }
    .trip-lightbox { padding: 10px; gap: 4px; }
    .trip-lightbox__nav { position: absolute; bottom: 18px; }
    .trip-lightbox__nav.prev { left: 18px; }
    .trip-lightbox__nav.next { right: 18px; }
}
