/* PEAS.HOME — public site styles. All colour/typography comes from CSS custom
   properties injected per active theme (see config/themes.php). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 14px;
    border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-600); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg); color: var(--header-ink);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header .inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.brand .dot { color: var(--primary); }
.brand .mark {
    width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center;
    background: var(--primary); color: var(--primary-ink); font-size: 15px; font-weight: 800;
}
.nav { display: flex; gap: 22px; margin-left: 10px; font-size: 14px; font-weight: 500; }
.nav a { color: var(--header-ink); opacity: .8; }
.nav a:hover { opacity: 1; color: var(--primary); }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* theme switcher */
.theme-switch { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-switch a {
    width: 26px; height: 26px; border-radius: 50%; display: inline-block; position: relative;
    border: 2px solid transparent; transition: transform .1s ease;
}
.theme-switch a:hover { transform: scale(1.12); }
.theme-switch a.active { border-color: var(--ink); }
.theme-switch .label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px 0 8px; }

.who { font-size: 13px; display: flex; align-items: center; gap: 10px; }
.linklike { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--primary); }

/* ---------- hero ---------- */
.hero {
    position: relative; color: var(--hero-ink);
    background:
      linear-gradient(120deg, color-mix(in srgb, var(--hero-from) 92%, transparent), color-mix(in srgb, var(--hero-to) 78%, transparent)),
      url('/media/photos/L2-colony-09-view.jpg') center/cover no-repeat;
    border-radius: 0 0 calc(var(--radius) * 1.6) calc(var(--radius) * 1.6);
    overflow: hidden;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.35), transparent 55%); pointer-events: none; }
.hero .inner { position: relative; z-index: 1; padding: 84px 0 110px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .92; background: rgba(255,255,255,.14); padding: 7px 14px; border-radius: 999px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 18px 0 12px; max-width: 16ch; }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); max-width: 52ch; opacity: .94; }

/* search */
.search {
    margin-top: 30px; background: var(--surface); color: var(--ink);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px; max-width: 920px;
}
.search .field { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; }
.search .field label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.search .field input, .search .field select { border: none; background: transparent; font: inherit; color: var(--ink); padding: 4px 0; outline: none; }
.search .field + .field { border-left: 1px solid var(--border); }
.search .go { align-self: stretch; }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: -54px auto 0; position: relative; z-index: 2; max-width: 980px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat .n { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- sections ---------- */
section.block { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.filters input, .filters select { padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink); }

/* ---------- listing grid + card ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(0,0,0,.14); }
.card .media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .tagrow { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.card .price-tag { position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,.62); color: #fff; padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 15px; backdrop-filter: blur(3px); }
.chip { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.chip.sale { background: var(--primary); color: var(--primary-ink); }
.chip.rent { background: var(--accent); color: var(--accent-ink); }
.chip.ai { background: #111; color: #fff; }
.card .body { padding: 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card .title { font-family: var(--font-head); font-size: 18px; font-weight: 600; }
.card .addr { font-size: 13px; color: var(--muted); }
.specs { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; margin-top: auto; }
.specs span { display: inline-flex; align-items: center; gap: 5px; }
.card .foot { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.verified { color: var(--primary); font-weight: 700; font-size: 12px; }

/* ---------- value props ---------- */
.props { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.prop { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.prop .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.prop h3 { font-size: 19px; margin-bottom: 8px; }
.prop p { color: var(--muted); font-size: 14px; margin: 0; }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(120deg, var(--hero-from), var(--hero-to)); color: var(--hero-ink); border-radius: var(--radius); padding: 48px; text-align: center; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 10px; }
.cta p { opacity: .92; margin: 0 auto 22px; max-width: 50ch; }

/* ---------- detail ---------- */
.detail { padding: 34px 0 64px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 150px; gap: 10px; border-radius: var(--radius); overflow: hidden; }
.gallery a:first-child { grid-column: 1; grid-row: 1 / span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .more { position: relative; }
.gallery .more span { position: absolute; inset: 0; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 30px; margin-top: 28px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 6px; }
.spec-grid .it { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.spec-grid .it .k { font-size: 12px; color: var(--muted); }
.spec-grid .it .v { font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--surface-2); border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.hl { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hl li { padding-left: 26px; position: relative; }
.hl li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.price-big { font-family: var(--font-head); font-size: 32px; font-weight: 700; color: var(--primary); }
.sticky { position: sticky; top: 86px; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; margin: 28px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.pagination .active span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }

/* ---------- flash ---------- */
.flash { background: var(--primary); color: var(--primary-ink); text-align: center; padding: 11px; font-size: 14px; font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 50px 0 30px; }
.site-footer h4 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.site-footer a { display: block; color: var(--ink); opacity: .8; font-size: 14px; padding: 4px 0; }
.site-footer a:hover { opacity: 1; color: var(--primary); }
.site-footer .legal { border-top: 1px solid var(--border); padding: 18px 0; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .visual { position: relative; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(160deg, color-mix(in srgb, var(--hero-from) 88%, transparent), color-mix(in srgb, var(--hero-to) 72%, transparent)), url('/media/photos/L1-tsr-01-facade.jpg') center/cover no-repeat; }
.auth .visual h2 { font-size: 34px; max-width: 14ch; }
.auth .visual .quote { font-size: 15px; opacity: .9; max-width: 40ch; }
.auth .formside { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth .formcard { width: 100%; max-width: 380px; }
.auth .formcard h1 { font-size: 28px; margin-bottom: 6px; }
.field-row { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field-row label { font-size: 13px; font-weight: 600; }
.field-row input { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--ink); }
.field-row input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }
.err { background: color-mix(in srgb, #e5484d 14%, transparent); color: #b42318; border: 1px solid color-mix(in srgb, #e5484d 35%, transparent); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-top: 16px; }
.inline { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.demo { margin-top: 22px; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--muted); }
.demo code { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .nav { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .props { grid-template-columns: 1fr; }
    .search { grid-template-columns: 1fr 1fr; }
    .search .field + .field { border-left: none; }
    .detail-grid { grid-template-columns: 1fr; }
    .site-footer .cols { grid-template-columns: 1fr 1fr; }
    .auth { grid-template-columns: 1fr; }
    .auth .visual { display: none; }
    .gallery { grid-template-columns: 1fr 1fr; }
    .gallery a:first-child { grid-column: 1 / span 2; grid-row: auto; }
}
@media (max-width: 540px) {
    .search { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
    .theme-switch .label { display: none; }
}
