/**
 * /assets/css/pages/itineraries.css
 *
 * Styles for /itineraries/ (hub) and /itineraries/{slug}/ (route template).
 * Follows the numbered-row motif already used for .destination-item and
 * .charter-item elsewhere on the site, rather than introducing a new visual
 * language - a route is just another list of things to explore.
 */

/* ============================================================
   HUB - route cards
   ============================================================ */
.route-card-list {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.route-card-link {
    display: grid;
    gap: 2.5rem;
    text-decoration: none;
    color: inherit;
}

/* The chart carries the route at a glance, so it gets the wider half. It
   swaps sides every other card, the same zig-zag the day list uses. */
@media (min-width: 900px) {
    .route-card-link {
        grid-template-columns: 1.15fr 1fr;
        gap: 4rem;
        align-items: center;
    }

    /* The chart swaps sides on every other card, and the tracks swap with it -
       order alone would hand the wider track to the text and shrink the chart
       on half the cards. */
    .route-card:nth-child(even) .route-card-link {
        grid-template-columns: 1fr 1.15fr;
    }

    .route-card:nth-child(even) .route-card-chart { order: 2; }
}

.route-card-chart {
    position: relative;
    margin: 0;
    border: 1px solid rgba(248, 246, 241, 0.09);
    border-radius: 0.75rem;
    overflow: hidden;
    background: #04070d;
}

/* Ticks at the corners, the way the route page frames its live map. */
.route-card-chart::before,
.route-card-chart::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    border-color: rgba(212, 175, 55, 0.45);
    border-style: solid;
    transition: border-color 0.5s ease;
}

.route-card-chart::before {
    top: 12px;
    left: 12px;
    border-width: 1px 0 0 1px;
}

.route-card-chart::after {
    right: 12px;
    bottom: 12px;
    border-width: 0 1px 1px 0;
}

.route-card-chart img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.6s ease;
    opacity: 0.92;
}

.route-card-index {
    position: absolute;
    top: 0.9rem;
    right: 1.2rem;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gold);
    opacity: 0.55;
}

/* The route's number draws itself on as the card arrives: slower than the
   card, so it reads as a hand writing it in the corner of the chart rather
   than as another thing fading up. Armed by JS (see itineraries/index.php),
   so the page renders the finished state and nothing here can hide a number
   from a reader without scripts. */
.route-card.is-armed .route-card-index {
    opacity: 0;
    transform: translateY(0.6rem) scale(0.9);
    letter-spacing: 0.3em;
}

.route-card.is-in .route-card-index {
    opacity: 0.55;
    transform: none;
    letter-spacing: 0;
    transition: opacity 1.6s ease 0.25s,
                transform 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s,
                letter-spacing 1.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}

/* The figures rise into place under their labels as the card arrives, each a
   beat behind the one before. Numbers also count up (see index.php); a port
   is a word, so the rise is all it gets. */
.route-card.is-armed .route-flip {
    opacity: 0;
    transform: translateY(0.4em);
}

.route-card.is-in .route-flip {
    opacity: 1;
    transform: none;
    transition: opacity 0.9s ease var(--flip-delay, 0s),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1) var(--flip-delay, 0s);
}

.route-card-spec > div:nth-child(1) { --flip-delay: 0.3s; }
.route-card-spec > div:nth-child(2) { --flip-delay: 0.42s; }
.route-card-spec > div:nth-child(3) { --flip-delay: 0.54s; }
.route-card-spec > div:nth-child(4) { --flip-delay: 0.66s; }

/* the value and its unit travel together */
.route-card.is-armed .route-card-spec dd { opacity: 0; }
.route-card.is-in .route-card-spec dd {
    opacity: 1;
    transition: opacity 0.9s ease var(--flip-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
    .route-card.is-armed .route-card-index { opacity: 0.55; transform: none; letter-spacing: 0; }
    .route-card.is-in .route-card-index { transition: none; }
    .route-card.is-armed .route-flip,
    .route-card.is-armed .route-card-spec dd { opacity: 1; transform: none; }
    .route-card.is-in .route-flip,
    .route-card.is-in .route-card-spec dd { transition: none; }
}

.route-card-eyebrow {
    margin: 0 0 0.9rem;
    font-size: 0.58rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.35);
}

