*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: #101527;
  background: #f6f7fb;
}

body {
  line-height: 1.6;
}

/* Scoped typography for map plugin - all Inter since using H3+ headings */
.sch-map-app {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

.sch-map-app h3,
.sch-map-app h4 {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.reg {
  font-size: 0.6em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.08em;
  font-weight: inherit;
}

/* Page header */

.page-header {
  padding: 70px 24px 56px;
  background: linear-gradient(135deg, #0b1733, #14264c);
  color: #eaf0ff;
}

.page-header-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  opacity: 0.75;
  margin-bottom: 0.45rem;
}

.page-header h1 {
  margin: 0 0 0.75rem;
  font-size: 1.9rem;
}

.page-header .lede {
  max-width: 640px;
  color: #bcc7e5;
  font-size: 0.98rem;
}

/* App layout */

.sch-map-app {
  padding: 56px 24px 80px;
  background: #f6f7fb;
}

.sch-map-intro,
.sch-map-layout {
  max-width: 1120px;
  margin: 0 auto;
}

.sch-map-intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.sch-map-copy {
  max-width: 640px;
}

.sch-map-copy h3 {
  margin: 0 0 0.4rem;
}

.sch-map-copy p {
  color: #4b5673;
}

.sch-map-filters {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  border-radius: 0;
  border: 1px solid rgba(14, 35, 77, 0.35);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.95rem;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  color: #14203d;
  transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out,
    box-shadow 160ms ease-out;
}

.filter-btn:hover {
  background: #14203d;
  color: #f5f7ff;
}

.filter-btn.is-active {
  background: #132649;
  color: #f5f7ff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(8, 23, 60, 0.35);
}

.sch-map-layout {
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr; /* map takes full content width */
  gap: 0;
  align-items: stretch;
  position: relative; /* anchor for absolutely-positioned panel on desktop */
}

/* Map canvas */

.sch-map-canvas {
  position: relative;
  background: #0b0f1f;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 32px 90px rgba(7, 16, 41, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  aspect-ratio: 1374 / 720;
  width: 100%;
}

.map-bg {
  position: absolute;
  inset: 0;
  background: url('map.jpg') center center / 100% 100% no-repeat;
}

/* Zoom layer — wraps grid + SVG so the panel stays fixed during pan/zoom */

.map-zoom-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

/* Zoom controls — mobile only */

.map-zoom-controls {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  flex-direction: column;
  gap: 4px;
}

.zoom-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 20, 50, 0.72);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 160ms ease-out;
}

.zoom-btn:active {
  background: rgba(30, 60, 120, 0.88);
}

/* Blueprint grid overlay */

.map-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    );
  background-size: 34px 34px;
  mix-blend-mode: soft-light;
  opacity: 0.65;
  pointer-events: none;
}

.map-svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

/* Water shapes, land outlines */

