/* =========================================================
   Nestwell Realty: deep green, warm sand and a touch of gold.
   Colours and sizes are variables, so the look can be changed here.
   ========================================================= */
:root {
  --green: #1f4d3a;
  --green-dark: #163a2b;
  --gold: #c8a25c;
  --sand: #f7f3ec;
  --white: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6a65;
  --line: #e4ddd1;
  --rent: #2f6fa3;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(29, 29, 27, 0.08);
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--white); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.container { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-tint { background: var(--sand); }
.eyebrow { margin: 0 0 0.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.page-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--green); color: var(--white);
  padding: 0.85rem 1.5rem; border-radius: 999px;
  font: 600 0.95rem var(--sans); text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: scale(0.97); }
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-light { background: var(--white); color: var(--green); }
.btn-light:hover { background: var(--sand); }
.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow::after { content: " →"; }
.link-back { display: inline-block; margin-bottom: 1.2rem; font-weight: 600; text-decoration: none; }
.link-back::before { content: "← "; }
.link-button { background: none; border: none; padding: 0; color: var(--green); font: 600 0.9rem var(--sans); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font: 1.45rem var(--serif); color: var(--ink); text-decoration: none; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--green); color: var(--gold); font-size: 1.15rem; }
.logo-light { color: var(--gold); margin-left: 0.25rem; }
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"]:not(.btn) { border-color: var(--gold); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; place-items: center; width: 42px; height: 42px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform 0.2s;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: 0.5rem 1rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 0.8rem; text-align: center; }
}

/* ---------- Hero + search ---------- */
.hero {
  background:
    linear-gradient(180deg, rgba(22, 58, 43, 0.55), rgba(22, 58, 43, 0.75)),
    url("../images/lekki-family-home.webp") center / cover;
  color: var(--white);
  padding: clamp(4rem, 10vw, 7.5rem) 0;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); max-width: 17ch; }
.hero-lead { max-width: 52ch; font-size: 1.15rem; opacity: 0.92; margin: 0 0 2rem; }

.search-box { background: var(--white); color: var(--ink); border-radius: var(--radius); padding: 1rem; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); max-width: 880px; }
.search-tabs { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; }
.search-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.search-tabs span { display: block; padding: 0.45rem 1.2rem; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); }
.search-tabs input:checked + span { background: var(--green); color: var(--white); }
.search-tabs input:focus-visible + span { outline: 3px solid var(--gold); }
.search-fields { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 0.8rem; align-items: end; }
.btn-search { height: 48px; padding-inline: 2rem; border-radius: 10px; }
@media (max-width: 760px) { .search-fields { grid-template-columns: 1fr 1fr; } .btn-search { grid-column: 1 / -1; } }

