/**
 * Locations map — [location_map]
 *
 * Every rule is scoped under .nt-loc and every class carries the nt-loc-
 * prefix, so nothing leaks into the theme. Salient forces some sizes with
 * !important (`body h3` font sizes, button border-radius and backgrounds),
 * so the few rules that must beat it say !important too; each says why.
 *
 * Layout: desktop (>= 1000px) is list left (scrolls on its own) and map
 * right (stays put); below that the map sits on top, short, with the list
 * under it in the page flow. The list comes first in the DOM either way: it
 * is the primary path, the map is a companion.
 *
 * No decorative icons. Headings are #000014. Secondary buttons are white-
 * filled with #000014 text and border, never transparent.
 */

.nt-loc {
    --nt-loc-ink: #000014;
    --nt-loc-blue: #00677F;
    --nt-loc-rapids: #053747;
    --nt-loc-line: rgba(0, 0, 20, 0.16);
    --nt-loc-soft: #F4F4F2;
    --nt-loc-tint: #EAF3F5;
    --nt-loc-height: clamp(520px, 75vh, 760px);
    --nt-loc-focus: 3px solid #00677F;

    position: relative;
    color: var(--nt-loc-ink);
    font-size: 16px;
    line-height: 1.5;
    max-width: 100%;
}

.nt-loc *,
.nt-loc *::before,
.nt-loc *::after {
    box-sizing: border-box;
}

.nt-loc [hidden] {
    display: none !important; /* beats display rules below, and theme rules */
}

.nt-loc .nt-loc-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Neutralise the theme's bare `button` styles first; restyled below. */
.nt-loc button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    box-shadow: none;
    transform: none;
    cursor: pointer;
    min-height: 0;
    min-width: 0;
}

.nt-loc a:focus-visible,
.nt-loc button:focus-visible,
.nt-loc input:focus-visible,
.nt-loc .nt-loc-card:focus-visible {
    outline: var(--nt-loc-focus) !important; /* Salient removes outlines */
    outline-offset: 2px;
}

/* A card (tabindex -1) takes focus when its text is clicked, and after a pin
   is chosen. Only keyboard focus draws the outline: the browser matches
   :focus-visible for a pin chosen by Enter/Space, not for mouse clicks. */
.nt-loc .nt-loc-card:focus:not(:focus-visible) {
    outline: none !important;
}

.nt-loc .nt-loc-heading {
    color: var(--nt-loc-ink) !important; /* house rule: headings #000014 */
    margin: 0 0 12px;
}

/* ------------------------------------------------------------- toolbar */

.nt-loc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    margin: 0 0 8px;
}

.nt-loc-search {
    flex: 1 1 260px;
    min-width: 0;
}

.nt-loc .nt-loc-search label {
    display: block;
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nt-loc-ink);
}

/* Salient styles bare input[type=search] at (0,1,1); outrank it. */
.nt-loc .nt-loc-search input.nt-loc-q {
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 12px;
    font: inherit;
    font-size: 16px;
    color: var(--nt-loc-ink);
    background: #fff;
    border: 1px solid rgba(0, 0, 20, 0.45);
    border-radius: 6px;
    box-shadow: none;
}

.nt-loc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nt-loc .nt-loc-chip,
.nt-loc .nt-loc-near {
    height: auto;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: var(--nt-loc-ink) !important;
    background: #fff !important; /* white-filled, never transparent */
    border: 1px solid var(--nt-loc-ink) !important;
    border-radius: 999px !important; /* Salient forces its own radius */
}

@media (max-width: 599px) {
    .nt-loc .nt-loc-chip,
    .nt-loc .nt-loc-near {
        min-height: 40px;
        padding: 7px 12px;
        font-size: 14px;
    }
}

.nt-loc .nt-loc-chip[aria-pressed="true"],
.nt-loc .nt-loc-near[aria-pressed="true"] {
    color: #fff !important;
    background: var(--nt-loc-ink) !important;
}

.nt-loc .nt-loc-near[disabled] {
    opacity: 0.6;
    cursor: progress;
}

