:root {
  color-scheme: light;
  --ink: #1b1d1a;
  --muted: #61665b;
  --panel: #f7f0e5;
  --panel-strong: #efe4d4;
  --accent: #c34f2f;
  --accent-2: #2c6e6a;
  --accent-3: #3a4f8a;
  --shadow: 0 18px 45px rgba(25, 20, 10, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ef 0%, #f2e9db 35%, #efe4d4 100%);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem clamp(1.5rem, 3vw, 3.5rem) 3rem;
  gap: 1.5rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

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

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.1rem, 3vw, 3.4rem);
  margin: 0;
  max-width: 28ch;
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.6rem 1.2rem;
  font-size: 0.9rem;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.city {
  background: #d96c2f;
}

.dot.mountain {
  background: #496c3f;
}

.dot.river {
  background: #2b6faa;
}

.dot.valley {
  background: #7b4fa0;
}

.dot.historical {
  background: #9a3c4f;
}

.dot.landmark {
  background: #6b5c3f;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.control-panel {
  background: var(--panel);
  padding: 1.5rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-block label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
}

.search-row input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #d6c8b7;
  background: #fff;
  font-size: 0.95rem;
}

.search-row button {
  padding: 0.7rem 1.2rem;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.filters {
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.section-title {
  font-weight: 600;
  margin: 0 0 0.3rem;
}

.place-list {
  display: grid;
  gap: 0.8rem;
  max-height: 420px;
  overflow: auto;
  padding-right: 0.3rem;
}

.place-card {
  background: #fff;
  border-radius: 16px;
  padding: 0.8rem 1rem;
  border: 1px solid #eadcca;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.place-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(30, 24, 18, 0.12);
}

.place-card h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.place-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.map-panel {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #f3efe6;
  min-height: 640px;
}

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

.info-panel {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  width: min(320px, 90%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  box-shadow: 0 18px 45px rgba(20, 15, 10, 0.18);
  backdrop-filter: blur(6px);
  z-index: 500;
}

.info-panel img {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 0.8rem;
}

.info-panel h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", serif;
}

.info-panel p {
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.info-panel a {
  color: var(--accent-3);
  font-weight: 600;
  text-decoration: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.gallery-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eadcca;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.muted {
  color: var(--muted);
}

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

  .map-panel {
    min-height: 520px;
  }

  .info-panel {
    position: static;
    width: auto;
    margin: 1rem;
  }
}
