/* ==========================================================================
   Chicago 1919 — Memorial Atlas
   Editorial cartography. Full-bleed map field with floating overlays.
   ========================================================================== */

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

:root {
  /* ---------- Palette: chalk · graphite · smoke · pink ---------- */
  --paper: #f4f4f2;
  --surface: #ffffff;
  --surface-translucent: rgba(255, 255, 255, 0.94);
  --ink: #16161a;
  --ink-soft: #2e2e33;
  --smoke: #6c6c72;
  --smoke-light: #858589;
  --smoke-faint: #c7c7cb;
  --rule: #d8d8da;
  --rule-faint: #e8e8ea;

  --accent: #d63b6e;
  --accent-deep: #b02e5b;

  --shadow-overlay: 0 1px 2px rgba(22, 22, 26, 0.04),
                    0 4px 16px rgba(22, 22, 26, 0.06),
                    0 16px 48px rgba(22, 22, 26, 0.08);
  --shadow-soft: 0 1px 3px rgba(22, 22, 26, 0.06),
                 0 6px 20px rgba(22, 22, 26, 0.06);

  /* ---------- Overlay architecture tokens ---------- */
  --panel-border: 1px solid rgba(216, 216, 218, 0.6);
  --panel-rule: 2px solid var(--accent);
  --panel-shadow: 0 1px 2px rgba(22, 22, 26, 0.03), 0 8px 24px rgba(22, 22, 26, 0.05);
  --panel-pad-x: 24px;
  --panel-pad-y: 16px;
  --control-h: 34px;

  /* ---------- Typography ---------- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-title: 'Oswald', 'Arial Narrow', 'DIN Condensed', 'Roboto Condensed', sans-serif;

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.15s;
  --duration-normal: 0.18s;
  --duration-slow: 0.3s;
  --transition-panel: 180ms var(--ease-out);
  --transition-state: 150ms var(--ease-out);

  --overlay-width: 360px;
}

html, body {
  height: 100%;
  background: var(--paper);
}

body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

a:hover {
  border-bottom-color: var(--accent);
}

button {
  font-family: inherit;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 22px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-bottom: none;
}

.skip-link:focus {
  top: 8px;
}

/* ==========================================================================
   Map field — fills the viewport
   ========================================================================== */

#map {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: var(--paper);
  z-index: 1;
}

/* Atmospheric, paper-like cast over basemap tiles */
.leaflet-tile-pane .leaflet-layer:first-child .leaflet-tile {
  filter: grayscale(0.65) contrast(0.88) brightness(1.04) saturate(0.45);
}

.leaflet-container {
  background: var(--paper);
  font-family: var(--font-sans);
}

/* Subtle cinematic vignette and paper grain */
.map-atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

.map-atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 120% 90% at center,
      transparent 55%,
      rgba(22, 22, 26, 0.07) 100%
    );
}

.map-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.08  0 0 0 0 0.09  0 0 0 0.045 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-soft) !important;
  margin: 18px !important;
}

.leaflet-control-zoom a {
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.leaflet-control-zoom a + a {
  border-top: none !important;
}

.leaflet-control-zoom a:hover {
  background: var(--ink) !important;
  color: var(--surface) !important;
}

/* Slide the bottom-right controls (zoom + layer toggles) left of the
   detail overlay when it opens, so they stay reachable on desktop. */
.leaflet-bottom.leaflet-right,
.layer-control {
  transition: right var(--duration-slow) var(--ease-in-out),
              transform var(--duration-slow) var(--ease-in-out);
}

@media (min-width: 769px) {
  body.detail-open .leaflet-bottom.leaflet-right {
    right: calc(var(--overlay-width) / 3 + 8px);
  }
  body.detail-open .layer-control {
    right: calc(var(--overlay-width) / 3 + 24px);
  }
}

.leaflet-control-attribution {
  background: var(--surface-translucent) !important;
  font-size: 10px !important;
  color: var(--smoke) !important;
  padding: 4px 8px !important;
  border-radius: 0 !important;
  letter-spacing: 0.01em;
}

.leaflet-control-attribution a {
  color: var(--smoke) !important;
  border-bottom: none;
}

/* ==========================================================================
   Memorial markers — pink square, white core
   ========================================================================== */

.memorial-marker {
  width: 14px;
  height: 14px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(22, 22, 26, 0.25);
  transition: transform var(--transition-state),
              box-shadow var(--transition-state),
              opacity var(--transition-state);
  cursor: pointer;
}

.memorial-marker .marker-core {
  width: 4px;
  height: 4px;
  background: var(--surface);
  transition: background var(--transition-state);
}

/* Hover / keyboard focus */
.memorial-marker:hover,
.memorial-marker:focus-visible {
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent);
}

