/*
 * Minimal theme — public microsites.
 *
 * Every colour and shape comes from a custom property so one stylesheet can
 * serve every site on this theme; the per-site values are injected inline by
 * the layout from Site::themeTokens().
 */

:root {
    --brand: #1f4b3f;
    --brand-ink: #ffffff;
    --accent: #c2703d;
    --radius: 10px;
    --font: system-ui, -apple-system, "Segoe UI", sans-serif;

    --ink: #16191c;
    --ink-muted: #5f6a72;
    --line: #e3e6e8;
    --surface: #ffffff;
    --surface-alt: #f6f7f8;
    --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 1.25rem; }
.section { padding-block: 2.5rem; }
.plain { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--ink-muted); }

.skip {
    position: absolute; left: -9999px;
    background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---------- Header ---------- */

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky; top: 0; z-index: 5;
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-block: .85rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; }
.brand-mark {
    width: 36px; height: 36px; border-radius: var(--radius);
    background: var(--brand); color: var(--brand-ink);
    display: grid; place-items: center; font-weight: 700;
}
.nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.nav a { text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--brand); }

/* ---------- Buttons & chips ---------- */

.btn {
    display: inline-block; border: 1px solid var(--brand); background: var(--brand);
    color: var(--brand-ink); border-radius: var(--radius);
    padding: .6rem 1.1rem; font: inherit; font-weight: 600; font-size: .95rem;
    text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-ghost { background: transparent; color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    display: inline-block; border: 1px solid var(--line); border-radius: 999px;
    padding: .3rem .8rem; font-size: .88rem; text-decoration: none; background: var(--surface-alt);
}
a.chip:hover { border-color: var(--brand); }

.badge {
    display: inline-block; border-radius: 999px; padding: .2rem .6rem;
    font-size: .78rem; font-weight: 600; background: var(--surface); color: var(--ink);
}
.badge-brand { background: var(--brand); color: var(--brand-ink); }
.badge-accent { background: var(--accent); color: #fff; }

/* ---------- Hero ---------- */

.hero { background: var(--surface-alt); border-bottom: 1px solid var(--line); padding-block: 3rem; }
.hero h1 { max-width: 20ch; }
.hero-sub { font-size: 1.1rem; color: var(--ink-muted); max-width: 55ch; }
.hero-search { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; max-width: 720px; }
.hero-search input[type="search"] { flex: 1 1 260px; }
.hero-stats { font-size: .95rem; }

/* ---------- Cards ---------- */

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-head a { font-size: .95rem; }

.grid {
    display: grid; gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; background: var(--surface); display: flex; flex-direction: column;
}
.card:hover { border-color: var(--brand); }
.card-media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--surface-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-empty { display: grid; place-items: center; height: 100%; color: var(--ink-muted); font-size: .9rem; }
.card-badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .4rem; }
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; }
.card-price { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--brand); }
.card-title { font-size: 1rem; margin: 0; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-location { font-size: .9rem; margin: 0; }
.card-specs { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .88rem; margin-top: .4rem; }
.card-specs li { color: var(--ink-muted); }
.card-ref { font-size: .78rem; margin: .35rem 0 0; }

/* ---------- Listing index ---------- */

.page-head { margin-bottom: 1.5rem; }
.layout-sidebar { display: grid; gap: 2rem; grid-template-columns: 280px 1fr; align-items: start; }
.sidebar {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem; background: var(--surface-alt); position: sticky; top: 5rem;
}

.pagination { margin-top: 2rem; }
.pager { display: flex; flex-wrap: wrap; gap: .4rem; }
.pager-link {
    display: inline-block; padding: .45rem .8rem; border: 1px solid var(--line);
    border-radius: var(--radius); text-decoration: none; font-size: .9rem; background: var(--surface);
}
.pager-link.is-current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.pager-link.is-disabled { color: var(--ink-muted); background: var(--surface-alt); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .85rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.field label, .field legend { font-size: .85rem; font-weight: 600; color: var(--ink-muted); }
input, select, textarea {
    font: inherit; padding: .55rem .7rem; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface); color: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 .85rem; }

.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; margin-bottom: .6rem; }
.check input { width: auto; margin-top: .25rem; }
.check-grid { display: grid; gap: .2rem; }

