/* ============================================================================
   S2 · THE FOOTPRINT — the signature interaction (spec §S2)
   Light warm-gray basemap, one amber footprint, drag to compare. Everything
   here stays quiet so the drag is the moment.
   ========================================================================== */

.s2__intro { max-width: var(--measure-text); }

/* --- "Meet the buildings" intro block (§S2 item 2) — before the picker ---- */
.meet { max-width: var(--measure-text); }
.meet__eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  color: var(--color-ink-55);
  margin: 0 0 var(--space-2xs);
}
/* Subtitle under the eyebrow — why these five, not a ranking. */
.meet__subtitle {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  color: var(--color-ink-70);
  margin: 0 0 var(--space-sm);
}
/* Meet-the-buildings cards (§C.12) — compact, single column on mobile,
   tap-to-select. Designed / under-construction cards get a dashed border to
   match the map's built-vs-announced device (§C.11). */
.meet__cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}
.meet-card {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  background: var(--color-paper);
  border: var(--rule-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.meet-card:hover { border-color: var(--color-amber); }
.meet-card[data-render="dashed"] { border-style: dashed; border-color: var(--color-warmgray-300); }
.meet-card[data-render="dashed"]:hover { border-color: var(--color-amber); }
.meet-card[aria-pressed="true"] {
  border-color: var(--color-ink);
  background: rgba(208, 138, 46, 0.06);
}
.meet-card__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-sm);
  margin-bottom: 2px;
}
.meet-card__name {
  font-family: var(--font-serif);
  font-size: var(--fs-body-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
  line-height: 1.2;
}
.meet-card__pill {
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--color-warmgray-300);
  color: var(--color-ink-70);
  white-space: nowrap;
}
.meet-card__pill[data-status="operational"] { color: var(--amber-stroke); border-color: var(--amber-stroke); }
.meet-card__pill[data-status="designed"],
.meet-card__pill[data-status="announced"],
.meet-card__pill[data-status="construction"] {
  border-style: dashed;
  white-space: normal;
}
.meet-card__line {
  display: block;
  font-size: var(--fs-annotation);
  line-height: 1.45;
  color: var(--color-ink-70);
}
.meet__prompt {
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
  margin: var(--space-xs) 0 0;
}

/* --- Controls: facility picker + search + presets ----------------------- */
.s2__controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-block: var(--space-md);
}
.picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}
/* Dashed chip edge signals designed/announced facilities in the picker too. */
.chip-toggle[data-render="dashed"] {
  border-style: dashed;
}
.chip-toggle[data-facility][data-pending="true"]::after {
  content: " · footprint pending";
  opacity: 0.7;
}

.s2__search {
  display: flex;
  gap: var(--space-2xs);
  max-width: 30rem;
}
.s2__search input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body-sm);
  color: var(--color-ink);
  background: var(--color-paper);
  border: var(--rule-mid);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}
.s2__search input:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }

.s2__presets {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
}
.s2__search-status {
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
  min-height: 1.2em;
}
.s2__search-status[data-state="error"] { color: var(--color-amber); }

/* --- Map ---------------------------------------------------------------- */
.map-wrap {
  position: relative;
  margin-inline: auto;
  max-width: var(--measure-graphic);
}
.map {
  height: clamp(360px, 62vh, 560px);
  background: var(--color-warmgray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* Full-bleed on mobile (§8) */
@media (max-width: 719px) {
  .map { border-radius: 0; }
  .map-wrap { margin-inline: calc(-1 * var(--gutter)); max-width: none; }
}
.map:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* Loading / no-JS state inside the map box */
.map__loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
  pointer-events: none;
}

/* Drag hint (instructional micro-copy, §2) */
.map__hint {
  position: absolute;
  top: var(--space-xs); left: var(--space-xs);
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink);
  background: rgba(252, 251, 248, 0.9);
  border: var(--rule-hairline);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  pointer-events: none;
  max-width: calc(100% - 2 * var(--space-xs));
}
.map__hint svg { width: 15px; height: 15px; flex: none; }

/* Drag instruction — a caption below the map (mobile wins: no overlay clutter) */
.map-hint-caption {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin-top: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
}
.map-hint-caption svg { width: 16px; height: 16px; flex: none; }

/* Tap fallback for drag (§5 accessibility) */
.map__place {
  position: absolute;
  bottom: var(--space-xs); left: var(--space-xs);
  background: rgba(252, 251, 248, 0.95);
  box-shadow: var(--shadow-popover);
}

/* Legend (built vs designed device, §2) */
.map__legend {
  position: absolute;
  bottom: var(--space-xs); right: var(--space-xs);
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(252, 251, 248, 0.92);
  border: var(--rule-hairline);
  border-radius: var(--radius-sm);
  padding: var(--space-2xs) var(--space-xs);
}

/* Grab cursor cue while pointer is over the draggable footprint */
.map.is-grabbable { cursor: grab; }
.map.is-grabbing { cursor: grabbing; }

