/* ==========================================================================
   Listing detail pages — extends the "Ink & Air" system in styles.css
   ========================================================================== */

.listing-page { padding-top: var(--header-h); } /* clearance under the pinned pill header */

/* The header and .btn-outline live in styles.css. */

/* ---- Listing masthead -------------------------------------------------- */

.listing-head {
  padding: clamp(48px, 6vw, 96px) 0 clamp(36px, 4vw, 56px);
}

/* Address on the left; price, facts and the call buttons on the right. */
.listing-head-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}
/* The eyebrow runs across the top; the address and the price block then
   start on the same line. */
.listing-head-main { display: contents; }
.listing-head-main .listing-eyebrow-row { grid-column: 1 / -1; grid-row: 1; }
.listing-head-main h1 { grid-column: 1 / span 7; grid-row: 2; margin-bottom: 0; }
.listing-head-side { grid-column: 9 / -1; grid-row: 2; padding-top: 0.35em; }

/* .breadcrumb lives in styles.css: the results, suburb and listings index
   pages show one too. */

.listing-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.listing-eyebrow-row .eyebrow { margin: 0; }

/* The status pill: the homepage card chip, in ink on paper. */
.chip-static {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 8px 13px;
  border-radius: var(--pill);
}

.listing-head h1 {
  font-size: clamp(42px, 5.6vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 14ch;
  margin-bottom: 20px;
  text-wrap: balance;
}

.listing-price {
  font-family: var(--serif);
  font-weight: 300;
  font-feature-settings: "lnum" 1, "pnum" 1;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.listing-soi-inline {
  margin-top: 10px;
  margin-bottom: 22px;
  font-size: 14px;
}

/* The price statement link sits directly under the advertised price, as one
   unit, so it is never pushed below the fold or away from the price. */
.listing-price-block { margin-bottom: 22px; }
.listing-price-block .listing-price { margin-bottom: 0; }
.listing-price-statement {
  margin-top: 8px;
  font-size: 14px;
}
.listing-price-block + .listing-soi-inline { margin-top: -10px; }

/* The masthead facts row is the card's .prop-facts, sitting under a rule. */
.listing-specs {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--grey);
}

.listing-specs span + span::before {
  content: "\00b7";
  margin: 0 10px;
  color: var(--steel);
}

/* One call button per agent, the same weight: side by side when they fit,
   else one full-width row each. */
.listing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.listing-actions .btn { flex: 1 1 auto; text-align: center; padding: 15px 22px; font-size: 14px; }

/* ---- Gallery: a mosaic up top, every photo below, a viewer on click ------ */

.gallery-section { padding-bottom: clamp(56px, 6vw, 96px); }

/* Above 820px: the cover over two rows with photos 2 and 3 stacked beside
   it, then the rest in the rows lib/listing-gallery.ts sizes (fours, with a
   three or a two taking up the slack, so no photo sits on its own). */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.gallery-grid { display: contents; }

.gallery-hero {
  position: relative;
  grid-column: 1 / span 8;
  grid-row: 1 / span 2;
  min-width: 0;
}
.gallery-tile { grid-column: span 3; min-width: 0; }
.gallery-tile.is-side:nth-child(1) { grid-column: 9 / -1; grid-row: 1; }
.gallery-tile.is-side:nth-child(2) { grid-column: 9 / -1; grid-row: 2; }
.gallery-tile.is-side:only-child { grid-row: 1 / span 2; }
.gallery-tile.is-third { grid-column: span 4; }
.gallery-tile.is-half { grid-column: span 6; }
.gallery-tile.is-full { grid-column: 1 / -1; }
/* A listing with one photo: it runs the full width. */
.gallery-hero:only-child { grid-column: 1 / -1; grid-row: auto; }

.gallery picture { display: block; width: 100%; height: 100%; }
.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #EDEDEB;
  cursor: zoom-in;
  transition: opacity 0.3s ease;
}
.gallery img:hover { opacity: 0.92; }
.gallery-hero img { aspect-ratio: auto; border-radius: var(--radius-md); }
.gallery-hero:only-child img { aspect-ratio: 16 / 9; }
.gallery-tile.is-side:only-child img { aspect-ratio: auto; }
.gallery-tile.is-full img { aspect-ratio: 21 / 9; }

