/* More websites: sites alternating between one across the column,
   scrolling in a browser window, and two side by side as clipped previews;
   and the viewer for the whole page. The layout is shared (../case.css). */

.shot {
  width: 100%;
}

.shot-scroll {
  aspect-ratio: 5 / 4;
}

.shot-preview {
  aspect-ratio: 4 / 5;
}

.stage {
  position: relative;
  overflow: hidden;
  padding: 9% 9% 0;
  background: var(--bg);
}

.shot-scroll .stage {
  padding: clamp(20px, 6%, 64px) clamp(20px, 9%, 110px) 0;
}

/* the page hangs off the bottom edge, so extra height goes above it */
.shot > .stage {
  justify-content: flex-end;
}

/* a film of a desktop site, whole in its window, in the middle of the slide */
.shot-film > .stage {
  justify-content: center;
  padding: clamp(20px, 7%, 80px) clamp(20px, 9%, 110px);
}

/* a window with as much of the page as fits */
.page {
  position: relative;
  flex: 1;
  min-height: 0;
  /* a button centres its content by default; the page starts at its top */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  /* grows from its bottom edge, which stays on the slide's edge */
  transform-origin: 50% 100%;
  transition: scale 0.5s var(--ease-out);
}

.page img {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
}

@media (hover: hover) {
  /* a hint that it opens larger */
  .page:hover {
    scale: 1.012;
  }
}

.page:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ── The scrolling slides: a browser window the page scrolls in ── */

.window {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* browser chrome: a bar with three dots */
.window::before,
.viewer-window.has-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 26px;
  background:
    radial-gradient(circle at 16px 13px, #d9d6cf 4px, transparent 4.5px),
    radial-gradient(circle at 30px 13px, #d9d6cf 4px, transparent 4.5px),
    radial-gradient(circle at 44px 13px, #d9d6cf 4px, transparent 4.5px),
    #f4f2ee;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.window img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 26px;
}

.window-film {
  flex: none;
  border-radius: 10px;
}

.window-film video {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 26px;
}

/* the expand button, in the bar, top right */
.expand {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  color: #8d8a82;
  cursor: pointer;
  transition: color 0.2s;
}

.expand:hover,
.expand:focus-visible {
  color: #23221f;
}

.expand svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 699px) {
  .shot-scroll {
    aspect-ratio: 2 / 3;
  }

  .shot-scroll .stage {
    padding: 24px 20px 0;
  }

  .window::before {
    height: 18px;
    background:
      radial-gradient(circle at 11px 9px, #d9d6cf 3px, transparent 3.5px),
      radial-gradient(circle at 21px 9px, #d9d6cf 3px, transparent 3.5px),
      radial-gradient(circle at 31px 9px, #d9d6cf 3px, transparent 3.5px),
      #f4f2ee;
  }

  .window img,
  .window-film video {
    margin-top: 18px;
  }

  .shot-film > .stage {
    padding: 24px 20px;
  }

  .expand {
    width: 30px;
    height: 18px;
  }

  .expand svg {
    width: 12px;
    height: 12px;
  }
}

/* ── The viewer: the page in a large window, scrolled by hand ── */

.viewer {
  --dim: 1;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px clamp(16px, 5vw, 64px) 0;
  border: 0;
  background: none;
  overflow: hidden;
}

.viewer[open] {
  display: flex;
  justify-content: center;
}

.viewer::backdrop {
  background: none;
}

/* the dim behind the window is a layer of the dialog rather than its ::backdrop, so it can fade (--dim) */
.viewer::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(20, 19, 17, calc(0.72 * var(--dim)));
}

.viewer-window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1200px);
  height: 100%;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.35);
  transform-origin: 0 0;
}

.viewer-window.has-bar .viewer-scroll {
  margin-top: 26px;
}

.viewer-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
}

.viewer-scroll img {
  display: block;
  width: 100%;
  height: auto;
}

.viewer-close {
  position: absolute;
  top: 24px;
  right: clamp(16px, 2vw, 24px);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #23221f;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.viewer-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* the page behind stays put while the viewer is open */
.is-viewing,
.is-viewing body {
  overflow: hidden;
}

@media (max-width: 699px) {
  .viewer {
    padding: 64px 12px 0;
  }

  .viewer-close {
    top: 12px;
    right: 12px;
  }
}
