/* ── The photographs of one record ────────────────────────────────────────────────────────────
 * A record's shots as a row of square thumbnails, each a link to its own full-size file, and the
 * viewer the site's gallery behaviour drives. The same strip is printed on a fabric page and on
 * a customization option, so it is written once here rather than in either page's own sheet —
 * a square crop, a hairline, no shadow, and the site's own square corners.
 */
.shots { margin: 0 }

.shots__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s2);
  margin: 0;
}

.shots__item {
  display: block;
  border: 1px solid var(--op-line);
  background: var(--op-white);
  overflow: hidden;
}

.shots__item:focus-visible {
  outline: 2px solid var(--op-accent);
  outline-offset: 2px;
}

.shots__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--op-white);
}

/* ── Under one big photograph ─────────────────────────────────────────────────────────────────
 * On a product or option page every picture lives in the hero: the first one in the big frame,
 * the rest as small squares under it. The stack keeps the two from drifting apart when the
 * column is wider than the frame's ratio.
 */
.bld-hero__stack,
.record-hero__stack {
  display: grid;
  gap: var(--s2);
  align-content: start;
  margin: 0;
}

.shots--compact .shots__row {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px;
}

/* ── The big frame, and the two buttons that step through it ──────────────────────────────────
 * The photograph on show is fitted whole into its page's own frame — the build page's landscape
 * on a fabric or option page — and the controls sit on the bottom of it, so the arrows are where
 * the eye already is and never push the layout down. The behaviour keeps every other slide out of
 * flow, so the frame is always the height of one photograph.
 */
.shot-flip {
  position: relative;
  display: block;
  margin: 0;
}

.shot-flip [hidden] { display: none !important }

.shot-flip__frame {
  position: relative;
  margin: 0;
}

/* On a build page the frame is the hero's landscape box, so the flip fills it — and so does every
   slide and the link inside it. Without a height of their own these fall back to the photograph's
   own ratio, so a square shot grew taller than the four-three frame and was cut off at its foot
   instead of being fitted whole and centred in it, the way the thumbnails under the frame are. */
.bld-hero__media .shot-flip,
.bld-hero__media .shot-flip__frame,
.bld-hero__media .shot-flip__slide,
.bld-hero__media .shot-flip__open { height: 100% }

.shot-flip__img {
  display: block;
  width: 100%;
}

/* The photograph on show is itself the way into the viewer — the whole frame is the button.
   The cue is the cursor, and nothing is drawn over the picture. */
.shot-flip__open { display: block; cursor: zoom-in }
.shot-flip__open:focus-visible { outline: 2px solid var(--op-warm); outline-offset: 2px }

.shot-flip__bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: .45rem .55rem;
  background: linear-gradient(to top, rgb(9 20 28 / .8), rgb(9 20 28 / 0));
  color: var(--op-white);
}

.shot-flip__count {
  margin: 0;
  font-size: var(--op-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: rgb(255 255 255 / .92);
}

.shot-flip__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: .25rem .6rem;
  border: 1px solid rgb(255 255 255 / .55);
  border-radius: 0;
  background: rgb(9 20 28 / .55);
  color: var(--op-white);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.shot-flip__btn:hover { background: rgb(9 20 28 / .84) }

.shot-flip__btn:focus-visible {
  outline: 2px solid var(--op-warm);
  outline-offset: 2px;
}

/* The viewer: a plain frame on the site's deep blue, the photo inside it uncropped.
   The frame is centred on the window, not on the card it was opened from: a modal dialog is put in
   the top layer and is placed there by `position: fixed` with `inset: 0` and `margin: auto`. This
   rule used to name `position: relative`, which took the dialog back out of that placement — it then
   opened at the card's own place in the page, scrolled with the page and lost its top half above the
   top of the screen. `height: fit-content` is what makes the two auto margins centre it instead of
   the frame stretching to the whole window. */
.shots__viewer {
  position: fixed;
  inset: 0;
  width: min(92vw, 1080px);
  height: fit-content;
  max-width: none;
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--op-deep);
  color: var(--op-white);
}

.shots__viewer::backdrop { background: rgb(9 20 28 / .84) }

.shots__big {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: var(--op-deep);
}

.shots__cap {
  margin: 0;
  padding: var(--s2) var(--s3) 0;
  font-size: var(--op-small);
  line-height: 1.55;
  color: rgb(255 255 255 / .76);
}

.shots__close,
.shots__btn {
  appearance: none;
  border: 1px solid rgb(255 255 255 / .32);
  border-radius: 0;
  background: transparent;
  color: var(--op-white);
  font: inherit;
  font-size: var(--op-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .55rem .9rem;
  cursor: pointer;
}

.shots__close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  background: var(--op-deep);
}

.shots__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding: var(--s2) var(--s3) var(--s3);
}

.shots__close:hover,
.shots__btn:hover { background: rgb(255 255 255 / .14) }

.shots__close:focus-visible,
.shots__btn:focus-visible {
  outline: 2px solid var(--op-warm);
  outline-offset: 2px;
}
