/* ============================================================
   BUILDING.CSS — Building Detail Page (Premium redesign)
   ============================================================ */

/* ── Page transition ── */
body { opacity: 0; }
body.page-loaded { opacity: 1; transition: opacity 0.35s ease; }
body.page-exiting { opacity: 0; transition: opacity 0.2s ease; }

/* ── Loading ── */
#loading-screen { position: fixed; inset: 0; background: var(--ink); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.loading-logo { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--clay); }

/* ── Error ── */
#error-wrap { min-height: 100vh; height: 100dvh; align-items: center; justify-content: center; padding: 48px 24px; }
.error-inner { text-align: center; max-width: 480px; }
.error-icon { font-size: 56px; margin-bottom: 20px; }
.error-title { font-family: var(--serif); font-size: 28px; margin-bottom: 10px; }
.error-sub { font-size: 15px; color: var(--warm-grey); line-height: 1.6; margin-bottom: 24px; }

/* ── Nav — dark/transparent fixed ── */
#main-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 52px;
  background: rgba(26,22,18,0.55);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  transition: background 0.3s ease;
}
#main-nav.scrolled { background: rgba(26,22,18,0.92); }
.nav-logo { font-family: var(--serif); font-size: 24px; color: white; font-weight: 700; text-decoration: none; letter-spacing: -0.04em; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { text-decoration: none; color: rgba(255,255,255,0.65); font-size: 13.5px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: white; }
.nav-list { background: transparent; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 10px; color: white !important; opacity: 1 !important; padding: 8px 16px; font-weight: 600 !important; font-size: 13px !important; transition: all 0.2s !important; }
.nav-list:hover { background: white !important; color: var(--ink) !important; }
.nav-login { color: white !important; opacity: 1 !important; padding: 8px 18px; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 10px; font-weight: 600 !important; transition: all 0.2s !important; }
.nav-login:hover { background: white !important; color: var(--ink) !important; }

/* ── FULL-BLEED HERO ── */
.building-hero {
  position: relative;
  height: 100vh; height: 100dvh; min-height: 560px; max-height: 740px;
  overflow: hidden;
}
.hero-photo {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--ink);
  transform: scale(1.05);
  transition: transform 10s ease;
}
body.page-loaded .hero-photo { transform: scale(1); }

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26,22,18,0.2) 0%,
    rgba(26,22,18,0.05) 25%,
    rgba(26,22,18,0.4) 60%,
    rgba(26,22,18,0.92) 100%
  );
}
.hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0 52px 80px;
  z-index: 2;
}
.building-breadcrumb { font-size: 12px; color: rgba(255,255,255,0.45); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; }
.building-breadcrumb a { color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; }
.building-breadcrumb a:hover { color: white; }
.bc-sep { opacity: 0.35; }

.building-badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.building-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(8px); }
.building-badge--walk { background: rgba(34,197,94,0.12); color: #86efac; border-color: rgba(34,197,94,0.2); }

.building-name {
  font-family: var(--serif);
  font-size: clamp(52px, 7.5vw, 88px);
  font-weight: 700; line-height: 0.92; letter-spacing: -0.03em;
  color: white; margin-bottom: 12px;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.65s ease 0.1s, transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}
body.page-loaded .building-name { opacity: 1; transform: translateY(0); }

.building-address {
  font-size: 15px; color: rgba(255,255,255,0.45); margin-bottom: 30px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.65s ease 0.25s, transform 0.65s ease 0.25s;
}
body.page-loaded .building-address { opacity: 1; transform: translateY(0); }

.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.65s ease 0.38s, transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.38s;
}
body.page-loaded .hero-actions { opacity: 1; transform: translateY(0); }

.building-badge-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}
body.page-loaded .building-badge-row { opacity: 1; transform: translateY(0); }

.hero-sv-label { position: absolute; bottom: 20px; right: 24px; font-size: 11px; color: rgba(255,255,255,0.25); z-index: 2; letter-spacing: 0.03em; }

/* ── Buttons ── */
.btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--clay); color: white; border: none; border-radius: var(--radius-full); padding: 14px 30px; font-size: 14px; font-weight: 600; font-family: var(--sans); text-decoration: none; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background: var(--clay-light); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(196,98,45,0.45); color: white; }
.btn-ghost { display: inline-flex; align-items: center; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.75); border-radius: var(--radius-full); padding: 13px 24px; font-size: 14px; font-weight: 500; font-family: var(--sans); text-decoration: none; cursor: pointer; transition: all 0.2s; backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,0.13); color: white; }
.btn-outline-clay { display: inline-flex; align-items: center; background: transparent; border: 1.5px solid var(--clay); color: var(--clay); border-radius: var(--radius-full); padding: 12px 24px; font-size: 14px; font-weight: 600; font-family: var(--sans); text-decoration: none; cursor: pointer; transition: all 0.2s; }
.btn-outline-clay:hover { background: var(--clay); color: white; }

