/* The House: the place written up like a listing. A lead photo with the
   title over it, then rooms, photos and the details. Builds on styles.css. */

.h-main { padding: var(--bar) var(--gut) 0; }

/* Lead photo, edge to edge inside the frame */
.h-hero { position: relative; height: calc(100vh - var(--bar) - var(--gut)); min-height: 460px; overflow: hidden; background: var(--ink); }
.h-hero img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.h-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,20,20,.05) 25%, rgba(20,20,20,.5) 62%, rgba(20,20,20,.62) 100%);
}
.h-hero-copy { position: absolute; left: 0; right: 0; bottom: 12vh; text-align: center; color: #fff; z-index: 1; pointer-events: none; }
.h-hero h1 {
  font-size: clamp(38px, 6.4vw, 96px); font-weight: 400; letter-spacing: .14em; line-height: 1;
  margin: 0 0 22px; text-shadow: 0 1px 24px rgba(0,0,0,.25);
}
.h-kicker, .h-sub { margin: 0 0 18px; font: 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .3em; }
.h-kicker, .h-sub { text-shadow: 0 1px 10px rgba(0,0,0,.55); }
.h-sub { margin: 0; letter-spacing: .24em; }
.h-all {
  position: absolute; right: 24px; bottom: 24px; z-index: 1; display: inline-flex; gap: 10px;
  padding: 12px 18px; border: 1px solid rgba(255,255,255,.8); border-radius: 999px; background: rgba(20,20,20,.25);
  color: #fff; font: 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; cursor: pointer;
}
.h-all:hover { background: #fff; color: var(--ink); }

/* The headline numbers */
.h-facts {
  display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; border-bottom: 1px solid var(--rule);
}
.h-facts div { padding: 22px 20px; border-left: 1px solid var(--rule); }
.h-facts div:first-child { border-left: 0; }
.h-facts dt { font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--mid); margin-bottom: 8px; }
.h-facts dd { margin: 0; font-size: 19px; line-height: 1.25; }
.h-facts small { display: block; font: 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--mid); }

