/* Layout: two matched map plates side-by-side with combined title + key overlays and a full-width footer below. */
@layer reset, base, components;

@layer reset {
  figure,
  figcaption,
  div,
  footer,
  p,
  ul,
  li,
  h2,
  button,
  span {
    box-sizing: border-box;
  }
}

@layer base {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --paper: #ffffff;
    --overlay-bg: rgba(255, 255, 255, 0.94);
    --ink: #1d2226;
    --muted: #5b6268;
    --rule: #d9dbd6;
    --accent: #1f5f73;
    --map-ground: #eceeea;
    --label: #2b3135;
    --label-halo: rgba(255, 255, 255, 0.85);
    --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.55;
    /* padding-inline-start: max(16px, env(safe-area-inset-left, 0px));
    padding-inline-end: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 16px 28px; */
  }
}

@layer components {
  .wrap {
    max-inline-size: 1240px;
    margin-inline: auto;
    display: grid;
    gap: 8px;
  }

  .plates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  @media (max-width: 600px) {
    .plates {
      grid-template-columns: 1fr;
    }
  }

  figure.plate {
    position: relative;
    margin: 0;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
    min-inline-size: 0;
  }

  .map {
    block-size: min(76dvh, 680px);
    min-block-size: 400px;
    background: var(--map-ground);
  }
  .leaflet-container {
    background: var(--map-ground);
    font-family: var(--font-body);
  }

  figcaption.map-overlay {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 12px;
    inline-size: fit-content;
    max-inline-size: calc(100% - 66px);
    z-index: 900;
    background: var(--overlay-bg);
    backdrop-filter: blur(6px);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    pointer-events: none;
  }

  .overlay-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    align-items: baseline;
  }
  .overlay-head h2 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.2;
    margin: 0;
    color: var(--ink);
  }
  .overlay-head span {
    font-size: 0.75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .key-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .key {
    display: flex;
    flex-direction: column;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
  }
  .key li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .sw {
    inline-size: 12px;
    block-size: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex: none;
  }
  .readout {
    font-size: 0.75rem;
    color: var(--muted);
    min-block-size: 1.4em;
    border-block-start: 1px solid var(--rule);
    padding-block-start: 5px;
  }
  .readout b {
    color: var(--ink);
  }

  .place-label {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    font: 600 0.6875rem/1 var(--font-body);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--label);
    text-shadow:
      0 0 3px var(--label-halo),
      0 0 3px var(--label-halo),
      0 0 1px var(--label-halo);
    white-space: nowrap;
  }
  .place-label::before {
    display: none;
  }
  .school-pin {
    background: none;
    border: 0;
  }
  .school-pin svg {
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  }
  .leaflet-tooltip.tip {
    font: 0.8125rem/1.35 var(--font-body);
  }
  .leaflet-popup-content {
    font: 0.8125rem/1.45 var(--font-body);
  }
  .tiles-off .leaflet-tile-pane {
    display: none;
  }
  .ghost {
    pointer-events: none;
  }
  .ghost span {
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #111;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
  }
  .ghost span::before,
  .ghost span::after {
    content: "";
    position: absolute;
    background: #111;
  }
  .ghost span::before {
    left: 50%;
    top: -8px;
    bottom: -8px;
    width: 2px;
    margin-left: -1px;
  }
  .ghost span::after {
    top: 50%;
    left: -8px;
    right: -8px;
    height: 2px;
    margin-top: -1px;
  }

  footer {
    font-size: 0.8125rem;
    color: var(--muted);
    inline-size: 100%;
    max-inline-size: none;
  }
  footer p {
    margin: 0;
    text-wrap: pretty;
  }
  footer strong {
    color: var(--ink);
    font-weight: 600;
  }
  footer a {
    color: var(--accent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaflet-zoom-anim .leaflet-zoom-animated {
    transition: none !important;
  }
}