.nt-loc .nt-loc-status {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--nt-loc-ink);
    min-height: 1.5em;
}

/* --------------------------------------------------------------- body */

.nt-loc-body {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--nt-loc-line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.nt-loc-mapwrap {
    order: -1; /* phones: map on top, list below */
    position: relative;
    height: clamp(220px, 40vh, 320px);
    border-bottom: 1px solid var(--nt-loc-line);
    background: #F0F0EE;
}

.nt-loc-map {
    position: absolute;
    inset: 0;
}

.nt-loc-no-map .nt-loc-mapwrap {
    display: none;
}

.nt-loc-list {
    padding: 4px 12px 12px;
}

@media (min-width: 1000px) {
    .nt-loc-body {
        display: grid;
        grid-template-columns: minmax(340px, 2fr) 3fr;
        height: var(--nt-loc-height);
    }

    .nt-loc-mapwrap {
        order: 0;
        height: auto;
        border-bottom: 0;
        border-left: 1px solid var(--nt-loc-line);
    }

    .nt-loc-list {
        overflow-y: auto;
        overscroll-behavior: contain;
        overflow-anchor: none; /* locations-map.js keeps a clicked card in place */
        padding: 4px 16px 16px;
    }

    .nt-loc-no-map .nt-loc-body {
        grid-template-columns: 1fr;
        height: auto;
    }

    .nt-loc-no-map .nt-loc-list {
        overflow: visible;
    }
}

/*
 * Click-to-activate (desktop only; locations-map.js sets .is-active). A
 * subtle outline shows the wheel now scrolls the list and zooms the map, and
 * a short note says how to give the wheel back to the page.
 */
/* The note stays rendered (empty) so screen readers keep its live region;
   it only gets a box when it has text. */
.nt-loc .nt-loc-activenote {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    max-width: calc(100% - 70px);
    margin: 0;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--nt-loc-ink);
    pointer-events: none;
}

.nt-loc .nt-loc-activenote:not(:empty) {
    padding: 5px 10px;
    background: #fff;
    border: 1px solid var(--nt-loc-ink);
    border-radius: 6px;
}

@media (min-width: 1000px) {
    .nt-loc.is-active .nt-loc-body {
        outline: 2px solid var(--nt-loc-blue);
        outline-offset: 2px;
    }
}

/* -------------------------------------------------------------- cards */

.nt-loc .nt-loc-card {
    padding: 14px 4px 16px;
    border-bottom: 1px solid var(--nt-loc-line);
    scroll-margin: 8px;
}

.nt-loc .nt-loc-card:last-child {
    border-bottom: 0;
}

/*
 * Design C, "summary, details on select": a card shows its name, open
 * status, address and services; selecting it (card, name or pin) opens its
 * stops, phone and buttons. The name button is the disclosure control. The
 * whole card selects its place for pointer users (locations-map.js,
 * .is-pickable). Selected cards take the light blue tint and the blue edge;
 * hover tints only where a real hover exists, so touch screens don't keep a
 * stale tint after a tap.
 */
.nt-loc .nt-loc-card.is-pickable {
    cursor: pointer;
}

