/* Listing media: 3D coverflow gallery, film, embedded 3D area view, full-screen photo viewer, one-pager button.
   Loaded after site.css. Positions that depend on the photo's place in the coverflow come from CSS variables
   set by coverflow.js (--offset, --abs: distance from the front photo, --side: -1, 0 or 1). */

/* ---------- coverflow ---------- */
.cf-section { overflow: hidden; color: var(--ink); background: radial-gradient(120% 70% at 50% 100%, var(--gold-900) 0%, var(--noir-900) 62%); }
.cf {
  --cf-w: min(80vw, 640px, 84vh);
  --cf-h: calc(var(--cf-w) * 2 / 3);
  --cf-top: var(--space-8);
  --cf-tilt: 34deg;
  --cf-spread: 0.17;
  --cf-depth: 300px;
  position: relative;
  height: calc(var(--cf-top) + var(--cf-h) * 1.42);
  margin-inline: calc(50% - 50vw); /* full bleed: side photos run to the screen edges */
  perspective: 1600px;
  perspective-origin: 50% 35%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
@media (min-width: 768px) { .cf { --cf-w: min(56vw, 680px, 84vh); --cf-tilt: 38deg; --cf-spread: 0.19; } }
@media (min-width: 1280px) { .cf { --cf-w: min(720px, 84vh); } }
/* Horizon line where the photos stand, and a warm glow on the floor. */
.cf::before { content: ""; position: absolute; inset-inline: 0; top: calc(var(--cf-top) + var(--cf-h) + 3px); height: 1px; background: linear-gradient(90deg, transparent, #d3bc8e4d 30%, #d3bc8e4d 70%, transparent); }
.cf::after { content: ""; position: absolute; inset-inline: 10%; top: calc(var(--cf-top) + var(--cf-h)); height: 40%; background: radial-gradient(50% 60% at 50% 0%, #b8995f26, transparent 70%); pointer-events: none; }

.cf__track { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; transform-style: preserve-3d; }
.cf__item {
  position: absolute;
  top: var(--cf-top);
  left: 50%;
  width: var(--cf-w);
  height: var(--cf-h);
  margin-left: calc(var(--cf-w) / -2);
  transform:
    translateX(calc(var(--side) * var(--cf-w) * (0.28 + var(--abs) * var(--cf-spread))))
    translateZ(calc(var(--abs) * var(--cf-depth) * -1))
    rotateY(calc(var(--side) * var(--cf-tilt) * -1));
  opacity: calc(1 - var(--abs) * 0.16);
  z-index: calc(10 - var(--abs));
  transition: transform .9s cubic-bezier(.2, .75, .2, 1), opacity .7s ease, visibility 0s;
}
.cf__item.is-offstage { opacity: 0; visibility: hidden; pointer-events: none; transition: transform .9s cubic-bezier(.2, .75, .2, 1), opacity .5s ease, visibility 0s .5s; }

.cf__card {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid #d3bc8e33;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--noir-800);
  box-shadow: 0 40px 60px -30px #000000e6, 0 0 0 1px #00000066;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cf__item.is-active .cf__card { cursor: zoom-in; border-color: #d3bc8e66; }
.cf__card:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--noir-900), 0 0 0 4px var(--gold-300), 0 40px 60px -30px #000000e6; }
.cf__img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
/* Side photos sit in shade; the front photo gets one light sweep when it arrives. */
.cf__card::before { content: ""; position: absolute; inset: 0; background: var(--noir-950); opacity: calc(var(--abs) * 0.2); transition: opacity .9s ease; pointer-events: none; }
.cf__card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #fdfbf72e 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }
.cf__item.is-active .cf__card::after { animation: cf-sheen 1.6s ease-out .45s both; }
.cf__item.is-active .cf__img { animation: cf-drift 16s ease-in-out infinite alternate; }

/* Mirror reflection on the floor: the same photo, flipped, fading out. */
.cf__mirror {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  height: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  transform: scaleY(-1);
  opacity: .34;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000000d9 0%, transparent 48%);
  mask-image: linear-gradient(to top, #000000d9 0%, transparent 48%);
}
.cf__item--broken .cf__img { visibility: hidden; }
.cf__item--broken .cf__card { background: linear-gradient(180deg, var(--noir-800), var(--noir-950)); }

.cf__nav {
  position: absolute;
  top: calc(var(--cf-top) + var(--cf-h) / 2);
  z-index: 20;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #d3bc8e59;
  border-radius: var(--radius-arch);
  background: #0f0e0cb3;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ivory-100);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.cf__nav:hover { background: #2a2418e6; border-color: var(--gold-300); }
.cf__nav:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--noir-900), 0 0 0 4px var(--gold-300); }
.cf__nav--prev { inset-inline-start: max(var(--space-gutter), calc(50% - var(--cf-w) / 2 - 76px)); }
.cf__nav--next { inset-inline-end: max(var(--space-gutter), calc(50% - var(--cf-w) / 2 - 76px)); }
@media (max-width: 767px) {
  .cf__nav { width: 44px; height: 44px; top: calc(var(--cf-top) + var(--cf-h) + var(--space-8)); }
}

.cf__meta { position: relative; display: grid; justify-items: center; gap: var(--space-2); margin-top: calc(var(--space-4) * -1); text-align: center; }
.cf__count { margin: 0; font-family: var(--font-heading); letter-spacing: .14em; color: var(--ink-muted); }
.cf__count b { font-weight: 400; font-size: var(--text-h3); color: var(--gold-300); }
.cf__caption { min-height: var(--leading-small); max-width: 52ch; margin: 0; color: var(--ink-soft); }
.cf__dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; }
.cf__play { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-inline-end: var(--space-2); padding: 0; border: 1px solid #d3bc8e59; border-radius: var(--radius-arch); background: #0f0e0cb3; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.cf__play:hover { border-color: var(--gold-300); background: #2a2418e6; }
.cf__play:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--noir-900), 0 0 0 4px var(--gold-300); }
.cf__play .view3d__glyph { width: 10px; height: 10px; }
.cf__play .view3d__glyph--pause { border-left-width: 3px; border-right-width: 3px; }
.cf__play .view3d__glyph--play { width: 0; height: 0; border-width: 5px 0 5px 9px; }
.cf__dot { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.cf__dot::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-arch); background: var(--noir-500); transition: width .3s ease, background-color .3s ease; }
.cf__dot[aria-current="true"]::before { width: 22px; background: var(--gold-300); }
.cf__dot:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold-300); border-radius: var(--radius-control); }

