/* ── Variables ─────────────────────────────── */
:root {
  --bg:        #f8f7f4;
  --card-bg:   #ffffff;
  --text:      #1a1a1a;
  --muted:     #666;
  --primary:   #1a6b8a;
  --primary-dk:#145570;
  --accent:    #e8a02e;
  --border:    #e2e0db;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.13);
  --max-w:     1200px;
  --nav-h:     60px;
}

/* ── Reset & base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ── Nav ───────────────────────────────────── */
.nav {
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.3px;
}
.nav-logo:hover { text-decoration: none; color: var(--primary-dk); }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-size: .9rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Hero ──────────────────────────────────── */
.hero {
  position: relative;
  background: var(--primary-dk);
  color: #fff;
  overflow: hidden;
}
.hero-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  opacity: .7;
}
.hero-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 60%);
}
.hero-body h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.15; }
.hero-body p  { margin-top: 8px; font-size: 1.05rem; opacity: .9; max-width: 640px; }

/* ── Page header (no photo) ────────────────── */
.page-header { padding: 40px 0 24px; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; }
.page-header p  { margin-top: 8px; color: var(--muted); max-width: 640px; }

/* ── Page description (below hero) ────────── */
.page-description {
  margin: 20px 0 8px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 720px;
}

/* ── Breadcrumb ────────────────────────────── */
.breadcrumb {
  padding: 12px 0;
  font-size: .85rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { opacity: .5; }

/* ── Summary sentence ──────────────────────── */
.locality-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: .95rem;
  color: var(--muted);
}

/* ── Filter bar ────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.filter-toggle:hover { border-color: var(--primary); color: var(--primary); }
.filter-toggle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-toggle input { display: none; }

/* ── Property grid ─────────────────────────── */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* ── Property card ─────────────────────────── */
.property-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.card-photo {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--border);
  position: relative;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.property-card:hover .card-photo img { transform: scale(1.04); }
.card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
  background: #f0ede8;
}
.card-type {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-name { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-stars { color: var(--accent); font-size: .9rem; letter-spacing: 1px; }
.card-amenities { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card-amenity { font-size: 1.1rem; title: attr(title); }
.card-locality { font-size: .82rem; color: var(--muted); margin-top: auto; padding-top: 8px; }

/* ── Amenity highlights ────────────────────── */
.highlights { margin: 48px 0; }
.highlights h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.highlight-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.highlight-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 10px; }
.highlight-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.highlight-card li { font-size: .88rem; }
.highlight-card a { color: var(--text); }
.highlight-card a:hover { color: var(--primary); }

/* ── Locality card (destination page) ─────── */
.locality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
  margin-bottom: 48px;
}
.locality-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.locality-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.locality-card .card-photo { aspect-ratio: 3/2; }
.locality-card-body { padding: 14px 16px; }
.locality-card-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.locality-card-count { font-size: .83rem; color: var(--muted); margin-top: 2px; }

/* ── Property detail ───────────────────────── */

/* Top split: photo left, key info right */
.detail-split {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 36px;
  min-height: 380px;
}
.detail-split-photo {
  position: relative;
  background: #f0ede8;
}
.detail-split-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-split-info {
  background: var(--card-bg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-title { font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  background: var(--primary);
  color: #fff;
}
.detail-stars { color: var(--accent); font-size: 1rem; }
.detail-location { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.detail-excerpt {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
}
.detail-contacts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}
.contact-item a { color: var(--text); word-break: break-all; }
.contact-item a:hover { color: var(--primary); }

/* Below the split */
.detail-body { margin-bottom: 40px; }
.detail-description { color: #3d3d3d; font-size: 1.02rem; line-height: 1.85; margin-bottom: 28px; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.amenity-list { display: flex; flex-wrap: wrap; gap: 10px; }
.amenity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f0f8fc;
  border: 1px solid #cce4ef;
  border-radius: 20px;
  font-size: .88rem;
}
.policy-row { margin-bottom: 10px; font-size: .9rem; }
.policy-row strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 2px; }
#detail-map { height: 220px; border-radius: var(--radius); margin-top: 20px; }

/* Photo grid (below split) */
.detail-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 40px;
}
.detail-photo-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .detail-split { grid-template-columns: 1fr; min-height: auto; }
  .detail-split-photo { aspect-ratio: 4/3; }
  .detail-photo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Map (homepage) ────────────────────────── */
#main-map { height: calc(100vh - var(--nav-h)); }

.map-destination-label.leaflet-tooltip {
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.06);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  transition: background .15s, color .15s, box-shadow .15s;
}
.map-destination-label.leaflet-tooltip::before { display: none; }
.map-destination-label.leaflet-tooltip a { color: inherit; text-decoration: none; }
.map-destination-label.leaflet-tooltip:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,107,138,.4);
}

/* ── About ─────────────────────────────────── */
.prose { max-width: 680px; margin: 40px auto 80px; }
.prose h1 { font-size: 2rem; font-weight: 800; margin-bottom: 24px; }
.prose h2 { font-size: 1.3rem; font-weight: 700; margin: 32px 0 12px; }
.prose p  { color: var(--muted); line-height: 1.8; margin-bottom: 16px; }

/* ── Footer ────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

/* ── Htmx loading ──────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator { opacity: 1; }

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .hero-body h1 { font-size: 1.5rem; }
  .hero-img { height: 220px; }
}