/* Honeypot — kept out of the accessibility tree and off screen, not display:none,
   because some bots skip hidden inputs. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.notice-ok { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.notice-error { border-color: #c0392b; background: #fdf1ef; color: #7d241a; }
.notice-error li { margin-left: 1rem; list-style: disc; }

/* ---------- Listing detail ---------- */

.breadcrumbs { font-size: .88rem; margin-bottom: 1rem; }
.listing-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.listing-price { text-align: right; }
.listing-price .price { font-size: 1.8rem; font-weight: 700; color: var(--brand); margin: 0; }
.listing-price p { margin: 0; font-size: .9rem; }

.gallery { margin: 1.5rem 0 2rem; }
.gallery-main { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--surface-alt); }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-top: .6rem; }
.gallery-thumbs img { aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }

.layout-aside { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: start; }
.listing-aside {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; background: var(--surface-alt); position: sticky; top: 5rem;
}
.agent-card { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.agent-name { font-weight: 600; margin: 0; }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem; margin: 0 0 2rem; }
.spec-grid dt { font-size: .82rem; color: var(--ink-muted); }
.spec-grid dd { margin: 0; font-weight: 600; }
.group-title { font-size: .9rem; color: var(--ink-muted); margin-top: 1rem; }
.prose { max-width: 68ch; margin-bottom: 2rem; }
.legal { margin-top: 2rem; }
.legal li { margin-bottom: .2rem; }

.panel {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.75rem; background: var(--surface-alt);
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 2.5rem 1.5rem; background: var(--surface-alt); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-title { font-weight: 600; margin-bottom: .4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .layout-sidebar, .layout-aside, .panel { grid-template-columns: 1fr; }
    .sidebar, .listing-aside { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .listing-price { text-align: left; }
    .field-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

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

/* ---------- Facets ---------- */

.facet { margin-top: 1.5rem; }
.facet-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-muted); margin-bottom: .5rem; }
.facet-list { display: grid; gap: .15rem; }
.facet-link {
    display: flex; justify-content: space-between; gap: .5rem; align-items: baseline;
    padding: .35rem .5rem; border-radius: var(--radius); text-decoration: none; font-size: .92rem;
}
.facet-link:hover { background: var(--surface); }
.facet-link.is-active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.facet-count { font-size: .8rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.facet-link.is-active .facet-count { color: inherit; opacity: .8; }

.active-filters { margin-top: 1rem; }
.chip-removable { text-decoration: none; }
.chip-removable:hover { border-color: var(--accent); }
.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;
}

/* ---------- Map ---------- */

.map-block { margin: 2rem 0; }
.map {
    height: 380px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); background: var(--surface-alt);
}
.map-note { font-size: .85rem; margin-top: .5rem; }
.map-pin {
    background: var(--brand); color: var(--brand-ink); border-radius: 999px;
    padding: .25rem .6rem; font-size: .8rem; font-weight: 600; text-decoration: none;
    white-space: nowrap; box-shadow: 0 1px 4px rgb(0 0 0 / .3);
}
.map-pin--area { background: var(--accent); opacity: .9; }

/* ---------- Mortgage calculator ---------- */

.mortgage {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; background: var(--surface-alt); margin: 2rem 0;
}
.mortgage-result { font-size: 1.1rem; margin-top: .5rem; }
.mortgage-note { font-size: .82rem; }

/* ---------- Testimonials, pages, consent ---------- */

.testimonial {
    margin: 0; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; background: var(--surface-alt); height: 100%;
}
.testimonial p { font-size: 1.02rem; }
.contact-list li { margin-bottom: .5rem; }
.social { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .6rem; font-size: .9rem; }

.consent {
    position: fixed; inset: auto 1rem 1rem 1rem; z-index: 20;
    max-width: 560px; margin-inline: auto;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); padding: 1rem 1.25rem;
    box-shadow: 0 6px 24px rgb(0 0 0 / .12);
}
.consent p { font-size: .9rem; }
.consent-actions { display: flex; gap: .5rem; }
