
/* =====================================================
   Metro Flex — Core (mf-core-v1-0-0.css)
   Purpose: global tokens, base elements, typography
   NOTE: Keep this as the very first stylesheet loaded.
   ===================================================== */

/* Fonts (loaded once here) */
@import "https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,700;1,400&family=Roboto+Condensed:wght@400;700&family=Material+Icons&display=swap&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200";
@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css";


/* Design tokens */
:root {
  /* Brand */
  --mf-blue: #0075df;
  --mf-blue-050: #e6f2ff;
  --mf-blue-100: #b7dcff;

  /* Greys */
  --mf-black: #000;
  --mf-text: #111;
  --mf-muted: #666;
  --mf-border: rgba(0, 0, 0, .08);
  --mf-shadow: rgba(0, 0, 0, 0.12);

  /* Surfaces */
  --mf-bg: #ffffff;
  --mf-bg-muted: #ffffff;
  --mf-map-bg: #e9edf1;

  /* Radii */
  --mf-radius-sm: 4px;
  --mf-radius-md: 6px;
  --mf-radius-lg: 10px;

  /* Elevation */
  --mf-elev-1: 0 0 24px var(--mf-shadow);
  --mf-elev-2: 0 6px 18px rgba(0, 0, 0, 0.15);

  /* Focus */
  --mf-focus: 3px solid var(--mf-blue);
  --mf-focus-soft: 0 0 0 3px #9ad1ff;
}

/* Base element reset-lite */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
html {
  font-family: sans-serif;
  /*block-size: 100%;*/
}
body {
  /*min-block-size: 100%;*/
  color: var(--mf-black);
  font-family: "Cabin", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--mf-bg);
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, .mf-subhead {
  font-family: "Roboto Condensed", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Simple layout utility used on pages with a header above the map */
.layout {
  height: calc(100vh - 64px);
}
.site-header {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}
.title {
  font: 600 18px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  margin: 0;
}/* =====================================================
   Metro Flex — Map (mf-map-v1-0-4.css)
   Purpose: map container, legend, Mapbox control spacing
   ===================================================== */

/* ---- Elevation tokens ---- */
:root {
  --z-map: 0;
  --z-popups: 300;
  --z-controls: 500;
  --z-legend-drawer: 800;
  --z-sidebar: 1000;
}

html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}
#map {
	position: relative;
	width: 100%;
	height: 100vh;
}

/* improve map link */
.mapbox-improve-map {
	display: none!important;
}

/* Popups above the map content */
.mapboxgl-popup { z-index: var(--z-popups); }

/* All Mapbox UI controls above popups */
.mapboxgl-control-container,
.mapboxgl-ctrl,
.mapboxgl-ctrl-group,
.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right { z-index: var(--z-controls); }

/* Your legend button should ride with controls */
#ctrl-legend { z-index: var(--z-controls); }

/* Legend drawer (when you add it) */
#legend-drawer {               /* name as you like */
  position: absolute;          /* or fixed, depending on your plan */
  z-index: var(--z-legend-drawer);
}

/* Optional scrim behind the drawer but under the sidebar */
#legend-scrim {
  position: absolute;          /* or fixed */
  z-index: calc(var(--z-legend-drawer) - 1);
}

/* Map container uses true viewport height and fixed positioning */

.map-wrap {
  position: fixed;         /* fill the window */
  inset: 0;
}
#map {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;           /* fallback */
  background: var(--mf-map-bg);
  z-index: var(--z-map);
}
/* iOS/modern mobile: match the *visible* viewport height */
@supports (height: 100svh) {
  #map { height: 100svh; }
}


/* When wrapper goes fullscreen, allow child map to fill */
#mf-shell:fullscreen {
  width: 100vw;
  height: 100vh;
}
#mf-shell:fullscreen #map {
  height: 100vh;
}

/* Mapbox logo and attribution */
.mapboxgl-ctrl-bottom-left {
  position: absolute;
  bottom: 10px;
}
.mapboxgl-ctrl-bottom-right {}

/* Legend (page-level or map-level) */