/* Selected */
.memorial-marker.active {
  width: 18px;
  height: 18px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent), 0 2px 8px rgba(22, 22, 26, 0.2);
}

.memorial-marker.active .marker-core {
  width: 6px;
  height: 6px;
  background: var(--surface);
}

/* Recessed while another entry is selected */
body.detail-open .memorial-marker:not(.active) {
  opacity: 0.45;
}

body.detail-open .memorial-marker:not(.active):hover {
  opacity: 0.85;
}

.memorial-marker-wrapper {
  background: transparent;
  border: 0;
}

/* Subtle map dimming when entry is open */
body.detail-open .leaflet-tile-pane {
  transition: opacity var(--transition-state);
  opacity: 0.88;
}

body.detail-open .map-atmosphere::before {
  background: radial-gradient(
    ellipse 120% 90% at center,
    transparent 40%,
    rgba(22, 22, 26, 0.1) 100%
  );
}

/* User location */
.user-location-dot {
  filter: drop-shadow(0 0 3px rgba(91, 155, 213, 0.5));
}

.user-location-pulse {
  animation: location-pulse 2.5s ease-out infinite;
}

@keyframes location-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.15; }
  100% { opacity: 0.4; }
}

/* ==========================================================================
   Neighborhood + Vortex labels
   ========================================================================== */

.neighborhood-label-wrap,
.vortex-label-wrap {
  background: transparent;
  border: none;
}

.neighborhood-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--smoke);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
  text-shadow:
    0 0 3px var(--paper),
    1px 0 2px var(--paper),
    -1px 0 2px var(--paper),
    0 1px 2px var(--paper),
    0 -1px 2px var(--paper);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  pointer-events: none;
  user-select: none;
}

.neighborhood-label.is-visible {
  opacity: 0.88;
}

.vortex-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  text-shadow:
    0 0 4px var(--paper),
    1px 0 3px var(--paper),
    -1px 0 3px var(--paper),
    0 1px 3px var(--paper),
    0 -1px 3px var(--paper);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  pointer-events: none;
  user-select: none;
}

.vortex-label-sub {
  display: block;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--smoke);
  margin-top: 2px;
}

.vortex-label.is-visible {
  opacity: 1;
}

/* ==========================================================================
   Site header — strong condensed title lockup, left side
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 24px 14px;
  pointer-events: none;
}

.site-header > * {
  pointer-events: auto;
}

.header-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(22, 22, 26, 0.25);
}

.header-icon-core {
  width: 16px;
  height: 16px;
  background: var(--surface);
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 0.92;
  white-space: nowrap;
}

.header-title-light {
  font-weight: 500;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin-left: 0.08em;
}

.header-subtitle-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-subtitle {
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--smoke);
  line-height: 1.35;
  white-space: nowrap;
}

.credits-trigger {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--smoke);
  background: none;
  border: 1px solid var(--rule);
  padding: 6px 14px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.credits-trigger:hover {
  color: var(--ink);
  border-color: var(--ink);
}



/* ==========================================================================
   Credits overlay
   ========================================================================== */

.credits-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 22, 26, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.credits-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.credits-panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  width: 460px;
  max-width: 92vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-overlay);
  transform: translateY(8px);
  transition: transform var(--duration-normal) var(--ease-out);
}

.credits-overlay.open .credits-panel {
  transform: translateY(0);
}

.credits-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--rule-faint);
}

.credits-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.credits-close {
  font-size: 1.3rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--smoke);
  padding: 0 4px;
  transition: color var(--duration-fast) var(--ease-out);
}

.credits-close:hover {
  color: var(--ink);
}

.credits-body {
  padding: 24px 28px 32px;
}

.credits-section {
  margin-bottom: 24px;
}

.credits-section:last-child {
  margin-bottom: 0;
}

.credits-section-title {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 10px;
}

.credits-text {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}

.credits-text strong {
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Floating overlay panels — index (left) + detail (right)
   ========================================================================== */

.overlay {
  position: fixed;
  top: 96px;
  bottom: 22px;
  width: var(--overlay-width);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--panel-border);
  border-top: var(--panel-rule);
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  z-index: 500;
  overflow: hidden;
  transition: transform var(--duration-slow) var(--ease-in-out),
              opacity var(--duration-normal) var(--ease-out);
}