/* ---------- Form fields (used everywhere) ---------- */
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > span { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.field select, .field input, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.85rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  font: 1rem var(--sans); color: var(--ink);
}
.field textarea { resize: vertical; }
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.15); }
.form { display: grid; gap: 1rem; }
.form-status:empty { display: none; }
.form-status { margin: 0; padding: 0.8rem 1rem; border-radius: 10px; }
.form-status.success { background: #e7f3ec; color: var(--green-dark); font-weight: 500; }

/* ---------- Section heading row ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }

/* ---------- Property cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.6rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.25s, transform 0.25s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-media img { transform: scale(1.05); }
.badge { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--white); background: var(--green); }
.badge-rent { background: var(--rent); }
.card-media .badge { position: absolute; top: 0.8rem; left: 0.8rem; }
.card-body { padding: 1.1rem 1.2rem 1.2rem; }
.card-price { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--green); }
.card-title { margin: 0.2rem 0 0.1rem; font: 600 1.02rem var(--sans); }
.card-place { margin: 0; color: var(--muted); font-size: 0.92rem; }
.facts { display: flex; gap: 1rem; margin: 0.9rem 0 0; padding: 0.8rem 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 0.88rem; color: var(--muted); }
/* Small line icons drawn with SVG and coloured by CSS (mask = use the drawing as a stencil) */
.facts li { display: flex; align-items: center; gap: 0.35rem; }
.facts li::before {
  content: ""; width: 16px; height: 16px; flex-shrink: 0;
  background: var(--gold);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.facts li[data-icon="bed"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 18V6M3 14h18v4M21 14v-2a3 3 0 0 0-3-3h-7v5'/%3E%3Ccircle cx='7' cy='11' r='2'/%3E%3C/svg%3E"); }
.facts li[data-icon="bath"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 12h18v2a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5v-2zM6 12V5a2 2 0 0 1 4 0M7 19l-1 2M17 19l1 2'/%3E%3C/svg%3E"); }
.facts li[data-icon="size"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6M4 4v6M20 20h-6M20 20v-6M4 4l16 16'/%3E%3C/svg%3E"); }

/* ---------- Cities ---------- */
.cities { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin-top: 1.5rem; }
.city {
  position: relative; display: flex; flex-direction: column; justify-content: end;
  min-height: 220px; padding: 1.2rem; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center; color: var(--white); text-decoration: none;
  isolation: isolate;
}
.city::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(22, 58, 43, 0.85)); transition: opacity 0.3s; }
.city:hover::before { opacity: 0.8; }
.city strong { font: 1.6rem var(--serif); }
.city span { font-size: 0.9rem; opacity: 0.9; }

/* ---------- Why us ---------- */
.why { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; }
.why-list { display: grid; gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.why-list li { padding-left: 1.2rem; border-left: 3px solid var(--gold); color: var(--muted); }
.why-list strong { display: block; color: var(--ink); font-size: 1.05rem; }
@media (max-width: 760px) { .why { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- Call to action ---------- */
.cta { background: var(--green); color: var(--white); padding: 3.5rem 0; text-align: center; }
.cta p { opacity: 0.85; margin: 0 0 1.5rem; }

/* ---------- Listings page ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; padding: 1rem; margin: 1.5rem 0 1rem; background: var(--sand); border-radius: var(--radius); }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; color: var(--muted); }
.results-bar p { margin: 0; }
.empty { text-align: center; padding: 3rem 1rem; background: var(--sand); border-radius: var(--radius); }

/* ---------- Property page ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.detail-head .page-title { margin: 0.6rem 0 0.2rem; }
.detail-place { margin: 0; color: var(--muted); }
.detail-price { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; color: var(--green); }
.gallery { display: grid; gap: 0.8rem; margin-bottom: 2.5rem; }
.gallery-main { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--sand); }
.gallery-thumbs { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.2rem; }
.gallery-thumbs button { flex: 0 0 110px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; opacity: 0.7; transition: opacity 0.2s, border-color 0.2s; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button[aria-current="true"] { border-color: var(--gold); opacity: 1; }
.gallery-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; align-items: start; }
.detail-main h2 { margin-top: 2.2rem; font-size: 1.6rem; }
.key-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.key-facts li { padding: 1rem; background: var(--sand); border-radius: 12px; text-align: center; }
.key-facts strong { display: block; font-size: 1.3rem; color: var(--green); }
.key-facts span { font-size: 0.82rem; color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.feature-list li::before { content: "✓"; color: var(--gold); font-weight: 700; margin-right: 0.5rem; }
.map { width: 100%; height: 320px; border: 0; border-radius: var(--radius); background: var(--sand); }
.map-note { font-size: 0.85rem; color: var(--muted); }

.enquiry-card { position: sticky; top: 90px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
.enquiry-card h2 { font-size: 1.5rem; margin: 1.2rem 0 0.8rem; }
.agent { display: flex; align-items: center; gap: 0.8rem; }
.agent-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: var(--gold); font-weight: 700; }
.agent strong { display: block; }
.agent span { font-size: 0.85rem; color: var(--muted); }
.similar { margin-top: 4rem; }

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; gap: 2rem; }
  .enquiry-card { position: static; }
}
@media (max-width: 520px) { .key-facts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Contact page ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.offices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0 1rem; padding: 0; list-style: none; }
.offices li { padding: 1rem; background: var(--sand); border-radius: 12px; color: var(--muted); font-size: 0.92rem; }
.offices strong { display: block; color: var(--ink); }
.form-card { padding: 1.8rem; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 860px) { .contact-layout { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfcac0; padding: 2rem 0; font-size: 0.92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer strong { color: var(--white); }
.footnote { opacity: 0.7; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Backend states ---------- */
.form-status.error { background: #fbeaea; color: #8a1f1f; font-weight: 500; }
.field [aria-invalid="true"] { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.grid[aria-busy="true"] { opacity: 0.5; transition: opacity 0.2s; }
.load-error { grid-column: 1 / -1; padding: 1.5rem; border-radius: var(--radius); background: #fbeaea; color: #8a1f1f; }
