/**
 * Microtransit Zones map — [microtransit_map]
 *
 * Ported from the standalone 2026-microtransit-map/microtransit-zones.html.
 * Every rule is scoped under .nt-microtransit and every class carries the
 * nt-mt- prefix, so nothing leaks into the theme and Salient's content
 * styles can't reach in. The original page's global `*` reset and `body`
 * background were dropped outright (they belong to a standalone document,
 * not an embedded widget).
 *
 * The original sized the map with 100vh and pinned the side panel with
 * position:fixed. Here the widget is three in-flow rows — toolbar, stage,
 * legend — and the zone panel is absolute *within the stage*, so nothing
 * overlays the site header or footer, or the toolbar and legend.
 *
 * Runs on MapLibre GL. Zones are canvas layers styled from
 * microtransit-map.js; everything here is DOM: toolbar, legend, panel,
 * access point markers and the pin.
 */

.nt-microtransit {
    --nt-mt-blue: #00677F;
    --nt-mt-teal: #0CAB9B;
    --nt-mt-rapids: #053747;
    --nt-mt-limestone: #D3D1CB;
    --nt-mt-yellow: #FFE2A1;
    --nt-mt-black: #000014;
    --nt-mt-height: clamp(480px, 70vh, 760px);
    --nt-mt-panel-w: 340px;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    overflow: clip;
    border-radius: 8px;
    /* Frames toolbar, map and legend as one object on a white page. */
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #F0F0EE;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
}

/* Salient sets box-sizing globally, but don't rely on it. */
.nt-microtransit *,
.nt-microtransit *::before,
.nt-microtransit *::after {
    box-sizing: border-box;
}

/**
 * Every control in this widget is a real <button> — the panel's zone and
 * hub links included, because they move the map rather than navigate. The
 * theme styles bare `button` (background, border, padding, transform), so
 * neutralize it first; the rules further down restyle from a known floor.
 * Kept at single-class specificity so those later rules win on order.
 */
.nt-mt-reset,
.nt-mt-fs,
.nt-mt-panel-close,
.nt-mt-hub-link,
.nt-mt-zone-link,
.nt-mt-back,
.nt-mt-zones-toggle,
.nt-mt-zone-btn,
.nt-mt-locate,
.nt-mt-nearest,
.nt-mt-hub {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    width: auto;
    min-width: 0;
    min-height: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    text-shadow: none;
    box-shadow: none;
    transform: none;
    cursor: pointer;
}

/* ------------------------------------------------------------------ layout */

/**
 * Three stacked rows: the toolbar (everything the rider operates), the
 * stage (map + zone panel), and the legend strip. Nothing the rider
 * operates floats on the map except MapLibre's own zoom/fullscreen stack.
 * The toolbar sits above the stage in the stacking order so the address
 * menu and the zone list can drop down over the map.
 */
.nt-mt-toolbar {
    position: relative;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 14px;
    color: var(--nt-mt-black);
}

.nt-mt-stage {
    position: relative;
    z-index: 1;
    /* clip, not just hidden: a hidden box can still be scrolled by script
       or focus, which slid the closed panel into view. Browsers without
       clip keep hidden. */
    overflow: hidden;
    overflow: clip;
}

.nt-mt-map {
    width: 100%;
    height: var(--nt-mt-height);
    min-height: 360px;
    background: #F0F0EE;
}

/* MapLibre injects its own font-family; keep the widget consistent. */
.nt-microtransit .maplibregl-map {
    font-family: inherit;
    background: #F0F0EE;
}

/* --------------------------------------------------------- toolbar controls */

/* One height for every toolbar control, so the bar reads as a single row. */
.nt-microtransit {
    --nt-mt-ctl-h: 40px;
    --nt-mt-ctl-border: #A9B4B8;
}

.nt-mt-search {
    flex: 1 1 280px;
    max-width: 440px;
    display: flex;
    gap: 6px;
    min-width: 0;
}

.nt-mt-search-box {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Salient styles bare input[type=text] (0,1,1) and its :focus (0,2,1);
   these selectors outrank the theme without resorting to !important. */
.nt-microtransit .nt-mt-search input.autocomplete__input {
    font: inherit;
    font-size: 15px;
    height: var(--nt-mt-ctl-h);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--nt-mt-ctl-border);
    border-radius: 6px;
    background: #fff;
    color: var(--nt-mt-black);
    line-height: 1.3;
    width: 100%;
    box-shadow: none;
}

