:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-alt: #ede7dd;
  --text: #18130c;
  --text-muted: #5c5143;
  --accent: #c8610a;
  --accent-dark: #9a4800;
  --stroke: rgba(24, 19, 12, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 20px 65px rgba(20, 16, 12, 0.15);
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
  color: var(--text);
  background-color: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

main {
  width: min(1200px, 90vw);
  margin: 0 auto 4rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.page-hero {
  width: min(1200px, 90vw);
  margin: 2.5rem auto 3rem;
  padding: clamp(1.5rem, 3vw, 3rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #fff5e8, #ffe6c8);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.hero-copy h1 {
  margin-top: 0.2rem;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-copy p {
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-visual img {
  border-radius: var(--radius-md);
  border: 6px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 45px rgba(24, 19, 12, 0.2);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent-dark);
  margin: 0;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s;
}

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 25px rgba(200, 97, 10, 0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px dashed rgba(24, 19, 12, 0.2);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-header.stack-mobile {
  flex-wrap: wrap;
}

.map-board,
.locations-panel {
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.map-stage {
  position: relative;
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 3fr minmax(240px, 1fr);
  gap: 1.5rem;
}

.map-canvas {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #000;
  min-height: 400px;
}

.map-canvas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-hotspots {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-dark);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.15s ease;
}

.hotspot:hover,
.hotspot:focus-visible {
  transform: translate(-50%, -50%) scale(1.05);
  background: var(--accent);
  color: white;
}

.hotspot.is-active {
  background: var(--accent);
  color: white;
  box-shadow: 0 18px 30px rgba(200, 97, 10, 0.4);
}

#leafletMap {
  width: 100%;
  height: 100%;
}

.map-canvas.is-live {
  display: none;
}

.map-stage[data-mode='live'] .map-canvas.is-live {
  display: block;
}

.map-stage[data-mode='live'] .map-canvas.is-static {
  display: none;
}

.map-side-panel {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--stroke);
  background: var(--surface-alt);
}

.panel-content {
  padding: 1.5rem;
}

.panel-content p {
  line-height: 1.5;
}

.panel-content .hint {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.view-switch {
  display: inline-flex;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.2rem;
  border: 1px solid var(--stroke);
}

.switch-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}

.switch-btn.active {
  background: var(--accent);
  color: white;
}

.filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

#searchInput {
  flex: 1;
  min-width: 220px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  padding: 0.55rem 0.85rem;
  font-size: 1rem;
}

.card-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.location-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(24, 19, 12, 0.08);
  display: flex;
  flex-direction: column;
}

.location-card.is-active {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 97, 10, 0.15);
}

.card-media {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card-id {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  margin-top: 1.5rem;
}

#detailDialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(900px, 90vw);
  max-height: 90vh;
}

.dialog-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dialog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-info {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}

#detailDialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 960px) {
  .map-stage {
    grid-template-columns: 1fr;
  }

  .map-side-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .page-hero,
  main {
    width: 94vw;
  }

  .hero-actions,
  .card-actions,
  .dialog-actions,
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  #searchInput {
    width: 100%;
  }
}
