/* ============================================================
   Krabi Estates — theme

   To re-brand later: change the CSS custom properties below and
   swap /public/images/logo.svg + /public/images/hero.svg. Nothing
   else in this file needs to change.
   ============================================================ */

:root {
  --brand-primary: #0B5563;
  --brand-primary-dark: #073C46;
  --brand-primary-light: #E6F1F1;
  --brand-accent: #E8734A;
  --brand-accent-dark: #C85A34;
  --brand-sand: #F4EDE1;
  --brand-ink: #16262A;
  --brand-muted: #5C6B6E;
  --brand-bg: #FAFAF8;
  --brand-card: #FFFFFF;
  --brand-border: #E7E2D8;
  --brand-hero-image: url('/static/images/hero.svg');

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 35, 40, .07), 0 1px 1px rgba(15, 35, 40, .04);
  --shadow-md: 0 10px 28px rgba(15, 35, 40, .10);
  --shadow-lg: 0 24px 56px rgba(15, 35, 40, .18);

  --font-heading: 'Manrope', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--brand-ink);
  background: var(--brand-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-accent-dark);
  margin-bottom: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--brand-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--brand-accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-dark {
  background: var(--brand-primary);
  color: #fff;
}
.btn-dark:hover { background: var(--brand-primary-dark); }
.btn-outline {
  background: transparent;
  border-color: var(--brand-border);
  color: var(--brand-ink);
}
.btn-outline:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-ghost {
  background: transparent;
  color: var(--brand-primary);
  padding: 13px 8px;
}
.btn-ghost:hover { color: var(--brand-accent-dark); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Header ──────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 248, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--brand-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand img { height: 34px; width: auto; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--brand-muted);
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary-dark);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: flex;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch a {
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-muted);
}
.lang-switch a.active { background: var(--brand-primary); color: #fff; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--brand-border);
    background: #fff;
  }
  body.nav-open .main-nav {
    display: flex;
    position: absolute;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    padding: 12px 24px 20px;
    box-shadow: var(--shadow-md);
    gap: 2px;
  }
  body.nav-open .main-nav a { width: 100%; }
}

/* ── Hero ────────────────────────────────────────────────────── */

.hero {
  position: relative;
  background-image: var(--brand-hero-image);
  background-size: cover;
  background-position: center;
  color: #fff;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,32,36,.15) 0%, rgba(7,32,36,.55) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 96px 24px 64px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  max-width: 900px;
  margin: 0 auto 16px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
}
.hero-subtitle {
  font-size: 18px;
  max-width: 620px;
  margin: 0 auto 40px;
  color: rgba(255, 255, 255, .92);
}