.route-card-name {
    margin: 0 0 1.1rem;
    font-size: 2.1rem;
    line-height: 1.15;
    color: rgba(248, 246, 241, 0.96);
    transition: color 0.4s ease;
}

.route-card-summary {
    max-width: 34rem;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.9;
    color: rgba(248, 246, 241, 0.5);
}

/* Every port the week calls at, in order, strung on middots. */
.route-card-ports {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.42);
}

.route-card-ports li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.route-card-ports li + li::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--gold);
    opacity: 0.55;
    transform: rotate(45deg);
}

.route-card-ports li:first-child,
.route-card-ports li:last-child { color: var(--gold); }

.route-card-spec {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
    margin: 0 0 1.75rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(248, 246, 241, 0.08);
    border-bottom: 1px solid rgba(248, 246, 241, 0.08);
}

@media (min-width: 560px) {
    .route-card-spec { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.route-card-spec dt {
    margin-bottom: 0.4rem;
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.3);
}

.route-card-spec dd {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gold);
}

.route-card-spec dd span {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* A pair of port names is words, not a figure, so it is set at reading size. */
.route-card-spec dd.route-card-ports-pair {
    font-size: 1rem;
    line-height: 1.3;
    color: rgba(248, 246, 241, 0.85);
}

.route-card-ports-pair span {
    margin: 0 0.4rem;
    color: var(--gold);
    opacity: 0.7;
}

.route-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.62rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
}

.route-card-arrow {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hover belongs to the whole card: the chart lifts a little, the name goes
   gold, the arrow moves off. */
.route-card-link:hover .route-card-chart img {
    transform: scale(1.04);
    opacity: 1;
}

.route-card-link:hover .route-card-chart::before,
.route-card-link:hover .route-card-chart::after { border-color: var(--gold); }

.route-card-link:hover .route-card-name { color: var(--gold); }

.route-card-link:hover .route-card-arrow { transform: translateX(6px); }

@media (prefers-reduced-motion: reduce) {
    .route-card-chart img,
    .route-card-arrow { transition: none; }
    .route-card-link:hover .route-card-chart img { transform: none; }
    .route-card-link:hover .route-card-arrow { transform: none; }
}

/* ============================================================
   ROUTE PAGE - hero
   ============================================================ */
/* The shared hero is a fixed 60vh box with its content bottom-aligned and
   overflow hidden, which works while the title fits on one line. A route
   name wraps to two, and the extra line grows upward into the header. Here
   the box grows with its content instead.

   min() rather than a bare 60vh: Google's renderer lays the page out with a
   viewport thousands of pixels tall, and a vh-driven minimum would push the
   whole page out of its screenshot. See CLAUDE.md, "GSC Rendering Gotcha". */
.itinerary-page .page-hero {
    height: auto;
    min-height: min(60vh, 620px);
    max-height: none;
}

/* ============================================================
   ROUTE PAGE - the week as a line of ports, then its numbers
   ============================================================ */
.itinerary-ribbon-section {
    padding: 5rem 8vw 6rem;
    border-bottom: 1px solid rgba(248, 246, 241, 0.07);
}

/* Ports in sailing order, strung on a hairline. On a phone it becomes a
   horizontal strip you can push along rather than a stack of names. */
.itinerary-ribbon {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
    list-style: none;
    margin: 0 0 3.5rem;
    padding: 0 0 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.itinerary-ribbon::-webkit-scrollbar { display: none; }

.itinerary-ribbon-stop {
    position: relative;
    flex: 1 0 auto;
    min-width: 9rem;
    padding-top: 1.6rem;
    padding-right: 2rem;
}

/* the hairline itself, drawn per stop so it stops at the last one */
.itinerary-ribbon-stop::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(212, 175, 55, 0.25);
}

.itinerary-ribbon-stop:last-child { flex: 0 0 auto; padding-right: 0; }
.itinerary-ribbon-stop:last-child::before { right: auto; width: 0; }

.itinerary-ribbon-mark {
    position: absolute;
    top: 0;
    left: 0;
    width: 9px;
    height: 9px;
    border: 1px solid var(--gold);
    background: var(--void);
    transform: rotate(45deg);
}

.itinerary-ribbon-stop:first-child .itinerary-ribbon-mark,
.itinerary-ribbon-stop:last-child .itinerary-ribbon-mark {
    background: var(--gold);
}

.itinerary-ribbon-name {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.55);
    white-space: nowrap;
}