.overlay-index {
  left: 22px;
}

body.panel-collapsed .overlay-index {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

/* Reopen tab — visible only when panel is collapsed */
.panel-reopen-tab {
  position: fixed;
  top: 96px;
  left: 0;
  z-index: 500;
  width: 28px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  color: var(--smoke);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  box-shadow: 0 2px 8px rgba(22, 22, 26, 0.06);
}

.panel-reopen-tab svg {
  width: 12px;
  height: 12px;
}

.panel-reopen-tab:hover {
  color: var(--accent);
}

body.panel-collapsed .panel-reopen-tab {
  opacity: 1;
  pointer-events: auto;
}

/* Minimize button in panel header */
.panel-minimize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  color: var(--smoke-light);
  padding: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.panel-minimize-btn:hover {
  color: var(--ink);
}

.panel-minimize-btn svg {
  width: 12px;
  height: 12px;
}

.overlay-header-right {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.overlay-detail {
  right: 22px;
  left: auto;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

body.detail-open .overlay-detail {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Overlay header ---------- */

.overlay-header {
  flex-shrink: 0;
  padding: var(--panel-pad-y) var(--panel-pad-x) calc(var(--panel-pad-y) - 4px);
  border-bottom: 1px solid rgba(232, 232, 234, 0.7);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.overlay-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.entry-expand-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.entry-expand-trigger:hover {
  color: var(--accent-deep);
}

.overlay-count {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
  font-variant-numeric: tabular-nums;
}

/* Three-square loading indicator */
.loading-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.loading-dots span {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--smoke-faint);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 60%, 100% { background: var(--smoke-faint); }
  30% { background: var(--accent); }
}

.overlay-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
  background: none;
  border: none;
  padding: 0;
  transition: color var(--duration-fast) var(--ease-out);
}

.overlay-back:hover {
  color: var(--ink);
}

.overlay-back svg {
  width: 14px;
  height: 14px;
  transition: transform var(--duration-fast) var(--ease-out);
}

.overlay-back:hover svg {
  transform: translateX(-2px);
}

/* ==========================================================================
   Index controls (search + filters)
   ========================================================================== */

.overlay-controls {
  flex-shrink: 0;
  padding: 14px 22px 16px;
  border-bottom: 1px solid var(--rule-faint);
}

.search-field {
  position: relative;
  margin-bottom: 10px;
}

.search-field input {
  width: 100%;
  height: var(--control-h);
  padding: 9px 12px 9px 32px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--ink);
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.search-field input::placeholder {
  color: var(--smoke-light);
}

.search-field input:focus {
  background: var(--surface);
  border-color: var(--ink);
}

.search-field input:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--smoke);
  pointer-events: none;
}

.filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-row select {
  flex: 1;
  min-width: 0;
  height: var(--control-h);
  padding: 6px 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink-soft);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><polyline points='2,4 5,7 8,4' stroke='%232e2e33' stroke-width='1.2' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.filter-row select:hover {
  border-color: var(--ink-soft);
}

.clear-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  height: var(--control-h);
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--smoke);
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.clear-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ==========================================================================
   Editorial register (memorial list)
   ========================================================================== */

.register {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--smoke-faint) transparent;
}

.register::-webkit-scrollbar { width: 6px; }
.register::-webkit-scrollbar-thumb { background: var(--smoke-faint); }
.register::-webkit-scrollbar-track { background: transparent; }

.register-entry {
  position: relative;
  padding: 16px 22px 18px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.register-entry::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1px;
  background: var(--rule-faint);
}

.register-entry:last-child::after { display: none; }

.register-entry:hover,
.register-entry.hovered {
  background: var(--paper);
}

.register-entry.active {
  background: var(--paper);
}

.register-entry.active::before,
.register-entry.hovered::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 18px;
  width: 2px;
  background: var(--accent);
}

.register-entry.hovered::before {
  background: var(--accent-deep);
  opacity: 0.4;
}

/* Vortex of Violence/Healing — special designation subtitle */
.entry-vortex,
.vortex-designation,
.hover-card-vortex {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.hover-card-vortex {
  margin-bottom: 3px;
}

.vortex-designation {
  margin-bottom: 5px;
}

.entry-name {
  font-family: var(--font-serif);
  font-size: 1.36rem;
  font-weight: 500;
  line-height: 1.18;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 36;
}

.entry-location {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.45;
  font-variation-settings: "opsz" 14;
}

.entry-meta {
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
}

.entry-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
}