.water-shape {
  stroke: rgba(210, 226, 255, 0.22);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.land-outline {
  fill: none;
  stroke: rgba(214, 231, 255, 0.6);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 10;
  opacity: 0.7;
}

.coast-outline {
  stroke-dasharray: 3 8;
}

/* Markers */

.marker {
  cursor: pointer;
}

.marker-inner {
  transform-origin: center;
  transform-box: fill-box;
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

/* Remove default browser focus ring on SVG groups, replace with custom style */
.marker:focus, .marker:focus-visible { outline: none; }
svg g.marker:focus { outline: none; }
.marker:focus .marker-inner { transform: scale(1.06); }
.marker:focus .marker-orbit {
  stroke: #2182BF; /* brand blue focus */
  stroke-opacity: 1;
  stroke-dasharray: 1 0;
  stroke-width: 1.4;
}

/* Remove iOS tap highlight */
.sch-map-canvas, .marker { -webkit-tap-highlight-color: transparent; }

.marker-orbit {
  /* Make the entire circle clickable without visual fill */
  fill: #ffffff;
  fill-opacity: 0.001; /* effectively invisible */
  pointer-events: all;
  stroke: #023E73; /* brand navy */
  stroke-opacity: 0.85;
  stroke-width: 1.2;
  stroke-dasharray: 2 6;
}

.marker-star {
  fill: #F28322; /* brand orange */
  stroke: #023E73; /* brand navy edge */
  stroke-width: 0.9;
  filter: drop-shadow(0 0 8px rgba(33, 130, 191, 0.65)); /* brand blue glow */
}

/* Nudge icon (circle+star) slightly upward to avoid label overlap */
.marker-orbit,
.marker-star {
  transform: translateY(-6px);
  transform-box: fill-box;
  transform-origin: center;
}

.marker-label {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  text-anchor: middle;
  fill: #023E73; /* brand navy for contrast */
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.geo-label {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-style: italic;
  font-size: 18px;
  fill: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  pointer-events: none;
  user-select: none;
}

.marker-label-bg {
  fill: #ffffff; /* solid white background for readability */
  pointer-events: none; /* do not block clicks */
}

.marker:hover .marker-inner { transform: scale(1.06); }

.marker.is-dimmed {
  opacity: 0.22;
  pointer-events: none;
}

.marker.is-active .marker-inner { transform: scale(1.12); }

.marker.is-active .marker-orbit {
  stroke: #2182BF; /* brand blue */
  stroke-opacity: 1;
  stroke-dasharray: 1 0; /* solid */
  stroke-width: 1.4;
}

.marker.is-active .marker-star {
  fill: #82BF45; /* brand green for active */
  stroke-width: 1;
}

/* Panel */

.sch-map-panel {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  background: #ffffff;
  border-radius: 0;
  padding: 20px 18px;
  box-shadow: 0 22px 60px rgba(9, 19, 45, 0.18);
  border: 1px solid rgba(13, 24, 51, 0.06);
  max-width: min(420px, 90%);
}

.panel-close {
  display: none; /* Hidden on desktop */
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #4a5266;
  cursor: pointer;
  z-index: 10;
  transition: color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.panel-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(13, 24, 51, 0.15);
  border-radius: 0;
  background: transparent;
  color: #4a5266;
  cursor: pointer;
  z-index: 10;
  transition: color 160ms ease-out, border-color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.panel-toggle:hover {
  color: #14203d;
  border-color: rgba(13, 24, 51, 0.35);
}

.panel-toggle svg {
  display: block;
  pointer-events: none;
  transition: transform 250ms ease-out;
}

.sch-map-panel.is-collapsed .panel-toggle svg {
  transform: rotate(180deg);
}

.sch-map-panel.is-collapsed .panel-meta,
.sch-map-panel.is-collapsed .panel-inner > p,
.sch-map-panel.is-collapsed .panel-cta {
  display: none;
}

.sch-map-panel.is-collapsed .panel-inner h3 {
  margin-bottom: 0;
}

.panel-inner h3 {
  padding-right: 2rem;
}

.panel-close:hover,
.panel-close:active {
  color: #14203d;
}

.panel-close svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.panel-inner {
  position: relative;
  z-index: 1;
}

.panel-inner h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.panel-inner p {
  color: #4a5266;
  font-size: 0.94rem;
}

.panel-meta {
  margin: 1rem 0;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #757f95;
}

.panel-list {
  padding-left: 1.1rem;
  margin: 0.3rem 0 1.3rem;
  font-size: 0.9rem;
  color: #4f586f;
}

.panel-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 0;
  border: none;
  background: #102241;
  color: #f4f6ff;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
}

.panel-cta:hover {
  background: #1e4d8c;
}

/* Responsive */

@media (max-width: 960px) {
  .sch-map-intro {
    grid-template-columns: 1fr;
  }
  .map-zoom-controls {
    display: flex;
  }
  .sch-map-canvas {
    touch-action: none; /* let JS handle all touch gestures */
  }
  .sch-map-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    max-width: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(13, 24, 51, 0.1);
    padding: 18px 16px;
    transition: none;
  }
  .sch-map-panel.is-hidden {
    display: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .panel-close {
    display: block;
  }
  .panel-toggle {
    display: none;
  }
}

@media (max-width: 720px) {
  .page-header {
    padding-inline: 18px;
  }

  .sch-map-app {
    padding-inline: 18px;
  }

  .sch-map-canvas {
    /* Aspect ratio maintained, min-height removed to allow proper scaling */
  }

  .marker-label {
    font-size: 10px;
  }
}

/* POSITIONING MODE - COMMENTED OUT FOR PRODUCTION */
/*
.sch-map-app.is-positioning .marker-orbit {
  stroke: #F28322;
}
.sch-map-app.is-positioning .marker-star {
  filter: drop-shadow(0 0 10px rgba(242, 131, 34, 0.7));
}
*/