/* On a phone there is no room for one long line, and a strip you have to
   push along hides half the week. The ports wrap instead, as many to a row
   as fit, with the diamond carried at the END of each name: a row can only
   break after a separator, so every new row starts with a port rather than
   with a mark left hanging in front of it. */
@media (max-width: 767px) {
    .itinerary-ribbon {
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.65rem 0.85rem;
        overflow: visible;
        padding-bottom: 0;
        margin-bottom: 2.5rem;
    }

    .itinerary-ribbon-stop {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        flex: 0 0 auto;
        min-width: 0;
        padding: 0;
        white-space: nowrap;
    }

    /* the rail and the mark above the name belong to the wide layout */
    .itinerary-ribbon-stop::before,
    .itinerary-ribbon-mark { display: none; }

    .itinerary-ribbon-stop:not(:last-child)::after {
        content: '';
        width: 5px;
        height: 5px;
        flex-shrink: 0;
        background: var(--gold);
        opacity: 0.55;
        transform: rotate(45deg);
    }

    /* embarkation and the last port carry the gold the marks used to */
    .itinerary-ribbon-stop:first-child .itinerary-ribbon-name,
    .itinerary-ribbon-stop:last-child .itinerary-ribbon-name {
        color: var(--gold);
    }

    .itinerary-ribbon-name { font-size: 0.62rem; letter-spacing: 0.16em; }
}

/* The week's numbers as a spec sheet: label above value, hairline between. */
.itinerary-spec-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 0;
    margin: 0;
    padding: 2rem 0 0;
    border-top: 1px solid rgba(248, 246, 241, 0.08);
}

@media (min-width: 768px) {
    .itinerary-spec-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.itinerary-spec {
    padding-left: 1.75rem;
    border-left: 1px solid rgba(248, 246, 241, 0.08);
}

/* Whichever cell starts a row loses its rule: every other one below 768px,
   only the first once the rail is a single row of four. */
.itinerary-spec:nth-child(odd) { padding-left: 0; border-left: 0; }

@media (min-width: 768px) {
    .itinerary-spec:nth-child(odd) { padding-left: 1.75rem; border-left: 1px solid rgba(248, 246, 241, 0.08); }
    .itinerary-spec:first-child { padding-left: 0; border-left: 0; }
}

.itinerary-spec dt {
    margin-bottom: 0.6rem;
    font-size: 0.55rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.3);
}

.itinerary-spec dd {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 2rem;
    line-height: 1;
    color: var(--gold);
}

.itinerary-spec dd span {
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* A port is a word, not a figure, so it is set at reading size rather than
   at the size of the numbers beside it. */
.itinerary-spec dd.itinerary-spec-port {
    font-size: 1.5rem;
    color: rgba(248, 246, 241, 0.9);
}

.itinerary-spec-note {
    margin: 0.7rem 0 0;
    font-size: 0.7rem;
    font-weight: 300;
    line-height: 1.5;
    color: rgba(248, 246, 241, 0.3);
}

/* ── the ribbon drawing itself in ───────────────────────────────────────
   Armed by JS (see route.php), so the page's own rendering is the finished
   state: nothing here hides anything until something is there to show it. */
.itinerary-ribbon-section.is-armed .itinerary-ribbon-stop::before {
    transform: scaleX(0);
    transform-origin: left center;
}

.itinerary-ribbon-section.is-armed .itinerary-ribbon-mark {
    opacity: 0;
    transform: rotate(45deg) scale(0.2);
}

.itinerary-ribbon-section.is-armed .itinerary-ribbon-name {
    opacity: 0;
    transform: translateY(8px);
}

.itinerary-ribbon-section.is-armed .itinerary-spec {
    opacity: 0;
    transform: translateY(16px);
}

/* Each stop carries its place in the running order as --i, so the line
   reaches a port, the diamond lands, and the name settles under it. */
.itinerary-ribbon-section.is-in .itinerary-ribbon-stop::before {
    transform: scaleX(1);
    transition: transform 0.55s cubic-bezier(0.33, 0, 0.2, 1) calc(var(--i, 0) * 130ms);
}

.itinerary-ribbon-section.is-in .itinerary-ribbon-mark {
    opacity: 1;
    transform: rotate(45deg) scale(1);
    transition: opacity 0.4s ease calc(var(--i, 0) * 130ms),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i, 0) * 130ms);
}