.entry-status::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  flex-shrink: 0;
}


.entry-status.pending::before { background: var(--smoke-light); }
.entry-status.planned::before {
  background: transparent;
  border: 1px solid var(--smoke-light);
  box-sizing: border-box;
}

.empty-state {
  padding: 48px 22px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.06rem;
  color: var(--smoke);
  font-style: italic;
  font-variation-settings: "opsz" 14;
}

/* ==========================================================================
   Detail panel
   ========================================================================== */

.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 22px 36px;
  scrollbar-width: thin;
  scrollbar-color: var(--smoke-faint) transparent;
}

.overlay-body::-webkit-scrollbar { width: 6px; }
.overlay-body::-webkit-scrollbar-thumb { background: var(--smoke-faint); }

.detail-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.08rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 10px;
  font-variation-settings: "opsz" 72;
}

.detail-location {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.0rem;
  color: var(--smoke);
  line-height: 1.5;
  margin-bottom: 18px;
  font-variation-settings: "opsz" 14;
}

.detail-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-faint);
}

.detail-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
}

.detail-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
}


.detail-status.pending::before { background: var(--smoke-light); }
.detail-status.planned::before {
  background: transparent;
  border: 1px solid var(--smoke-light);
  box-sizing: border-box;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.96rem;
}

.detail-grid dt {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke-light);
  white-space: nowrap;
  padding-top: 2px;
}

.detail-grid dd {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.06rem;
  line-height: 1.4;
  font-variation-settings: "opsz" 14;
}

.detail-notes {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 14;
}

.detail-bio-link {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.5;
}

.detail-bio-link a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.detail-bio-link a:hover,
.detail-bio-link a:focus-visible {
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Photo gallery — detail panel
   ========================================================================== */


.detail-gallery {
  margin-bottom: 20px;
}

.detail-gallery-frame {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: var(--panel-border);
  overflow: hidden;
}

.detail-gallery-img {
  height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
  cursor: zoom-in;
  object-fit: contain;
}

/* Lightbox overlay */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(22, 22, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  cursor: zoom-out;
  padding: 56px 80px;
  opacity: 0;
  transition: opacity 0.22s var(--ease-out);
}

.photo-lightbox.is-open {
  opacity: 1;
}

.photo-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  transform-origin: center center;
  user-select: none;
}

.photo-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 8px;
}

.photo-lightbox-close:hover { opacity: 1; }

.photo-lightbox-prev,
.photo-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  font-size: 3.5rem;
  line-height: 1;
  padding: 16px 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
  z-index: 1;
}

.photo-lightbox-prev { left: 0; }
.photo-lightbox-next { right: 0; }

.photo-lightbox-prev:hover,
.photo-lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
}

/* Info card — top right */
.lightbox-info {
  position: absolute;
  top: 16px;
  right: 60px;
  max-width: 260px;
  padding: 12px 16px;
  background: rgba(22, 22, 26, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  text-align: right;
}

.lightbox-info-name {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 4px;
  font-variation-settings: "opsz" 18;
}

.lightbox-info-meta {
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
}

.lightbox-info-credit {
  font-size: 0.67rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

/* Counter — bottom center */
.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Gallery nav */
.detail-gallery-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
}

.gallery-arrow {
  background: rgba(255, 255, 255, 0.75);
  border: none;
  padding: 8px;
  color: var(--ink-soft);
  transition: background var(--transition-state), color var(--transition-state);
  display: flex;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

.gallery-arrow:hover {
  background: var(--surface);
  color: var(--ink);
}

.gallery-arrow svg {
  width: 14px;
  height: 14px;
}

.gallery-indicator {
  display: none;
  text-align: center;
}

/* Photo credits beneath the gallery */
.detail-photo-credit {
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--smoke-light);
  margin-top: 6px;
  font-style: italic;
}


/* Artist credit in the record section */
.detail-artist-credit {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--smoke);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule-faint);
  font-style: italic;
}

/* ==========================================================================
   Hover card thumbnail
   ========================================================================== */

.hover-card-thumb {
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-top: -14px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin-bottom: 10px;
}

.detail-shared {
  margin-bottom: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--rule-faint);
}