/* ── STATS STRIP — clean cream with entrance ── */
.stats-strip {
  background: var(--cream); border-bottom: 1px solid var(--sand); padding: 44px 52px;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}
body.page-loaded .stats-strip { opacity: 1; transform: translateY(0); }
.aurora-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; display: block; filter: blur(12px) saturate(1.3); transform: scale(1.08); }
.stats-strip-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.stats-strip .building-desc { font-size: 16px; color: var(--warm-grey); line-height: 1.72; max-width: 520px; }

.building-quick-stats {
  display: flex; gap: 0; border: 1.5px solid var(--sand); border-radius: 14px;
  overflow: hidden; background: white; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(26,22,18,0.05);
}
.qs {
  flex: 1; min-width: 92px; padding: 18px 22px; text-align: center; position: relative;
  transition: background 0.2s ease;
}
.qs:hover { background: rgba(196,98,45,0.03); }
.qs + .qs::before { content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 1px; background: var(--sand); }
.qs-num {
  display: block; font-family: var(--serif); font-size: 22px; font-weight: 700;
  color: var(--clay); line-height: 1; margin-bottom: 4px;
  transition: color 0.3s ease;
}
.qs-num.counting { color: var(--clay-light); }
.qs-num.counted { animation: countLand 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.qs-num--sm { font-size: 14px; }
.qs-label { display: block; font-size: 10px; color: var(--warm-grey); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }

/* ── Transit bar ── */
.building-transit-bar { background: rgba(59,130,246,0.08); border-bottom: 1px solid rgba(59,130,246,0.15); padding: 14px 52px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #1E40AF; font-weight: 500; }
.transit-icon { font-size: 16px; flex-shrink: 0; }

/* ── Map section ── */
.building-map-section { position: relative; height: 340px; background: var(--sand); overflow: hidden; }
.building-map-embed { width: 100%; height: 100%; }
.map-overlay { position: absolute; bottom: 16px; left: 20px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink); background: white; padding: 6px 12px; border-radius: 100px; box-shadow: 0 2px 12px rgba(26,22,18,0.12); z-index: 10; font-weight: 500; }
.map-pin-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 3px rgba(196,98,45,0.2); flex-shrink: 0; animation: pulse 2s infinite; }

/* ── Generic sections ── */
.building-section { padding: clamp(56px, 7vw, 96px) 52px; background: white; }
.building-section--dark { background: var(--ink); }
.building-section--cream { background: var(--cream); }
.building-section--cream.section-similar { padding-bottom: clamp(40px, 5vw, 64px); }
.building-section-inner { max-width: 1100px; margin: 0 auto; }

.building-section .section-label { font-size: 11px; font-weight: 700; color: var(--clay); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.building-section--dark .section-label { color: var(--clay-light); }
.building-section .section-title { font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); font-weight: 700; line-height: 1.1; margin-bottom: 40px; letter-spacing: -0.02em; color: var(--ink); }
.building-section--dark .section-title { color: white; }
.building-section .section-title em { font-style: italic; color: var(--clay); }
.building-section--dark .section-title em { color: var(--clay-light); }

/* ── Amenities ── */
.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.amenity-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border: 1px solid var(--sand); border-radius: 12px;
  padding: 13px 16px; font-size: 13px; font-weight: 500; color: var(--ink);
  opacity: 0; transform: translateY(14px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.amenity-chip.revealed { opacity: 1; transform: translateY(0) scale(1); }
.amenity-chip:hover { border-color: var(--clay); background: rgba(196,98,45,0.04); box-shadow: 0 4px 16px rgba(196,98,45,0.08); transform: translateY(-2px) scale(1); }
.amenity-chip-icon { font-size: 17px; flex-shrink: 0; }

/* ── Layouts ── */
.layouts-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.layout-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px; padding: 12px 22px; color: white;
  font-size: 14px; font-weight: 500;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.layout-pill:hover { background: rgba(196,98,45,0.18); border-color: rgba(196,98,45,0.4); transform: translateY(-3px) scale(1.03); }
.layout-pill-icon { font-size: 16px; }
.layouts-note { font-size: 13px; color: rgba(255,255,255,0.3); line-height: 1.6; }

/* ── Listings ── */
.building-listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.blc {
  background: white; border: 1px solid var(--sand); border-radius: 16px;
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: box-shadow 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
}
.blc:hover { box-shadow: 0 20px 56px rgba(26,22,18,0.12); transform: translateY(-6px); border-color: transparent; }
.blc-img { height: 200px; background: var(--sand); overflow: hidden; flex-shrink: 0; }
.blc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.blc:hover .blc-img img { transform: scale(1.06); }
.blc-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.blc-body { padding: 18px 20px; flex: 1; }
.blc-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.blc-addr { font-size: 12px; color: var(--warm-grey); margin-bottom: 10px; }
.blc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blc-price { font-size: 14px; font-weight: 700; color: var(--clay); }
.blc-beds { font-size: 12px; color: var(--warm-grey); background: var(--cream); padding: 3px 8px; border-radius: 6px; }
.blc-avail { font-size: 12px; color: var(--warm-grey); margin-top: 6px; }
.blc-arrow { padding: 0 20px 16px; font-size: 16px; color: var(--clay); text-align: right; }

.listings-loading { display: flex; align-items: center; justify-content: center; padding: 56px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--sand); border-top-color: var(--clay); border-radius: 50%; animation: spin 0.8s linear infinite; }
.listings-empty { text-align: center; padding: 64px 32px; background: var(--cream); border: 1.5px dashed var(--sand); border-radius: 16px; }
.le-icon { font-size: 44px; margin-bottom: 16px; }
.le-title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.le-sub { font-size: 14px; color: var(--warm-grey); line-height: 1.65; max-width: 460px; margin: 0 auto 24px; }