.nt-microtransit .nt-mt-search input.autocomplete__input--focused,
.nt-microtransit .nt-mt-search input.autocomplete__input:focus {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 0;
    border-color: var(--nt-mt-rapids);
    box-shadow: none;
    background: #fff;
}

.nt-mt-search .autocomplete__menu {
    font-size: 14px;
}

.nt-mt-search .autocomplete__option {
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.35;
}

/* Locate, Zones and View all zones share one outline-button look. */
.nt-mt-locate,
.nt-mt-zones-toggle,
.nt-mt-reset {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--nt-mt-ctl-h);
    background: #fff;
    border: 1px solid var(--nt-mt-ctl-border);
    border-radius: 6px;
    color: var(--nt-mt-blue);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.nt-mt-locate:hover,
.nt-mt-zones-toggle:hover,
.nt-mt-reset:hover {
    background: #EEF6F8;
    border-color: var(--nt-mt-blue);
}

.nt-mt-locate:focus-visible,
.nt-mt-zones-toggle:focus-visible,
.nt-mt-reset:focus-visible,
.nt-mt-zone-btn:focus-visible,
.nt-mt-nearest:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 2px;
}

.nt-mt-locate {
    justify-content: center;
    width: var(--nt-mt-ctl-h);
    flex-shrink: 0;
}

.nt-mt-locate[hidden] {
    display: none;
}

.nt-mt-locate svg {
    display: block;
    width: 18px;
    height: 18px;
}

.nt-mt-reset {
    padding: 0 14px;
    white-space: nowrap;
}

/* The status line gets its own full-width row under the controls. */
.nt-mt-status {
    flex-basis: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--nt-mt-rapids);
}

.nt-mt-status[hidden] {
    display: none;
}

.nt-mt-nearest {
    color: var(--nt-mt-blue);
    font-weight: 600;
    text-decoration: underline;
}

/* ------------------------------------------------------------ zone list */

/* The keyboard route to every zone: the canvas has no focusable shapes. */
.nt-mt-zones {
    position: relative;
}

.nt-mt-zones-toggle {
    padding: 0 12px 0 14px;
    min-width: 120px;
    justify-content: space-between;
}

.nt-mt-zones-toggle::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.nt-mt-zones-toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(-135deg);
}

.nt-mt-zone-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 2;
    width: 240px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.nt-mt-zone-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nt-mt-zone-btn {
    display: block;
    width: 100%;
    padding: 7px 14px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--nt-mt-black);
}

.nt-mt-zone-btn:hover {
    background: #EEF6F8;
    color: var(--nt-mt-blue);
}

/* ------------------------------------------------------------ map buttons */

/**
 * MapLibre's zoom group plus our fullscreen group, top-right. Above the
 * gesture overlay (900) so they never dim; below the panel (1001). While
 * the panel is open on a wide screen they slide left out from under it.
 */
/* MapLibre's `.maplibregl-ctrl-group button { display: block }` (0,1,1)
   outranks .nt-mt-fs, which left the icon in the button's top-left corner. */
.nt-microtransit .maplibregl-ctrl-group .nt-mt-fs {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nt-microtransit .maplibregl-ctrl-top-right {
    z-index: 950;
    transition: right 0.3s ease;
}

.nt-microtransit.is-panel-open .maplibregl-ctrl-top-right {
    right: var(--nt-mt-panel-w);
}

.nt-mt-fs {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    color: #333;
}

.nt-mt-fs svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* Icon follows the button's state; the hidden label is swapped by JS. */
.nt-mt-fs .nt-mt-fs-exit,
.nt-mt-fs[data-fs-state="on"] .nt-mt-fs-enter {
    display: none;
}

.nt-mt-fs[data-fs-state="on"] .nt-mt-fs-exit {
    display: block;
}

.nt-mt-fs:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: -3px;
}

/* ------------------------------------------------------------------ legend */

/* One line under the map; it wraps on narrow screens and scrolls on phones. */
.nt-microtransit .nt-mt-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    margin: 0;
    padding: 9px 14px;
    list-style: none;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 13px;
    line-height: 1.3;
    color: var(--nt-mt-black);
}

.nt-microtransit .nt-mt-legend-item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}