.itinerary-ribbon-section.is-in .itinerary-ribbon-name {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease calc(var(--i, 0) * 130ms + 160ms),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 130ms + 160ms);
}

/* The figures come in behind the line, once it has run the week. */
.itinerary-ribbon-section.is-in .itinerary-spec {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease calc(var(--i, 0) * 120ms + 850ms),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--i, 0) * 120ms + 850ms);
}

/* ============================================================
   ROUTE PAGE - overview map
   ============================================================ */
/* The map sits in a frame with ticks at the corners, the way a chart is
   pinned down. The ticks are drawn on the wrapper's own corners so they
   survive the map redrawing itself. */
.itinerary-map-wrap {
    position: relative;
    border: 1px solid rgba(248, 246, 241, 0.08);
    border-radius: 0.75rem;
    overflow: hidden;
}

.itinerary-map-wrap::before,
.itinerary-map-wrap::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 500;
    border-color: rgba(212, 175, 55, 0.5);
    border-style: solid;
}

.itinerary-map-wrap::before {
    top: 14px;
    left: 14px;
    border-width: 1px 0 0 1px;
}

.itinerary-map-wrap::after {
    right: 14px;
    bottom: 14px;
    border-width: 0 1px 1px 0;
}

.itinerary-map-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2.5rem;
    margin-top: 1.25rem;
}

.itinerary-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.itinerary-map-legend li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.35);
}

.itinerary-map-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1px solid var(--gold);
    border-radius: 50%;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.7rem;
    letter-spacing: 0;
    color: var(--gold);
}

.itinerary-map-key--start {
    background: var(--gold);
    color: var(--void);
}

.itinerary-map-key--line {
    width: 26px;
    height: 0;
    border: 0;
    border-top: 1px dashed var(--gold);
    border-radius: 0;
}

/* Leaflet's own stylesheet loads after this one and paints .leaflet-container
   a light grey, which then shows through the hairline seams between tiles as
   bright lines across a dark map. Matching its specificity settles it. */
.itinerary-map,
.itinerary-map.leaflet-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #05070c;
}

@media (max-width: 640px) {
    /* same two classes as the rule above, or Leaflet's specificity wins and
       the map stays letterboxed on a phone */
    .itinerary-map,
    .itinerary-map.leaflet-container { aspect-ratio: 4 / 5; }
}

.itinerary-map-caption {
    margin: 0;
    font-size: 0.68rem;
    color: rgba(248, 246, 241, 0.25);
    font-style: italic;
}

/* No filter or tint overlay here on purpose: the basemap's own palette is
   rewritten in itinerary-map.php, which is exact, whereas a filter would
   drag the route and markers' colours around with it. */

.itinerary-map .leaflet-control-zoom a {
    background: rgba(2, 2, 4, 0.85);
    color: var(--gold);
    border-color: rgba(212, 175, 55, 0.25) !important;
}

.itinerary-map .leaflet-control-zoom a:hover {
    background: rgba(2, 2, 4, 1);
}

/* Attribution has to stay (OSM and Esri both require it), but it can sit
   quietly in the corner instead of in a white box. The extra .leaflet-control
   is there to out-rank Leaflet's own two-class rule, which would otherwise win
   the tie on source order and paint this white. */
.itinerary-map .leaflet-control-attribution.leaflet-control {
    /* a soft fade rather than a white box, so the credit stays legible over
       pale coastline without drawing the eye */
    background: linear-gradient(to left, rgba(2, 2, 4, 0.6), rgba(2, 2, 4, 0));
    color: rgba(248, 246, 241, 0.42);
    font-size: 0.55rem;
    letter-spacing: 0.03em;
    padding: 0.1rem 0.6rem;
    text-shadow: 0 1px 2px rgba(2, 2, 4, 0.9);
}

.itinerary-map .leaflet-control-attribution.leaflet-control a {
    color: rgba(248, 246, 241, 0.55);
    text-decoration: none;
    transition: color 0.3s ease;
}

