/* Tower page hero gallery (November 3, 2026). Shared by the three sites (tools/sync-shared.mjs);
   markup from tools/pages/hero-gallery.mjs, behavior from hero-gallery.js. The box keeps the hero
   photo's size from building.css (.b-hero-img), so nothing moves as photos load. */
.hero-gal { position: relative; overflow: hidden; background: var(--stone); display: flex; flex-direction: column; }
.hg-track { flex: 1 1 auto; min-height: 0; position: relative; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; outline: none; }
.hg-track::-webkit-scrollbar { display: none; }
.hg-track:focus-visible { box-shadow: inset 0 0 0 3px var(--lake-light, #a9c7d4); }
.hg-slide { flex: 0 0 100%; position: relative; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.b-hero-img .hg-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.hg-slide img { cursor: zoom-in; }
.hg-cap { position: absolute; right: .75rem; bottom: .6rem; max-width: calc(100% - 6.5rem); margin: 0; text-align: right; font-family: var(--font-ui); font-size: var(--fs-2xs); line-height: 1.35; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .7); }
.hg-cap a { color: #fff; }
.hg-count { position: absolute; left: .75rem; bottom: .55rem; margin: 0; padding: .2rem .6rem; border-radius: 999px; background: rgb(15 18 20 / .62); color: #fff; font: 600 var(--fs-xs)/1.4 var(--font-ui); font-variant-numeric: tabular-nums; pointer-events: none; }
.hg-note { flex: none; margin: 0; padding: .55rem .9rem; background: var(--ink); color: #fff; font-family: var(--font-ui); font-size: var(--fs-xs); line-height: 1.4; }

/* Arrows: big, round and always shown, on phones too, so nobody has to guess the photos swipe. */
.hg-btn { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--ink); box-shadow: 0 2px 10px rgb(0 0 0 / .22); cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
.hg-btn[hidden], .hg-full[hidden], .hg-count[hidden] { display: none; }
.hg-btn:hover { background: #fff; }
.hg-btn:active { transform: scale(.94); }
.hg-prev, .hg-dprev { left: .75rem; }
.hg-next, .hg-dnext { right: .75rem; }
.hg-full { position: absolute; top: .75rem; right: .75rem; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgb(15 18 20 / .55); color: #fff; cursor: pointer; transition: background-color .15s ease; }
.hg-full:hover { background: rgb(15 18 20 / .75); }
.hg-btn:focus-visible, .hg-full:focus-visible, .hg-x:focus-visible { outline: 3px solid var(--lake-light, #a9c7d4); outline-offset: 2px; }
@media (max-width: 560px) {
  .hg-btn { width: 44px; height: 44px; margin-top: -22px; }
  .hg-prev { left: .5rem; } .hg-next { right: .5rem; }
  .hg-full { top: .5rem; right: .5rem; }
}

/* Full screen: the same photos, the same arrows, Esc or the close button to leave. */
.hg-dlg { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(10 12 14 / .97); color: #fff; overflow: hidden; }
.hg-dlg[open] { display: grid; place-items: center; }
.hg-dlg::backdrop { background: rgb(10 12 14 / .9); }
.hg-big { display: block; width: calc(100vw - 8rem); height: calc(100vh - 6rem); height: calc(100dvh - 6rem); object-fit: contain; }
.hg-x { position: absolute; top: .75rem; right: .75rem; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: #fff; cursor: pointer; }
.hg-x:hover { background: rgb(255 255 255 / .26); }
.hg-dcount { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); margin: 0; font: 600 var(--fs-sm)/1.4 var(--font-ui); font-variant-numeric: tabular-nums; color: #fff; }
@media (max-width: 760px) {
  .hg-big { width: 100vw; height: calc(100vh - 9rem); height: calc(100dvh - 9rem); }
  .hg-dlg .hg-btn { top: auto; bottom: .75rem; margin-top: 0; }
  .hg-dcount { bottom: 1.6rem; }
}
html:has(.hg-dlg[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .hg-btn, .hg-full { transition: none; } .hg-btn:active { transform: none; } }

/* One photo frame on every tower page (owner, November 12, 2026). On a desktop the frame is 3:2,
   the shape most tower photos are shot in, whatever the length of the tower's name and intro beside it,
   with a row of thumbnails under it (hero-gallery.js builds .hg-col and .hg-thumbs). It never runs
   taller than the window under the header and stays in view (sticky) while the hero text scrolls past.
   Before, the frame took the height of the text column, 936 to 1,118px at 1440x900 depending on the
   tower, and cut half the width off a wide photo. Phones keep their fixed height and get no thumbnails. */
@media (min-width: 901px) {
  .b-hero-img.hero-gal { align-self: start; position: sticky; top: 72px; min-height: 0; height: auto; aspect-ratio: 3 / 2; max-height: calc(100vh - 96px); max-height: calc(100svh - 96px); }
  .hg-col { align-self: start; position: sticky; top: 72px; min-width: 0; padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 3vw, 3rem) 1.5rem 0; }
  .hg-col > .b-hero-img.hero-gal { position: relative; top: auto; border-radius: var(--radius, 4px); max-height: calc(100vh - 230px); max-height: calc(100svh - 230px); }
  .hg-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; }
  .hg-thumb { position: relative; display: block; aspect-ratio: 3 / 2; padding: 0; border: 0; border-radius: var(--radius, 4px); overflow: hidden; background: var(--stone); cursor: pointer; }
  .hg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s ease; }
  .hg-thumb:hover img { opacity: .85; }
  .hg-thumb[aria-current="true"] { box-shadow: 0 0 0 3px var(--lake, #2c5d73); }
  .hg-thumb:focus-visible { outline: 3px solid var(--lake-light, #a9c7d4); outline-offset: 2px; }
  .hg-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(15 18 20 / .55); color: #fff; font: 600 var(--fs-sm, .95rem)/1.2 var(--font-ui, sans-serif); }
}
/* Phones and tablets: the same 3:2 frame across the full width, never more than about half the screen. */
@media (max-width: 900px) {
  .hg-col { display: contents; } .hg-thumbs { display: none; }
  .b-hero-img.hero-gal { height: auto; min-height: 0; aspect-ratio: 3 / 2; max-height: 55vh; max-height: 55svh; }
}
/* A photo far from the frame's shape (portrait or square, about 1 in 12) is shown whole on a blurred,
   dimmed copy of itself instead of cropped hard. hero-gallery.js sets .hg-fit and --hg-bg once the
   photo's own size is known. */
.hg-slide.hg-fit { background: var(--ink, #1b1f22); }
.hg-slide.hg-fit::before { content: ""; position: absolute; inset: -24px; background: var(--hg-bg) center / cover no-repeat; filter: blur(22px) brightness(.72); }
.b-hero-img .hg-slide.hg-fit img { object-fit: contain; object-position: center; }