/* Centred passages between the photos */
.h-intro { max-width: 700px; margin: 0 auto; padding: 110px 24px 90px; text-align: center; }
.h-intro > p:not(.eyebrow) { font-size: 17px; color: #4a4a48; margin: 0 auto 22px; max-width: 58ch; }
.h-intro > p.h-lede { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.25; color: var(--ink); max-width: 26ch; margin-bottom: 26px; }
.h-intro .eyebrow { margin-bottom: 22px; }
.h-rule { display: block; width: 1px; height: 70px; background: var(--rule); margin: 50px auto 0; }
.h-area .h-rule { margin: 0 auto 50px; }
.h-near { text-align: left; max-width: 520px; margin: 34px auto 40px; }
.h-near div { grid-template-columns: 74px 1fr; }

/* Photos: click to enlarge */
.h-shot { margin: 0; overflow: hidden; background: #e6e6dd; }
.h-shot img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .8s ease; }
.h-shot:hover img { transform: scale(1.025); }
.h-wide { height: 78vh; min-height: 360px; }
.h-tall { height: 88vh; }

/* A room: words on one side, photos on the other */
.h-room {
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: 56px; align-items: center;
  padding: 100px 32px;
}
.h-room.h-flip { grid-template-columns: 7fr minmax(280px, 5fr); }
.h-room.h-flip .h-text { order: 2; }
.h-text > p:not(.eyebrow) { font-size: 17px; color: #4a4a48; max-width: 46ch; margin: 0 0 26px; }
.h-text .spec { max-width: 420px; }
.h-pics { display: grid; gap: 8px; }
.h-pics-2 { grid-template-columns: 1fr 1fr; }
.h-pics-2 .h-shot { aspect-ratio: 3 / 4; }
.h-pics-3 { grid-template-columns: 1fr 1fr; }
.h-pics-3 .h-shot { aspect-ratio: 4 / 5; }
.h-pics-3 .h-span { grid-column: 1 / -1; aspect-ratio: 3 / 2; }

/* Bedrooms and bathrooms, three across */
.h-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 32px; }
.h-grid .h-shot { aspect-ratio: 4 / 5; }

/* Floorplan on paper, never cropped */
.h-plan {
  display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: 56px; align-items: start;
  padding: 100px 32px; border-top: 1px solid var(--rule); margin-top: 0;
}
.h-plan .h-text { position: sticky; top: calc(var(--bar) + 40px); }
.h-floorplan { background: #fff; border: 1px solid var(--rule); padding: 24px; }
.h-floorplan img { height: auto; object-fit: contain; }
.h-floorplan:hover img { transform: none; }

/* The viewer */
.h-box {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(24,24,22,.97); color: #f5f5ed;
}
.h-box::backdrop { background: rgba(24,24,22,.9); }
.h-box[open] { display: grid; grid-template-rows: auto 1fr; }
.h-box-bar {
  display: flex; justify-content: space-between; align-items: center; padding: 18px 24px;
  font: 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em;
}
.h-box-close { background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; padding: 6px 0; }
.h-box-close:hover { color: var(--accent); }
.h-box-stage { margin: 0; min-height: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 0 84px 24px; }
.h-box-stage img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; align-self: center; }
.h-box-stage figcaption { padding-top: 14px; font: 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #b3b3af; text-align: center; }
.h-box-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(245,245,237,.4); background: none; color: inherit; font-size: 20px; cursor: pointer;
}
.h-box-nav:hover { border-color: var(--accent); color: var(--accent); }
.h-box-nav.prev { left: 18px; }
.h-box-nav.next { right: 18px; }
body:has(.h-box[open]) { overflow: hidden; }

@media (max-width: 1000px) {
  .h-facts { grid-template-columns: repeat(3, 1fr); }
  .h-facts div:nth-child(4) { border-left: 0; }
  .h-facts div:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .h-room, .h-room.h-flip, .h-plan { grid-template-columns: 1fr; gap: 36px; padding: 72px 24px; }
  .h-room.h-flip .h-text { order: 0; }
  .h-plan .h-text { position: static; }
}

@media (max-width: 800px) {
  .h-hero { height: calc(88vh - var(--bar)); }
  .h-hero-copy { bottom: 96px; padding: 0 16px; }
  .h-hero h1 { letter-spacing: .1em; }
  .h-kicker, .h-sub { font-size: 10.5px; letter-spacing: .2em; }
  .h-all { left: 50%; right: auto; transform: translateX(-50%); bottom: 22px; white-space: nowrap; }
  .h-facts { grid-template-columns: repeat(2, 1fr); }
  .h-facts div { padding: 16px 14px; }
  .h-facts div:nth-child(4) { border-left: 1px solid var(--rule); }
  .h-facts div:nth-child(odd) { border-left: 0; }
  .h-facts div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .h-facts dd { font-size: 16px; }
  .h-intro { padding: 72px 16px 60px; }
  .h-room, .h-room.h-flip, .h-plan { padding: 56px 16px; }
  .h-wide { height: 56vh; min-height: 0; }
  .h-tall { height: 70vh; }
  .h-grid { grid-template-columns: 1fr 1fr; padding: 0 16px; gap: 6px; }
  .h-pics { gap: 6px; }
  .h-floorplan { padding: 10px; }
  .h-box-stage { padding: 0 12px 84px; }
  .h-box-nav { top: auto; bottom: 18px; transform: none; }
  .h-box-nav.prev { left: calc(50% - 64px); }
  .h-box-nav.next { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
  .h-shot img { transition: none; }
}
.h-box.single .h-box-nav { display: none; }

/* A photo with a second take of the same room: hover to see it, phones fade between them */
.h-swap { position: relative; }
.h-swap .h-swap-b { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease, transform .8s ease; pointer-events: none; }
.h-swap-tag {
  position: absolute; left: 10px; bottom: 10px; padding: 7px 10px; background: rgba(245,245,237,.92); color: var(--ink);
  font: 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: 0; transition: opacity .4s ease;
}
.h-swap.ready .h-swap-tag { opacity: 1; }
.h-swap-touch { display: none; }
@media (hover: hover) {
  .h-swap.ready:hover .h-swap-b { opacity: 1; }
  .h-swap.ready:hover .h-swap-tag { opacity: 0; }
}
@media (hover: none) {
  .h-swap-hover { display: none; }
  .h-swap-touch { display: inline; }
  .h-swap.ready .h-swap-b { animation: h-swap 7s ease-in-out infinite; }
}
@keyframes h-swap { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .h-swap.ready .h-swap-b { animation: none; } }