.itinerary-map .leaflet-control-attribution.leaflet-control a:hover {
    color: var(--gold);
}

/* Leaflet's own flag badge is decoration, not attribution. */
.itinerary-map .leaflet-attribution-flag { display: none; }

.itinerary-map-pin span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(2, 2, 4, 0.92);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.85rem;
}

/* A harbour the week calls at more than once - Split as embarkation, day 7
   and day 8; Hvar as day 4 and day 5 - wears every one of those days rather
   than hiding the later ones under the first pin. */
/* The marker box is sized in JS for the finished pill; the pill itself is
   only as wide as the days showing so far, centred in that box, so it can
   grow as the route comes back to the same harbour. */
/* Leaflet's own stylesheet loads after this one and gives .leaflet-marker-icon
   display:block at the same specificity, which would win the tie and leave the
   pill stretched to the full marker box. The extra .itinerary-map settles it. */
.itinerary-map .itinerary-map-pin--multi {
    display: flex;
    align-items: center;
    justify-content: center;
}

.itinerary-map-pin--multi span {
    width: auto;
    min-width: 26px;
    height: 26px;
    padding: 0 0.7rem;
    border-radius: 100px;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.itinerary-map-badge {
    display: inline-block;
    font-style: italic;
}

/* Draw-in: a day only appears on the pill once the line has sailed it, so
   Split starts the week as S and picks up 7 and 8 on the way home. Outside
   the animation - reduced motion, no JS, a finished map - every day is
   simply there. */
.itinerary-map.is-animating .itinerary-map-badge {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.itinerary-map.is-animating .itinerary-map-badge.is-in {
    max-width: 3ch;
    opacity: 1;
}

/* Draw-in: while the route is sailing itself in, each stop stays dark until
   the line reaches it. Scoped to .is-animating so the pins are always visible
   when the animation is skipped (reduced motion, no JS, older browser). */
.itinerary-map.is-animating .itinerary-map-pin span {
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.itinerary-map.is-animating .itinerary-map-pin.is-in span {
    opacity: 1;
    transform: scale(1);
}

/* The light at the head of the line, like a masthead lamp running ahead. */
.itinerary-map-head span {
    display: block;
    width: 10px;
    height: 10px;
    margin: 2px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18),
                0 0 14px 4px rgba(212, 175, 55, 0.55);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.itinerary-map-head.is-done span {
    opacity: 0;
    transform: scale(2.2);
}

.itinerary-map-pin--start span {
    background: var(--gold);
    color: var(--void);
}

/* ============================================================
   ROUTE PAGE - map popup (one card per place, paged by day)
   ============================================================ */
.leaflet-popup.itinerary-pop-wrap .leaflet-popup-content-wrapper {
    background: linear-gradient(160deg, rgba(10, 13, 19, 0.98), rgba(3, 4, 7, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 0.65rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    color: var(--cream);
}

.leaflet-popup.itinerary-pop-wrap .leaflet-popup-content {
    margin: 1rem 1.1rem 0.9rem;
    font-family: 'Inter', sans-serif;
}

.leaflet-popup.itinerary-pop-wrap .leaflet-popup-tip {
    background: rgba(6, 8, 12, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.28);
}

.leaflet-popup.itinerary-pop-wrap .leaflet-popup-close-button {
    color: rgba(248, 246, 241, 0.35);
    font-weight: 300;
    padding: 0.45rem 0.5rem 0 0;
    transition: color 0.3s ease;
}

.leaflet-popup.itinerary-pop-wrap .leaflet-popup-close-button:hover {
    color: var(--gold);
    background: transparent;
}

.itinerary-pop-place {
    margin: 0 0 0.6rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(248, 246, 241, 0.08);
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.4);
}

/* The viewport clips the slides; the track slides them past it. */
.itinerary-pop-viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.itinerary-pop-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* While a finger is down the card tracks it exactly, so the easing that makes
   the release feel springy is switched off. */
.itinerary-pop-track.is-dragging { transition: none; }

.itinerary-pop-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.itinerary-pop-eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
}

.itinerary-pop-title {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.25;
    color: rgba(248, 246, 241, 0.95);
}

.itinerary-pop-meta {
    display: flex;
    gap: 0.9rem;
    margin: 0.5rem 0 0;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.4);
}

.itinerary-pop-meta span + span {
    padding-left: 0.9rem;
    border-left: 1px solid rgba(248, 246, 241, 0.12);
}

/* Dots say where you are; the arrows say you can move - a swipe on its own
   is invisible until someone happens to try it. */
.itinerary-pop-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.itinerary-pop-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--gold);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

.itinerary-pop-arrow:hover:not(:disabled) {
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--gold);
}

