/* ==========================================================================
   Listing detail page (property template)
   ========================================================================== */

/* gallery — full-bleed hero image; header sits transparent over it (like home),
   thumbnails overlay the image. Clicking any thumb (or the image) opens the
   fullscreen lightbox. */
.listing-gallery { background: transparent; }
.lg-main {
  position: relative;
}
.lg-main > img {
  width: 100%;
  height: 82vh;
  min-height: 460px;
  max-height: 820px;
  object-fit: cover;
}
/* top scrim keeps the white header legible over bright photos */
.lg-main::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 190px;
  background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,0));
  pointer-events: none;
  z-index: 1;
}
/* bottom scrim so the thumbnails read against the photo */
.lg-main::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 170px;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.48));
  pointer-events: none;
  z-index: 1;
}
/* up to 8 thumbnails, sized to fit the rail exactly — never clipped */
.lg-thumbs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  z-index: 3;
  width: min(1180px, calc(100% - 48px));
  display: flex;
  justify-content: center;
  gap: 8px;
  --cols: 8;
}
.lg-thumbs img {
  width: calc((100% - (var(--cols) - 1) * 8px) / var(--cols));
  aspect-ratio: 3 / 2;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .78;
  transition: opacity .2s, border-color .2s, transform .2s;
}
.lg-thumbs img:hover { opacity: 1; border-color: #fff; transform: translateY(-3px); }

/* ---- fullscreen lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(9, 11, 15, .95);
}
.lightbox[hidden] { display: none; }
.lb-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
}
.lb-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform .45s cubic-bezier(.22, .61, .36, 1);
}
.lb-track.no-anim { transition: none; }
.lb-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 7vw;
}
.lb-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}
.lb-close,
.lb-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.lb-close {
  top: 20px;
  right: 24px;
  font-size: 40px;
  line-height: 1;
  opacity: .8;
  transition: opacity .2s;
}
.lb-close:hover { opacity: 1; }
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--secondary);
  opacity: .9;
  transition: background-color .2s, opacity .2s;
}
.lb-nav:hover { background: var(--dark); opacity: 1; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-count {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* summary bar */
.listing-summary { background: #f1f1f1; padding: 40px 0; }
/* if a listing has no gallery, the summary is first and needs to clear the
   fixed header on its own */
#listing-root > .listing-summary:first-child { padding-top: calc(var(--header-h) + 28px); }
.ls-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.ls-status { position: static; display: inline-block; }
.ls-title {
  margin-top: 14px;
  font-family: var(--gruppo);
  font-size: 30px;
  font-weight: 500;
  color: var(--secondary);
  text-align: left;
  line-height: 1.3;
}
.ls-address {
  margin-top: 6px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--secondary);
}
.ls-divider { height: 1px; background: #cfcfcf; margin: 22px 0; }
.ls-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}
.ls-price { font-size: 20px; font-weight: 700; color: var(--secondary); }
.ls-stats { display: none; }

/* description + fact rail */
.lb-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 20px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 60px;
}
.lb-desc p { font-size: 16px; line-height: 26px; color: var(--secondary); }
.lb-facts { border-left: 1px solid #d5d5d5; padding-left: 40px; }
.lb-fact { margin-bottom: 26px; }
.lb-fact .n { display: block; font-size: 20px; font-weight: 700; color: var(--secondary); }
.lb-fact .l { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #444; }

/* agent card — light grey band */
.listing-agent {
  background: #f1f1f1;
}
.la-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 20px;
  display: flex;
  align-items: center;
  gap: 70px;
  flex-wrap: wrap;
}
.la-photo img { width: 144px; height: 200px; object-fit: cover; object-position: top center; }
.la-info { flex: 1; min-width: 300px; }
.la-name {
  font-family: var(--gruppo);
  font-size: 38px;
  font-weight: 400;
  color: var(--secondary);
  margin-bottom: 22px;
}
.la-cols { display: flex; gap: 44px; flex-wrap: wrap; }
.la-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--secondary);
  margin-bottom: 6px;
}
.la-col p { font-size: 14px; color: #333; }
.la-col a:hover { text-decoration: underline; }
.la-contact { white-space: nowrap; }

/* features & amenities — white, breaks from the grey agent band above it */
.listing-features {
  background: #fff;
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 20px;
}
.lf-title {
  font-family: var(--gruppo);
  font-size: 43px;
  font-weight: 400;
  line-height: 1.12;
  color: var(--secondary);
  margin-bottom: 30px;
}
.lf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 44px;
  align-items: start;
}
.lf-block h3 {
  font-family: var(--gruppo);
  font-size: 30px;
  font-weight: 400;
  color: var(--secondary);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--secondary);
  margin-bottom: 12px;
}
.lf-block dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e5e5;
}
.lf-block dt { font-size: 14px; font-weight: 700; color: var(--secondary); }
.lf-block dd { font-size: 14px; color: #333; text-align: right; }

@media (max-width: 1024px) {
  .lg-main > img { height: 62vh; min-height: 380px; }
  .lg-thumbs { --cols: 6; }
  .lg-thumbs img:nth-child(n+7) { display: none; }
  .lb-inner { grid-template-columns: 1fr; padding: 52px 24px; }
  .lb-facts {
    border-left: 0;
    padding-left: 0;
    display: flex;
    gap: 34px;
    border-top: 1px solid #d5d5d5;
    padding-top: 24px;
  }
  .listing-features { padding: 52px 24px; }
  .lf-grid { grid-template-columns: 1fr; }
  .la-inner { gap: 34px; padding: 44px 24px; }
}

@media (max-width: 680px) {
  .lf-title { font-size: 34px; }
  .lg-thumbs { --cols: 4; width: calc(100% - 24px); bottom: 12px; }
  .lg-thumbs img:nth-child(n+5) { display: none; }
  .lb-nav { width: 42px; height: 42px; }
}