@media (hover: hover) {
    .nt-loc .nt-loc-card.is-pickable:hover {
        background: var(--nt-loc-tint);
    }

    .nt-loc .nt-loc-card.is-pickable:not(.is-selected):hover .nt-loc-more,
    .nt-loc .nt-loc-pick:hover .nt-loc-more {
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

/* Text and controls inside keep their own cursor. */
.nt-loc .nt-loc-card.is-pickable .nt-loc-details {
    cursor: auto;
}

.nt-loc .nt-loc-card.is-selected {
    box-shadow: inset 4px 0 0 var(--nt-loc-blue);
    padding-left: 14px;
    background: var(--nt-loc-tint);
}

/* The open card's body does nothing on click; only its name button does. */
.nt-loc .nt-loc-card.is-pickable.is-selected {
    cursor: auto;
}

.nt-loc .nt-loc-card.is-selected .nt-loc-pick {
    cursor: pointer;
}

/* Salient sizes `body h3` with !important; the card name stays modest. */
.nt-loc .nt-loc-card h3.nt-loc-name {
    margin: 0 0 3px !important;
    padding: 0 !important;
    font-size: 17px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    color: var(--nt-loc-ink) !important;
}

/* The name button fills the heading row: name left, "Details"/"Hide" right. */
.nt-loc .nt-loc-pick {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-height: 24px; /* WCAG 2.2 target size (2.5.8) */
    padding: 0;
    font: inherit;
    font-size: inherit !important;
    line-height: inherit;
    font-weight: inherit;
    text-align: left;
    color: var(--nt-loc-ink) !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    text-decoration: none;
}

.nt-loc .nt-loc-pick-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.nt-loc .nt-loc-more {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--nt-loc-blue);
}

.nt-loc .nt-loc-pick:focus-visible .nt-loc-more {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nt-loc .nt-loc-card p,
.nt-loc .nt-loc-card ul {
    margin: 0 0 6px;
    padding: 0;
    font-size: 15px;
}

/* Summary lines: quieter than the name. */
.nt-loc .nt-loc-card p.nt-loc-open,
.nt-loc .nt-loc-card p.nt-loc-address,
.nt-loc .nt-loc-card p.nt-loc-dist,
.nt-loc .nt-loc-card p.nt-loc-svc {
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.4;
}

.nt-loc .nt-loc-card p.nt-loc-open,
.nt-loc .nt-loc-card p.nt-loc-address {
    color: #3D3D46;
}

.nt-loc .nt-loc-card p.nt-loc-svc {
    color: var(--nt-loc-ink);
}

.nt-loc .nt-loc-card p.nt-loc-svc strong {
    font-weight: 700;
}

.nt-loc .nt-loc-details {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #C9DDE2;
}

.nt-loc .nt-loc-card a {
    color: var(--nt-loc-blue);
    text-decoration: underline;
}

.nt-loc .nt-loc-open-head {
    font-weight: 700;
}

.nt-loc .nt-loc-open.is-open .nt-loc-open-head {
    color: #1E6B34;
}

.nt-loc .nt-loc-open.is-closed .nt-loc-open-head {
    color: #6B1F1F;
}

.nt-loc .nt-loc-card p.nt-loc-dist {
    color: var(--nt-loc-rapids);
}

/*
 * "Nearest bus stops": no panel; text sits on the card (white, or #EAF3F5
 * when hovered/selected). WCAG AA (4.5:1) on white / tint: label #000014
 * 20.8 / 18.5; links #00677F 6.5 / 5.7; meta #3D3D46 10.8 / 9.5. Stop code
 * #000014 on its white box 20.8; code box border #5A8A95 3.8 / 3.4 (3:1 for
 * non-text). Row dividers are decorative.
 */
/* No box of its own (user, 2026-11-04: a tinted panel looked too busy);
   the "Nearest bus stops" label and the row dividers group the stops. */
.nt-loc .nt-loc-nearby {
    margin: 10px 0 6px;
    padding: 0;
    background: none;
    border: 0;
    cursor: auto;
}

/* Salient sizes `body h4` with !important; keep this a small label. */
.nt-loc .nt-loc-nearby h4.nt-loc-nearby-h {
    margin: 0 0 4px !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    color: var(--nt-loc-ink) !important; /* house rule: headings #000014 */
}

/* list-style must die on the li too: Salient styles content list items. */
.nt-loc .nt-loc-nearby ul.nt-loc-stops {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nt-loc .nt-loc-nearby ul.nt-loc-stops li.nt-loc-stop {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 9px;
    row-gap: 1px;
    align-items: baseline;
    list-style: none;
    margin: 0;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.35;
    border-top: 1px solid #DADAD4;
}

.nt-loc .nt-loc-nearby ul.nt-loc-stops li.nt-loc-stop:first-child {
    border-top: 0;
    padding-top: 2px;
}

.nt-loc .nt-loc-nearby ul.nt-loc-stops li.nt-loc-stop::before {
    content: none;
}

.nt-loc .nt-loc-nearby .nt-loc-code {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    min-width: 4.2em;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--nt-loc-ink);
    background: #fff;
    border: 1px solid #5A8A95;
    border-radius: 4px;
}

.nt-loc .nt-loc-nearby a.nt-loc-stop-name {
    grid-column: 2;
    color: var(--nt-loc-blue);
    text-decoration: underline;
    overflow-wrap: anywhere;
}

.nt-loc .nt-loc-nearby .nt-loc-meta {
    grid-column: 2;
    font-size: 13px;
    color: #3D3D46;
}

.nt-loc .nt-loc-nearby li.no-code a.nt-loc-stop-name,
.nt-loc .nt-loc-nearby li.no-code .nt-loc-meta {
    grid-column: 1 / -1;
}

.nt-loc .nt-loc-note {
    font-style: italic;
}

.nt-loc .nt-loc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Secondary buttons: white-filled, #000014 text and border. */
.nt-loc .nt-loc-btn,
.nt-loc a.nt-loc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px; /* WCAG 2.2 target size (2.5.8) needs 24px */
    min-width: 44px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--nt-loc-ink) !important;
    background: #fff !important;
    border: 1px solid var(--nt-loc-ink) !important;
    border-radius: 6px !important;
    text-decoration: none !important;
}

