/* 171 Listings - styles. Plain CSS, no build step. Edit the variables to rebrand. */
:root {
  --navy: #1d1f3b;
  --navy-2: #2b2e55;
  --ink: #1b1c2e;
  --muted: #5b5e74;
  --line: #dcdee8;
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --accent: #00d5aa;
  --accent-dark: #00a884;
  --link: #00695a;
  --danger: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 22, 45, .08), 0 4px 14px rgba(20, 22, 45, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid #5b8cff; outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip-link:focus { left: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .7em 1.2em; border-radius: 8px; border: 2px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 44px; }
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: #2ae8c1; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--bg-alt); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-block { display: flex; width: 100%; margin-top: 10px; }

/* Header */
.demo-banner { background: #fff4cc; color: #5c4400; text-align: center; font-size: .875rem; padding: 6px 12px; }
.site-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.main-nav a:hover { background: var(--navy-2); }
.site-header :focus-visible { outline-color: var(--accent); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #1f5f6e 100%); color: #fff; padding: 48px 0 56px; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .2em; }
.hero-sub { font-size: 1.15rem; opacity: .9; margin-bottom: 1.5em; }
.hero-search { background: #fff; color: var(--ink); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); max-width: 980px; }
.tabs { border: 0; padding: 0; margin: 0 0 12px; display: inline-flex; background: var(--bg-alt); border-radius: 10px; padding: 4px; position: relative; }
.tabs input { position: absolute; opacity: 0; pointer-events: none; }
.tabs label { padding: 8px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs input:checked + label { background: var(--navy); color: #fff; }
.tabs input:focus-visible + label { outline: 3px solid #5b8cff; outline-offset: 2px; }
.hero-fields { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); align-items: end; }
.hero-fields .field-wide { grid-column: 1 / -1; }
.hero-submit { grid-column: 1 / -1; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: .8125rem; font-weight: 700; color: var(--muted); }
.field input, .field select { font: inherit; padding: .65em .75em; border: 1px solid #9a9db2; border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; width: 100%; }
.field input:focus, .field select:focus { border-color: var(--navy); }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
.field-check input { width: 20px; height: 20px; min-height: 0; }
.field-check label { font-size: .9rem; color: var(--ink); font-weight: 600; }
.field-actions { flex-direction: row; gap: 8px; align-items: center; }

/* Sections */
.section { padding: 40px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; background: #fff; color: var(--navy); }
.chips a:hover { border-color: var(--navy); }
.usp { display: grid; gap: 24px; grid-template-columns: 1fr; }
.usp h3 { margin-bottom: .3em; }

/* Cards */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.photo-count { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 22, 45, .8); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.badge { position: absolute; left: 8px; top: 8px; background: var(--navy); color: #fff; font-size: .75rem; font-weight: 800; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.badge-inline { position: static; display: inline-block; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-price { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin: 0; }
.qual { display: block; font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
.card-title { font-size: 1.05rem; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-address { color: var(--muted); margin: 0; }
.card-meta { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; font-size: .9rem; }
.card-summary { color: #3b3d52; font-size: .95rem; margin: 4px 0 8px; }
.card-date { margin: auto 0 0; color: var(--muted); font-size: .8125rem; }

/* Search page */
.search-head { background: var(--navy); padding: 20px 0; }
.filters { background: #fff; border-radius: 14px; padding: 16px; display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); align-items: end; }
.filters .field-wide { grid-column: 1 / -1; }
.filters .field-check, .filters .field-actions { grid-column: 1 / -1; }
.results { padding-top: 24px; padding-bottom: 40px; }
.results-heading { font-size: 1.3rem; margin-bottom: 16px; }
.results-heading:focus { outline: none; }
.results-list { display: grid; gap: 16px; }
.results-list .card { flex-direction: column; }
.empty { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.pager a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--navy); min-width: 44px; text-align: center; }
.pager a.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.notice { background: #eef6ff; border: 1px solid #c8defa; border-radius: 8px; padding: 12px 14px; color: #1b3558; }

/* Property detail */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--link); }
.detail { display: grid; gap: 24px; grid-template-columns: 1fr; padding-bottom: 40px; }
.gallery { position: relative; display: grid; gap: 6px; border-radius: var(--radius); overflow: hidden; }
.gallery button { padding: 0; border: 0; background: var(--bg-alt); cursor: zoom-in; display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.g-main { aspect-ratio: 4 / 3; }
.g-sub { display: none !important; }
.g-all { position: absolute; right: 10px; bottom: 10px; background: rgba(20, 22, 45, .85) !important; color: #fff; font: inherit; font-weight: 700; font-size: .875rem; padding: 8px 14px !important; border-radius: 8px; cursor: pointer !important; min-height: 40px; }
.g-all:hover { background: var(--navy) !important; }
.detail-head { padding: 18px 0 6px; }
.detail-head h1 { margin-bottom: .1em; }
.detail-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: .6em; }
.detail-price { font-size: 2rem; font-weight: 800; color: var(--navy); margin: 0; }
.price-was { color: var(--muted); margin: 0; font-size: .95rem; }
.detail-added { color: var(--muted); font-size: .9rem; margin: 8px 0 0; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 16px 0 0; }
.fact { background: #fff; padding: 12px 14px; }
.fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fact dt { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; }
.block { padding: 24px 0 0; }
.block h2 { margin-bottom: .6em; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
.feature-list li { padding-left: 26px; position: relative; }
.feature-list li::before { content: ""; position: absolute; left: 4px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-dark); }
.room { padding: 10px 0; border-top: 1px solid var(--line); }
.room h3 { margin-bottom: .1em; }
.room-dim { color: var(--muted); font-weight: 600; margin: 0 0 .3em; }
.detail-list { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-list div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.detail-list div:first-child { border-top: 0; }
.detail-list div:nth-child(even) { background: var(--bg-alt); }
.detail-list dt { color: var(--muted); font-weight: 700; }
.detail-list dd { margin: 0; font-weight: 600; }
.floorplan { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.map { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: var(--radius); }
.hint { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.calc-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.calc-out { font-size: 1.2rem; margin: 14px 0 0; }
.agent-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 800; color: var(--muted); margin: 0 0 4px; }
.agent-name { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
.agent-card address { font-style: normal; color: var(--muted); margin-bottom: 8px; }
.ref { margin: 14px 0 0; color: var(--muted); font-size: .8125rem; }
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
body.property { padding-bottom: 70px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(10, 11, 24, .92); }
.lb { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; position: relative; }
.lb img { max-height: calc(100vh - 140px); max-width: 100%; object-fit: contain; border-radius: 8px; }
.lb-bar { display: flex; align-items: center; gap: 16px; color: #fff; font-weight: 700; }
.lb button { background: #fff; color: var(--navy); border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lb-close { position: absolute; top: 12px; right: 12px; }

/* Text pages */
.prose { padding-top: 32px; padding-bottom: 48px; max-width: 760px; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Footer */
.site-footer { background: var(--navy); color: #d9dcf0; padding: 36px 0 20px; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
.footer-brand { font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: .3em; }
.footer-head { font-weight: 800; color: #fff; margin-bottom: .5em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 3px 0; }
.footer-small { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 24px; padding-top: 16px; font-size: .8125rem; }

/* Tablet */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero-fields { grid-template-columns: repeat(4, 1fr); }
  .hero-fields .field-wide { grid-column: 1 / -1; }
  .hero-submit { grid-column: auto; }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .usp { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .feature-list { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(5, 1fr); }
  .fact:last-child:nth-child(odd) { grid-column: auto; }
  .results-list .card { flex-direction: row; }
  .results-list .card-media { width: 300px; aspect-ratio: auto; min-height: 220px; flex-shrink: 0; }
}

/* Desktop */
@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero-fields { grid-template-columns: 2.2fr 1fr 1fr 1fr auto; }
  .hero-fields .field-wide { grid-column: auto; }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
  .filters .field-wide { grid-column: auto; }
  .filters .field-check { grid-column: span 2; }
  .filters .field-actions { grid-column: span 3; justify-content: flex-end; }
  .detail { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
  .detail-side { position: sticky; top: 16px; align-self: start; }
  .gallery.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 460px; }
  .gallery.n3 .g-main { grid-row: 1 / span 2; aspect-ratio: auto; }
  .gallery.n3 .g-sub { display: block !important; }
  .gallery.n2 { grid-template-columns: 1fr 1fr; height: 400px; }
  .gallery.n2 .g-main { aspect-ratio: auto; }
  .cta-bar { display: none; }
  body.property { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