.nt-mt-swatch {
    width: 20px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

.nt-mt-swatch.is-selected {
    background: var(--nt-mt-teal);
    border: 2px solid var(--nt-mt-teal);
}

.nt-mt-swatch.is-connected {
    background: rgba(0, 103, 127, 0.45);
    border: 2px solid var(--nt-mt-blue);
}

.nt-mt-swatch.is-unconnected {
    background: var(--nt-mt-limestone);
    border: 2px solid #999;
}

.nt-mt-swatch.is-inactive {
    background: #E5E5E5;
    border: 2px dashed #999;
}

.nt-mt-swatch.is-hub {
    background: var(--nt-mt-yellow);
    border: 2px solid #D4A84A;
    border-radius: 50%;
    width: 14px;
    height: 14px;
}

/* ------------------------------------------------------------- side panel */

.nt-mt-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--nt-mt-panel-w);
    max-width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.nt-mt-panel.is-open {
    transform: translateX(0);
}

.nt-mt-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.2s ease;
}

.nt-mt-panel-close:hover {
    background: #fff;
}

.nt-mt-panel-close:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 2px;
}

.nt-mt-panel-close svg {
    stroke: var(--nt-mt-rapids);
    display: block;
}

.nt-mt-panel-content {
    flex: 1;
}

.nt-mt-panel-content .nt-mt-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Drag handle — mobile bottom-sheet affordance only. */
.nt-mt-panel-handle {
    display: none;
}

/* Sticky footer holding the Book a Ride CTA. */
.nt-mt-panel-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.nt-mt-book {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #0CAB9B 0%, #089485 100%);
    color: #fff;
    text-align: center;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(12, 171, 155, 0.3);
}

.nt-mt-book:hover,
.nt-mt-book:focus {
    background: linear-gradient(135deg, #089485 0%, #067a6d 100%);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 171, 155, 0.4);
}

.nt-mt-book:focus-visible {
    outline: 3px solid var(--nt-mt-rapids);
    outline-offset: 2px;
}

.nt-mt-book:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------- panel cards */

.nt-mt-card-head {
    background: var(--nt-mt-blue);
    color: #fff;
    padding: 20px 24px;
    padding-right: 50px;
}

/* Salient sizes headings with `.row .col h3/h4` (0,2,1) in Inter; these
   selectors carry one more class so the panel keeps its own type. */
.nt-microtransit .nt-mt-panel .nt-mt-card-head h3 {
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: normal;
    margin: 0 0 12px;
    color: #fff;
}

.nt-mt-card-head.is-hub {
    background: linear-gradient(135deg, #F5C842 0%, #E0AD20 100%);
    color: var(--nt-mt-black);
}

.nt-microtransit .nt-mt-panel .nt-mt-card-head.is-hub h3 {
    color: var(--nt-mt-black);
    margin-bottom: 8px;
}

.nt-mt-hub-type {
    font-size: 14px;
    color: #3D2E00;
}

.nt-mt-card-head .nt-mt-hours {
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0 0;
    font-size: 15px;
}

.nt-mt-card-head .nt-mt-hours svg {
    stroke: rgba(255, 255, 255, 0.9);
}

.nt-mt-card-head .nt-mt-noservice {
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 500;
}

.nt-mt-card-body {
    padding: 20px 24px;
    flex: 1;
    color: var(--nt-mt-black);
}

.nt-mt-hours {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    font-size: 15px;
    color: var(--nt-mt-rapids);
}

.nt-mt-hours svg {
    margin-right: 8px;
    margin-top: 2px;
    flex-shrink: 0;
}

.nt-mt-noservice {
    color: #D32F2F;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}

.nt-mt-section {
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.nt-mt-section:first-child {
    border-top: none;
    padding-top: 0;
}

.nt-mt-section:last-child {
    margin-bottom: 0;
}

.nt-microtransit .nt-mt-panel .nt-mt-section-title {
    font-family: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    color: #4A4A4A;
    margin: 0 0 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.nt-mt-section-title:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 2px;
}

.nt-mt-chevron svg {
    display: block;
}

.nt-mt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/**
 * list-style must be killed on the `li`, not just the `ul`: Salient ships
 * `ul li { list-style: disc }` set directly on the item, and a direct rule
 * beats the value inherited from the list. Without this the theme's disc
 * renders alongside this widget's teal ::before dot — two bullets per row.
 */
.nt-mt-list li {
    list-style: none;
    font-size: 15px;
    /* The widget root sets 1.5 for body copy; single-line list rows read
       as double-spaced at that leading, so tighten them here. */
    line-height: 1.35;
    padding: 3px 0 3px 18px;
    position: relative;
    color: var(--nt-mt-black);
    margin: 0;
}

.nt-mt-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--nt-mt-teal);
    border-radius: 50%;
}

.nt-mt-list.is-hubs li::before {
    background: var(--nt-mt-yellow);
    border: 1px solid #D4A84A;
}

.nt-mt-hub-link,
.nt-mt-zone-link {
    color: var(--nt-mt-blue);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nt-mt-hub-link:hover,
.nt-mt-zone-link:hover {
    color: var(--nt-mt-teal);
    text-decoration: underline;
}

.nt-mt-hub-link:focus-visible,
.nt-mt-zone-link:focus-visible,
.nt-mt-back:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 2px;
}

.nt-mt-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--nt-mt-blue);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.nt-mt-back:hover {
    color: var(--nt-mt-teal);
}

.nt-mt-back svg {
    flex-shrink: 0;
}

.nt-mt-startdate {
    background: #E8F5E9;
    border: 1px solid #81C784;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #2E7D32;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nt-mt-startdate svg {
    flex-shrink: 0;
}

.nt-mt-notice {
    background: #FFF3CD;
    border: 1px solid var(--nt-mt-yellow);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 15px;
    color: #5D4800;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.nt-mt-notice-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.nt-mt-notice-icon svg {
    display: block;
}

.nt-mt-routes-text {
    font-size: 15px;
    color: var(--nt-mt-black);
    line-height: 1.6;
    margin: 0;
}

/* -------------------------------------------------- map overlays & a11y */

/* Access points: real buttons handed to maplibregl.Marker. MapLibre owns
   the button's transform (positioning), so all visuals sit on the dot. */
.nt-mt-hub {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.nt-mt-hub-dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nt-mt-yellow);
    border: 2px solid #D4A84A;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.nt-mt-hub:hover .nt-mt-hub-dot {
    transform: scale(1.15);
}