/* Site pin (e.g. the Colossus site, marked from public property records) */
.site-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.site-pin__card {
  display: flex;
  flex-direction: column;
  max-width: 12rem;
  background: rgba(252, 251, 248, 0.95);
  border: var(--rule-hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  padding: 0.3rem 0.5rem;
  margin-bottom: 4px;
  font-family: var(--font-sans);
  text-align: center;
}
.site-pin__card b { font-size: var(--fs-annotation); color: var(--color-ink); }
.site-pin__card small { font-size: 0.6875rem; color: var(--color-ink-55); font-style: italic; }
.site-pin__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-amber);
  border: 2px solid var(--color-paper);
  box-shadow: 0 0 0 1px var(--amber-stroke);
}

/* Facility label that follows the footprint centroid */
.map__fp-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  font-weight: var(--weight-semibold);
  color: var(--color-ink);
  background: rgba(252, 251, 248, 0.85);
  padding: 0.1em 0.45em;
  border-radius: var(--radius-sm);
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

/* --- On-map identity card (§S2 item 2) — pinned to the map, collapsible ---
   Always tells the reader what they're dragging without scrolling; capped so it
   never covers more than about a third of the map; COI is never trimmed. */
.map-idcard {
  position: absolute;
  top: var(--space-xs);
  left: var(--space-xs);
  z-index: 3;
  width: min(300px, calc(100% - 2 * var(--space-xs)));
  /* Sizes to content and always renders in full — never clipped (§C.13).
     The collapse toggle is how the reader reclaims the map, not a height cap. */
  background: rgba(252, 251, 248, 0.96);
  border: var(--rule-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: var(--space-xs) var(--space-sm) var(--space-sm);
}
.map-idcard.is-collapsed { max-height: none; overflow: visible; }
.map-idcard.is-collapsed .map-idcard__body { display: none; }
/* Collapsed: the entire compact bar is the tap target (name + pill + Details ▾). */
.map-idcard.is-collapsed .map-idcard__header { cursor: pointer; min-height: 44px; }
.map-idcard__header {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  flex-wrap: wrap;
}
.map-idcard__header .annotation-card__name { flex: 1 1 auto; }
/* Labeled toggle ("Details ▾" / "Hide ▴"), min 44px tap target (§accessibility). */
.map-idcard__toggle {
  flex: none;
  min-height: 44px;
  padding: 0 0.6rem;
  border: var(--rule-hairline);
  border-radius: var(--radius-sm);
  background: var(--color-paper);
  color: var(--color-ink-70);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  font-weight: var(--weight-semibold);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.map-idcard__body { margin-top: var(--space-2xs); }

/* Mobile (≤768px): COLLAPSED IS THE DEFAULT. The rule keys off the ABSENCE of
   `.is-expanded`, so the compact bar is the first state on load — before the JS
   collapse state is applied and regardless of render path — not only after a
   facility switch. The card only opens when JS explicitly adds `.is-expanded`
   (which, on mobile, happens solely from a reader tap). */
@media (max-width: 768px) {
  .map-idcard:not(.is-expanded) .map-idcard__body { display: none; }
  .map-idcard:not(.is-expanded) .map-idcard__header { cursor: pointer; min-height: 44px; }

  /* Expanded on mobile: capped at 45% of the map container so the map is never
     more than half covered. If content overflows (Colossus + its COI disclosure),
     the BODY scrolls internally — the disclosure stays scrollable, never
     truncated. The header stays fixed as the always-visible identity bar. */
  .map-idcard.is-expanded {
    display: flex;
    flex-direction: column;
    max-height: 45%;
  }
  .map-idcard.is-expanded .map-idcard__header { flex: none; }
  .map-idcard.is-expanded .map-idcard__body {
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}
.annotation-card__name {
  font-family: var(--font-serif);
  font-size: var(--fs-body-lg);
  font-weight: var(--weight-semibold);
}
.status-pill {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--color-warmgray-300);
  color: var(--color-ink-70);
}
.status-pill[data-status="operational"] { color: var(--amber-stroke); border-color: var(--amber-stroke); }
.status-pill[data-status="designed"],
.status-pill[data-status="announced"],
.status-pill[data-status="construction"] { border-style: dashed; color: var(--color-ink-70); }

.annotation-card__sentence { margin-top: var(--space-2xs); }
.annotation-card__sentence--secondary {
  font-size: var(--fs-annotation);
  color: var(--color-ink-70);
  font-style: italic;
}
.annotation-card__facts {
  margin-top: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-70);
  display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
}
.annotation-card__facts b { color: var(--color-ink); font-weight: var(--weight-semibold); }

.approx-note {
  margin-top: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
  font-style: italic;
}

/* COI disclosure marker where Colossus/Anthropic appears (§9) */
.coi-note {
  margin-top: var(--space-2xs);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-55);
  font-style: italic;
}

/* Footprint-pending notice (Colossus, until a traced outline is supplied) */
.footprint-pending {
  margin-top: var(--space-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-annotation);
  color: var(--color-ink-70);
  background: rgba(208, 138, 46, 0.06);
  border: 1px dashed var(--amber-stroke);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
}