@keyframes cf-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-2%, -1.5%); } }
@keyframes cf-sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* ---------- film ---------- */
.film-section { background: var(--noir-950); color: var(--ink); }
.film {
  position: relative;
  width: min(100%, calc(78vh * var(--film-w) / var(--film-h)));
  aspect-ratio: var(--film-w) / var(--film-h);
  margin: 0 auto;
  border: 1px solid #d3bc8e33;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
  box-shadow: 0 50px 80px -40px #000, 0 0 120px -40px #b8995f40;
}
.film__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.film__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-4);
  padding: 0;
  border: 0;
  background: radial-gradient(60% 60% at 50% 50%, #08080733, #080807a6);
  color: var(--ivory-100);
  cursor: pointer;
  transition: opacity .35s ease;
}
.film__ring { position: relative; display: grid; place-items: center; width: 88px; height: 88px; border: 1px solid var(--gold-300); border-radius: var(--radius-arch); background: #0f0e0c80; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .3s ease, background-color .3s ease; }
.film__ring::after { content: ""; position: absolute; inset: -1px; border: 1px solid var(--gold-300); border-radius: inherit; animation: film-pulse 2.6s ease-out infinite; }
/* Physical borders on purpose: a play triangle points right in every language. */
.film__triangle { width: 0; height: 0; margin-left: 6px; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent var(--gold-300); }
.film__label { font-family: var(--font-heading); font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: var(--case-eyebrow); text-shadow: 0 1px 12px #000; }
.film__play:hover .film__ring { transform: scale(1.06); background: #2a2418cc; }
.film__play:focus-visible { outline: none; }
.film__play:focus-visible .film__ring { box-shadow: 0 0 0 2px var(--noir-900), 0 0 0 4px var(--gold-300); }
.film.is-playing .film__play { opacity: 0; pointer-events: none; }
.film__video:focus-visible { outline: 2px solid var(--gold-300); outline-offset: -2px; }
@keyframes film-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.45); opacity: 0; } }