.itinerary-pop-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.itinerary-pop-dots {
    display: flex;
    gap: 0.4rem;
    margin-right: auto;
}

.itinerary-pop-dot {
    width: 16px;
    height: 2px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: rgba(248, 246, 241, 0.18);
    cursor: pointer;
    transition: background 0.3s ease, width 0.3s ease;
}

.itinerary-pop-dot.is-current {
    width: 26px;
    background: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
    .itinerary-pop-track { transition: none; }
}

/* ============================================================
   ROUTE PAGE - day by day
   ============================================================ */
/* minmax(0, 1fr), never a bare 1fr: a grid track sized by a plain fr still
   refuses to go below its items' min-content width, and the day nav is a
   nowrap row of every stop on the route. Left at 1fr the track inflates to
   that row's full width and drags the day text off the side of the screen. */
.itinerary-days-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 5rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .itinerary-days-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
}

/* Sticky day list. Set as a ship's list of calls: number, then port, with
   the current one carried out to the gold. */
.itinerary-nav {
    position: sticky;
    top: 130px;
}

.itinerary-nav-label { margin-bottom: 1.75rem; }

.itinerary-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.itinerary-nav-item { border-top: 1px solid rgba(248, 246, 241, 0.06); }
.itinerary-nav-item:first-child { border-top: none; }

.itinerary-nav-link {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.7rem 0;
    color: rgba(248, 246, 241, 0.38);
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.4;
    transition: color 0.4s ease;
}

.itinerary-nav-link:hover { color: rgba(248, 246, 241, 0.7); }

.itinerary-nav-link.is-current { color: var(--gold); }

.itinerary-nav-num {
    flex-shrink: 0;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    color: rgba(248, 246, 241, 0.22);
    transition: color 0.4s ease;
}

.itinerary-nav-link:hover .itinerary-nav-num,
.itinerary-nav-link.is-current .itinerary-nav-num { color: var(--gold); }

@media (max-width: 1023px) {
    .itinerary-nav {
        position: sticky;
        top: 76px;
        z-index: 20;
        background: var(--void);
        padding: 1rem 0;
        margin: 0 -6vw;
        padding-left: 6vw;
        border-bottom: 1px solid rgba(248, 246, 241, 0.06);
    }
    /* specific enough to beat the eyebrow rule, which sets these to flex */
    .itinerary-page .itinerary-days-section .itinerary-nav-label,
    .itinerary-nav-label { display: none; }
    .itinerary-nav-list {
        display: flex;
        gap: 1.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 6vw;
        scrollbar-width: none;
    }
    .itinerary-nav-list::-webkit-scrollbar { display: none; }
    .itinerary-nav-item { border-top: none; flex-shrink: 0; }
    .itinerary-nav-link { padding: 0.25rem 0; white-space: nowrap; }
    .itinerary-days-grid .itinerary-day:first-child { padding-top: 2.5rem; }
}

/* ============================================================
   ROUTE PAGE - day articles
   ============================================================ */
