/* Zillow-inspired styles for 12309 Calibri Ln listing */

:root {
  --z-blue: #006aff;
  --z-blue-dark: #0050c2;
  --z-navy: #0c2340;
  --ink: #0e1a2b;
  --text: #1f2a37;
  --muted: #6b7280;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --green: #1a8754;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Open Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--z-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3 { color: var(--ink); }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; margin: 0 0 0.5rem; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top nav ---------- */
.topnav {
  background: var(--z-navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 14px; }
.brand-text { letter-spacing: -0.02em; }

.topnav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.topnav-links a {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.topnav-links a:hover { text-decoration: none; border-color: rgba(255,255,255,.5); }
.topnav-links a.active { border-color: white; }

.topnav-actions {
  margin-left: auto;
  display: flex;
  gap: 16px;
  align-items: center;
}
.topnav-actions .link {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  font-weight: 500;
}

@media (max-width: 880px) {
  .topnav-links, .topnav-actions { display: none; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.breadcrumb .container {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.breadcrumb a { color: var(--z-blue); font-weight: 500; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---------- Gallery ---------- */
.gallery {
  background: var(--bg);
  padding: 8px 0 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  height: 480px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 4px;
}

.g-cell {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 0;
  background: #ddd;
  cursor: pointer;
}
.g-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.g-cell:hover img { transform: scale(1.03); }

.g-hero {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

.g-more .g-more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

@media (max-width: 880px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 200px;
    height: auto;
  }
  .g-hero { grid-column: 1 / 3; grid-row: 1; }
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  margin-top: 24px;
  padding-bottom: 64px;
}
.primary { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sidebar { position: relative; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

/* Price header */
.price-header {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.price-mo {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.address-line {
  margin-top: 4px;
  color: var(--text);
  font-weight: 500;
}
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-icon:hover { background: var(--bg-soft); }

.key-facts {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}
.key-facts strong { font-size: 1.05rem; color: var(--ink); }
.key-facts .dot { color: var(--line); }

.status-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e8f4ec;
  color: var(--green);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}
.dot-green {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag {
  display: inline-block;
  background: #eef4ff;
  color: var(--z-blue-dark);
  border: 1px solid #d6e4ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 4px;
}

.lede { font-size: 1rem; line-height: 1.6; margin-top: 0; }

/* Facts grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 32px;
}
.fact-block h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  margin-bottom: 8px;
}
.fact-block ul {
  margin: 0; padding: 0;
  list-style: none;
  font-size: 0.92rem;
}
.fact-block li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.fact-block li:last-child { border-bottom: none; }

@media (max-width: 640px) {
  .facts-grid { grid-template-columns: 1fr; }
}

/* Map */
.map {
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.map-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Nearby */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 28px;
}
.nearby h3 { margin-bottom: 4px; }
.nearby p { margin: 0; color: var(--text); font-size: 0.92rem; }

@media (max-width: 640px) {
  .nearby-grid { grid-template-columns: 1fr; }
}

/* Schools */
.schools-list { list-style: none; padding: 0; margin: 12px 0 0; }
.schools-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.schools-list li:first-child { border-top: none; }
.schools-list .rating {
  width: 36px; height: 36px;
  background: var(--green);
  color: white;
  border-radius: 6px;
  display: grid; place-items: center;
  font-weight: 700;
  flex: none;
}
.schools-list strong { display: block; color: var(--ink); }
.schools-list .muted { font-size: 0.85rem; color: var(--muted); }

/* Bullets */
.bullet-list { margin: 0; padding-left: 18px; }
.bullet-list li { padding: 4px 0; }

/* Sidebar / contact card */
.contact-card {
  position: sticky;
  top: 80px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.agent-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #006aff, #0c2340);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
}
.agent-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.agent-name { font-weight: 700; color: var(--ink); }

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn-primary {
  background: var(--z-blue);
  color: white;
}
.btn-primary:hover { background: var(--z-blue-dark); text-decoration: none; }
.btn-secondary {
  background: white;
  color: var(--z-blue);
  border-color: var(--z-blue);
}
.btn-secondary:hover { background: #eef4ff; }

.trust-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 4px;
}
.trust-line svg { color: var(--green); }

/* Footer */
.footer {
  background: var(--z-navy);
  color: rgba(255,255,255,.85);
  padding: 32px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.footer-brand { font-weight: 800; font-size: 1.2rem; color: white; }
.footer-meta { font-size: 0.85rem; }
.footer a { color: white; text-decoration: underline; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 2.2rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 20px; right: 20px; font-size: 1.8rem; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-figure img {
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 4px;
}
.lb-caption {
  color: rgba(255,255,255,.85);
  margin-top: 12px;
  font-size: 0.88rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 480px;
  position: relative;
  box-shadow: var(--shadow-md);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  width: 32px; height: 32px;
}
.modal-card h2 { margin-top: 0; }
.modal-card .muted { color: var(--muted); margin-top: -4px; }
.modal-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.modal-card input, .modal-card textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.modal-card input:focus, .modal-card textarea:focus {
  outline: 2px solid var(--z-blue);
  outline-offset: -1px;
  border-color: var(--z-blue);
}

.muted { color: var(--muted); }
