/* 55plus.community — shared stylesheet */

:root {
  --ground: #f4f6f3;
  --surface: #ffffff;
  --surface-alt: #eef1ec;
  --ink: #17211c;
  --muted: #566a60;
  --line: #dde3dc;
  --brand: #1f5140;
  --brand-deep: #143529;
  --brand-soft: #e7efe9;
  --accent: #d98a4e;
  --accent-deep: #b96f37;
  --radius: 14px;
  --maxw: 1080px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #101613;
    --surface: #18211c;
    --surface-alt: #1e2823;
    --ink: #eef2ef;
    --muted: #a6b6ac;
    --line: #2a352e;
    --brand: #57987d;
    --brand-deep: #3f7862;
    --brand-soft: #1c2a23;
    --accent: #e6a068;
    --accent-deep: #d98a4e;
  }
}
:root[data-theme="light"] {
  --ground: #f4f6f3; --surface: #ffffff; --surface-alt: #eef1ec; --ink: #17211c;
  --muted: #566a60; --line: #dde3dc; --brand: #1f5140; --brand-deep: #143529;
  --brand-soft: #e7efe9; --accent: #d98a4e; --accent-deep: #b96f37;
}
:root[data-theme="dark"] {
  --ground: #101613; --surface: #18211c; --surface-alt: #1e2823; --ink: #eef2ef;
  --muted: #a6b6ac; --line: #2a352e; --brand: #57987d; --brand-deep: #3f7862;
  --brand-soft: #1c2a23; --accent: #e6a068; --accent-deep: #d98a4e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
a { color: var(--brand); }
.eyebrow {
  font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--accent-deep);
}

/* Header */
header.site {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.navrow { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem;
  color: inherit; text-decoration: none;
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--accent), var(--brand) 72%);
  flex: none;
}
.navlinks { display: flex; gap: 26px; align-items: center; }
.navlinks a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.navlinks a:hover { color: var(--ink); }
.navlinks a[aria-current="page"] { color: var(--ink); }
.btn {
  display: inline-block; background: var(--brand); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--brand-deep); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
@media (max-width: 720px) { .navlinks a:not(.btn) { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-inner { padding: 78px 0 0; display: grid; gap: 26px; max-width: 720px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); }
.hero p.lead { font-size: 1.22rem; color: var(--muted); margin: 0; max-width: 40ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.hills { display: block; width: 100%; height: auto; margin-top: 44px; }

/* Sections */
section { padding: 72px 0; }
.section-head { max-width: 620px; margin-bottom: 40px; display: grid; gap: 14px; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
.section-head p { margin: 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; display: grid; gap: 12px;
}
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft);
  display: grid; place-items: center; color: var(--brand); margin-bottom: 4px;
}
.card h3 { font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }

.band { background: var(--surface-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { display: grid; gap: 10px; }
.step .num { font-family: var(--serif); font-size: 2.1rem; color: var(--accent); line-height: 1; }
.step h3 { font-size: 1.2rem; }
.step p { margin: 0; color: var(--muted); font-size: 1rem; }

/* Live listings */
.listing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .listing-grid { grid-template-columns: 1fr; } }
.listing-status { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; font-size: 1.05rem; }
a.listing-card, .listing-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.listing-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.10); }
.listing-photo {
  aspect-ratio: 3 / 2; background-size: cover; background-position: center;
  background-color: var(--brand-soft);
}
.listing-photo--empty {
  display: grid; place-items: center; color: var(--brand);
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: .02em;
}
.listing-body { padding: 18px 20px; display: grid; gap: 7px; }
.listing-price { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--brand); }
.listing-addr { color: var(--ink); font-size: 1rem; line-height: 1.35; }
.listing-loc { color: var(--muted); font-size: 0.92rem; }
.listing-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.listing-meta span { opacity: .5; }
.listing-pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 40px; }
.pager-btn {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--brand); border: 1px solid var(--line);
  padding: 11px 20px; border-radius: 999px; transition: background .15s ease, border-color .15s ease;
}
.pager-btn:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-page { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; min-width: 70px; text-align: center; }