.itinerary-day-list {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* The rail: a hairline down the left of the days, with a gold line that
   fills to wherever the reader has got to - the same line the map draws,
   carried into the reading. Phones get neither; there is no room. */
.itinerary-day-progress {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    background: linear-gradient(to bottom,
        rgba(212, 175, 55, 0) 0,
        rgba(212, 175, 55, 0.55) 140px,
        var(--gold) 340px);
    height: 0;
    pointer-events: none;
}

.itinerary-day {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 3rem 0;
    border-top: 1px solid rgba(248, 246, 241, 0.06);
    scroll-margin-top: 110px;
}

.itinerary-day:first-child { padding-top: 0; }

.itinerary-day-head {
    position: relative;
    margin-bottom: 1.75rem;
}

/* The day's number, drawn as an outline. It is decoration - the day is
   already announced in words underneath - so it is aria-hidden in the
   markup and can be as large as it likes. */
.itinerary-day-num {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 2.75rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px rgba(212, 175, 55, 0.45);
    text-stroke: 1px rgba(212, 175, 55, 0.45);
    transition: -webkit-text-stroke-color 0.5s ease, color 0.5s ease;
}

/* Browsers without text-stroke would render nothing at all, so they get the
   old solid numeral instead. */
@supports not ((-webkit-text-stroke: 1px red) or (text-stroke: 1px red)) {
    .itinerary-day-num { color: rgba(212, 175, 55, 0.4); }
}

.itinerary-day.is-current .itinerary-day-num {
    -webkit-text-stroke-color: var(--gold);
    color: rgba(212, 175, 55, 0.08);
}

.itinerary-day-date {
    margin: 0 0 0.5rem;
    font-size: 0.6rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.75;
}

.itinerary-day-title {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.15;
    color: rgba(248, 246, 241, 0.96);
}

/* Where the day goes, how far, how long - set as a spec sheet rather than
   as pills, so the numbers line up down the page. */
.itinerary-day-spec {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin: 0 0 1.75rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(248, 246, 241, 0.08);
    border-bottom: 1px solid rgba(248, 246, 241, 0.08);
}

.itinerary-day-spec-item {
    min-width: 0;
}

.itinerary-day-spec dt {
    margin-bottom: 0.4rem;
    font-size: 0.52rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(248, 246, 241, 0.3);
}

.itinerary-day-spec dd {
    margin: 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.2;
    color: rgba(248, 246, 241, 0.8);
}

.itinerary-day-spec dd span {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--gold);
}

.itinerary-day-spec-arrow {
    margin: 0 0.5rem;
    color: var(--gold);
    opacity: 0.6;
}

.itinerary-day-desc {
    max-width: 42rem;
    margin: 0 0 1.75rem;
    color: rgba(248, 246, 241, 0.58);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.95;
}

.itinerary-day-highlights {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 42rem;
}

.itinerary-day-highlights li {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(248, 246, 241, 0.05);
    font-size: 0.85rem;
    color: rgba(248, 246, 241, 0.45);
    font-weight: 300;
    line-height: 1.6;
}

.itinerary-day-highlights li:last-child { padding-bottom: 0; }

/* From the tablet up the days hang off the rail: hairline, a diamond node
   per day that lights as you reach it, then the day itself. */
@media (min-width: 768px) {
    .itinerary-day-list { padding-left: 4.5rem; }

    .itinerary-day-progress { display: block; }

    .itinerary-day {
        padding: 4rem 0;
        border-top: 0;
    }

    /* the faint rail, drawn per day so it runs the length of the list */
    .itinerary-day::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: -4.5rem;
        width: 1px;
        background: rgba(248, 246, 241, 0.09);
    }

    /* The node sits on the rail beside the day's number - hung off the head
       rather than off the article, so a day that opens with a photograph
       keeps its node level with the number rather than halfway up the
       picture. */
    .itinerary-day-head::before {
        content: '';
        position: absolute;
        top: 0.85rem;
        left: -4.5rem;
        width: 9px;
        height: 9px;
        margin-left: -4px;
        background: var(--void);
        border: 1px solid rgba(248, 246, 241, 0.25);
        transform: rotate(45deg);
        transition: border-color 0.5s ease, background 0.5s ease, transform 0.5s ease;
    }

    .itinerary-day:first-child { padding-top: 1rem; }

    .itinerary-day.is-current .itinerary-day-head::before {
        background: var(--gold);
        border-color: var(--gold);
        transform: rotate(45deg) scale(1.15);
    }

    .itinerary-day-head { padding-top: 0.25rem; }

    .itinerary-day-num { font-size: 3.5rem; }

    .itinerary-day-title { font-size: 2.4rem; }
}