/* Legend button */
#ctrl-legend {
  z-index: var(--z-controls);
  background-color:#fff;
  border:0;
  box-sizing:border-box;
  cursor:pointer;
  outline:none;
  font-weight: bold;
  position: absolute;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: background-color 0.2s, box-shadow 0.2s;
}
#ctrl-legend button {
  display:flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: auto;
  height:36px;
  padding:4px 10px;
  font-weight: bold;
  font-size: .9rem;
}
#ctrl-legend button:hover,
#ctrl-legend button:focus {
  background-color: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#ctrl-legend .fa-list {
  font-size: 1.2rem;
}
.legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--mf-elev-2);
  border-radius: var(--mf-radius-lg);
  padding: 10px 12px;
  max-width: 320px;
  max-height: 50vh;
  overflow: auto;
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.legend h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
}
.legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.legend li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  column-gap: 8px;
}
.legend .swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #999;
}
.legend .swatch.line {
  border-radius: 2px;
  height: 6px;
  border: 0;
}
.legend .swatch.point {
  border-radius: 50%;
  border-width: 0;
  width: 14px;
  height: 14px;
}
.legend small {
  color: var(--mf-muted);
}

/* Prevent page scroll when overlays are open */
/*body.mf-no-scroll{ overflow: hidden; }*//* =====================================================
   Metro Flex — Popups (mf-popups-v3-2-0.css)
   Purpose: MapboxGL popup card styling and custom close
   ===================================================== */

/* Ensure popups float above map UI */
.mapboxgl-popup { z-index: 30; filter: drop-shadow(0 10px 26px rgba(0,0,0,.28)); }
/* Hide the triangular pointer’s shadow */
.mapboxgl-popup-tip { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }

/* Reset default Mapbox content so we can style our cards */
.mapboxgl-popup-content {
  padding: 0;
  border-radius: var(--mf-radius-md);
  overflow: hidden;
  position: relative;
}

/* Global text defaults inside popups */
.mapboxgl-popup .popup {
  font-size: 14px;
  line-height: 1.35;
}
.mapboxgl-popup .popup-title {
  font-weight: 700;
  margin-bottom: 8px;
}

/* --- Service area card --- */
.mapboxgl-popup .popup--area { min-width: 200px; }
.mapboxgl-popup .popup--area .popup-header {
  background: #f2f2f2;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  border-radius: var(--mf-radius-md) var(--mf-radius-md) 0 0;
}
.mapboxgl-popup .popup--area .popup-kicker,
.mapboxgl-popup .popup--generic .popup-kicker {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.1;
  color: #333;
  margin-bottom: 2px;
}
.mapboxgl-popup .popup--area .popup-title {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}
.mapboxgl-popup .popup--area .popup-body {
  padding: 10px 14px 12px;
}
.mapboxgl-popup .popup--area .hours {
  font-family: "Cabin", sans-serif;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

/* --- Generic (1/2 Line, stations, P&R, Transit Centers) --- */
.mapboxgl-popup .popup--generic {
  background: #fff;
  padding-inline-start: 12px;
  padding-inline-end: 32px;
  padding-block: 10px;
  border-radius: var(--mf-radius-md);
}
.mapboxgl-popup .popup--generic .popup-title {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
}
.mapboxgl-popup .popup--generic .popup-title + .popup-text { margin-top: 6px; }
.mapboxgl-popup .popup--generic .popup-text,
.mapboxgl-popup .popup--generic .popup-text div {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 13px;
  line-height: 1.3;
}
.mapboxgl-popup .popup--generic .popup-text:empty {
  display: none;
}

/* --- Stock Mapbox close (keep for mouse users) --- */
.mapboxgl-popup-close-button {
  font-size: 20px !important;
  line-height: 1 !important;
  top: 0px !important;
  right: 4px !important;
  color: #444 !important;
  text-shadow: 0 0 2px rgba(255,255,255,.7);
  cursor: pointer;
}
.mapboxgl-popup-close-button:hover { color: #000 !important; }

/* --- Custom close button for VoiceOver / SR users --- */
.popup-close-custom {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  padding: 2px;
  border: none;
  background: transparent;
  border-radius: var(--mf-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.popup-close-custom:hover,
.popup-close-custom:focus {
  background: rgba(255, 255, 255, 1);
  outline: 2px solid var(--mf-blue);
  outline-offset: 1px;
}
.popup-close-custom svg {
  width: 20px;
  height: 20px;
  stroke: #2b3e50;
}

/* Adjust popup header to accommodate close button */
.popup-header {
  position: relative;
  padding-right: 36px;
}
/* =====================================================
   Metro Flex — Sidebar (mf-sidebar-v3-2-0.css)
   Purpose: off-canvas sidebar, header, body/scroll, FAB,
            sidebar legend and interactive list items
   ===================================================== */

/* -------- Tokens specific to sidebar anims -------- */
:root {
  --mf-sidebar-w: 320px;                  /* expanded width */
  --mf-sidebar-w-collapsed: 175px;        /* collapsed header width */
  --mf-ease: cubic-bezier(.2,.7,.2,1);
}
@media (max-width: 768px) {
  :root { --mf-sidebar-w: min(88vw, 320px); }
}

/* Lock page scroll on mobile when sidebar is open */
body.mf-lock { overflow: hidden; }

/* Sidebar container */
#mf-header,
#mf-sidebar {
	z-index: var(--z-sidebar);
}
#mf-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--mf-sidebar-w);
  height: 100%;
  background: var(--mf-bg);
  box-shadow: var(--mf-elev-1);
  border-right: 1px solid var(--mf-border);
  display: flex;
  flex-direction: column;
}

/* Collapsed state: do NOT move the whole sidebar.
   We slide only the body so the header remains operable. */
#mf-sidebar.collapsed {
  background: none;
  box-shadow: none;
  border-right: 0;
  pointer-events: none; /* let the map receive interactions */
}

/* -------- Header (acts as the single toggle) -------- */
#mf-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--mf-border);
  background: var(--mf-bg);
  position: relative;

  /* Smoothly animate header width so the container shrinks gracefully */
  width: var(--mf-sidebar-w);
  transition:
    width .28s var(--mf-ease),
    padding .20s ease,
    border-radius .20s ease,
    box-shadow .20s ease,
    outline-offset .15s ease;
  will-change: width;
  pointer-events: auto; /* always clickable */
}

