/* ============================================================
   DeshMate warm, welcoming design system
   Palette: cream background, terracotta primary, WhatsApp green CTA
   Type: Fraunces (headings) / Nunito Sans (body)
   ============================================================ */

:root {
  --bg: #FBF5EC;
  --surface: #FFFFFF;
  --surface-warm: #FFF9F1;
  --ink: #33261C;
  --muted: #6F5D50;
  --primary: #C05621;
  --primary-dark: #9A431A;
  --primary-soft: #FBE8DB;
  --green: #1B9E4B;
  --green-dark: #157A3A;
  --border: #EBDFD0;
  --shadow-sm: 0 1px 3px rgba(51, 38, 28, 0.08);
  --shadow-md: 0 6px 24px rgba(51, 38, 28, 0.10);
  --shadow-lg: 0 16px 48px rgba(51, 38, 28, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-warm); border-color: var(--muted); }
.btn-lg { min-height: 52px; padding: 12px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.link-btn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--primary); font-size: inherit; font-weight: 700;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--primary-dark); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 245, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 8px; padding-bottom: 8px;
  /* the header owns the full width: brand and nav sit in the corners */
  max-width: none; padding-left: 28px; padding-right: 28px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.brand-mark { width: 33px; height: 33px; color: var(--primary); }
.brand-name { font-size: 29px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-auth { display: flex; align-items: center; gap: 8px; margin-left: 6px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.account-menu { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 5px 12px 5px 6px;
  background: none; border: 1.5px solid var(--border); border-radius: 999px;
  cursor: pointer; font-weight: 800; font-size: 14px; color: var(--ink);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--surface-warm); border-color: var(--muted); }
.account-caret { width: 14px; height: 14px; color: var(--muted); }
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.account-email {
  padding: 8px 12px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  border-bottom: 1px solid var(--border); margin-bottom: 6px; word-break: break-all;
}
.account-item {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 11px 12px; border: none; background: none; border-radius: 9px;
  cursor: pointer; font-weight: 700; font-size: 14px; color: var(--ink); text-align: left;
  transition: background-color 150ms ease;
}
.account-item:hover { background: var(--surface-warm); }
.account-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.mine-section { padding-top: 34px; }
.nav-link {
  background: none; border: none; cursor: pointer;
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--muted);
  transition: color 200ms ease, background-color 200ms ease;
}
.nav-link:hover { color: var(--ink); background: var(--primary-soft); }
.nav-link.is-active { color: var(--primary-dark); }
/* header controls run a notch slimmer than their site-wide cousins */
.header-nav .btn, .header-nav .nav-link, .header-nav .account-btn { min-height: 40px; }

/* hamburger + slide-in drawer: phone-only chrome, hidden on desktop */
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  background: none; border: none; border-radius: 10px;
  color: var(--ink); cursor: pointer;
}
.menu-btn:hover { background: var(--primary-soft); }
.menu-btn svg { width: 24px; height: 24px; }
.nav-link-mobile { display: none; }
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(26, 19, 12, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 240ms ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-drawer {
  display: none; position: fixed; top: 0; bottom: 0; left: 0; z-index: 95;
  width: min(78vw, 300px);
  flex-direction: column; gap: 2px; padding: 12px;
  background: var(--bg); border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  visibility: hidden; transform: translateX(-105%);
  transition: transform 240ms ease, visibility 0s linear 240ms;
}
.mobile-drawer.open { visibility: visible; transform: none; transition: transform 240ms ease; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--ink); }
.drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: none; border: none; border-radius: 10px;
  color: var(--muted); cursor: pointer;
}
.drawer-close:hover { background: var(--primary-soft); color: var(--ink); }
.drawer-close svg { width: 20px; height: 20px; }
.drawer-item {
  display: flex; align-items: center;
  min-height: 48px; padding: 10px 12px;
  background: none; border: none; border-radius: 10px;
  font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--ink);
  text-align: left; cursor: pointer;
}
.drawer-item:hover { background: var(--primary-soft); }

/* ---------- Hero ---------- */
/* The journey wrapper is tall on purpose: the extra scroll length is the
   video's timeline. The hero itself stays pinned while the user scrubs. */
