/*
 * Copyright (c) 2026 Michael C. Pfau. All rights reserved.
 * Proprietary. Use requires prior written consent.
 */

.landing-map-panel {
  display: none;
  width: 100%;
}

body[data-landing-tab="map"] .landing-hero,
body[data-landing-tab="map"] .landing-carousel,
body[data-landing-tab="map"] .landing-strip {
  display: none;
}

body[data-landing-tab="map"] .landing-map-panel {
  display: block;
}

.landing-map-engine-switch {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.landing-map-engine-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  background: rgba(0, 0, 0, 0.64);
  border: 1px solid rgba(233, 236, 225, 0.18);
  border-radius: 4px;
  color: rgba(244, 245, 240, 0.76);
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.landing-map-engine-link:hover,
.landing-map-engine-link:focus-visible,
.landing-map-engine-link.active {
  border-color: rgba(210, 242, 184, 0.72);
  color: var(--brand-zest);
  text-decoration: none;
}

.rectangular-map {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 16px;
}

.rect-map-stage {
  position: relative;
  min-height: 640px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rect-map-leaflet,
.rect-map-maplibre {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000000;
}

.rect-map-stage .leaflet-container {
  width: 100%;
  height: 100%;
  background: #000000;
  color: #ffffff;
  font-family: "Diatype", Inter, sans-serif;
}

:root[data-theme="dark"] .rect-map-stage .leaflet-tile-pane {
  filter: grayscale(1) invert(1) brightness(0.55) contrast(1.18);
}

:root[data-theme="light"] .rect-map-stage .leaflet-tile-pane {
  filter: saturate(0.8) contrast(0.96) brightness(1.04);
}

.rect-map-stage .leaflet-control-attribution,
.rect-map-stage .leaflet-control-scale-line {
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(233, 236, 225, 0.24);
  color: rgba(244, 245, 240, 0.78);
  font-size: 10px;
}

.rect-map-stage .leaflet-control-attribution a {
  color: var(--brand-zest);
  text-decoration: none;
}

.rect-map-stage .leaflet-control-zoom {
  border: 1px solid rgba(233, 236, 225, 0.22);
  border-radius: 4px;
  overflow: hidden;
}

.rect-map-stage .leaflet-control-zoom a {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.78);
  border-color: rgba(233, 236, 225, 0.18);
  color: #ffffff;
  line-height: 32px;
}

.rect-map-stage .leaflet-tooltip {
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(233, 236, 225, 0.22);
  border-radius: 4px;
  color: #ffffff;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.rect-map-route-polyline {
  filter: drop-shadow(0 0 8px rgba(210, 242, 184, 0.45));
}

.rect-map-card,
.rect-map-route-card,
.rect-map-location-card,
.rect-map-controls,
.rect-map-kind-controls,
.rect-map-layer-list,
.rect-map-compass {
  position: absolute;
  z-index: 500;
}

.rect-map-card,
.rect-map-route-card,
.rect-map-location-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.76);
  border: 1px solid rgba(233, 236, 225, 0.24);
  border-radius: 6px;
  backdrop-filter: blur(14px);
}

.rect-map-card {
  top: 24px;
  left: 24px;
  width: min(350px, calc(100% - 48px));
}

.rect-map-route-card {
  top: 24px;
  right: 24px;
  width: min(326px, calc(100% - 48px));
}

.rect-map-location-card {
  top: 252px;
  right: 24px;
  width: min(326px, calc(100% - 48px));
}