.itinerary-day-figure {
    margin: 0 0 1.75rem;
    max-width: 42rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.itinerary-day-figure--middle,
.itinerary-day-figure--bottom {
    margin-top: 2rem;
}

.itinerary-day-figure img {
    width: 100%;
    display: block;
}

.itinerary-day-figure figcaption {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    font-style: italic;
    color: rgba(248, 246, 241, 0.3);
}

.itinerary-day-image {
    margin: 0 0 1.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.itinerary-day-image img {
    width: 100%;
    display: block;
}

.diamond-mark {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 0.5rem;
    background: var(--gold);
    transform: rotate(45deg);
    opacity: 0.85;
}

/* ============================================================
   ROUTE PAGE - where a day's gallery sits (see 'media_layout')
   ============================================================ */
/* Stacked - what every layout does below the two-column breakpoint, and what
   'below'/'above' do at every width. */
.itinerary-day-media { margin-top: 2.25rem; }

.itinerary-day--media-above .itinerary-day-media {
    order: -1;
    margin: 0 0 2.25rem;
}

/* Beside the text: 'right', 'left', or the side 'alternate' resolved to in
   itinerary-days.php. 1320px, not 1100: the sticky day nav and the rail
   already take their share of the container, and a photo column any earlier
   squeezes the text to about 45 characters. */
@media (min-width: 1320px) {
    .itinerary-day-list { --media-col: clamp(300px, 24vw, 400px); }

    :is(.itinerary-day--media-right, .itinerary-day--media-left) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--media-col);
        gap: clamp(2.5rem, 4vw, 4.5rem);
        align-items: center;
    }

    :is(.itinerary-day--media-right, .itinerary-day--media-left) .itinerary-day-body {
        grid-row: 1;
        grid-column: 1;
    }

    :is(.itinerary-day--media-right, .itinerary-day--media-left) .itinerary-day-media {
        grid-row: 1;
        grid-column: 2;
        margin-top: 0;
    }

    .itinerary-day--media-left {
        grid-template-columns: var(--media-col) minmax(0, 1fr);
    }

    .itinerary-day--media-left .itinerary-day-body { grid-column: 2; }
    .itinerary-day--media-left .itinerary-day-media { grid-column: 1; }

    /* A day with no photographs has no second column to balance against, so
       its text takes the full width back. */
    :is(.itinerary-day--media-right, .itinerary-day--media-left) .itinerary-day-body:only-child {
        grid-column: 1 / -1;
    }

    :is(.itinerary-day--media-right, .itinerary-day--media-left) :is(.itinerary-day-desc, .itinerary-day-highlights, .itinerary-day-figure) {
        max-width: 34rem;
    }

    :is(.itinerary-day--media-right, .itinerary-day--media-left) .itinerary-day-body:only-child :is(.itinerary-day-desc, .itinerary-day-highlights, .itinerary-day-figure) {
        max-width: 42rem;
    }
}

/* ============================================================
   ROUTE PAGE - captain's note
   ============================================================ */
/* The note belongs to the day list above it, not to the CTA below, so it
   sits close under the days with a rule leading into it. */
.itinerary-disclaimer-section {
    padding: 0 8vw 4rem;
    margin-top: -0.5rem;
}

@media (min-width: 768px) {
    .itinerary-disclaimer-section { margin-top: -2rem; }
}

.itinerary-note {
    display: grid;
    gap: 1rem 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(248, 246, 241, 0.08);
}

@media (min-width: 900px) {
    .itinerary-note { grid-template-columns: 14rem minmax(0, 1fr); }
}

.itinerary-note-label {
    margin: 0;
    font-size: 0.55rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
}

.itinerary-disclaimer {
    max-width: 44rem;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.95;
    color: rgba(248, 246, 241, 0.28);
}

/* ============================================================
   ROUTE PAGE - finishing
   ============================================================ */
/* The hero's chart fades into the ribbon below it, so the two read as one
   opening rather than two stacked blocks. */
.itinerary-page .page-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 18vh;
    background: linear-gradient(to bottom, rgba(2, 2, 4, 0), var(--void));
    pointer-events: none;
}

/* A photograph on a day lifts very slightly under the cursor - enough to
   read as a thing you can look at, not enough to move the page. */
.itinerary-day-figure img {
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.itinerary-day-figure:hover img { transform: scale(1.025); }

@media (prefers-reduced-motion: reduce) {
    .itinerary-day-figure img,
    .itinerary-day-figure:hover img { transition: none; transform: none; }

    .itinerary-day-progress,
    .itinerary-day-num,
    .itinerary-day-head::before,
    .itinerary-nav-link { transition: none; }
}