.nt-loc .nt-loc-btn:hover {
    background: var(--nt-loc-soft) !important;
}

.nt-loc .nt-loc-btn[aria-expanded="true"] {
    background: var(--nt-loc-soft) !important;
}

.nt-loc .nt-loc-hours {
    margin-top: 10px;
}

.nt-loc .nt-loc-hours table {
    width: 100%;
    max-width: 360px;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
    border: 0;
}

.nt-loc .nt-loc-hours th,
.nt-loc .nt-loc-hours td {
    padding: 3px 8px 3px 0;
    text-align: left;
    vertical-align: top;
    border: 0;
    background: none;
    color: var(--nt-loc-ink);
}

.nt-loc .nt-loc-hours th {
    font-weight: 600;
    width: 7.5em;
}

.nt-loc .nt-loc-hours tr.is-today th,
.nt-loc .nt-loc-hours tr.is-today td {
    font-weight: 700;
}

.nt-loc .nt-loc-empty,
.nt-loc .nt-loc-loading {
    margin: 12px 0;
    color: var(--nt-loc-ink);
}

.nt-loc .nt-loc-error,
.nt-loc-error {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--nt-loc-line, rgba(0, 0, 20, 0.16));
    border-radius: 8px;
    background: #fff;
    color: #000014;
}

/* ---------------------------------------------------------------- pins */

/*
 * A plain dot, not an icon: the marker is the place itself.
 *
 * MapLibre moves a DOM marker by setting `transform` on this very element
 * every frame. Salient gives every button `transition: transform .45s …`
 * (its "slightly_rounded" button rules), which made pins ease after the
 * map and drift while panning or zooming. The pins must never transition
 * transform; only MapLibre's own opacity fade and the colour change stay.
 */
.nt-loc .nt-loc-pin,
.nt-loc .nt-loc-here {
    transition: opacity 0.2s, background-color 0.15s !important;
    animation: none !important;
}

/* 24px is the WCAG 2.5.8 minimum target size; the 44px touch area around
   the dot comes from style.css (MOB-8). */
.nt-loc .nt-loc-pin {
    width: 24px;
    height: 24px;
    padding: 0;
    background: var(--nt-loc-blue) !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.nt-loc .nt-loc-pin:hover {
    background: var(--nt-loc-rapids) !important;
}

.nt-loc .nt-loc-pin.is-selected {
    width: 28px;
    height: 28px;
    background: var(--nt-loc-ink) !important;
    z-index: 2;
}

.nt-loc .nt-loc-pin:focus-visible {
    outline: 3px solid var(--nt-loc-ink) !important;
    outline-offset: 2px;
}

.nt-loc .nt-loc-here {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0CAB9B;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #0CAB9B;
}

/* MapLibre's controls should keep their own look inside Salient. */
.nt-loc .maplibregl-ctrl button {
    border-radius: 0 !important;
    background-color: transparent !important;
}