.rect-map-category,
.rect-map-location-category,
.rect-map-route-heading span,
.rect-map-status,
.rect-map-route-card label span {
  color: var(--brand-zest);
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.rect-map-category {
  width: fit-content;
  text-decoration: none;
}

.rect-map-category:hover,
.rect-map-category:focus-visible {
  color: var(--brand-zest-light);
  text-decoration: none;
}

.rect-map-card h2,
.rect-map-location-card h3 {
  color: #ffffff;
  font-family: "GT Ultra Median", Georgia, serif;
  line-height: 1.05;
}

.rect-map-card h2 {
  font-size: 27px;
}

.rect-map-location-card h3 {
  font-size: 23px;
}

.rect-map-card p,
.rect-map-location-card p,
.rect-map-location-card small {
  color: rgba(244, 245, 240, 0.78);
  font-size: 13px;
  line-height: 1.38;
}

.rect-map-location-card small {
  color: rgba(244, 245, 240, 0.62);
}

.rect-map-status {
  color: rgba(244, 245, 240, 0.68) !important;
}

.rect-map-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rect-map-stat {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(39, 48, 41, 0.72);
  border: 1px solid rgba(233, 236, 225, 0.16);
  border-radius: 4px;
}

.rect-map-stat small,
.rect-map-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rect-map-stat small {
  color: rgba(233, 236, 225, 0.64);
  font-size: 11px;
  line-height: 1.1;
}

.rect-map-stat strong,
.rect-map-route-heading strong {
  color: #ffffff;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
}

.rect-map-route-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.rect-map-route-card label {
  display: grid;
  gap: 6px;
}

.rect-map-select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  background: rgba(39, 48, 41, 0.9);
  border: 1px solid rgba(233, 236, 225, 0.18);
  border-radius: 4px;
  color: #ffffff;
  font: inherit;
}

.rect-map-route-button,
.rect-map-location-route {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(210, 242, 184, 0.62);
  border-radius: 4px;
  background: rgba(210, 242, 184, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.rect-map-route-button:hover,
.rect-map-location-route:hover {
  border-color: var(--brand-zest);
  background: rgba(210, 242, 184, 0.22);
}

.rect-map-location-route:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.rect-map-location-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.rect-map-location-data div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  background: rgba(39, 48, 41, 0.72);
  border: 1px solid rgba(233, 236, 225, 0.14);
  border-radius: 4px;
}

.rect-map-location-data dt,
.rect-map-location-data dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rect-map-location-data dt {
  color: rgba(233, 236, 225, 0.58);
  font-size: 11px;
}

.rect-map-location-data dd {
  color: #ffffff;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.rect-map-detail-card {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  background: #000000;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rect-map-detail-thumbnail {
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--brand-pine);
  border: 1px solid rgba(233, 236, 225, 0.18);
  border-radius: 4px;
}

.rect-map-detail-thumbnail img,
.rect-map-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.rect-map-detail-thumbnail img {
  object-fit: cover;
}

.rect-map-thumbnail-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background:
    linear-gradient(135deg, rgba(210, 242, 184, 0.16), rgba(171, 134, 109, 0.18)),
    var(--brand-pine);
  color: #ffffff;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  text-align: center;
}

.rect-map-thumbnail-placeholder span {
  color: var(--brand-zest);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.rect-map-thumbnail-placeholder strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.rect-map-detail-body {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 16px;
}

.rect-map-detail-heading {
  display: grid;
  gap: 7px;
}

.rect-map-detail-heading p {
  color: var(--brand-zest);
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.rect-map-detail-heading h2 {
  color: #ffffff;
  font-family: "GT Ultra Median", Georgia, serif;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.02;
}

.rect-map-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(233, 236, 225, 0.18);
  border-bottom: 1px solid rgba(233, 236, 225, 0.18);
}

.rect-map-detail-facts div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-right: 1px solid rgba(233, 236, 225, 0.18);
}

.rect-map-detail-facts div:last-child {
  border-right: 0;
}