.shared-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shared-list button {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: none;
  padding: 4px 0;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-variation-settings: "opsz" 14;
  transition: color var(--duration-fast) var(--ease-out);
}

.shared-list button:hover {
  color: var(--accent);
}

.shared-list button::before {
  content: "\2192";
  font-size: 0.85em;
  color: var(--accent);
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-faint);
}

.detail-nav button {
  flex: 1;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--smoke);
  transition: color var(--duration-fast) var(--ease-out);
}

.detail-nav button.next { text-align: right; }

.detail-nav button:hover { color: var(--ink); }

.nav-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.nav-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.03rem;
  font-weight: 500;
  color: inherit;
  font-variation-settings: "opsz" 14;
  line-height: 1.25;
}

/* ==========================================================================
   Marker hover preview (desktop only)
   ========================================================================== */

.hover-card {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 700;
  min-width: 220px;
  max-width: 280px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-sans);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 80ms ease-out,
              transform 80ms ease-out;
}

.hover-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.hover-card-shared {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.hover-card-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.14rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 4px;
  font-variation-settings: "opsz" 18;
}

.hover-card-location {
  font-size: 0.85rem;
  color: var(--smoke);
  line-height: 1.4;
  margin-bottom: 6px;
}

.hover-card-context {
  font-size: 0.78rem;
  color: var(--smoke-light);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.hover-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 8px;
}

.hover-card-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
}


.hover-card-status.pending::before { background: var(--smoke-light); }
.hover-card-status.planned::before {
  background: transparent;
  border: 1px solid var(--smoke-light);
  box-sizing: border-box;
}

.hover-card-hint {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  padding-top: 8px;
  border-top: 1px solid var(--rule-faint);
}

@media (hover: none) {
  .hover-card { display: none !important; }
}

@media (max-width: 768px) {
  .photo-lightbox {
    padding: 48px 16px;
  }
  .photo-lightbox-prev,
  .photo-lightbox-next {
    padding: 20px 16px;
    font-size: 2.5rem;
  }
  .lightbox-info {
    right: 12px;
    top: 48px;
    max-width: 200px;
    padding: 8px 12px;
  }
}

/* ==========================================================================
   Full-screen memorial dossier
   ========================================================================== */

.dossier {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(22, 22, 26, 0.25);
  display: flex;
  align-items: stretch;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.dossier.open {
  opacity: 1;
  pointer-events: auto;
}

.dossier-window {
  position: relative;
  background: var(--surface);
  margin: 20px;
  flex: 1;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 0 4px 48px rgba(22, 22, 26, 0.12);
  transform: scale(0.97);
  transition: transform var(--duration-normal) var(--ease-out);
}

.dossier.open .dossier-window {
  transform: scale(1);
}

.dossier-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  font-size: 1.6rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--smoke);
  padding: 4px 8px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.dossier-close:hover { color: var(--ink); }

.dossier-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dossier-body::-webkit-scrollbar { width: 6px; }
.dossier-body::-webkit-scrollbar-thumb { background: var(--smoke-faint); }

/* Hero image area */
.dossier-hero {
  position: relative;
  height: 320px;
  max-width: 560px;
  margin: var(--panel-pad-y) auto;
  background: var(--paper);
  border: var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dossier-hero img {
  height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
  cursor: zoom-in;
  object-fit: contain;
}

.dossier-hero-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(22, 22, 26, 0.55);
  padding: 6px 14px;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s var(--ease-out);
}

.dossier-hero-hint.fade-out {
  opacity: 0;
}

.dossier-hero-nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}

.dossier-hero-nav button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.75);
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  pointer-events: auto;
  transition: background var(--transition-state), color var(--transition-state);
}

.dossier-hero-nav button:hover {
  background: var(--surface);
  color: var(--ink);
}

.dossier-hero-nav svg {
  width: 14px;
  height: 14px;
}

.dossier-hero-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 6px 12px;
  font-size: 0.63rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  background: rgba(22, 22, 26, 0.4);
}

/* Content layout */
.dossier-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dossier-image-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border-right: 1px solid var(--rule-faint);
  overflow: hidden;
}

.dossier-image-col .dossier-hero {
  position: static;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dossier-image-col .dossier-hero img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.dossier-main {
  padding: 28px 36px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--smoke-faint) transparent;
  display: flex;
  flex-direction: column;
}

.dossier-main::-webkit-scrollbar { width: 5px; }
.dossier-main::-webkit-scrollbar-thumb { background: var(--smoke-faint); }

