/**
 * Syria Scope Tour Maps — Brand-Matched Responsive Front-End Stylesheet.
 * Typography: 'Jost', sans-serif | Brand Palette: #ff5a60 (Coral), #468aab (Slate Teal), #0f172a (Deep Navy)
 */

.sstm-tour-widget,
.sstm-tour-widget *,
.sstm-tour-widget *::before,
.sstm-tour-widget *::after {
  box-sizing: border-box;
  font-family: 'Jost', sans-serif;
}

.sstm-tour-widget {
  --sstm-coral: #ff5a60;
  --sstm-coral-dark: #e6454b;
  --sstm-teal: #468aab;
  --sstm-navy: #0f172a;
  --sstm-slate: #475569;
  --sstm-muted: #64748b;
  --sstm-surface: #ffffff;
  --sstm-bg-subtle: #f8fafc;
  --sstm-border: #e2e8f0;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 8px auto 24px;
  background: var(--sstm-surface);
  border: 1px solid var(--sstm-border);
  border-radius: 22px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  color: var(--sstm-navy);
}

.sstm-tour-widget.sstm-theme-night {
  --sstm-surface: #0f1d32;
  --sstm-bg-subtle: #132540;
  --sstm-border: #223b5e;
  --sstm-navy: #f1f5f9;
  --sstm-slate: #cbd5e1;
  --sstm-muted: #94a3b8;
}

.u-shortcode-tour-map {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

html.sstm-body-fs-lock,
html.sstm-body-fs-lock body {
  overflow: hidden !important;
}

.sstm-tour-widget.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483640 !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: none !important;
}

/* Hide any residual Leaflet attribution box if ever injected */
.sstm-tour-widget .leaflet-control-attribution {
  display: none !important;
}

/* Top Filter + Trip Stats Bar */
.sstm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  background: var(--sstm-surface);
  border-bottom: 1px solid var(--sstm-border);
}

.sstm-filter-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
  flex: 1 1 auto;
}

.sstm-filter-scroll::-webkit-scrollbar {
  display: none;
}

.sstm-leg-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--sstm-border);
  background: var(--sstm-bg-subtle);
  color: var(--sstm-slate);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sstm-leg-pill:hover {
  border-color: var(--sstm-teal);
  color: var(--sstm-navy);
}

.sstm-leg-pill.is-active {
  background: linear-gradient(135deg, #ff5a60 0%, #e94858 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(255, 90, 96, 0.26);
}

.sstm-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sstm-leg-pill.is-active .sstm-leg-dot {
  background: #ffffff !important;
}

.sstm-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sstm-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(70, 138, 171, 0.10);
  color: var(--sstm-teal);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.sstm-stat-chip strong {
  font-weight: 700;
}

/* Main Split Stage */
.sstm-stage {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: var(--sstm-desktop-h, 560px);
}

.sstm-tour-widget.sstm-no-sidebar .sstm-stage {
  grid-template-columns: minmax(0, 1fr);
}

.sstm-tour-widget.sstm-no-sidebar .sstm-itinerary-pane {
  display: none;
}

.sstm-tour-widget.is-fullscreen .sstm-stage {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  height: 100% !important;
}

.sstm-tour-widget.is-fullscreen .sstm-canvas-wrap,
.sstm-tour-widget.is-fullscreen .sstm-itinerary-pane,
.sstm-tour-widget.is-fullscreen .sstm-map-canvas {
  height: 100% !important;
  min-height: 0 !important;
}

.sstm-ctrl-btn.is-active {
  background: #ff5a60 !important;
  border-color: #ff5a60 !important;
  color: #ffffff !important;
}

/* Left Itinerary Pane */
.sstm-itinerary-pane {
  display: flex;
  flex-direction: column;
  background: var(--sstm-bg-subtle);
  border-right: 1px solid var(--sstm-border);
  overflow: hidden;
}

.sstm-pane-header {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--sstm-border);
  background: var(--sstm-surface);
}

.sstm-pane-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sstm-coral);
  margin-bottom: 3px;
}

.sstm-pane-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sstm-navy);
  line-height: 1.25;
}