.hero-journey { height: 320vh; }
.hero {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* dusk apartment photo under a soft ink veil: the pre-video poster and the
     fallback when the video can't play */
  background:
    linear-gradient(180deg, rgba(26, 19, 12, 0.52) 0%, rgba(26, 19, 12, 0.26) 42%, rgba(26, 19, 12, 0.44) 100%),
    url("images/hero-home.jpg") 30% 32% / cover no-repeat,
    #241B26;
  border-bottom: 1px solid var(--border);
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 32%;
}
/* fades in together with the text so the skyline stays readable behind it */
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(26, 19, 12, 0.5) 0%, rgba(26, 19, 12, 0.28) 45%, rgba(26, 19, 12, 0.5) 100%);
}
.hero-scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  margin: 0; color: rgba(255, 244, 228, 0.9);
  font-size: 12.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(10, 6, 2, 0.6);
  animation: hint-bob 1.6s ease-in-out infinite alternate;
}
@keyframes hint-bob {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, 8px); }
}
.hero-inner {
  position: relative; z-index: 1; padding: 72px 20px 64px; text-align: center;
  width: 100%;
  /* the question and the closing act share the same spot: the headline holds
     it through the whole walk, the finale takes it over on the skyline */
  display: grid;
}
.hero-intro, .hero-finale { grid-area: 1 / 1; align-self: center; }
/* the question: pinned in place for the whole walk, bows out on the skyline;
   lifted off center so the first line starts up on the roofline */
.hero-intro { will-change: opacity; pointer-events: none; transform: translateY(-20vh); }
/* the language slot: its own line, so the swapping words never move the sentence */
.hero-word {
  display: block; margin-top: 4px;
  line-height: 1.3; min-height: 1.3em;
  will-change: opacity;
}
/* closing act: the line lands first, the search bar settles in below it;
   dropped below center so it sits over the city lights, clear of the skyline */
.hero-finale { pointer-events: none; transform: translateY(12vh); }
.hero-finale-title {
  margin: 0 0 26px;
  font-family: var(--font-head); font-weight: 700; letter-spacing: -1px;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  color: #FFF9EE; text-shadow: 0 2px 26px rgba(10, 6, 2, 0.45);
  opacity: 0; transform: translateY(18px); will-change: opacity, transform;
}
.hero-finale-actions {
  opacity: 0; transform: translateY(26px);
  will-change: opacity, transform;
}
/* static hero: reduced motion, video failure, or anything else that breaks
   the journey falls back to the photo with all the text always visible */
.hero-static { height: auto; }
.hero-static .hero { position: relative; height: auto; }
.hero-static .hero-video, .hero-static .hero-scroll-hint,
.hero-static .hero-veil { display: none; }
.hero-static .hero-inner { display: block; }
.hero-static .hero-intro { opacity: 1; pointer-events: auto; transform: none; }
.hero-static .hero-intro h1 { margin-bottom: 30px; }
.hero-static .hero-finale { pointer-events: auto; transform: none; }
.hero-static .hero-finale-title,
.hero-static .hero-finale-actions { opacity: 1; transform: none; }

/* scroll-reveal */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 600ms ease, transform 600ms ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700; letter-spacing: -1px;
  max-width: 780px; margin: 0 auto 16px;
  color: #FFF9EE;
  text-shadow: 0 2px 26px rgba(10, 6, 2, 0.45);
}
/* the accent words ("your language", "home"): gold hugged by a tight dark
   halo, so they read over the bright sunset and the dim interior alike */
.hero-highlight {
  color: #FFC46B; font-style: italic;
  text-shadow: 0 2px 4px rgba(15, 9, 3, 0.95), 0 4px 22px rgba(15, 9, 3, 0.8);
}

/* solid porcelain pill over the video: nothing bleeds through the fields */
.hero-search {
  display: flex; gap: 10px; max-width: 860px; margin: 0 auto 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 8px;
  box-shadow: 0 12px 36px rgba(15, 10, 5, 0.35);
}
.hero-search-field input::placeholder { color: var(--muted); }
.hero-search-field {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 8px 0 16px; min-width: 0;
}
.hero-search-field svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.hero-search-field input, .hero-search-field select {
  width: 100%; min-height: 44px;
  border: none; background: transparent; outline: none;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
}
.hero-search-select { flex: 0 0 230px; border-left: 1px solid var(--border); }
.hero-search-field select { cursor: pointer; }
.hero-search-btn { flex-shrink: 0; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  min-height: 38px; padding: 6px 16px;
  border-radius: 999px; border: 1.5px solid var(--surface);
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}
.chip:hover { background: var(--surface-warm); border-color: var(--primary); color: var(--primary-dark); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- How it works ---------- */
.how { padding: 56px 20px 8px; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.how-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-top: 20px;
}
.how-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow-sm);
}
.how-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-dark);
  margin-bottom: 14px;
}
.how-icon svg { width: 24px; height: 24px; }
.how-card h3 { font-size: 18px; }
.how-card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Listings & filters ---------- */
.listings-section { padding: 48px 20px 72px; }
.listings-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.results-count { margin: 0; color: var(--muted); font-weight: 700; }