/* "View all 10 photos" and "Floorplan" (js/gallery.js): frosted pills in
   the cover's corner, 44px to tap. */
.gallery-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.gallery-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--pill);
  background: rgba(252, 252, 251, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgba(16, 16, 16, 0.45);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.35s var(--ease);
}
.gallery-action:hover { background: #fff; transform: translateY(-1px); }
/* A paper halo under the ink ring, so the ring shows on any photo. */
.gallery-action:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(252, 252, 251, 0.95);
}

/* ---- Photo viewer ------------------------------------------------------- */

.lightbox-open, .lightbox-open body { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #0A0A0A;
  color: #fff;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; }
.lightbox [hidden] { display: none; } /* one-photo listings hide the arrows */

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
}
.lightbox-count {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.8px;
  font-feature-settings: "tnum" 1;
  color: rgba(255, 255, 255, 0.75);
}
.lightbox-close {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--pill);
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lightbox-close:hover { background: #fff; color: var(--ink); }

.lightbox-stage {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(16px, 7vw, 120px) clamp(16px, 4vh, 48px);
  min-height: 0;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lightbox-nav:hover { background: #fff; color: var(--ink); }
.lightbox-prev { left: clamp(8px, 2vw, 32px); }
.lightbox-next { right: clamp(8px, 2vw, 32px); }
.lightbox button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

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

.listing-body {
  border-top: 1px solid var(--hairline);
  padding: clamp(56px, 7vw, 112px) 0;
}

.listing-body-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}
.listing-desc { grid-column: 1 / span 7; }
/* Not sticky: with open times and the Ask block the column runs past
   1000px, taller than most screens, so a held column would hide its lower
   blocks until the description ended. The masthead carries the price
   statement, the next open and both call buttons. */
.listing-aside { grid-column: 9 / -1; }

/* A measured column: long-form copy reads at 62 characters or so. The
   floorplan and video take the column's full width. */
.listing-desc > * { max-width: 62ch; }
.listing-desc > .listing-floorplans,
.listing-desc > .listing-video { max-width: none; }

.listing-desc h2 {
  font-weight: 300;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin-bottom: 32px;
  text-wrap: balance;
}

.listing-desc p { margin-bottom: 20px; }
.listing-desc ul { margin: 0 0 20px 18px; }
.listing-desc li { margin-bottom: 8px; }
.listing-desc p, .listing-desc li {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  color: #333;
}

/* ---- Compliance / SOI block ---------------------------------------------- */

.listing-aside > div {
  border-top: 1px solid var(--hairline);
  padding: 24px 0 30px;
}

.aside-label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 16px;
}

.aside-note {
  font-size: 13px;
  color: var(--grey);
  margin-top: 12px;
  line-height: 1.6;
}

/* ---- Agent mini-cards ------------------------------------------------------ */

.agent-mini {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.agent-mini picture { display: block; flex: none; }
.agent-mini img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  object-position: center 25%;
  filter: grayscale(100%);
  transition: filter 0.4s ease;
}
.agent-mini:hover img { filter: none; }

.agent-mini-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.agent-mini a {
  display: block;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  width: fit-content;
  position: relative;
  padding-bottom: 1px;
  overflow: hidden;
}
.agent-mini a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: translateX(-101%);
  transition: transform 0.3s ease;
}
.agent-mini a:hover::after { transform: translateX(0); }

/* ---- Listing page standard: sold line, floorplans, video, opens, ask ------- */

/* Small-caps section labels that are real headings (h2) for the outline. */
.listing-desc h2.listing-subhead,
.listing-aside h2.aside-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 16px;
}
.listing-desc h2.listing-subhead { margin-top: 48px; }

