:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #1c242b;
  --muted: #5d6873;
  --accent: #8c3d1f;
  --accent-soft: #dba97a;
  --line: #d7d1c8;
  --shadow: 0 18px 45px rgba(26, 26, 26, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px;
  background: linear-gradient(180deg, #f7f1e7 0%, #f0eadf 100%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
}

.intro,
.status,
.site-card__summary,
.detail-card__summary {
  line-height: 1.55;
}

.intro,
.status,
.meta-grid dd,
.site-card__meta,
.detail-card__credit {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
}

.button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.site-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.site-card,
.detail-card {
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.site-card {
  padding: 16px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.site-card:hover,
.site-card.is-active {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
}

.site-card h2,
.detail-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.site-card__meta {
  margin: 10px 0 12px;
  font-size: 0.95rem;
}

.map-panel {
  position: relative;
  min-height: 100vh;
}

#map {
  height: 100vh;
  width: 100%;
}

.detail-panel {
  position: absolute;
  right: 20px;
  top: 20px;
  width: min(420px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  z-index: 500;
}

.detail-panel__empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.detail-card {
  overflow: hidden;
}

.detail-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.detail-card__body {
  padding: 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 12px;
  margin: 14px 0;
}

.meta-grid dt {
  font-weight: 700;
}

.meta-grid dd {
  margin: 0;
}

.detail-card__links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.link-chip {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--text);
  background: white;
  font-weight: 600;
}

.custom-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #b6471e;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.custom-marker.is-selected {
  transform: scale(1.2);
  background: #6d2310;
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
}

.popup-card {
  min-width: 220px;
}

.popup-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.popup-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .map-panel {
    min-height: 70vh;
  }

  #map {
    height: 70vh;
  }

  .detail-panel {
    position: static;
    width: 100%;
    max-height: none;
    padding: 16px;
  }
}