/* Home: community preview rows */
.home-rows { padding: 56px 20px 8px; }
.home-row { margin-bottom: 44px; }
.home-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.home-see-all {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; font-weight: 800;
  color: var(--primary-dark);
}
.home-see-all svg { width: 16px; height: 16px; transition: transform 180ms ease; }
.home-see-all:hover svg { transform: translateX(3px); }
.home-browse-cta { text-align: center; margin: 4px 0 20px; }
.home-browse-cta .btn svg { width: 18px; height: 18px; }

/* Browse page: search on top, filter sidebar on the left */
.browse-section { padding: 40px 20px 72px; }
.browse-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.browse-search {
  flex: 1 1 340px; max-width: 560px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 5px 5px 5px 16px;
  box-shadow: var(--shadow-sm);
}
.browse-search:focus-within { border-color: var(--primary); }
.browse-search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.browse-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 15px; color: var(--ink); padding: 9px 0;
}
.browse-search .btn { border-radius: 999px; flex-shrink: 0; }
.browse-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px; align-items: start;
}
.browse-filters {
  position: sticky; top: 86px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.browse-filters-head {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
}
.browse-filters .filter-clear { width: 100%; }
.browse-results .results-count { margin-bottom: 14px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field label { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-field select {
  min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; cursor: pointer;
  transition: border-color 200ms ease;
}
.filter-field select:hover { border-color: var(--muted); }
.filter-clear { flex: 0 0 auto; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; text-align: left; padding: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 160ms ease-out;
  will-change: transform;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #DCC9B4; }
.card-media { position: relative; height: 210px; flex-shrink: 0; overflow: hidden; background: var(--primary-soft); }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-community {
  position: absolute; top: 12px; left: 12px;
  padding: 5px 13px; border-radius: 999px;
  background: rgba(51, 38, 28, 0.82); color: #fff;
  font-size: 13px; font-weight: 800; backdrop-filter: blur(4px);
}
.card-yours {
  position: absolute; top: 12px; right: 12px;
  padding: 5px 13px; border-radius: 999px;
  background: var(--green); color: #fff;
  font-size: 12.5px; font-weight: 800;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-price { font-size: 21px; font-weight: 800; }
.card-price span { font-size: 14px; font-weight: 700; color: var(--muted); }
.card-title {
  font-family: var(--font-body); font-size: 16px; font-weight: 800;
  margin: 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-loc { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.card-loc svg { width: 15px; height: 15px; flex-shrink: 0; }
.card-facts { display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.card-fact { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.card-fact svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--primary); }
.card-fact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.tag {
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-warm); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.tag-community { background: var(--primary-soft); border-color: #EBD3BE; color: var(--primary-dark); }
.tag-veg { background: #E8F6EC; border-color: #BFE5CB; color: #157A3A; }
.tag-halal { background: #E9F2FB; border-color: #C4DCF3; color: #1D5FA8; }
.tag-nonveg { background: #FDEEE4; border-color: #F2D2BC; color: #9A431A; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center; padding: 64px 20px;
  background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius);
}
.empty-state svg { width: 46px; height: 46px; color: var(--muted); margin-bottom: 8px; }
.empty-state h3 { font-size: 20px; }
.empty-state p { color: var(--muted); margin: 0; }

/* ---------- Post form ---------- */
.post-container { max-width: 1160px; padding-top: 48px; padding-bottom: 80px; }
.post-head p { color: var(--muted); margin: 8px 0 0; }

.post-layout {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 44px; align-items: start;
}
.post-side h2 { font-family: var(--font-head); font-size: 24px; margin: 0 0 8px; color: var(--primary-dark); }
.post-side p { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.post-side-photos { display: grid; gap: 14px; }
.post-side-photos img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block;
  border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
@media (max-width: 920px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-side { display: none; }
}

.post-form { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }
.post-form fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 22px; margin: 0;
  box-shadow: var(--shadow-sm);
}
.post-form legend {
  font-family: var(--font-head); font-size: 19px; font-weight: 700;
  padding: 0 10px; color: var(--primary-dark);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field[hidden] { display: none; }
.form-field-wide { grid-column: 1 / -1; }
.room-type-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 4px; }
.form-field label { font-size: 14px; font-weight: 800; }
.req { color: var(--primary); }
.form-field input, .form-field select, .form-field textarea {
  min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-warm); color: var(--ink);
  font-family: var(--font-body); font-size: 16px;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--muted); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(192, 86, 33, 0.15);
}
.form-field small { color: var(--muted); font-size: 13px; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 auto; width: 128px; padding-left: 10px; padding-right: 6px; }
.phone-row input { flex: 1; min-width: 0; }
.form-field.has-error input, .form-field.has-error select, .form-field.has-error textarea { border-color: #C0392B; }
.field-error { color: #C0392B; font-size: 13px; font-weight: 700; }

/* Community multi-select combobox */
.multi-combo {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 46px; padding: 6px 10px; cursor: text;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-warm);
  transition: border-color 200ms ease, background-color 200ms ease;
}
.multi-combo:focus-within {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(192, 86, 33, 0.15);
}
.form-field.has-error .multi-combo { border-color: #C0392B; }
.form-field .multi-combo input {
  flex: 1; min-width: 130px; min-height: 0;
  border: none; background: transparent; padding: 6px 2px;
}
.form-field .multi-combo input:focus, .form-field .multi-combo input:hover {
  border: none; box-shadow: none; background: transparent; outline: none;
}
.combo-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 14px; font-weight: 800;
  border-radius: 999px; padding: 6px 12px;
}
.combo-chip button {
  display: flex; background: none; border: none; padding: 0;
  color: inherit; cursor: pointer;
}
.combo-chip svg { width: 13px; height: 13px; }
.combo-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  max-height: 264px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.combo-option {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 14px; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
}
.combo-option:hover { background: var(--primary-soft); }
.combo-option.is-selected { font-weight: 700; }
.combo-check {
  width: 19px; height: 19px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 5px;
  background: var(--surface); color: #fff;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.combo-option.is-selected .combo-check { background: var(--primary); border-color: var(--primary); }
.combo-check svg { width: 13px; height: 13px; }
.combo-special { font-weight: 800; color: var(--primary-dark); }
.combo-option.combo-special + .combo-option:not(.combo-special) { border-top: 1px solid var(--border); }
.combo-empty { padding: 11px 14px; color: var(--muted); font-size: 14.5px; }

.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.check {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-warm); font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease;
}
.check:hover { border-color: var(--primary); }
.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }

.photo-upload { display: flex; flex-direction: column; gap: 14px; }
.photo-upload.has-error .photo-drop { border-color: #C0392B; }
.photo-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 20px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface-warm); color: var(--muted);
  cursor: pointer; transition: border-color 200ms ease, background-color 200ms ease;
}
.photo-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.photo-drop svg { width: 34px; height: 34px; }
.photo-drop strong { color: var(--primary-dark); }
.photo-previews { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-preview { position: relative; width: 130px; height: 96px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview button {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(51, 38, 28, 0.8); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color 200ms ease;
}
.photo-preview button:hover { background: #C0392B; }
.photo-preview button svg { width: 14px; height: 14px; }

.form-footer { display: flex; flex-direction: column; gap: 14px; }
.form-note { margin: 0; color: var(--muted); font-size: 14px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal-overlay[hidden], .toast[hidden] { display: none; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 20, 12, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto;
}
.modal {
  position: relative; width: 100%; max-width: 780px;
  background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 240ms ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(51, 38, 28, 0.65); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color 200ms ease;
}
.modal-close:hover { background: rgba(51, 38, 28, 0.9); }
.modal-close svg { width: 20px; height: 20px; }

.gallery-main { aspect-ratio: 16 / 9; background: var(--primary-soft); border-radius: 18px 18px 0 0; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px 24px 0; }
.gallery-thumb {
  width: 84px; height: 60px; padding: 0; border-radius: 8px; overflow: hidden;
  border: 2.5px solid transparent; cursor: pointer; background: none;
  transition: border-color 200ms ease; flex-shrink: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--primary); }

.detail-body { padding: 18px 26px 28px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.detail-title { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-bottom: 4px; }
.detail-loc { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.detail-loc svg { width: 17px; height: 17px; }
.detail-locdesc { color: var(--muted); font-size: 14.5px; font-weight: 600; margin: -8px 0 14px; }
.detail-price { font-size: 26px; font-weight: 800; margin-bottom: 16px; }
.detail-price span { font-size: 15px; font-weight: 700; color: var(--muted); }

.detail-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.fact {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--surface-warm); border: 1px solid var(--border);
}
.fact svg { width: 19px; height: 19px; color: var(--primary); flex-shrink: 0; }
.fact-label { display: block; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.fact-value { font-size: 14.5px; font-weight: 800; }

/* ---------- Auth modal ---------- */
.auth-modal { max-width: 430px; }
.auth-body { padding: 36px 30px 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-body h2 { font-size: 1.55rem; margin: 0; }
.auth-sub { color: var(--muted); margin: -6px 0 0; }
.google-btn { background: #fff; color: var(--ink); border-color: var(--border); font-weight: 800; }
.google-btn:hover { background: var(--surface-warm); border-color: var(--muted); }
.google-btn svg { width: 19px; height: 19px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-error {
  background: #FDECEA; color: #C0392B;
  padding: 10px 13px; border-radius: 10px;
  font-size: 14px; font-weight: 700; margin: 0;
}
.auth-error.is-info { background: var(--primary-soft); color: var(--primary-dark); }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 0; }

.detail-section-title { font-family: var(--font-body); font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 18px 0 8px; }
.detail-desc { margin: 0; white-space: pre-line; }
.detail-amenities { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-amenities .tag { font-size: 13.5px; padding: 6px 13px; }

.detail-contact {
  margin-top: 22px; padding: 18px;
  border-radius: var(--radius); background: var(--surface-warm); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.contact-person { display: flex; align-items: center; gap: 12px; }
.contact-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.contact-person p { margin: 0; font-weight: 800; }
.contact-person small { color: var(--muted); font-weight: 700; }
.contact-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.contact-actions[hidden], .contact-locked[hidden] { display: none; }

.contact-locked { display: flex; flex-direction: column; gap: 6px; }
.slide-reveal {
  position: relative; width: 280px; max-width: 100%; height: 52px;
  border-radius: 26px; background: var(--bg);
  border: 1px solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  user-select: none; touch-action: none;
}
.slide-reveal-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 48px;
  background: linear-gradient(90deg, #b7e0c3, #79c98f);
  border-radius: 26px; transition: width 0.25s ease;
}
.slide-reveal.is-dragging .slide-reveal-fill { transition: none; }
.slide-reveal-label {
  position: relative; font-size: 14px; font-weight: 700; color: var(--muted);
  padding-left: 30px; pointer-events: none;
}
.slide-reveal-handle {
  position: absolute; left: 4px; top: 4px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: grab;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: transform 0.25s ease;
  touch-action: none;
}
.slide-reveal.is-dragging .slide-reveal-handle { cursor: grabbing; transition: none; }
.slide-reveal-handle svg { width: 20px; height: 20px; pointer-events: none; }
.slide-reveal-hint { color: var(--muted); font-size: 12.5px; }

.detail-remove {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.edit-btn svg { width: 16px; height: 16px; }
.remove-btn {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 8px 14px; border-radius: var(--radius-sm);
  color: #A93226; font-size: 14px; font-weight: 700;
  transition: background-color 200ms ease;
}
.remove-btn:hover { background: #FDEDEB; }
.remove-btn svg { width: 16px; height: 16px; }
.remove-btn.confirming { background: #A93226; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: #2C2118; color: #E8DDD2; margin-top: 20px; }
.footer-inner {
  display: grid; grid-template-columns: 1.3fr 0.7fr 1.3fr;
  gap: 36px; padding-top: 48px; padding-bottom: 32px;
}
.site-footer .brand { color: #fff; }
.site-footer .brand-mark { color: #E89B6C; }
.footer-brand p { color: #BFAE9E; font-size: 14.5px; max-width: 300px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-links h4, .footer-note h4 {
  font-family: var(--font-body); font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px; color: #BFAE9E; margin: 0 0 6px;
}
.footer-links .link-btn { color: #E8DDD2; text-decoration: none; font-weight: 700; }
.footer-links .link-btn:hover { color: #E89B6C; }
.footer-note p { color: #BFAE9E; font-size: 13.5px; margin: 0; }
.footer-bottom {
  border-top: 1px solid rgba(232, 221, 210, 0.15); padding-top: 18px; padding-bottom: 22px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
}
.footer-bottom p { margin: 0; font-size: 13.5px; color: #BFAE9E; }
.footer-legal { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #BFAE9E; }
.footer-legal .link-btn { color: #E8DDD2; text-decoration: none; font-weight: 700; font-size: 13.5px; }
.footer-legal .link-btn:hover { color: #E89B6C; }

/* ---------- Legal pages (privacy & terms) ---------- */
.legal-page { max-width: 760px; padding-top: 48px; padding-bottom: 64px; }
.legal-page .section-title { margin-bottom: 4px; }
.legal-updated { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.legal-page h2 { font-family: var(--font-head); font-size: 22px; margin: 30px 0 10px; }
.legal-page p, .legal-page li { font-size: 15.5px; line-height: 1.65; }
.legal-page ul { padding-left: 22px; margin: 10px 0; display: grid; gap: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 200; max-width: min(92vw, 480px);
  background: #2C2118; color: #fff;
  padding: 14px 24px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: toast-in 260ms ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-search { flex-direction: column; border-radius: var(--radius); }
  .hero-search-field { padding: 4px 10px; }
  .hero-search-select { flex: 1; border-left: none; border-top: 1px solid var(--border); }
  .hero-search-btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .browse-layout { grid-template-columns: 1fr; }
  .browse-filters {
    position: static;
    flex-direction: row; flex-wrap: wrap; align-items: flex-end;
  }
  .browse-filters-head { width: 100%; }
  .browse-filters .filter-field { flex: 1 1 150px; min-width: 140px; }
  .browse-filters .filter-clear { width: auto; }
}

@media (max-width: 640px) {
  /* app header: hamburger + brand on the left, Listings and Post on the
     right; everything else moves into the drawer */
  .header-inner { gap: 6px; padding-left: 10px; padding-right: 12px; }
  .menu-btn { display: inline-flex; }
  .brand { gap: 8px; margin-right: auto; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-name { font-size: 23px; }
  .header-nav { gap: 2px; }
  .header-nav .nav-link:not(.nav-link-mobile) { display: none; }
  .nav-link-mobile { display: inline-flex; align-items: center; padding: 8px 10px; }
  .post-more { display: none; }
  .header-nav .btn { padding: 8px 14px; }
  .header-auth { display: none; }
  /* the drawer and its overlay only exist as elements on phones */
  .drawer-overlay { display: block; }
  .mobile-drawer { display: flex; }
  .hero-inner { padding: 44px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-contact { flex-direction: column; align-items: stretch; }
  .contact-actions { flex-direction: column; }
  .contact-actions .btn { width: 100%; }
  .modal-overlay { padding: 12px 8px; }
  .gallery-thumbs { padding: 10px 14px 0; }
  .detail-body { padding: 16px 16px 22px; }
}

/* ---------- Contact us band (bottom of home page) ---------- */
.contact-section { margin: 64px auto 40px; }

.contact-band {
  background: #2C2118;
  color: #E8DDD2;
  border-radius: 28px;
  padding: 56px 52px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.contact-intro h2 {
  color: #fff;
  font-size: clamp(26px, 3.4vw, 38px);
  margin-bottom: 12px;
}

.contact-intro p {
  color: #C9BBAE;
  margin: 0;
  max-width: 46ch;
}

.contact-form { display: grid; gap: 14px; }

.contact-form input[type="text"],
.contact-form textarea {
  width: 100%;
  background: #241B13;
  color: #F5EDE3;
  border: 1.5px solid #4A3A2C;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font: inherit;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #8D7B6B; }

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 3px solid #E89B6C;
  outline-offset: 1px;
}

.contact-attach {
  display: inline-flex; align-items: center; gap: 9px;
  justify-self: start;
  min-height: 44px; padding: 9px 20px;
  background: transparent;
  color: #C9BBAE;
  border: 1.5px dashed #5C4936;
  border-radius: 999px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}

.contact-attach svg { width: 17px; height: 17px; flex: none; }
.contact-attach small { font-weight: 400; color: #8D7B6B; }

.contact-attach:hover { border-color: #8D7B6B; color: #fff; }

.contact-attach.has-file {
  border-style: solid;
  border-color: #E89B6C;
  color: #fff;
}

.contact-send {
  justify-self: start;
  background: #fff;
  color: #2C2118;
  padding: 12px 28px;
}

.contact-send:hover { background: #F1E6D8; }
.contact-send:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 860px) {
  .contact-band {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 26px;
  }
}