.sold-note {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.listing-desc .sold-note-line {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 16px;
}
.listing-desc .sold-note-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-bottom: 0; }
/* A thin sold page has no copy under the line, so no rule either. */
.sold-note:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
/* Notes under the video read as notes, not body copy. */
.listing-desc p.aside-note { font-size: 13px; line-height: 1.6; color: var(--grey); }

.floorplan-list { display: grid; gap: 16px; }
.floorplan-list img {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--hairline);
  cursor: zoom-in;
}
.floorplan-list img:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.video-frame video,
.video-frame iframe,
.video-poster,
.video-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Full colour, no wash: the paper chip carries its own contrast. */
.video-poster img { object-fit: cover; }
.video-poster picture { display: contents; }
.video-play {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--pill);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.video-play-icon {
  width: 0;
  height: 0;
  border-left: 10px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.video-poster:hover .video-play,
.video-poster:focus-visible .video-play { background: var(--ink); color: #fff; }
.video-poster:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.listing-next-open { margin: 18px 0 0; }

.open-list { list-style: none; margin: 0; padding: 0; }
.open-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}
.open-list li:first-child { border-top: 0; padding-top: 0; }
.open-day {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  grid-column: 1;
}
.open-time { font-size: 15px; color: #333; grid-column: 1; }
.open-calendar { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
.open-none { font-size: 15px; line-height: 1.6; color: #333; }
/* Phones: the day on one line, "Add to calendar" under its time. */
@media (max-width: 420px) {
  .open-list li { grid-template-columns: 1fr; }
  .open-calendar { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; }
}

/* Call, Text and Email: each at least 44px square to tap, the underline
   under the word rather than at the foot of the target. The side padding
   makes the gap between links; the negative margin keeps the first word
   lined up with the name above. */
.ask-links {
  display: flex;
  flex-wrap: wrap;
  margin-left: -10px;
}
.agent-mini .ask-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
}
/* Inset underline: translateX(-101%) would leave the 10px inset showing, so
   these grow from the left instead. */
.agent-mini .ask-links a::after { bottom: 11px; left: 10px; right: 10px; width: auto; transform: scaleX(0); transform-origin: left; }
.agent-mini .ask-links a:hover::after,
.agent-mini .ask-links a:focus-visible::after { transform: scaleX(1); }

/* ---- Book an inspection: how a page for a home on the market closes ------- */

/* Xavier's card (call and email), beside the ask; the next opens under it
   when there are any. A sold page closes on the shared sand
   appraisal band instead. */
.listing-enquire {
  border-top: 1px solid var(--hairline);
  padding: var(--section-pad) 0;
}
.listing-enquire-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 40px;
  align-items: start;
}
.listing-enquire-intro { grid-column: 1 / span 5; }
.listing-enquire-intro .section-title { max-width: 14ch; margin-bottom: 24px; }
.listing-enquire-lede { color: var(--grey); max-width: 40ch; }
.listing-enquire-agents {
  grid-column: 7 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--col-gap);
}
.enquire-agent {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(22px, 2.2vw, 32px);
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.enquire-agent picture { display: block; }
.enquire-agent img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  object-position: center 25%;
  border-radius: var(--radius-sm);
}
.enquire-agent-info { display: flex; flex-direction: column; gap: 10px; }
.enquire-agent-name {
  font-weight: 400;
  font-size: var(--text-subhead);
  line-height: 1.2;
  margin-bottom: 6px;
}
.enquire-agent .btn { display: block; text-align: center; padding: 15px 14px; }
/* One agent: the card spans the column with the headshot beside the name
   and both buttons, so it reads as one contact card, not half a pair. */
.enquire-agent:only-child { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; }
.enquire-agent:only-child .enquire-agent-info {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.enquire-agent:only-child .enquire-agent-name { grid-column: 1 / -1; }

.enquire-opens { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.enquire-opens .choice-kicker { margin-bottom: 8px; }
.enquire-open-list { list-style: none; margin: 0 0 16px; }
.enquire-open-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 6px 0; }
.enquire-open-day { font-family: var(--serif); font-size: 20px; line-height: 1.3; }
.enquire-open-time { font-size: 15px; color: #333; }

/* ---- Listings index ---------------------------------------------------------- */

.index-head { border-bottom: 1px solid var(--hairline); }
.index-head h1 { max-width: none; margin-bottom: 18px; }
.index-results { margin-top: 18px; }
.index-count {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(20px, 1.8vw, 26px);
  color: var(--grey);
}
.index-body { border-top: 0; }
.index-group + .index-group { margin-top: clamp(72px, 8vw, 120px); }
.index-group-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 18px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--hairline);
}
.index-group-title span { color: var(--grey); font-weight: 500; }
.index-group .card-grid { row-gap: 56px; }

/* ---- Responsive ---------------------------------------------------------------- */

@media (max-width: 1080px) {
  .listing-enquire-intro,
  .listing-enquire-agents { grid-column: 1 / -1; }
  .listing-head-main h1 { grid-column: 1 / span 7; }
  .listing-head-side { grid-column: 8 / -1; }
  .listing-desc { grid-column: 1 / span 7; }
  .listing-aside { grid-column: 8 / -1; }
}

@media (max-width: 900px) {
  .listing-head-main h1, .listing-head-side { grid-column: 1 / -1; }
  .listing-head-side { grid-row: 3; padding-top: 28px; }
  .listing-desc, .listing-aside { grid-column: 1 / -1; }
  .listing-aside { margin-top: 48px; }
}

/* Phones: the cover, then the other photos in a swipe rail with the next
   one peeking in (the homepage rails' pattern), not a long stack. */
@media (max-width: 820px) {
  .gallery { display: block; }
  .gallery-hero img,
  .gallery-hero:only-child img { height: auto; aspect-ratio: 4 / 3; }
  .gallery-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 74%;
    gap: 8px;
    margin: 8px calc(var(--gutter) * -1) 0;
    padding: 0 var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--gutter);
    scrollbar-width: none;
  }
  .gallery-grid::-webkit-scrollbar { display: none; }
  .gallery-tile,
  .gallery-tile.is-side:nth-child(1),
  .gallery-tile.is-side:nth-child(2),
  .gallery-tile.is-side:only-child,
  .gallery-tile.is-third,
  .gallery-tile.is-half,
  .gallery-tile.is-full { grid-column: auto; grid-row: auto; scroll-snap-align: start; }
  .gallery-tile img,
  .gallery-tile.is-side:only-child img,
  .gallery-tile.is-full img { height: auto; aspect-ratio: 3 / 2; }
  .gallery-actions { right: 12px; bottom: 12px; }
}

@media (max-width: 620px) {
  .listing-head { padding-top: 20px; }
  .listing-head .breadcrumb { margin-bottom: 14px; }
  .listing-eyebrow-row { margin-bottom: 16px; }
  .listing-head-side { padding-top: 18px; }
  .listing-price-block { margin-bottom: 16px; }
  .listing-specs { padding-top: 14px; }
  .listing-desc p, .listing-desc li { font-size: 17px; }
  /* Phones: call buttons side by side when there is more than one, so all sit on
     the first screen; a lone button keeps its number. */
  .listing-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 22px; }
  .listing-actions .btn { padding: 14px 10px; }
  .listing-actions .btn:not(:only-child) .listing-call-number { display: none; }
  .listing-enquire-agents { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .enquire-agent:only-child .enquire-agent-info { grid-template-columns: minmax(0, 1fr); }
  .lightbox-nav { top: auto; bottom: 18px; margin-top: 0; width: 52px; height: 52px; }
  .lightbox-stage { padding-bottom: 88px; }
}