.nt-mt-hub.is-active {
    z-index: 2;
}

.nt-mt-hub.is-active .nt-mt-hub-dot {
    width: 20px;
    height: 20px;
    background: #FFD54F;
    border: 3px solid #FFA000;
}

.nt-mt-hub.is-muted .nt-mt-hub-dot {
    background: var(--nt-mt-limestone);
    border-color: #999;
    opacity: 0.6;
}

.nt-mt-hub:focus-visible {
    outline: 3px solid var(--nt-mt-teal);
    outline-offset: 2px;
}

/* Name tag: on hover/focus always, and for every hub from zoom 12. */
.nt-mt-hub-name {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    transform: translateX(-50%);
    white-space: nowrap;
    background: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nt-mt-rapids);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.nt-microtransit.nt-mt-hub-names .nt-mt-hub-name,
.nt-mt-hub:hover .nt-mt-hub-name,
.nt-mt-hub:focus-visible .nt-mt-hub-name {
    display: block;
}

/* Search / locate result. */
.nt-mt-pin {
    pointer-events: none;
}

.nt-mt-pin svg {
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.nt-mt-located {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 10px 12px;
    background: #EEF6F8;
    border-left: 4px solid var(--nt-mt-blue);
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--nt-mt-black);
}

.nt-mt-located svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--nt-mt-blue);
}

/* Zone-name tooltip (a MapLibre Popup) — desktop hover only. */
.nt-microtransit .nt-mt-tooltip {
    pointer-events: none;
}