/* ---------- embedded 3D area view ---------- */
.area3d-section { background: var(--noir-950); color: var(--ink); }
.area3d {
  position: relative;
  height: clamp(420px, 72vh, 760px);
  border: 1px solid #d3bc8e33;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: radial-gradient(80% 80% at 50% 40%, var(--noir-800), var(--noir-950));
  box-shadow: 0 50px 80px -40px #000;
}
.area3d::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, #d3bc8e14 50%, transparent 70%) 0 0 / 200% 100%; animation: area3d-wait 2.4s linear infinite; }
.area3d__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.area3d__note { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-4) 0 0; color: var(--ink-soft); }
.area3d__note .mc-icon { flex: none; margin-top: 3px; color: var(--gold-300); }
@keyframes area3d-wait { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* The 3D page itself when shown inside that frame, and its tour controls. */
.view3d--embed { background: var(--noir-950); overflow: hidden; }
.view3d--embed .view3d__page { grid-template-rows: 1fr; }
.view3d--embed .view3d__stage { background: transparent; }
.view3d__overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* Physical sides on purpose: they keep clear of Google's own controls, which do not mirror. */
.view3d__chip { position: absolute; left: var(--space-4); top: var(--space-4); display: inline-flex; align-items: center; gap: var(--space-2); max-width: calc(100% - 2 * var(--space-4)); margin: 0; padding: 6px 14px 6px 10px; border: 1px solid #d3bc8e40; border-radius: var(--radius-arch); background: #0f0e0cb3; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ivory-100); }
.view3d__chip .mc-icon { flex: none; color: var(--gold-300); }
.view3d__controls { position: absolute; left: var(--space-4); bottom: var(--space-4); display: flex; gap: var(--space-2); pointer-events: auto; }
.view3d__btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-width: 44px; min-height: 44px; padding: 0 var(--space-3); border: 1px solid #d3bc8e59; border-radius: var(--radius-arch); background: #0f0e0cb3; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--ivory-100); font-family: var(--font-heading); font-size: var(--text-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: var(--case-eyebrow); cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.view3d__btn:hover { background: #2a2418e6; border-color: var(--gold-300); }
.view3d__btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--noir-900), 0 0 0 4px var(--gold-300); }
.view3d__btn-label:empty { display: none; }
@media (max-width: 479px) { .view3d__btn-label { display: none; } .view3d__btn { padding: 0; } }
.view3d__glyph { position: relative; display: inline-block; flex: none; width: 14px; height: 14px; color: var(--gold-300); }
.view3d__glyph--pause { box-sizing: border-box; width: 12px; border-left: 4px solid; border-right: 4px solid; }
.view3d__glyph--play { width: 0; height: 0; margin-left: 2px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent currentColor; }
.view3d__glyph--replay { box-sizing: border-box; border: 2px solid; border-top-color: transparent; border-radius: 50%; }
.view3d__glyph--replay::after { content: ""; position: absolute; top: -3px; right: -1px; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent currentColor; transform: rotate(35deg); }
.view3d__glyph--fullscreen {
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 5px 2px, linear-gradient(currentColor, currentColor) 0 0 / 2px 5px,
    linear-gradient(currentColor, currentColor) 100% 0 / 5px 2px, linear-gradient(currentColor, currentColor) 100% 0 / 2px 5px,
    linear-gradient(currentColor, currentColor) 0 100% / 5px 2px, linear-gradient(currentColor, currentColor) 0 100% / 2px 5px,
    linear-gradient(currentColor, currentColor) 100% 100% / 5px 2px, linear-gradient(currentColor, currentColor) 100% 100% / 2px 5px;
  background-repeat: no-repeat;
}

/* ---------- full-screen photo viewer ---------- */
.viewer--photos { inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; overflow: hidden; }
.viewer--photos::backdrop { background: #080807f5; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.viewer--photos .viewer__close { top: var(--space-4); inset-inline-end: var(--space-4); z-index: 3; border-radius: var(--radius-arch); border-color: #d3bc8e59; background: #0f0e0cb3; }
.viewer--photos .viewer__stage { box-sizing: border-box; height: 100%; grid-template-rows: minmax(0, 1fr) auto auto; justify-items: stretch; gap: var(--space-3); padding: var(--space-16) var(--space-4) var(--space-4); }
.viewer__photo { position: relative; display: grid; min-height: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.viewer__photo .viewer__img { grid-area: 1 / 1; width: 100%; height: 100%; max-height: none; object-fit: contain; opacity: 0; transition: opacity .7s ease; }
.viewer__photo .viewer__img.is-shown { opacity: 1; animation: viewer-zoom 14s ease-out both; }
.viewer--photos .viewer__nav { z-index: 2; border: 1px solid #d3bc8e59; border-radius: var(--radius-arch); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.viewer--photos .viewer__nav:hover { background: #2a2418e6; border-color: var(--gold-300); }
.viewer__meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: var(--space-1) var(--space-4); text-align: center; }
.viewer__meta p { margin: 0; }
.viewer--photos .viewer__count { font-family: var(--font-heading); letter-spacing: .14em; color: var(--gold-300); }
.viewer__thumbs { display: flex; gap: var(--space-2); overflow-x: auto; padding: 4px; scrollbar-width: none; }
.viewer__thumbs::-webkit-scrollbar { display: none; }
.viewer__thumb:first-child { margin-inline-start: auto; } /* centred while they fit, scrollable when they don't */
.viewer__thumb:last-child { margin-inline-end: auto; }
.viewer__thumb { flex: none; width: 76px; height: 54px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-control); overflow: hidden; background: var(--noir-800); opacity: .5; cursor: pointer; transition: opacity .25s ease, border-color .25s ease; }
.viewer__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewer__thumb:hover { opacity: .85; }
.viewer__thumb[aria-current="true"] { opacity: 1; border-color: var(--gold-300); }
.viewer__thumb:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--gold-300); }
@media (max-width: 767px) { .viewer--photos .viewer__stage { padding-inline: 0; } .viewer--photos .viewer__nav { display: none; } }
@keyframes viewer-zoom { from { transform: scale(1); } to { transform: scale(1.05); } }

/* ---------- price per m², one-pager button ---------- */
.mc-price-card__unit { margin: calc(var(--space-2) * -1) 0 0; font-family: var(--font-heading); font-size: var(--text-small); letter-spacing: .06em; color: var(--accent-text); }
.pdf-btn[aria-disabled="true"] { cursor: progress; opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  .cf__item, .cf__item.is-offstage, .cf__card::before, .viewer__photo .viewer__img, .film__play, .film__ring { transition-duration: .01s; transition-delay: 0s; }
  .cf__item.is-active .cf__img, .cf__item.is-active .cf__card::after, .viewer__photo .viewer__img.is-shown, .film__ring::after, .area3d::before { animation: none; }
}