/* CTA */
.cta-box {
  background: var(--brand); color: #fff; border-radius: 20px;
  padding: 52px 44px; text-align: center; display: grid; gap: 18px; justify-items: center;
}
.cta-box h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.cta-box p { margin: 0; color: rgba(255,255,255,.85); max-width: 46ch; }
.cta-box .btn { background: #fff; color: var(--brand-deep); }
.cta-box .btn:hover { background: #f0f0eb; }

/* Sub-page header (About / Privacy / Terms) */
.page-head { padding: 64px 0 8px; }
.page-head .inner { max-width: 720px; display: grid; gap: 16px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.page-head p.lead { font-size: 1.15rem; color: var(--muted); margin: 0; max-width: 52ch; }
.page-head .updated { font-size: 0.92rem; color: var(--muted); }

/* Long-form prose (legal pages) */
.prose { max-width: 760px; padding: 40px 0 80px; }
.prose h2 {
  font-size: 1.45rem; margin: 44px 0 14px;
  padding-top: 26px; border-top: 1px solid var(--line);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 8px; }
.prose h3 { font-size: 1.12rem; margin: 26px 0 10px; }
.prose p { margin: 0 0 16px; color: var(--muted); }
.prose ul { margin: 0 0 16px; padding-left: 22px; color: var(--muted); }
.prose li { margin-bottom: 9px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--brand); }

/* Callout used for fair-housing / data-source notices */
.notice {
  background: var(--brand-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 20px 24px; margin: 26px 0;
}
.notice p { margin: 0; color: var(--ink); font-size: 0.98rem; }
.notice p + p { margin-top: 10px; }

/* Two-column value list on About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* Contact / footer — the verification-critical block */
footer.site { background: var(--surface); border-top: 1px solid var(--line); padding: 60px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.9fr; gap: 40px; }
@media (max-width: 940px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 620px) { .foot-grid { grid-template-columns: 1fr; gap: 30px; } }
.foot-brand { display: grid; gap: 14px; align-content: start; }
.foot-brand .brand { font-size: 1.3rem; }
.foot-brand p { margin: 0; color: var(--muted); font-size: 0.98rem; max-width: 34ch; }
.foot-col h4 { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.foot-col address { font-style: normal; color: var(--ink); line-height: 1.7; font-size: 0.98rem; }
.foot-col a { color: var(--brand); text-decoration: none; }
.foot-col a:hover { text-decoration: underline; }
.foot-col ul { list-style: none; margin: 0; padding: 0; line-height: 1.9; font-size: 0.98rem; }
.legal { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph { color: var(--accent-deep); font-weight: 600; }

:where(a, .btn, button):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   Additions for the Django site: filters, detail page, empty states.
   ========================================================================== */

.skip {
  position: absolute; left: -9999px;
  background: var(--brand); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
  text-decoration: none; z-index: 100;
}
.skip:focus { left: 0; top: 0; }

/* Listing card images are real <img> now (was a background-image) so we can
   set referrerpolicy — some CDNs block hotlinks by Referer. */
.listing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-photo { aspect-ratio: 3 / 2; overflow: hidden; }
.listing-meta .v + .v::before { content: "·"; opacity: .5; margin-right: 10px; }
.listing-meta { gap: 10px; }

.center-cta { display: flex; justify-content: center; margin-top: 40px; }
.listing-section { padding-top: 34px; }

/* Filter bar */
.filters {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 16px; align-items: end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-top: 26px;
}
@media (max-width: 940px) { .filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .filters { grid-template-columns: 1fr; } }
.filter-field { display: grid; gap: 6px; min-width: 0; }
.filter-field label {
  font-size: 0.78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.filter-field input, .filter-field select {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--ground); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 12px; width: 100%;
}
.filter-field input:focus, .filter-field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.filter-actions { display: flex; align-items: center; gap: 14px; }
.filter-actions .btn { border: 0; cursor: pointer; font-family: var(--sans); }
.clear-link { color: var(--muted); font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.clear-link:hover { color: var(--ink); text-decoration: underline; }

/* Pager as links (was buttons in the JS version) */
.pager-btn { text-decoration: none; display: inline-block; }
.pager-btn.disabled { opacity: .4; pointer-events: none; }

.empty-state {
  text-align: center; padding: 70px 20px; display: grid; gap: 14px; justify-items: center;
}
.empty-state h2 { font-size: 1.6rem; }
.empty-state p { color: var(--muted); margin: 0; max-width: 46ch; }

/* Detail page */
.crumbs { padding-top: 28px; }
.crumbs a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.crumbs a:hover { color: var(--ink); }

.detail { padding: 24px 0 30px; }
.detail-media {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: var(--brand-soft); margin-bottom: 30px;
}
.detail-media img { width: 100%; display: block; max-height: 520px; object-fit: cover; }

.detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 30px; flex-wrap: wrap; margin-bottom: 12px;
}
.detail-price { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--brand); }
.detail-addr { font-size: 1.5rem; margin-top: 4px; }
.detail-loc { color: var(--muted); margin: 6px 0 0; }
.detail-keyfacts { display: flex; gap: 26px; flex-wrap: wrap; }
.detail-keyfacts div { display: grid; gap: 2px; text-align: center; }
.detail-keyfacts strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.detail-keyfacts span { font-size: 0.82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.detail-block { padding: 34px 0 0; }
.detail-block h2 { font-size: 1.35rem; margin-bottom: 14px; }
.detail-block p { color: var(--muted); margin: 0; max-width: 70ch; }

.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 30px; margin: 0; }
@media (max-width: 820px) { .spec-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .spec-grid { grid-template-columns: 1fr; } }
.spec-grid > div { border-top: 1px solid var(--line); padding-top: 12px; }
.spec-grid dt { font-size: 0.8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.spec-grid dd { margin: 0; color: var(--ink); font-size: 1rem; }

.detail-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 12px; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-grid .card p { margin: 0 0 8px; }
.contact-grid .card p:last-child { color: var(--muted); font-size: 0.95rem; margin-bottom: 0; }

.filter-hint {
  margin: 12px 2px 0; font-size: 0.95rem; color: var(--accent-deep); font-weight: 600;
}