/* Shadow for collapsed header only */
#mf-sidebar.collapsed #mf-header {
  width: var(--mf-sidebar-w-collapsed);
  border-bottom-right-radius: var(--mf-radius-md);
  background: #fff;
  box-shadow: var(--mf-elev-2);
}

/* Remove shadow completely when open */
#mf-sidebar:not(.collapsed) #mf-header {
  box-shadow: none;
}

#mf-header .brand {
  height: 44px;
  width: auto;
  display: block;
}

#mf-header .header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--mf-radius-md);
}
#mf-header .header-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  color: var(--mf-text);
}

/* Focus styles - visible keyboard focus indicator */
#mf-header:focus {
  outline: 2px solid var(--mf-blue);
  outline-offset: 2px;
}

/* Hide outline for mouse clicks (only for browsers that support :focus-visible) */
#mf-header:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for keyboard navigation */
#mf-header:focus-visible {
  outline: 2px solid var(--mf-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 117, 223, 0.2);
}

/* --- Frame becomes non-scrollable; its child scrollport will scroll --- */
#mf-body {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;            /* was: auto */
  -webkit-overflow-scrolling: touch;
  padding: 0;                  /* we’ll pad the inner scrollport instead */
  z-index: 1;

  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    transform .28s var(--mf-ease),
    opacity .20s ease,
    visibility 0s linear 0s;
  will-change: transform, opacity;
}

/* New scrollport fills the body and handles scrolling */
:root { --mf-indicator-h: 72px; } /* arrow/gradient height */
#mf-scrollport {
  position: absolute;
  inset: 0;                    /* top:0 right:0 bottom:0 left:0 */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0; 
}

/* Same slide/fade behavior when collapsing */
#mf-sidebar.collapsed #mf-body {
  transform: translateX(-110%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform .28s var(--mf-ease),
    opacity .20s ease,
    visibility 0s linear .20s;
}

/* Arrows now overlay the scrollport, fixed to the top/bottom of #mf-body */
.mf-scroll-indicator {
  position: absolute;          /* key: positioned inside the frame, not the scrollport */
  left: 0;
  right: 0;
  height: var(--mf-indicator-h);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .20s ease, visibility .20s ease, transform .20s ease;
  pointer-events: none;        /* enabled when .visible */
}
.mf-scroll-indicator.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#mf-scroll-top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0) 100%
  );
}
#mf-scroll-bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0) 100%
  );
}


.mf-scroll-indicator svg {
  width: 28px;
  height: 28px;
  display: block;
  color: var(--mf-text);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
.mf-scroll-indicator:hover svg { color: var(--mf-blue); }
.mf-scroll-indicator:active { transform: scale(0.95); }

/* -------- Sections and subheads -------- */
.mf-section {
  padding: 0;
  margin-bottom: 16px;
}
.mf-subhead {
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 8px 16px 12px;
}

/* -------- Sidebar legend -------- */
#mf-scrollport .mf-section:nth-of-type(2) {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .04);
  margin: 20px;
  padding: 10px 0;
}
#mf-scrollport .mf-section:nth-of-type(2) .mf-subhead {
  font-size: 1.1rem;
  font-weight: bold; 
}
.mf-legend {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mf-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
}
.mf-legend li .mf-name {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 1rem;
  line-height: 1.2;
  user-select: none;
}
.mf-legend .mf-area-item .mf-name {
  font-size: 1.2rem;
}