.sstm-stops-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sstm-stop-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--sstm-surface);
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sstm-stop-row:hover {
  border-color: rgba(70, 138, 171, 0.35);
  transform: translateX(2px);
}

.sstm-stop-row.is-selected {
  border-color: var(--sstm-coral);
  background: rgba(255, 90, 96, 0.06);
  box-shadow: 0 4px 12px rgba(255, 90, 96, 0.12);
}

.sstm-stop-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sstm-coral);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sstm-stop-row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sstm-stop-row-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sstm-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sstm-stop-row-cat {
  font-size: 0.75rem;
  color: var(--sstm-muted);
}

/* Map Canvas & Overlays */
.sstm-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
}

.sstm-map-canvas {
  width: 100%;
  height: 100%;
  outline: none;
  z-index: 1;
}

/* Basemap Geographic Labels */
.sstm-geo-label-wrap {
  background: transparent !important;
  border: 0 !important;
}

.sstm-geo-label {
  display: block;
  text-align: center;
  font-family: 'Jost', sans-serif;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.sstm-geo-country_focal {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.34em;
}

.sstm-geo-country {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.sstm-geo-sea {
  font-size: 10.5px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.sstm-geo-water {
  font-size: 10px;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* Destination Pins & Anti-Collision Pills */
.sstm-marker-shell {
  background: transparent !important;
  border: 0 !important;
}

.sstm-pin-wrap {
  position: relative;
  width: 0;
  height: 0;
}

.sstm-pin-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--pin-color, #ff5a60);
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.28);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
}

.sstm-pin-dot.has-num {
  width: 23px;
  height: 23px;
  border-width: 2.5px;
}

.sstm-pin-wrap:hover .sstm-pin-dot,
.sstm-marker-shell.is-hovered .sstm-pin-dot,
.sstm-pin-wrap.is-selected .sstm-pin-dot {
  transform: translate(-50%, -50%) scale(1.26);
  box-shadow: 0 0 0 5px rgba(255, 90, 96, 0.24), 0 5px 14px rgba(15, 23, 42, 0.32);
}

.sstm-pin-wrap.is-muted {
  opacity: 0.30;
}

.sstm-pin-label {
  position: absolute;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  color: #0f172a;
  font-size: 11.8px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.sstm-tour-widget.sstm-theme-night .sstm-pin-label {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(148, 163, 184, 0.28);
  color: #f8fafc;
}

.sstm-pin-wrap.is-selected .sstm-pin-label {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.sstm-pin-wrap[data-anchor="right"] .sstm-pin-label {
  left: 13px;
  top: -11px;
}

.sstm-pin-wrap[data-anchor="left"] .sstm-pin-label {
  right: 13px;
  top: -11px;
}

.sstm-pin-wrap[data-anchor="top"] .sstm-pin-label {
  left: 0;
  top: -30px;
  transform: translateX(-50%);
}

.sstm-pin-wrap[data-anchor="bottom"] .sstm-pin-label {
  left: 0;
  top: 12px;
  transform: translateX(-50%);
}

.sstm-pin-wrap[data-anchor="top-right"] .sstm-pin-label {
  left: 11px;
  top: -27px;
}

.sstm-pin-wrap[data-anchor="bottom-left"] .sstm-pin-label {
  right: 11px;
  top: 10px;
}

.sstm-pin-wrap.is-label-hidden .sstm-pin-label {
  opacity: 0;
  pointer-events: none;
}

.sstm-pin-wrap.is-label-hidden:hover .sstm-pin-label,
.sstm-marker-shell.is-hovered .sstm-pin-wrap.is-label-hidden .sstm-pin-label {
  opacity: 1;
  z-index: 999;
}

/* Directional Route Arrows */
.sstm-route-arrow-icon {
  background: transparent !important;
  border: 0 !important;
}

.sstm-route-arrow {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
}

/* Clean Line Hover Tooltip */
.leaflet-tooltip.sstm-clean-tooltip {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 7px 11px !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25) !important;
  font-family: 'Jost', sans-serif !important;
}

.leaflet-tooltip.sstm-clean-tooltip::before {
  border-top-color: #0f172a !important;
}

.sstm-line-tip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.sstm-line-tip strong {
  font-weight: 600;
  color: #ffffff;
}

.sstm-line-tip span {
  font-size: 11px;
  color: #cbd5e1;
}

/* Custom Floating Map Controls */
.sstm-map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sstm-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
  transition: all 0.18s ease;
  padding: 0;
}

.sstm-ctrl-btn:hover {
  background: #ff5a60;
  border-color: #ff5a60;
  color: #ffffff;
}

/* Subtle Scroll Hint & Syria Scope Brand Pill (Zero Third-Party Watermark) */
.sstm-scroll-hint {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 550;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 11.5px;
  font-weight: 500;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sstm-scroll-hint.is-hidden {
  opacity: 0;
}

.sstm-brand-pill {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 550;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.sstm-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5a60, #468aab);
}

/* Floating Destination / Segment Detail Card */
.sstm-detail-card {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 650;
  width: min(340px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  padding: 15px 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  color: #0f172a;
}

.sstm-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: #f1f5f9;
  color: #475569;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.sstm-detail-close:hover {
  background: #ff5a60;
  color: #ffffff;
}

.sstm-detail-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #468aab;
}

.sstm-detail-title {
  margin: 4px 0 6px !important;
  font-size: 1.08rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  padding-right: 24px;
}

.sstm-detail-desc {
  margin: 0 !important;
  font-size: 0.86rem !important;
  line-height: 1.48 !important;
  color: #475569 !important;
}

.sstm-detail-legs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sstm-detail-leg-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.sstm-detail-leg-btn:hover {
  border-color: #ff5a60;
  color: #ff5a60;
}

.sstm-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.sstm-metric-pill {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.sstm-metric-lbl {
  display: block;
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sstm-metric-pill strong {
  font-size: 0.92rem;
  color: #0f172a;
}

/* Mobile Quick Stops Bar (Hidden on Desktop, Shown on Tablet/Mobile) */
.sstm-mobile-stops-bar {
  display: none;
}

.sstm-admin-notice {
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #9b2c2c;
  font-size: 0.92rem;
}

/* Tablet & Mobile Responsive Breakpoints */
@media (max-width: 959px) {
  .sstm-stage {
    grid-template-columns: minmax(0, 1fr);
    height: var(--sstm-mobile-h, 430px);
  }

  .sstm-itinerary-pane {
    display: none;
  }

  .sstm-mobile-stops-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--sstm-bg-subtle);
    border-top: 1px solid var(--sstm-border);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sstm-mobile-stops-bar::-webkit-scrollbar {
    display: none;
  }

  .sstm-mobile-stop-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--sstm-border);
    background: var(--sstm-surface);
    color: var(--sstm-navy);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
  }

  .sstm-mobile-stop-chip.is-selected {
    border-color: var(--sstm-coral);
    background: var(--sstm-coral);
    color: #ffffff;
  }

  .sstm-mobile-chip-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 90, 96, 0.14);
    color: var(--sstm-coral);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sstm-mobile-stop-chip.is-selected .sstm-mobile-chip-num {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
  }
}

@media (max-width: 639px) {
  .sstm-tour-widget {
    border-radius: 16px;
    margin: 6px auto 18px;
  }

  .sstm-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .sstm-stats-bar {
    justify-content: flex-start;
  }

  .sstm-scroll-hint {
    display: none;
  }

  .sstm-detail-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 13px 14px;
  }

  .sstm-ctrl-btn {
    width: 34px;
    height: 34px;
  }
}

/* v1.1 — OpenStreetMap road data credit (ODbL) */
.sstm-road-credit {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 700;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #64748b !important;
  font-size: 10px;
  line-height: 1.6;
  text-decoration: none !important;
}
.sstm-road-credit:hover {
  color: #0f172a !important;
}
.sstm-tour-widget.sstm-theme-night .sstm-road-credit {
  background: rgba(15, 29, 50, 0.7);
  color: #94a3b8 !important;
}