.dossier-main .detail-name {
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  margin-bottom: 8px;
  line-height: 1.1;
}

.dossier-main .detail-location {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.dossier-main .detail-status-line {
  margin-bottom: 18px;
  padding-bottom: 14px;
}

.dossier-main .detail-section {
  margin-bottom: 18px;
}

.dossier-main .detail-section-title {
  margin-bottom: 10px;
}

.dossier-main .detail-grid {
  grid-template-columns: auto 1fr;
  gap: 6px 20px;
}

.dossier-main .detail-grid dt {
  white-space: nowrap;
  padding-right: 4px;
}

.dossier-main .detail-grid dd {
  font-size: 1.0rem;
}

.dossier-main .detail-notes {
  font-size: 1.0rem;
  line-height: 1.6;
}

.dossier-main .detail-nav {
  margin-top: auto;
  padding-top: 14px;
  flex-shrink: 0;
}



@media (max-width: 900px) {
  .dossier-content {
    grid-template-columns: 1fr;
  }
  .dossier-image-col {
    border-right: none;
    border-bottom: 1px solid var(--rule-faint);
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .dossier-window {
    margin: 0;
  }
  .dossier-main {
    padding: 24px 24px 40px;
  }
  .dossier-main .detail-name {
    font-size: 1.8rem;
  }
}

/* ==========================================================================
   Layer visibility toggles
   ========================================================================== */

.layer-control {
  position: fixed;
  bottom: 82px;
  right: 18px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.layer-toggle {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--smoke-light);
  padding: 0;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.layer-toggle + .layer-toggle {
  border-top: none;
}

.layer-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.layer-label {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 4px 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s var(--ease-out);
}

.layer-toggle:hover .layer-label {
  opacity: 1;
}

.layer-toggle:hover {
  color: var(--ink);
}

.layer-toggle.active {
  color: var(--accent);
  background: rgba(214, 59, 110, 0.06);
}

.layer-toggle.active .layer-label {
  color: var(--accent);
}

/* Context layer styles */
.layer-transit {
  opacity: 0.7;
}

/* ==========================================================================
   Mobile toggle
   ========================================================================== */

.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--surface);
  border: none;
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(22, 22, 26, 0.25);
}

.mobile-toggle:active {
  transform: translateX(-50%) scale(0.97);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .site-header {
    padding: 10px 14px 8px;
  }

  .header-title { font-size: 1.4rem; }
  .header-icon { width: 28px; height: 28px; }
  .header-icon-core { width: 9px; height: 9px; }
  .header-lockup { gap: 10px; }

  .header-subtitle-block { display: none; }

  .credits-trigger {
    font-size: 0.56rem;
    padding: 5px 10px;
  }

  .overlay {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border: none;
    border-top: 2px solid var(--accent);
    z-index: 1100;
    transform: translateY(100%);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .overlay-index.open {
    transform: translateY(0);
  }

  .overlay-detail {
    transform: translateY(100%);
    z-index: 1150;
  }

  body.detail-open .overlay-detail {
    transform: translateY(0);
  }

  body.panel-collapsed .overlay-index {
    transform: translateY(100%);
    opacity: 1;
  }

  .leaflet-top, .leaflet-bottom {
    z-index: 400;
  }

  .leaflet-control-zoom {
    margin: 12px !important;
  }

  .layer-control {
    bottom: 68px;
    right: 12px;
  }

  .mobile-toggle { display: block; }
  body.detail-open .mobile-toggle { display: none; }

  .panel-reopen-tab { display: none; }
  .panel-minimize-btn { display: none; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .overlay { width: 320px; }
  .header-icon { width: 36px; height: 36px; }
  .header-icon-core { width: 12px; height: 12px; }
  .header-title { font-size: 1.6rem; }
  .header-subtitle { font-size: 0.68rem; }
  .site-header { padding: 12px 18px 10px; }
  .overlay { top: 80px; }
  .panel-reopen-tab { top: 80px; }
}

/* ==========================================================================
   Embed mode — for iframe embeds on external sites (?embed=1)
   Hides the site header so the host page's own branding can take over.
   ========================================================================== */

body.embedded .site-header {
  display: none;
}

body.embedded .overlay,
body.embedded .panel-reopen-tab {
  top: 22px;
}

body.embedded .credits-trigger {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 600;
}

@media (max-width: 1100px) {
  body.embedded .overlay,
  body.embedded .panel-reopen-tab {
    top: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
