/* Public listing site primitives.
   Design tokens + repeated component primitives. Tailwind utilities handle
   one-off page layout; this file owns the canonical visual decisions. */

: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 {
  height: 52px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  border-radius: 8px;
  flex: none;
}
.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); }

/* .eyebrow — pill above headings. ~8 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;
}

/* Panel-style surfaces. ~6 callers. */
.detail-meta,
.detail-block,
.footer-card,
.contact-card,
.broker-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
}

/* .field — form input wrapper. Used by inquiry forms + contact card. */
.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. ~14 callers (.button), ~5 callers (.ghost-button). */
.button,
.ghost-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); }

.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; }

/* .section — generic section spacing. Used on detail/brokers/list-property pages. */
.section { padding: 18px 0; }

/* .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 / .broker-card — repeating tile. */
.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;
}

/* .detail-hero — full-width title + price strip above the detail grid. */
.detail-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 26px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}
.detail-hero__main { display: grid; gap: 6px; min-width: 0; flex: 1 1 320px; }
.detail-hero__title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.detail-hero__loc { font-size: 1rem; }
.detail-hero__price { display: grid; gap: 4px; text-align: right; flex: 0 0 auto; }
.detail-hero__price-amount {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent-deep);
  line-height: 1;
}
.detail-hero__price-note { font-size: 0.85rem; }
@media (max-width: 640px) {
  .detail-hero { align-items: flex-start; }
  .detail-hero__price { text-align: left; }
}
.price-row,
.listing-summary,
.broker-summary,
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.listing-summary,
.broker-summary,
.muted { color: var(--muted); }

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

/* .area-link — Browse-by-area chip. */
.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); }

/* 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 { position: static; }
}
.detail-meta {
  padding: 24px;
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}
.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; }