/* ── Similar buildings ── */
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sim-card {
  background: white; border: 1.5px solid var(--sand); border-radius: 14px;
  padding: 20px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, box-shadow 0.3s;
}
.sim-card.revealed { opacity: 1; transform: translateY(0); }
.sim-card:hover { border-color: var(--clay); box-shadow: 0 12px 36px rgba(196,98,45,0.12); transform: translateY(-4px); }
.sim-card-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.sim-card-addr { font-size: 12px; color: var(--warm-grey); }
.sim-walk { font-size: 12px; color: #166534; background: #F0FDF4; border-radius: 100px; padding: 3px 8px; margin-top: 4px; display: inline-block; width: fit-content; }
.sim-card-arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--clay); opacity: 0; transition: opacity 0.2s; }
.sim-card:hover .sim-card-arrow { opacity: 1; }

/* ── Aurora CTA ── */
.building-cta { position: relative; background: var(--ink); padding: clamp(64px, 9vw, 112px) 52px; text-align: center; overflow: hidden; }
.building-cta-inner { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.building-cta .section-title { font-family: var(--serif); font-size: clamp(28px, 4vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; color: white; margin-bottom: 14px; }
.building-cta .section-title em { font-style: italic; color: var(--clay-light); }
.building-cta .section-sub { font-size: 16px; color: rgba(255,255,255,0.4); margin-bottom: 36px; line-height: 1.65; }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .btn-outline-clay { border-color: rgba(255,255,255,0.18); color: rgba(255,255,255,0.6); }
.cta-buttons .btn-outline-clay:hover { border-color: white; background: rgba(255,255,255,0.08); color: white; }

/* ── Footer ── */
footer { background: var(--ink); border-top: 1px solid rgba(255,255,255,0.05); padding: 56px 52px 36px; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand { font-family: var(--serif); font-size: 24px; color: white; font-weight: 700; margin-bottom: 8px; }
.footer-tagline { font-size: 13px; color: rgba(255,255,255,0.3); }
.footer-col h5 { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: rgba(255,255,255,0.5); text-decoration: none; margin-bottom: 8px; transition: color 0.2s; }
.footer-col a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,0.2); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 12px; color: rgba(255,255,255,0.2); text-decoration: none; }
.footer-legal a:hover { color: rgba(255,255,255,0.5); }

/* ── Reveal animations — handled by animations.css spring system ── */

/* ── Keyframes ── */
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(196,98,45,0.2); } 50% { box-shadow: 0 0 0 6px rgba(196,98,45,0.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-strip-inner { flex-direction: column; gap: 28px; }
  .building-quick-stats { width: 100%; max-width: 480px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  #main-nav { padding: 14px 16px; }
  .nav-links a:not(.nav-login):not(.nav-list):not(#nav-account-link) { display: none; }
  .building-hero { max-height: 620px; }
  .hero-content { padding: 0 20px 44px; }
  .building-name { font-size: 40px; }
  .hero-actions { flex-direction: column; max-width: 260px; }
  .btn-primary, .btn-ghost { justify-content: center; }
  .stats-strip { padding: 32px 20px; }
  .building-transit-bar { padding: 12px 20px; }
  .building-map-section { height: 240px; }
  .building-section { padding: 48px 20px; }
  .building-cta { padding: 56px 20px; }
  footer { padding: 40px 20px 28px; }
  .amenities-grid { grid-template-columns: 1fr 1fr; }
  .similar-grid { grid-template-columns: 1fr 1fr; }
  .building-listings-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .building-name { font-size: 32px; }
  .hero-actions { max-width: 100%; }
  .amenities-grid { grid-template-columns: 1fr; }
  .similar-grid { grid-template-columns: 1fr; }
  .building-quick-stats { flex-wrap: wrap; }
  .qs { min-width: 50%; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
