:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --bg-alt: #131315;
  --text: #f2efe9;
  --muted: #a3a29c;
  --accent: #c8a45c;
  --accent-soft: rgba(200, 164, 92, 0.15);
  --border: rgba(255, 255, 255, 0.12);
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
}

.loading-message,
.error-message {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  margin: 0;
}

.section-heading {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--accent);
  margin: 0 0 2rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: 0;
}

.hero-image-wrap {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 420px;
  overflow: hidden;
  background: #000;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}

@media (min-width: 700px) {
  .hero-overlay {
    padding: 2.5rem;
  }
}

.hero-realtor,
.hero-property {
  pointer-events: auto;
  background: rgba(11, 11, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  max-width: 320px;
}

.hero-realtor {
  text-align: left;
}

.hero-property {
  text-align: right;
  margin-left: auto;
}

.hero-realtor strong,
.hero-property strong {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.hero-realtor em,
.hero-property em {
  display: block;
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.hero-realtor span,
.hero-property span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.hero-property .hero-price {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* ---------- CTA bar ---------- */

.cta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  justify-content: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.cta {
  padding: 0.75rem 2rem;
  border: 1px solid var(--accent);
  color: var(--text);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}

.cta:hover {
  background: var(--accent);
  color: #14140f;
}

/* ---------- Facts row ---------- */

.facts {
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.facts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
}

.fact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  text-align: center;
}

.fact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
}

.fact-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: var(--accent);
  display: block;
}

.fact-label {
  font-style: italic;
  color: var(--muted);
  font-size: 0.8rem;
}

.fact-value {
  font-weight: 500;
}

/* ---------- Description ---------- */

.description {
  padding: 2.5rem 1.25rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.description p {
  max-width: 68ch;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--muted);
  font-weight: 300;
}

/* ---------- 360 Tour ---------- */

.tour {
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.tour-embed {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  height: min(75vh, 620px);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0b0b0c center / cover no-repeat;
}

.tour-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.tour-launch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  border: 0;
  cursor: pointer;
  color: var(--text);
  background: rgba(11, 11, 12, 0.5);
  transition: background 0.2s ease;
}

.tour-launch:hover {
  background: rgba(11, 11, 12, 0.38);
}

.tour-launch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.tour-launch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(11, 11, 12, 0.35);
}

.tour-launch-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---------- Gallery (row-by-row grid) ---------- */

.gallery {
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1000px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  cursor: pointer;
  background: #1a1a1a;
}

.gallery-thumb:focus-visible,
.hero-image:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Map ---------- */

.map {
  padding: 2.5rem 1.25rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.map-embed {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 45%;
  border: 1px solid var(--border);
}

.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Realtor / Presented By ---------- */

.realtor-card {
  padding: 2.5rem 1.25rem 3rem;
  background: var(--bg);
  text-align: center;
}

.realtor-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

#realtor-info {
  max-width: 40ch;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#realtor-info strong {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

#realtor-info em {
  font-style: italic;
  color: var(--muted);
}

#realtor-info span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Scroll-to-top ---------- */

.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: blur(4px);
  color: var(--accent);
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  background: var(--accent);
  color: #14140f;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.site-footer p {
  margin: 0.2rem 0;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  color: var(--accent);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------- Additions for the pre-written pages (properties-src/build.py) ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

a { color: inherit; }

.hero-realtor a,
#realtor-info a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.hero-realtor a:hover,
#realtor-info a:hover { color: var(--accent); border-color: var(--accent); }

.hero-realtor a:focus-visible,
#realtor-info a:focus-visible,
.gallery-thumb:focus-visible,
.hero-image:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Sold / Leased ribbon over the hero */
.status-ribbon {
  position: absolute;
  left: 0;
  bottom: 2rem;
  padding: 0.6rem 1.75rem;
  background: var(--accent);
  color: #14140f;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Realtor photo and brokerage logo (optional; initials are used when there is no photo) */
.realtor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Realtor's initials (or photo, when one is given) in a circle beside the name at the top */
.hero-realtor {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 380px;
}

.hero-realtor-text { min-width: 0; }

.hero-realtor-avatar {
  flex: none;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-realtor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.realtor-logo {
  display: block;
  max-width: 160px;
  max-height: 60px;
  margin: 1.25rem auto 0;
}

.sample-note { font-style: italic; }

/* Landing page at the root of the properties site */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.landing h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 0;
}

.landing p { color: var(--muted); max-width: 46ch; margin: 0; }
.landing a { color: var(--accent); }

.description p + p { margin-top: 1rem; }

/* Map as a short, wide strip instead of a tall box (overrides .map-embed above) */
.map-embed {
  max-width: 1100px;
  padding-top: 0;
  height: 320px;
}

@media (max-width: 600px) {
  .map-embed { height: 220px; }
}
