:root {
    --navy:    #14304F;
    --blue:    #2C6099;
    --gold:    #C0892E;
    --gold-dk: #A5761F;
    --surface: #F4F6F8;
    --ink:     #1F2A37;
    --muted:   #5B6875;
    --line:    #E2E7EC;
    --white:   #FFFFFF;
    --radius:  10px;
    --shadow:  0 1px 3px rgba(20,48,79,.08), 0 6px 20px rgba(20,48,79,.06);
    --maxw:    1140px;
    --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--white);
    line-height: 1.55;
    font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold-dk); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.section--alt { background: var(--surface); }

/* Section heading with thin gold rule */
.section-head { margin-bottom: 28px; }
.section-head h2 { display: inline-block; margin: 0; }
.section-head .rule { width: 56px; height: 3px; background: var(--gold); margin-top: 10px; border: 0; }
.section-head p { color: var(--muted); margin: 8px 0 0; }

/* Buttons */
.btn {
    display: inline-block; font-weight: 600; cursor: pointer;
    padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
    font-size: 15px; text-align: center; transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--gold); color: #fff; }
.btn--primary:hover { background: var(--gold-dk); color: #fff; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: #0e2338; color: #fff; }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn--block { display: block; width: 100%; }
.btn--sm { padding: 7px 12px; font-size: 14px; }

/* Header / nav */
.site-header { background: var(--navy); position: sticky; top: 0; z-index: 40; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand .mark {
    width: 38px; height: 38px; border-radius: 7px; flex: none;
    background: linear-gradient(135deg, var(--gold), var(--gold-dk));
    display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
    font-family: Georgia, serif;
}
.brand b { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.brand span { display: block; font-size: 11px; color: #A9BBD0; font-weight: 400; margin-top: -2px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
    color: #E7EDF4; padding: 8px 12px; border-radius: 6px; font-size: 15px; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--gold); border-radius: 0; }
.nav .btn { margin-left: 8px; }

.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; }
.nav-toggle svg { width: 26px; height: 26px; }

/* Hero */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background-color: #14304F;
    background-image: url("/assets/img/hero.svg");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}
/* Scrim: keeps the headline readable over the artwork at every width. */
.hero::before {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(11,30,51,.94) 0%, rgba(11,30,51,.78) 42%, rgba(11,30,51,.32) 78%, rgba(11,30,51,.18) 100%),
        linear-gradient(180deg, rgba(11,30,51,.55) 0%, transparent 40%);
}
.hero .wrap { position: relative; z-index: 1; padding: 80px 20px 48px; }
.hero h1 { color: #fff; font-size: clamp(28px, 4vw, 46px); max-width: 18ch; text-shadow: 0 1px 24px rgba(0,0,0,.35); }
.hero p { color: #D3DEEA; font-size: 18px; max-width: 52ch; margin-top: 10px; }
@media (max-width: 900px) {
    .hero { background-position: 62% bottom; }
    .hero .wrap { padding: 52px 20px 36px; }
}

/* Search bar */
.searchbar {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px; margin-top: 26px; display: grid; gap: 10px;
    grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end;
}
.searchbar .field { display: flex; flex-direction: column; gap: 5px; }
.searchbar label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.searchbar input, .searchbar select, .field input, .field select, .field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
.searchbar input:focus, .searchbar select:focus, .field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}

/* Category tiles */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 4px; transition: box-shadow .15s, transform .15s;
}
.cat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cat b { color: var(--navy); font-size: 16px; }
.cat span { color: var(--muted); font-size: 13px; }

/* Listing card grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .photo { aspect-ratio: 3 / 2; background: var(--surface); position: relative; overflow: hidden; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .photo .placeholder {
    width: 100%; height: 100%; display: grid; place-items: center; color: #9AA7B4;
    background: linear-gradient(135deg, #EFF3F7, #E3EAF1); font-size: 13px; letter-spacing: .5px;
}
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .price { font-size: 20px; font-weight: 700; color: var(--navy); }
.card .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.card .cta-price { color: var(--gold-dk); font-weight: 700; font-size: 16px; }
.card h3 { font-size: 16px; margin: 0; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--blue); }
.card .meta { color: var(--muted); font-size: 14px; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.card .dist { font-size: 13px; color: var(--muted); }

/* Status + info pills */
.pill {
    display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
    letter-spacing: .3px; text-transform: uppercase;
}
.photo .pill { position: absolute; top: 10px; left: 10px; }
.pill--sale   { background: var(--gold); color: #fff; }
.pill--lease  { background: var(--gold); color: #fff; }
.pill--closed { background: #6B7785; color: #fff; }
.pill--type   { background: rgba(20,48,79,.86); color: #fff; text-transform: none; }
.photo .pill--type { top: 10px; left: auto; right: 10px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--blue); background: #EAF1F8; padding: 3px 9px; border-radius: 6px; }

/* Layout split: results + filters */
.results-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.results-top .count { color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 10px; align-items: end; }
.more-filters { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: none; }
.more-filters.open { display: block; }
.facet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 18px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.check input { width: auto; }
.link-toggle { background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; padding: 6px 0; font-size: 14px; }

/* Listing detail */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; }
.gallery { position: relative; }
.gallery .main { aspect-ratio: 16 / 10; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .main img[data-lightbox] { cursor: zoom-in; }
.gallery .main img.art { object-fit: contain; padding: 6%; background: linear-gradient(135deg, #EFF3F7, #E3EAF1); }
.card .photo img.art { object-fit: contain; padding: 8%; background: linear-gradient(135deg, #EFF3F7, #E3EAF1); }
.gallery-expand {
    position: absolute; right: 12px; top: 12px; z-index: 2;
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(20,48,79,.86); color: #fff; border: 0; cursor: pointer;
    padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; font-family: inherit;
}
.gallery-expand:hover { background: var(--navy); }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 82px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.thumbs img.active { outline: 2px solid var(--gold); }
.thumbs img:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 100; display: none;
    background: rgba(8,18,30,.94); padding: 24px;
}
.lightbox.open { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; color: #C9D6E5; font-size: 14px; }
.lightbox__stage { display: grid; place-items: center; min-height: 0; position: relative; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox__cap { color: #C9D6E5; text-align: center; font-size: 14px; min-height: 22px; padding-top: 10px; }
.lightbox button {
    background: rgba(255,255,255,.10); color: #fff; border: 0; cursor: pointer;
    border-radius: 8px; font-family: inherit; font-size: 15px;
}
.lightbox button:hover { background: rgba(255,255,255,.20); }
.lightbox button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lightbox__close { width: 40px; height: 40px; font-size: 22px; line-height: 1; }
.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 64px; font-size: 26px; line-height: 1;
}
.lightbox__nav[data-prev] { left: 0; }
.lightbox__nav[data-next] { right: 0; }
.lightbox__nav[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.fact { background: var(--surface); border-radius: 8px; padding: 12px 14px; }
.fact b { display: block; color: var(--navy); font-size: 17px; }
.fact span { color: var(--muted); font-size: 13px; }
.feature-cols { columns: 2; column-gap: 30px; }
.feature-cols .fg { break-inside: avoid; margin-bottom: 16px; }
.feature-cols h4 { color: var(--navy); font-size: 14px; text-transform: uppercase; letter-spacing: .4px; margin: 0 0 6px; }
.feature-cols ul { list-style: none; margin: 0; padding: 0; }
.feature-cols li { padding: 3px 0; color: var(--ink); font-size: 15px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.feature-cols li span { color: var(--muted); }

.contact-panel { position: sticky; top: 84px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.contact-panel .price { font-size: 26px; font-weight: 800; color: var(--navy); }
.contact-panel .agent { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contact-panel .agent .av { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.contact-panel .agent b { color: var(--navy); }
.contact-panel .agent span { color: var(--muted); font-size: 13px; display: block; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { color: var(--muted); font-size: 12px; }
label.req::after { content: " *"; color: var(--gold-dk); }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.member { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.member .av { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.member b { color: var(--navy); font-size: 18px; }
.member .role { color: var(--gold-dk); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.member .lines { color: var(--muted); font-size: 14px; }
.member .lines a { display: block; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 15px; }
.flash--success { background: #E7F5EC; color: #1B6B3A; border: 1px solid #BFE4CC; }
.flash--error { background: #FBEAEA; color: #9C2A2A; border: 1px solid #F0C4C4; }

/* Footer */
.site-footer { background: var(--navy); color: #C9D6E5; margin-top: 40px; }
.site-footer .wrap { padding: 40px 20px 28px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.site-footer a { color: #C9D6E5; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 20px; padding: 16px 20px; text-align: center; font-size: 13px; color: #8FA3BC; }

/* Utilities */
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.hidden { display: none; }

/* Admin */
.admin-body { background: var(--surface); }
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-side { background: var(--navy); color: #cfe; padding: 20px 14px; }
.admin-side .brand { margin-bottom: 22px; }
.admin-side nav a { display: block; color: #C9D6E5; padding: 9px 12px; border-radius: 7px; font-weight: 500; }
.admin-side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side nav a.active { background: var(--gold); color: #fff; }
.admin-main { padding: 26px 30px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { font-size: 28px; color: var(--navy); display: block; }
.stat span { color: var(--muted); font-size: 14px; }
table.data { width: 100%; border-collapse: collapse; background: #fff; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
table.data th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.feature-group { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.feature-group h4 { margin: 0 0 10px; color: var(--navy); font-size: 14px; text-transform: uppercase; letter-spacing: .4px; }

/* Auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 24px; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.qr-box { display: grid; place-items: center; padding: 16px; background: var(--surface); border-radius: 10px; margin: 16px 0; }
.qr-box svg, .qr-box img { width: 200px; height: 200px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface); padding: 10px 12px; border-radius: 8px; word-break: break-all; text-align: center; letter-spacing: 1px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.codes code { background: var(--surface); padding: 10px; border-radius: 6px; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; }

@media (max-width: 900px) {
    .nav { position: fixed; inset: 68px 0 auto 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 10px 16px 18px; gap: 2px; display: none; box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .nav a { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
    .nav a.active { border-bottom-color: var(--gold); }
    .nav-toggle { display: block; }
    .cats { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .searchbar { grid-template-columns: 1fr 1fr; }
    .detail { grid-template-columns: 1fr; }
    .contact-panel { position: static; }
    .filters { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer .wrap { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { display: none; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .grid, .cats, .team-grid, .filters, .searchbar, .facts { grid-template-columns: 1fr; }
    .feature-cols { columns: 1; }
}
