:root {
  --cream: #f6f0e4;
  --paper: #fffaf2;
  --ink: #17352d;
  --teal: #0f766e;
  --orange: #c8672a;
  --line: rgba(23, 53, 45, 0.12);
  --shadow: 0 18px 40px rgba(23, 53, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(200, 103, 42, 0.14), transparent 30%),
    linear-gradient(180deg, #f7efe2 0%, #f2eadf 100%);
  color: var(--ink);
  font-family: "Inter", sans-serif;
}

body {
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#embed-title,
.detail-card h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.9rem, 2vw, 2.8rem);
  line-height: 1.05;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.control {
  display: grid;
  gap: 6px;
  min-width: 160px;
  font-size: 14px;
  font-weight: 600;
}

.control select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 18px;
  min-height: calc(100vh - 120px);
  padding-top: 18px;
}

.map-panel,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  min-height: 700px;
  height: 100%;
}

.status-banner {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 16px;
  right: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(23, 53, 45, 0.92);
  color: white;
  font-size: 14px;
}

.detail-panel {
  min-height: 700px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.detail-intro {
  padding: 22px 24px 6px;
}

.detail-intro h2 {
  margin: 0 0 8px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.45rem, 1.7vw, 2rem);
  line-height: 1.1;
}

.detail-intro p:last-child {
  margin: 0;
  color: rgba(23, 53, 45, 0.76);
  line-height: 1.55;
}

.detail-card {
  height: 100%;
  overflow: hidden;
}

.detail-card-empty,
.detail-copy,
.detail-location {
  margin: 0;
}

.detail-card-empty {
  min-height: 240px;
}

.detail-image-wrap {
  position: relative;
  min-height: 240px;
  background:
    linear-gradient(140deg, rgba(15, 118, 110, 0.92), rgba(200, 103, 42, 0.82)),
    #ddd;
}

.detail-image-wrap img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  display: block;
}

.image-fallback {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 20px;
  color: white;
  font-family: "Fraunces", serif;
  font-size: 2rem;
}

.detail-body {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.detail-location {
  color: rgba(23, 53, 45, 0.72);
  font-size: 14px;
  font-weight: 600;
}

.detail-copy {
  line-height: 1.6;
  font-size: 15px;
}

.detail-copy-full {
  color: rgba(23, 53, 45, 0.88);
}

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

.leaflet-popup-content {
  margin: 12px 14px;
  min-width: 220px;
}

.popup-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink);
}

.popup-copy {
  margin: 0 0 10px;
  color: rgba(23, 53, 45, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--teal);
  color: white;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .detail-panel,
  #map {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    align-items: start;
    padding: 16px;
  }

  .controls {
    width: 100%;
  }

  .control {
    min-width: 0;
    flex: 1 1 140px;
  }

  #map {
    min-height: 360px;
  }

  .detail-body {
    padding: 18px;
  }

  .detail-intro {
    padding: 18px 18px 2px;
  }
}