.search-card {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  background: var(--brand-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  align-items: end;
  transform: translateY(24px);
}
.search-card .field { text-align: left; }
.search-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.field select, .field input {
  width: 100%;
}
@media (max-width: 960px) {
  .search-card { grid-template-columns: 1fr 1fr; }
  .search-card .btn { grid-column: span 2; }
}

/* ── Form controls ──────────────────────────────────────────── */

input[type=text], input[type=number], input[type=email], input[type=tel],
input[type=password], input[type=url], select, textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-border);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--brand-ink);
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}
label.form-label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 6px;
  color: var(--brand-ink);
}
.form-group { margin-bottom: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ── Sections ────────────────────────────────────────────────── */

.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head p { color: var(--brand-muted); margin: 0; }

/* ── Area chips ──────────────────────────────────────────────── */

.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.area-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 26px 22px;
  background: linear-gradient(155deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.area-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.area-card span { font-weight: 700; font-size: 17px; }

/* ── Property cards ──────────────────────────────────────────── */

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 26px;
}
.property-card {
  background: var(--brand-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--brand-border);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.property-media { position: relative; aspect-ratio: 4 / 3; background: var(--brand-sand); overflow: hidden; }
.property-media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.badge-featured { left: 12px; background: var(--brand-accent); color: #fff; }
.badge-status { right: 12px; background: rgba(22, 38, 42, .78); color: #fff; text-transform: capitalize; }
.badge-status.status-sold { background: #B33B3B; }
.badge-status.status-pending { background: #A97418; }
.property-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.property-price { font-family: var(--font-heading); font-weight: 800; font-size: 21px; color: var(--brand-primary-dark); }
.property-title { font-weight: 700; font-size: 16px; }
.property-location { color: var(--brand-muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.property-specs {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--brand-border);
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--brand-muted);
}
.property-specs strong { color: var(--brand-ink); }

.type-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
}

/* ── Why-us ──────────────────────────────────────────────────── */

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.why-card h3 { font-size: 18px; }
.why-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
}

/* ── CTA band ────────────────────────────────────────────────── */

.cta-band {
  background: linear-gradient(155deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 52px 40px;
  text-align: center;
}
.cta-band h2 { font-size: 28px; }
.cta-band p { color: rgba(255, 255, 255, .85); max-width: 520px; margin: 0 auto 28px; }

/* ── Listings page ───────────────────────────────────────────── */

.filter-bar {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 30px;
}
.filter-bar .field label { display: block; font-size: 12px; font-weight: 700; color: var(--brand-muted); text-transform: uppercase; margin-bottom: 6px; }
@media (max-width: 1000px) {
  .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .btn { grid-column: span 2; }
}
.results-count { color: var(--brand-muted); margin-bottom: 20px; font-size: 14.5px; }
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--brand-muted);
  background: var(--brand-card);
  border: 1px dashed var(--brand-border);
  border-radius: var(--radius-md);
}

/* ── Listing detail ──────────────────────────────────────────── */

.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 36px; }
.gallery-main { aspect-ratio: 4/3; background: var(--brand-sand); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; }
.gallery-side div { overflow: hidden; background: var(--brand-sand); position: relative; }
.gallery-side img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-more {
  position: absolute; inset: 0;
  background: rgba(11, 42, 45, .55);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-side { grid-template-rows: unset; grid-template-columns: 1fr 1fr; }
}

.listing-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 44px; align-items: start; }
@media (max-width: 900px) { .listing-layout { grid-template-columns: 1fr; } }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px;
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin: 24px 0;
}
.spec-item { text-align: left; }
.spec-item .val { font-family: var(--font-heading); font-weight: 800; font-size: 20px; color: var(--brand-primary-dark); }
.spec-item .lab { font-size: 12.5px; color: var(--brand-muted); text-transform: uppercase; letter-spacing: .03em; }

.sidebar-card {
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: sticky;
  top: 96px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card h3 { font-size: 18px; }
.sidebar-card p.muted { color: var(--brand-muted); font-size: 14px; }
.map-embed { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--brand-border); margin: 24px 0; }
.map-embed iframe, .map-embed #map-canvas { width: 100%; height: 340px; border: 0; display: block; }

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-success { background: #E4F5EB; color: #1E6B41; border: 1px solid #BFE6CE; }
.alert-error { background: #FCEBE8; color: #A2352A; border: 1px solid #F3C6BE; }

/* ── Lightbox ────────────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0;
  background: rgba(8, 20, 22, .92);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox-close {
  position: absolute; top: 24px; right: 32px;
  color: #fff; font-size: 32px; background: none; border: 0;
}
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ── Footer ──────────────────────────────────────────────────── */

.site-footer {
  background: var(--brand-ink);
  color: rgba(255, 255, 255, .78);
  padding: 56px 0 28px;
  margin-top: 80px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand { font-family: var(--font-heading); font-weight: 800; font-size: 20px; color: #fff; margin-bottom: 10px; }
.footer-brand span { color: var(--brand-accent); }
.site-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }
.site-footer a { display: block; padding: 4px 0; color: rgba(255, 255, 255, .68); font-size: 14.5px; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding-top: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── Generic page header (contact, listings) ────────────────── */

.page-hero {
  background: var(--brand-primary-light);
  padding: 56px 0;
  text-align: center;
  margin-bottom: 48px;
}
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); color: var(--brand-primary-dark); }
.page-hero p { color: var(--brand-muted); max-width: 560px; margin: 0 auto; }

.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.contact-info-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--brand-border); }
.contact-info-item .lab { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-muted); }
.contact-info-item .val { font-weight: 600; }

/* ── Error page ──────────────────────────────────────────────── */

.error-page { text-align: center; padding: 120px 20px; }
.error-page h1 { font-size: 72px; color: var(--brand-primary); }
