* { box-sizing: border-box; }

:root {
  --night: #16130f;
  --frame: #2c261d;
  --brass: #c6a46a;
  --paper: #f0e6d2;
  --ink: #2a2218;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  background: #1b2a1e;
}

#map {
  width: 100%;
  height: 100vh;
  z-index: 1;
}

.leaflet-container .leaflet-control-attribution {
  display: none !important;
}

.map-plaque {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  max-width: min(520px, calc(100vw - 120px));
  padding: 10px 22px 12px;
  background: linear-gradient(180deg, #2f3d4f 0%, #243140 100%);
  color: #f3ead8;
  text-align: center;
  box-shadow: 0 8px 24px rgba(20, 16, 10, 0.28);
  border-bottom: 3px solid var(--brass);
  pointer-events: none;
}

.map-plaque p {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4c4a0;
}

.map-plaque h1 {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.25;
  color: #fff8ea;
}

.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.78);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.video-modal[hidden] {
  display: none;
}

.modal-stage {
  position: relative;
  width: min(920px, 100%);
  background: var(--frame);
  padding: 12px 12px 0;
  box-shadow:
    0 0 0 1px rgba(198, 164, 106, 0.35),
    0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-screen {
  background: #050403;
  line-height: 0;
}

.modal-screen[hidden],
.modal-gallery[hidden],
.modal-text[hidden] {
  display: none;
}

.modal-gallery {
  background: #050403;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px;
  max-height: 58vh;
}

.modal-gallery img {
  max-height: 54vh;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  background: #111;
}

#modal-video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #050403;
}

.modal-caption {
  padding: 14px 18px 16px;
  background:
    linear-gradient(90deg, var(--brass), var(--brass)) left 18px top 0 / 36px 2px no-repeat,
    var(--paper);
}

.modal-caption h2 {
  margin: 8px 44px 0 0;
  font-family: Palatino, "Palatino Linotype", "Times New Roman", serif;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.modal-text {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #3a3126;
  white-space: pre-wrap;
  max-height: 28vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 19, 15, 0.72);
  color: #f3ead8;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover,
.close-btn:focus-visible {
  background: var(--night);
  color: #fff;
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .map-plaque {
    top: 10px;
    left: 58px;
    right: 10px;
    transform: none;
    max-width: none;
    padding: 8px 12px;
    text-align: left;
  }

  .video-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .modal-stage {
    padding: 8px 8px 0;
  }

  #modal-video {
    max-height: 62vh;
  }

  .modal-caption {
    padding: 12px 12px 14px;
  }

  .close-btn {
    top: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-stage {
    box-shadow: 0 0 0 1px rgba(198, 164, 106, 0.35);
  }
}
