:root {
  --bg: #f4efe6;
  --panel: rgba(255, 251, 245, 0.92);
  --panel-border: rgba(120, 94, 55, 0.18);
  --text: #1d2b2a;
  --muted: #53615d;
  --accent: #e37b40;
  --accent-deep: #0e7c86;
  --shadow: 0 20px 50px rgba(30, 36, 33, 0.14);
  --family: #d46f36;
  --beach: #2b96d7;
  --view: #378b5f;
  --food: #be4f63;
  --shopping: #8f63c9;
  --date: #cf8a15;
  --local: #4e6578;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(227, 123, 64, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(14, 124, 134, 0.16), transparent 30%),
    linear-gradient(135deg, #f8f1e7 0%, #e8f3f2 100%);
}

.layout {
  height: 100vh;
  display: grid;
  grid-template-columns: 360px 1fr;
  overflow: hidden;
}

.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(244, 239, 230, 0.86);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--panel-border);
  overflow: auto;
}

.hero h1,
.map-header h2,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: 1.95rem;
  line-height: 1.05;
  margin-top: 6px;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-deep);
  font-weight: 700;
}

.intro {
  margin: 10px 0 0;
  line-height: 1.45;
  color: var(--muted);
  font-size: 0.96rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  background: white;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 43, 42, 0.16);
}

.filter-chip.active {
  color: white;
  background: var(--chip-color, var(--accent));
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats div {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.stats strong {
  display: block;
  font-size: 1.3rem;
}

.stats span,
.highlights,
.itinerary {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.93rem;
}

.highlights,
.itinerary {
  margin: 10px 0 0;
  padding-left: 18px;
}

.map-shell {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  isolation: isolate;
}

.map-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.map-header h2 {
  margin-top: 4px;
  font-size: 1.45rem;
}

#reset-view {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: var(--shadow);
}

#map {
  height: 100%;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

#map .leaflet-tile-pane {
  filter: saturate(0.2) brightness(1.08) contrast(0.9);
}

.leaflet-overlay-pane path {
  mix-blend-mode: multiply;
}

.marker-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 6px 20px rgba(20, 25, 22, 0.28);
  transition: transform 0.18s ease;
}

.marker-pin.is-active {
  transform: scale(1.28);
}

.area-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--area-color) 55%, white);
  background: color-mix(in srgb, var(--area-color) 14%, white);
  color: #1b2524;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(29, 43, 42, 0.12);
  backdrop-filter: blur(8px);
}

.place-drawer {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(360px, calc(100% - 36px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 250, 244, 0.93);
  border: 1px solid rgba(120, 94, 55, 0.16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
  z-index: 1200;
  overflow: auto;
}

.place-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.drawer-close {
  align-self: end;
  border: none;
  background: rgba(29, 43, 42, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.drawer-empty h3,
.drawer-content h3 {
  margin: 4px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.drawer-empty p,
.drawer-description,
.drawer-facts dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.drawer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.drawer-image {
  min-height: 180px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 28px rgba(29, 43, 42, 0.12);
  background: linear-gradient(135deg, rgba(255,255,255,0.78), rgba(231, 240, 239, 0.88));
}

.drawer-gallery-viewport {
  width: 100%;
  height: 100%;
}

.drawer-image svg,
.drawer-gallery-viewport img {
  display: block;
  width: 100%;
  height: 100%;
}

.drawer-gallery-viewport img {
  object-fit: cover;
}

.drawer-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(17, 27, 28, 0.52);
  color: white;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.drawer-gallery-prev {
  left: 10px;
}

.drawer-gallery-next {
  right: 10px;
}

.drawer-gallery-nav[disabled] {
  opacity: 0.38;
  cursor: default;
}

.drawer-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 6px;
  z-index: 2;
}

.drawer-gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
}

.drawer-gallery-dot.active {
  background: white;
}

.drawer-image.loading::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.68) 50%,
    rgba(255,255,255,0.22) 100%
  );
  animation: drawer-shimmer 1.2s linear infinite;
}

@keyframes drawer-shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  background: var(--accent);
}

.drawer-chip-soft {
  color: var(--text);
  background: rgba(29, 43, 42, 0.08);
}

.drawer-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.drawer-facts div {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.drawer-facts dt {
  margin: 0 0 6px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  font-weight: 700;
}

.drawer-facts dd {
  margin: 0;
}

.drawer-rating-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.rating-stars {
  position: relative;
  display: inline-block;
  line-height: 1;
  letter-spacing: 0.14em;
  color: rgba(29, 43, 42, 0.16);
}

.rating-stars::before,
.rating-stars::after {
  content: "★★★★★";
}

.rating-stars::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--rating) / 5 * 100%);
  overflow: hidden;
  color: #cf8a15;
}

.drawer-rating-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.map-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(14, 124, 134, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.map-link-button:hover,
.map-link-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(14, 124, 134, 0.24);
}

.popup-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.popup-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 980px) {
  html,
  body {
    overflow: hidden;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 36vh) 1fr;
  }

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

  .map-header {
    align-items: start;
    flex-direction: column;
  }

  .place-drawer {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: min(52vh, 420px);
    transform: translateY(calc(100% + 20px));
  }

  .drawer-gallery-nav {
    width: 32px;
    height: 32px;
  }

  #map {
    min-height: 0;
  }
}
