/* ===== Public header =====
   Fixed at the top of the viewport so it stays visible through the entire
   page scroll. The [data-header] wrapper holds the header's space so main
   content starts below it. */
[data-header] { display: block; height: 72px; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(253, 251, 246, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}
.site-header.is-dark {
  background: rgba(10, 9, 8, .7);
  border-bottom-color: rgba(212, 175, 55, .15);
}
.site-header .container {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.is-dark .brand-name .name { color: var(--ivory-50); }
.is-dark .brand-name .sub { color: var(--gold-300); }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a { padding: .5rem .85rem; font-size: .85rem; color: var(--ink-500); transition: color var(--t-fast); border-radius: 8px; }
.nav a:hover, .nav a.is-active { color: var(--ink-900); }
.is-dark .nav a { color: var(--ink-200); }
.is-dark .nav a:hover, .is-dark .nav a.is-active { color: var(--gold-300); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.mobile-toggle { display: none; }

@media (max-width: 880px) {
  .nav, .header-actions .btn-outline { display: none; }
  .mobile-toggle { display: grid; place-items: center; }
}

/* ===== Mobile menu ===== */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 72px 0 0 0;
  z-index: 35;
  background: var(--ink-900);
  color: var(--ivory-50);
  padding: 2rem 1.5rem;
}
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: 1rem 0; font-family: var(--font-display); font-size: 1.5rem; border-bottom: 1px solid rgba(212, 175, 55, .15); color: var(--ivory-50); }
.mobile-menu a:last-child { border-bottom: 0; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: var(--ivory-50);
  overflow: hidden;
  margin-top: -72px;
  padding-top: 72px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-bg img, .hero-bg video {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 9, 8, .55) 0%, rgba(10, 9, 8, .2) 40%, rgba(10, 9, 8, .85) 100%);
}
.hero-content {
  padding: 5rem 0 6rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7.5vw, 6.5rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.0;
  max-width: 18ch;
  margin-top: 2rem;
}
.hero-title em,
.hero-title .accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.005em;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0 .05em;
}
.hero-lead {
  margin-top: 2rem;
  max-width: 38rem;
  color: rgba(253, 251, 246, .82);
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 300;
}
.hero-actions { margin-top: 3rem; display: flex; flex-wrap: wrap; gap: .85rem; }

/* ===== Search bar over hero ===== */
.search-bar {
  margin-top: 3rem;
  background: rgba(253, 251, 246, .98);
  border-radius: var(--radius-xl);
  padding: .5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: .5rem;
  max-width: 760px;
  box-shadow: var(--shadow-lift);
}
.search-bar .select, .search-bar .input { border-color: transparent; background: transparent; }
.search-bar .select:focus, .search-bar .input:focus { box-shadow: none; background: var(--ivory-200); }
@media (max-width: 720px) { .search-bar { grid-template-columns: 1fr; padding: 1rem; } }

/* ===== Section heads ===== */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; flex-wrap: wrap; }
.section-head h2 { margin-top: 1rem; }

/* ===== Property grid ===== */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem;
}

/* ===== Stat grid ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
}
.stat { padding: 1.75rem 0; border-top: 1px solid rgba(212, 175, 55, .25); }
.stat .num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
}
.stat .label {
  margin-top: .5rem;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-400);
  font-weight: 500;
}
.stat-dark { border-color: rgba(212, 175, 55, .25); }
.stat-dark .label { color: var(--gold-200); }

/* ===== Values grid ===== */
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.value-card {
  padding: 2rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.value-card .icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--gradient-gold);
  color: var(--ink-900);
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: -.01em;
  box-shadow: 0 4px 12px rgba(212, 175, 55, .2);
}
.value-card h3 {
  margin-top: 1.75rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.15;
}
.value-card p {
  margin-top: .85rem;
  color: var(--ink-500);
  font-size: .92rem;
  line-height: 1.65;
}
.value-card { transition: transform var(--t), box-shadow var(--t); }
.value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

/* ===== Filters bar ===== */
.filters-card { padding: 1.5rem; }
.filters-card .label { font-size: 11px; }
.filters-card .field { margin-bottom: 1rem; }

/* ===== Detail page ===== */
.detail-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: .5rem;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 540px;
}
.detail-gallery > * { background: var(--ivory-200); position: relative; overflow: hidden; }
.detail-gallery > *:first-child { grid-row: span 2; }
.detail-gallery img, .detail-gallery video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 740px) {
  .detail-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 120px 120px; }
  .detail-gallery > *:first-child { grid-column: span 2; grid-row: span 1; }
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
}
@media (max-width: 980px) { .detail-layout { grid-template-columns: 1fr; } }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.fact {
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.fact .label { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-400); }
.fact .value { margin-top: .25rem; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }

/* ===== Footer ===== */
.site-footer {
  background: var(--ink-900);
  color: var(--ivory-100);
  padding: 5rem 0 2rem;
  margin-top: 6rem;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
@media (max-width: 880px) { .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 540px) { .site-footer .footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 1rem;
  font-weight: 500;
}
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; color: var(--ink-100); }
.site-footer a { color: var(--ink-100); }
.site-footer a:hover { color: var(--gold-300); }
.site-footer .footer-brand { max-width: 380px; margin-top: 1rem; color: rgba(253, 251, 246, .65); font-size: .9rem; }
.site-footer .footer-bottom { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid rgba(212, 175, 55, .15); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 12px; color: var(--ink-300); }

/* ===== Background bands ===== */
.band-ink { background: var(--ink-900); color: var(--ivory-50); }
.band-ivory { background: var(--ivory-100); }

/* ===== Agent card ===== */
.agent-card { padding: 0; overflow: hidden; }
.agent-card .photo { aspect-ratio: 4 / 5; background: var(--ivory-200); overflow: hidden; }
.agent-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.agent-card .body { padding: 1.25rem; }
.agent-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.agent-card .role { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-500); margin-top: .25rem; }
.agent-card p { margin-top: .85rem; font-size: .85rem; color: var(--ink-500); line-height: 1.55; }

/* Listings page (propiedades): aside + grid layout */
.listings-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}
.listings-shell .filters-card {
  position: sticky;
  top: 1rem;
}
@media (max-width: 880px) {
  .listings-shell {
    grid-template-columns: 1fr;
  }
  .listings-shell .filters-card {
    position: static;
  }
}
