:root {
  color-scheme: light dark;
  --bg: #0f1419;
  --surface: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --accent: #e85d4c;
  --accent-hover: #ff7563;
  --border: #2d3a4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.95rem;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.site-main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.hero {
  margin-bottom: 2rem;
}

.hero h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 1rem;
}

.card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
}

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

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

.map-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 3.25rem);
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.map-toolbar input[type="search"] {
  flex: 1 1 16rem;
  min-width: 12rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.map-status {
  font-size: 0.9rem;
  color: var(--muted);
}

.map-results {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  max-height: min(38vh, 16rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.map-results[hidden] {
  display: none;
}

.map-layout.detail-open .map-results {
  display: none;
}

.map-results li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.map-results li:last-child {
  border-bottom: none;
}

.map-result-btn {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.35;
  padding: 0.7rem 1.25rem;
  cursor: pointer;
}

.map-result-btn:hover,
.map-result-btn:focus-visible {
  background: var(--bg);
  outline: none;
}

.map-result-more {
  margin: 0;
  padding: 0.55rem 1.25rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.map-result-heading {
  margin: 0;
  padding: 0.65rem 1.25rem 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Stacked reviews at the same coordinates (#242). */
.marker-stack {
  background: transparent;
  border: none;
}

.marker-stack-pin {
  width: 30px;
  height: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  background: var(--accent);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.marker-stack-count {
  display: block;
  min-width: 1.1em;
  text-align: center;
  color: #fff;
  font: 700 0.8rem/1 system-ui, sans-serif;
  transform: rotate(45deg);
}

.map-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

#map {
  flex: 1 1 auto;
  min-height: 10rem;
  transition: flex-basis 0.2s ease, min-height 0.2s ease;
}

.review-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0 1rem 1.25rem;
  overflow: hidden;
}

.map-layout.detail-open #map {
  flex: 0 0 22vh;
  min-height: 7rem;
  max-height: 26vh;
}

.map-layout.detail-open .review-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.review-panel-bar {
  display: flex;
  justify-content: flex-start;
  padding: 0.65rem 0 0.35rem;
  flex: 0 0 auto;
}

.review-close {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.review-close:hover {
  border-color: var(--accent);
}

.review-title {
  margin: 0.25rem 0 0.35rem;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  line-height: 1.3;
  flex: 0 0 auto;
}

.review-meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.review-actions {
  margin: 0 0 0.85rem;
  flex: 0 0 auto;
}

.review-directions {
  display: inline-block;
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.review-directions[hidden] {
  display: none !important;
}

.review-directions:hover {
  filter: brightness(1.05);
}

.review-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  line-height: 1.55;
  padding-bottom: 1rem;
}

@media (min-width: 900px) {
  .map-layout.detail-open .map-stage {
    flex-direction: row;
  }

  .map-layout.detail-open #map {
    flex: 0 0 38%;
    max-height: none;
    min-height: 0;
    border-right: 1px solid var(--border);
  }

  .map-layout.detail-open .review-panel {
    border-top: none;
    padding: 0 1.5rem 1.5rem;
  }
}