.rect-map-detail-facts dt,
.rect-map-detail-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.rect-map-detail-facts dt {
  color: rgba(233, 236, 225, 0.56);
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.rect-map-detail-facts dd {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.3;
}

.rect-map-detail-description {
  max-width: 780px;
  color: rgba(244, 245, 240, 0.78);
  font-size: 15px;
  line-height: 1.45;
}

.rect-map-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rect-map-detail-route {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(210, 242, 184, 0.62);
  border-radius: 4px;
  background: rgba(210, 242, 184, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.rect-map-detail-route:hover {
  border-color: var(--brand-zest);
  background: rgba(210, 242, 184, 0.22);
}

.rect-map-detail-route:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.rect-map-detail-actions span {
  color: rgba(244, 245, 240, 0.62);
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.rect-map-controls {
  top: 226px;
  left: 24px;
  display: flex;
  gap: 8px;
}

.rect-map-kind-controls {
  right: 24px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(660px, calc(100% - 48px));
}

.rect-map-control,
.rect-map-kind {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(233, 236, 225, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: rgba(244, 245, 240, 0.76);
  cursor: pointer;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.rect-map-control:hover,
.rect-map-kind:hover,
.rect-map-control.active,
.rect-map-kind.active {
  border-color: rgba(210, 242, 184, 0.8);
  color: #ffffff;
}

.rect-map-control.active,
.rect-map-kind.active {
  background: rgba(39, 48, 41, 0.86);
}

.rect-map-layer-list {
  left: 24px;
  bottom: 24px;
  width: min(430px, calc(100% - 48px));
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rect-map-layer-pill {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(233, 236, 225, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.66);
  color: rgba(244, 245, 240, 0.78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
  backdrop-filter: blur(10px);
}

.rect-map-layer-pill::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--layer-color);
  content: "";
}

.rect-map-compass {
  top: 24px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 9px 10px 7px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(233, 236, 225, 0.22);
  border-radius: 4px;
  color: #ffffff;
  font-family: "Diatype Semi Mono Condensed", "Diatype", Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.rect-map-compass-arrow {
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-bottom: 26px solid #d32f2f;
  border-left: 8px solid transparent;
}

:root[data-theme="light"] .rect-map-stage {
  border-color: var(--brand-lichen-dark);
}

:root[data-theme="light"] .rect-map-detail-card {
  background: var(--brand-lichen-light);
  border-color: var(--brand-lichen-dark);
}

:root[data-theme="light"] .rect-map-detail-thumbnail {
  border-color: rgba(39, 48, 41, 0.16);
}

:root[data-theme="light"] .rect-map-card,
:root[data-theme="light"] .rect-map-route-card,
:root[data-theme="light"] .rect-map-location-card,
:root[data-theme="light"] .rect-map-control,
:root[data-theme="light"] .rect-map-kind,
:root[data-theme="light"] .rect-map-layer-pill,
:root[data-theme="light"] .rect-map-compass,
:root[data-theme="light"] .leaflet-control-attribution,
:root[data-theme="light"] .leaflet-control-scale-line,
:root[data-theme="light"] .leaflet-control-zoom a {
  background: rgba(244, 245, 240, 0.88);
  border-color: rgba(39, 48, 41, 0.2);
  color: var(--brand-pine);
}

:root[data-theme="light"] .rect-map-card h2,
:root[data-theme="light"] .rect-map-location-card h3,
:root[data-theme="light"] .rect-map-detail-heading h2,
:root[data-theme="light"] .rect-map-stat strong,
:root[data-theme="light"] .rect-map-route-heading strong,
:root[data-theme="light"] .rect-map-location-data dd,
:root[data-theme="light"] .rect-map-detail-facts dd {
  color: var(--brand-pine);
}

:root[data-theme="light"] .rect-map-card p,
:root[data-theme="light"] .rect-map-location-card p,
:root[data-theme="light"] .rect-map-location-card small,
:root[data-theme="light"] .rect-map-detail-description,
:root[data-theme="light"] .rect-map-status {
  color: rgba(39, 48, 41, 0.74) !important;
}

:root[data-theme="light"] .rect-map-detail-facts {
  border-color: rgba(39, 48, 41, 0.16);
}

:root[data-theme="light"] .rect-map-detail-facts div {
  border-color: rgba(39, 48, 41, 0.16);
}

:root[data-theme="light"] .rect-map-route-button,
:root[data-theme="light"] .rect-map-location-route,
:root[data-theme="light"] .rect-map-detail-route {
  color: var(--brand-pine);
}

:root[data-theme="light"] .rect-map-stat,
:root[data-theme="light"] .rect-map-location-data div,
:root[data-theme="light"] .rect-map-select {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(39, 48, 41, 0.14);
  color: var(--brand-pine);
}

:root[data-theme="light"] .rect-map-stat small,
:root[data-theme="light"] .rect-map-location-data dt,
:root[data-theme="light"] .rect-map-detail-facts dt,
:root[data-theme="light"] .rect-map-detail-actions span {
  color: rgba(39, 48, 41, 0.58);
}

:root[data-theme="light"] .rect-map-control:hover,
:root[data-theme="light"] .rect-map-kind:hover,
:root[data-theme="light"] .rect-map-control.active,
:root[data-theme="light"] .rect-map-kind.active {
  border-color: var(--brand-granite);
  color: var(--brand-pine);
}

:root[data-theme="light"] .rect-map-control.active,
:root[data-theme="light"] .rect-map-kind.active {
  background: rgba(233, 236, 225, 0.96);
}

@media (max-width: 1180px) {
  .rect-map-stage {
    min-height: 590px;
  }

  .rect-map-card {
    width: min(316px, calc(100% - 48px));
  }

  .rect-map-route-card,
  .rect-map-location-card {
    width: min(304px, calc(100% - 48px));
  }
}

@media (max-width: 920px) {
  .rect-map-card h2 {
    font-size: 23px;
  }

  .rect-map-card {
    width: min(300px, calc(100% - 48px));
  }

  .rect-map-route-card,
  .rect-map-location-card {
    width: min(286px, calc(100% - 48px));
  }

  .rect-map-detail-card {
    grid-template-columns: 1fr;
  }

  .rect-map-detail-thumbnail {
    max-width: 520px;
  }

  .rect-map-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rect-map-detail-facts div:nth-child(2n) {
    border-right: 0;
  }

  .rect-map-detail-facts div:nth-child(n + 3) {
    border-top: 1px solid rgba(233, 236, 225, 0.18);
  }
}

@media (max-width: 760px) {
  .rect-map-stage {
    display: grid;
    gap: 8px;
    min-height: 0;
    min-width: 0;
    aspect-ratio: auto;
    padding: 8px;
    overflow: hidden;
  }

  .rect-map-leaflet {
    position: relative;
    inset: auto;
    min-height: 380px;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(233, 236, 225, 0.16);
    border-radius: 4px;
    overflow: hidden;
  }

  .rect-map-card,
  .rect-map-route-card,
  .rect-map-location-card,
  .rect-map-controls,
  .rect-map-kind-controls,
  .rect-map-layer-list,
  .rect-map-compass {
    position: static;
    min-width: 0;
    width: auto;
    max-width: none;
    transform: none;
  }

  .rect-map-compass {
    order: -1;
    width: fit-content;
    justify-self: end;
  }

  .rect-map-stats,
  .rect-map-location-data {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rect-map-card,
  .rect-map-route-card,
  .rect-map-location-card {
    padding: 14px;
  }

  .rect-map-controls,
  .rect-map-kind-controls,
  .rect-map-layer-list {
    justify-content: flex-start;
  }

  .rect-map-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rect-map-kind-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rect-map-kind,
  .rect-map-control {
    width: 100%;
  }

  .rect-map-layer-pill {
    flex: 1 1 160px;
    min-height: 28px;
    line-height: 1.2;
  }

  .rect-map-detail-card {
    gap: 14px;
    padding: 14px;
  }

  .rect-map-detail-heading h2 {
    font-size: 27px;
  }

  .rect-map-detail-facts {
    grid-template-columns: 1fr;
  }

  .rect-map-detail-facts div,
  .rect-map-detail-facts div:nth-child(2n) {
    border-right: 0;
  }

  .rect-map-detail-facts div + div,
  .rect-map-detail-facts div:nth-child(n + 3) {
    border-top: 1px solid rgba(233, 236, 225, 0.18);
  }
}