#mf-legend-areas {
  padding: 0 12px 16px;
  border-bottom: 1px solid var(--mf-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#mf-legend-symbols {
  padding: 0 16px;
  margin: 0;
}
#mf-legend-symbols li { padding: 8px; }

/* Swatches */
.mf-swatch {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 3px solid currentColor;
  box-sizing: border-box;
}
.mf-swatch.point {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 0;
  margin-left: -4px;
}

/* Icon image swatches (stations, P&R, TC) */
.mf-icon-swatch {
  width: 32px;
  height: auto;
  display: block;
  object-fit: contain;
  margin-left: -4px;
  margin-right: -4px;
  vertical-align: middle;
}

/* Symbol legend tweaks */
#mf-legend-symbols li .mf-swatch.line {
  width: 28px;
  height: 6px;
  border: 0;
  border-radius: 3px;
  margin-top: 1px;
  margin-left: -2px;
  margin-right: 2px;
}
.mf-swatch.point img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.mf-swatch.point img.mf-icon-small {
  width: 26px;
  height: auto;
  border: none;
  border-radius: 0;
  margin-left: 3px;
}

/* -------- Clickable service-area items -------- */
.mf-area-item {
  all: unset;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0;
  background: var(--mf-bg-muted);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.mf-area-item:hover {
  background: rgba(0, 0, 0, .04);
  border-color: rgba(0, 0, 0, .04);
}
.mf-area-item:focus-visible { box-shadow: var(--mf-focus-soft); }
.mf-area-item.active {
  background: var(--mf-blue-050);
  border-color: var(--mf-blue-100);
}/* =====================================================
   Metro Flex — Utilities & Accessibility (mf-utilities-v1-0-0.css)
   Purpose: helpers that can be used anywhere
   ===================================================== */

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: #111;
  color: #fff;
}

/* Visually hidden (screen-reader only) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}/* =====================================================
   Metro Flex — Popup RTL Overrides - v1.0.0
   Notes:
   - Keep the Mapbox popup container in LTR so anchor/tip logic stays correct.
   - Set the popup content back to RTL for Arabic text + alignment.
   ===================================================== */

/* =====================================================
   Metro Flex — Sidebar RTL Overrides
   ===================================================== */

/* Move sidebar to the right in RTL */
[dir="rtl"] #mf-sidebar {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid var(--mf-border);
}

/* Slide body OUT to the RIGHT when collapsed */
[dir="rtl"] #mf-sidebar.collapsed #mf-body {
  transform: translateX(110%);
}

/* Mirror collapsed header rounding */
[dir="rtl"] #mf-sidebar.collapsed #mf-header {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: var(--mf-radius-md);
}
[dir="rtl"] .mapboxgl-ctrl-top-right {
	left: 0;
}
[dir="rtl"] .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
  float:left;
  margin:10px 0 0 10px
}

/* Keep Mapbox positioning logic stable (prevents tip/gutter issues in RTL) */
[dir="rtl"] .mapboxgl-popup {
  direction: ltr;
}

/* Restore RTL direction for readable Arabic inside the card */
[dir="rtl"] .mapboxgl-popup-content,
[dir="rtl"] .mapboxgl-popup .popup {
  direction: rtl;
  text-align: right;
}

/* RTL: force LTR rendering for street addresses only */
[dir="rtl"] .popup-text-address {
  direction: ltr;
  unicode-bidi: isolate;
  /*text-align: left;*/
}

/* Move both close buttons to the left corner in RTL */
[dir="rtl"] .mapboxgl-popup-close-button {
  right: auto !important;
  left: 4px !important;
}
[dir="rtl"] .popup-close-custom {
  right: auto;
  left: 2px;
}

/* Header padding: make room for close button on the left in RTL */
[dir="rtl"] .popup-header {
  padding-right: 14px;
  padding-left: 36px;
}

/* When collapsed in RTL, remove the left border to avoid a stray vertical line */
[dir="rtl"] #mf-sidebar.collapsed {
  border-left: 0;
}

/* Flip the header (collapse/expand) icon in RTL so it points the correct direction */
[dir="rtl"] #mf-header .header-icon svg {
  transform: scaleX(-1);
  transform-origin: 50% 50%;
}