.nt-microtransit .nt-mt-tooltip .maplibregl-popup-content {
    background: var(--nt-mt-rapids);
    color: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nt-microtransit .nt-mt-tooltip .maplibregl-popup-tip {
    border-top-color: var(--nt-mt-rapids);
}

.nt-mt-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Shown when data/microtransit-zones.json can't be loaded. */
.nt-mt-notice-block {
    padding: 24px;
    font-size: 16px;
    color: var(--nt-mt-rapids);
}

/* ------------------------------------------------------- scroll/zoom hint */

/**
 * MapLibre's cooperative-gestures overlay, restyled to match the widget's
 * old hint. It never takes pointer events, and sits below the controls,
 * legend and panel (999+) so it dims the map without dimming them.
 */
.nt-microtransit .maplibregl-cooperative-gesture-screen {
    z-index: 900;
    padding: 24px;
    background: rgba(0, 0, 20, 0.5);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

/* Only carries the translatable hint strings to JS now. */
.nt-mt-scrollhint {
    display: none;
}

@media (max-width: 600px) {
    .nt-microtransit .maplibregl-cooperative-gesture-screen {
        font-size: 16px;
    }
}

/* ------------------------------------------------------------ fullscreen */

/**
 * One class covers both paths: the native Fullscreen API (where the root is
 * already the fullscreen element and these rules just make it fill the
 * space) and the iOS fallback, where Safari refuses requestFullscreen() on
 * anything but a <video> and the widget pins itself over the viewport
 * instead. JS adds .is-fullscreen in both cases.
 */
.nt-microtransit.is-fullscreen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    z-index: 100000;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

/* Toolbar and legend keep their height; the stage takes the rest. */
.nt-microtransit.is-fullscreen .nt-mt-stage {
    flex: 1 1 auto;
    min-height: 0;
}

.nt-microtransit.is-fullscreen .nt-mt-map {
    height: 100%;
    min-height: 0;
}

/* Locks the page behind the iOS fallback so it can't scroll underneath. */
html.nt-mt-fs-lock,
html.nt-mt-fs-lock body {
    overflow: hidden;
}

/* Native fullscreen letterboxes with black by default. */
.nt-microtransit:fullscreen {
    background: #F0F0EE;
}

.nt-microtransit:-webkit-full-screen {
    background: #F0F0EE;
}

/* ------------------------------------------------------------- collapsing */

/* Sections collapse on small screens only; the chevron is the affordance. */
.nt-mt-chevron {
    display: none;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nt-mt-section.is-collapsed .nt-mt-chevron {
    transform: rotate(-90deg);
}

/* ------------------------------------------------------------------ small */

@media (max-width: 600px) {
    .nt-microtransit {
        --nt-mt-height: clamp(420px, 65vh, 620px);
    }

    /* Search takes the first row; Zones and View all zones share the
       second, each half the width. */
    .nt-mt-search {
        flex-basis: 100%;
        max-width: none;
    }

    .nt-mt-zones,
    .nt-mt-reset {
        flex: 1 1 0;
    }

    .nt-mt-zones-toggle,
    .nt-mt-reset {
        width: 100%;
        justify-content: center;
    }

    .nt-mt-zones-toggle {
        justify-content: space-between;
    }

    .nt-mt-zone-list {
        width: 100%;
        min-width: 220px;
    }

    /* The legend scrolls sideways rather than wrapping to three lines. */
    .nt-microtransit .nt-mt-legend {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 16px;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* The bottom sheet covers the map's buttons; no need to slide them. */
    .nt-microtransit.is-panel-open .maplibregl-ctrl-top-right {
        right: 0;
    }

    /* Bottom sheet, anchored to the widget rather than the viewport. */
    .nt-mt-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: 75%;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .nt-mt-panel.is-open {
        transform: translateY(0);
    }

    .nt-mt-panel-handle {
        display: block;
        width: 36px;
        height: 4px;
        background: var(--nt-mt-limestone);
        border-radius: 2px;
        margin: 10px auto 6px;
    }

    .nt-mt-panel-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }

    .nt-mt-card-head {
        padding: 16px;
        padding-right: 45px;
    }

    .nt-microtransit .nt-mt-panel .nt-mt-card-head h3 {
        font-size: 18px;
    }

    .nt-mt-card-body {
        padding: 16px;
    }

    .nt-mt-panel-footer {
        padding: 12px 16px;
    }

    .nt-mt-book {
        padding: 14px 20px;
        font-size: 16px;
    }

    .nt-mt-chevron {
        display: inline-flex;
    }

    .nt-mt-section-title {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .nt-mt-section.is-collapsed .nt-mt-list,
    .nt-mt-section.is-collapsed .nt-mt-routes-text {
        display: none;
    }
}

@media (max-width: 480px) {
    .nt-microtransit .maplibregl-ctrl-attrib {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nt-mt-panel,
    .nt-mt-reset,
    .nt-mt-zones-toggle,
    .nt-mt-locate,
    .nt-microtransit .maplibregl-ctrl-top-right,
    .nt-mt-book,
    .nt-mt-chevron,
    .nt-mt-hub-dot,
    .nt-mt-zones-toggle::after {
        transition: none;
    }
}
