/* Property detail pages. Loaded after site.css, so it reuses the same variables. */

main.property { padding: 18px 0 30px; }
main.property .container { padding-bottom: 8px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 500;
  font-size: .95rem;
  color: var(--forest);
}
.back-link svg { width: 18px; height: 18px; transition: transform .15s ease; }
.back-link:hover svg { transform: translateX(-3px); }

.property-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 6px;
}
.property-top, .property-body { min-width: 0; }

/* ---------- Gallery ---------- */
.gallery {
  position: relative;
  background: var(--cream-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  outline-offset: -3px;
}
.gallery-track::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  background: var(--cream-2);
  cursor: zoom-in;
  display: block;
  position: relative;
}
.slide picture, .slide img { display: block; width: 100%; height: 100%; }
.slide img { object-fit: cover; }
.gallery-single img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(251, 247, 242, .9);
  color: var(--forest);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: background .15s ease, transform .15s ease;
}
.gallery-arrow:hover, .gallery-arrow:focus-visible { background: #fff; transform: translateY(-50%) scale(1.05); }
.gallery-arrow:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gallery-arrow svg { width: 22px; height: 22px; }
.gallery-arrow.prev { left: 14px; }
.gallery-arrow.next { right: 14px; }
@media (hover: hover) and (pointer: fine) {
  .gallery-arrow { display: flex; }
}
.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(42, 42, 42, .72);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
}

/* ---------- Header block ---------- */
.prop-head { padding: 20px 0 6px; }
.status-badge {
  display: inline-block;
  background: var(--forest);
  color: var(--cream);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.status-badge.is-sold { background: var(--sold); }
.status-badge.is-sold.is-buyer { background: var(--forest); }
.prop-head h1 { font-size: clamp(2rem, 6vw, 2.9rem); margin-bottom: .1em; }
.prop-head .locale { color: var(--muted); font-size: 1.05rem; margin: 0 0 14px; }
.prop-head .price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  color: var(--charcoal);
  margin: 0;
  line-height: 1.1;
}
.prop-head .price-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 4px;
}
.prop-head .closed-on, .prop-head .mls { color: var(--muted); font-size: .95rem; margin: 6px 0 0; }

/* ---------- Facts strip ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.fact { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: -0px -1px -1px 0; }
.fact dt {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: 1.12rem; color: var(--forest); }

/* ---------- Contact card ---------- */
.contact-card {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow);
}
.contact-card h2 { font-size: 1.7rem; margin-bottom: .25em; }
.contact-card > p { color: var(--muted); margin: 0 0 18px; }
.agent-card + .agent-card { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.agent-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 10px;
}
.agent-actions { display: grid; gap: 10px; }
.btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--forest);
  background: var(--cream);
  color: var(--forest);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease;
}
.btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn small { display: block; font-weight: 400; font-size: .82rem; opacity: .85; }
.btn:hover, .btn:focus-visible { background: var(--forest); color: var(--cream); }
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--forest-2); color: var(--cream); }

/* ---------- Body sections ---------- */
.prop-section { margin-top: 30px; }
.prop-section h2 { font-size: 1.8rem; }
.prop-section p { color: var(--charcoal); max-width: 70ch; }
.feature-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px 28px; }
.feature-group h3 { font-size: 1.15rem; margin-bottom: .4em; }
.feature-group ul { list-style: none; margin: 0; padding: 0; }
.feature-group li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: .96rem;
  color: var(--charcoal);
}
.feature-group li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .85em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.detail-list { margin: 0; border-top: 1px solid var(--line); }
.detail-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 4px 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.detail-list dt { color: var(--muted); font-size: .9rem; font-weight: 500; }
.detail-list dd { margin: 0; }

/* ---------- Footer extras ---------- */
footer.site .eho-slot { margin: 0 0 6px; }
footer.site .eho-slot .eho { margin: 0; }
footer.site address a { border-bottom-color: rgba(230,221,201,.3); }

/* ---------- Lightbox ---------- */
dialog.lightbox {
  border: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: rgba(20, 24, 21, .96);
  color: #fff;
}
dialog.lightbox::backdrop { background: rgba(20, 24, 21, .96); }
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; touch-action: pan-y; }
.lb-close, .lb-arrow {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(251, 247, 242, .16);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.lb-close:hover, .lb-arrow:hover, .lb-close:focus-visible, .lb-arrow:focus-visible { background: rgba(251, 247, 242, .32); }
.lb-close:focus-visible, .lb-arrow:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lb-close svg, .lb-arrow svg { width: 24px; height: 24px; }
.lb-close { top: 14px; right: 14px; }
.lb-arrow { top: 50%; transform: translateY(-50%); }
.lb-arrow.prev { left: 14px; }
.lb-arrow.next { right: 14px; }
.lb-count {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  font-size: .9rem;
  background: rgba(0,0,0,.45);
  padding: 4px 14px;
  border-radius: 999px;
}
dialog.lightbox.single .lb-arrow, dialog.lightbox.single .lb-count { display: none; }
body.lb-open { overflow: hidden; }

/* ---------- Layout ---------- */
@media (max-width: 699px) {
  /* Gallery runs edge to edge on phones. */
  .property-top .gallery { margin: 0 -22px; border-radius: 0; box-shadow: none; }
  .fact { padding: 12px 12px; }
}
@media (min-width: 700px) {
  .agent-actions { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .property-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "top contact" "body contact";
    column-gap: 40px;
    row-gap: 0;
    align-items: start;
  }
  .property-top { grid-area: top; }
  .property-body { grid-area: body; }
  .contact-card { grid-area: contact; position: sticky; top: 96px; }
  .agent-actions { grid-template-columns: 1fr; }
  .gallery-arrow { width: 52px; height: 52px; }
}
