/* Public listing site primitives.
   Faithfully ports the mockup at mockups/public-listing-site/ — flat modern
   blue/sans-serif aesthetic, subtle shadows, 14px radii.
   Tailwind utilities handle one-off page layout; this file owns the design
   tokens + the repeated component primitives. */

:root {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.08);
  --line-strong: rgba(17, 24, 39, 0.14);
  --accent: #1570ef;
  --accent-deep: #1254b5;
  --accent-soft: #dbeafe;
  --sky: #fbfcfe;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --content: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* --- .shell — page-width wrapper. ~12 callers. */
.shell {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}

/* --- .page — main vertical padding. ~5 callers (every page). */
.page { padding-bottom: 96px; }

/* --- .site-header — sticky top nav. 1 caller (chrome). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

/* --- .brand — header/footer brand block. ~3 callers. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
  background: var(--sky);
}
.brand__name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__sub {
  color: var(--muted);
  font-size: 0.84rem;
}

/* --- .site-nav — primary nav. 1 caller. */
.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav a.active,
.site-nav a:hover {
  color: var(--ink);
  background: var(--bg);
}
.site-nav a.cta {
  background: var(--accent);
  color: #fff;
}
.site-nav a.cta:hover { background: var(--accent-deep); }

/* --- .hero / .hero__panel — top of index page. */
.hero { padding: 28px 0 18px; }
.hero__panel {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero__panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--accent);
  pointer-events: none;
}

/* --- .eyebrow — pill above headings. ~10 callers. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Headings — page titles, hero, section heads. */
.hero h1,
.section-heading h2,
.detail-headline h1,
.page-title h1 {
  margin: 16px 0 10px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
}
.section-heading h2,
.page-title h1 { font-size: clamp(2rem, 4vw, 3rem); }
.hero p.lead,
.page-title p,
.section-heading p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 10px;
}

/* --- .hero-grid — hero two-column layout. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: end;
}

/* --- Panel-style surfaces (search card, trust card, etc). ~12 callers. */
.search-card,
.trust-card,
.cta-band,
.section-card,
.results-context,
.empty-state,
.detail-meta,
.detail-block,
.footer-card,
.contact-card,
.broker-directory,
.broker-hero,
.list-form {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}
.search-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) {
  .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .search-grid { grid-template-columns: 1fr; }
}

/* --- .field — form input wrapper. ~20 callers. */
.field { display: grid; gap: 8px; }
.field label,
.field > span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--ink);
  font-size: 16px;
}
.field textarea { min-height: 140px; resize: vertical; }

/* --- Buttons. ~30+ callers across pages. */
.button,
.ghost-button,
.soft-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}
.button { background: var(--accent); color: #fff; }
.button:hover { background: var(--accent-deep); }
.ghost-button { border-color: var(--line-strong); color: var(--ink); background: var(--panel); }
.ghost-button:hover { background: var(--bg); }
.soft-button { background: var(--accent-soft); color: var(--accent); }
.soft-button:hover { background: #c7daff; }

.search-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-deep);
  font-weight: 700;
}
.text-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* --- .trust-card — broker meta on hero right. */
.trust-card { padding: 22px; display: grid; gap: 16px; }
.trust-card h2 { margin: 0; font-size: 1.05rem; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--sky);
  border: 1px solid var(--line);
}
.metric strong {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.metric span { color: var(--muted); font-size: 0.84rem; }

/* --- .section / .section-heading. ~15 callers. */
.section { padding: 18px 0; }
.section-heading,
.page-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

/* --- .cards — listings & brokers grid. */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.cards--four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1020px) {
  .cards, .cards--four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cards, .cards--four { grid-template-columns: 1fr; }
}

/* --- .property-card — listing tile. ~8 callers. */
.property-card,
.broker-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.property-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.property-card__media,
.broker-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sky);
}
.property-card__media img,
.broker-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.property-card__badge { position: absolute; left: 14px; top: 14px; }
.property-card__body,
.broker-card__body {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.property-card h3,
.broker-card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.price {
  letter-spacing: -0.03em;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
}
.price-row,
.listing-summary,
.broker-summary,
.meta-row,
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.listing-summary,
.broker-summary,
.muted { color: var(--muted); }

/* --- .pill / .badge — small status chips. ~12 callers. */
.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.pill { color: var(--accent); background: var(--accent-soft); }
.badge { color: #fff; background: var(--ink); }

/* --- .area-link — Browse-by-area chip. ~5 callers. */
.area-links { display: flex; flex-wrap: wrap; gap: 12px; }
.area-link {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}
.area-link:hover { background: var(--bg); }

/* --- .cta-band — bottom CTA strip. */
.cta-band {
  padding: 24px 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

/* --- .empty-state — no-results panel. */
.empty-state {
  padding: 22px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

/* --- Detail page layout. */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 1020px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-meta {
  padding: 24px;
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}
.detail-headline h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0; }
.detail-block { padding: 22px; }
.detail-block + .detail-block { margin-top: 18px; }
.detail-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}
.detail-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.listed-by { display: flex; gap: 14px; align-items: center; }
.listed-by img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--sky);
}

/* --- Scroll-snap photo gallery (mobile-first swipe + counter). */
.gallery {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--sky);
  box-shadow: var(--shadow);
}
.gallery-hero {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  aspect-ratio: 16 / 10;
  background: var(--sky);
}
.gallery-hero::-webkit-scrollbar { display: none; }
.gallery-hero figure {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin: 0;
}
.gallery-hero figure img { width: 100%; height: 100%; object-fit: cover; }
.gallery-counter {
  position: absolute;
  right: 14px; bottom: 14px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(17, 24, 39, 0.72); color: #fff;
  font-size: 0.84rem; font-weight: 700;
  pointer-events: none;
}
.gallery-thumbs {
  display: flex; gap: 8px; padding: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-thumbs button {
  flex: 0 0 23%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--sky) center / cover;
  cursor: pointer;
  overflow: hidden;
}
.gallery-thumbs button.is-active { border-color: var(--accent); }
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty {
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
  color: var(--muted);
}

/* --- Footer. */
.footer-card { padding: 28px; margin-top: 28px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-card h4 { margin: 0 0 10px; font-size: 0.95rem; }
.footer-card ul {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: 8px;
  color: var(--muted); font-size: 0.92rem;
}
.footer-card ul a:hover { color: var(--ink); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials a {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.socials a:hover { color: var(--ink); }

/* --- Skeleton loading placeholder. */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.5), rgba(255,255,255,0.9), rgba(255,255,255,0.5));
  background-size: 200% 100%;
  animation: skel 1.2s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Inquiry status indicator. */
.inquiry-status {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 700;
}
.inquiry-status.is-success { background: #dcfce7; color: #166534; }
.inquiry-status.is-error { background: #fee2e2; color: #991b1b; }

/* --- Responsive overall. */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .detail-meta { position: static; }
}
@media (max-width: 760px) {
  .hero__panel { padding: 24px; border-radius: var(--radius-lg); }
  .hero h1 { max-width: none; }
  .section { padding: 12px 0; }
}
