/* The film — canvas board "2 · Video". */

.sgf {
  background: var(--sg-page);
  padding: var(--page-gutter) 0;
}

.sgf.has-sec-bg { background-color: var(--sg-page) !important; }

.sgf__in {
  margin-inline: var(--page-gutter);
  border-radius: var(--panel-r);
  overflow: hidden;
}

.sgf__frame {
  position: relative;
  /* Wider than the film: a cinematic strip, about 2.4 to 1. The film is
     cropped top and bottom to fill it (object-fit: cover below). */
  aspect-ratio: 12 / 5;
  background: var(--sec-bg, var(--plum));
  display: grid;
  place-items: center;
}

.sgf__poster { position: absolute; inset: 0; }
.sgf__poster img { width: 100%; height: 100%; object-fit: cover; object-position: var(--sgf-pos, 50% 50%); }

.sgf__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the crop position set in the Panel */
  object-position: var(--sgf-pos, 50% 50%);
  background: #000;
}

.sgf__play {
  position: relative;
  z-index: 2;
  width: clamp(64px, 7.5vw, 96px);
  height: clamp(64px, 7.5vw, 96px);
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--amber);
  color: var(--plum);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--yel);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

/* The glyph is nudged right because a triangle's optical centre is left of its
   bounding box, and dead-centring it reads as off. */
.sgf__play svg { width: 31%; height: auto; margin-left: 8%; }

.sgf__play:hover { background: var(--cream); transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--yel); }
.sgf__play:active { transform: translate(6px, 6px); box-shadow: 0 0 0 var(--yel); }
.sgf__frame.is-playing .sgf__play,
.sgf__frame.is-playing .sgf__poster { display: none; }

/* Playing on its own: the big play button is not needed. */
.sgf__frame.is-auto .sgf__play { display: none; }

/* the small pause button in the corner, a sticker like the rest */
.sgf__toggle {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--amber);
  color: var(--plum);
  box-shadow: 3px 3px 0 var(--yel);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: translate .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.sgf__toggle svg { width: 18px; height: 18px; }
.sgf__toggle:hover { background: var(--cream); translate: 2px 2px; box-shadow: 1px 1px 0 var(--yel); }
.sgf__toggle:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

/* On a phone the strip would be a sliver, so it goes back to 16:9. */
@media (max-width: 760px) {
  .sgf__frame { aspect-ratio: 16 / 9; }
  .sgf__toggle { right: 12px; bottom: 12px; width: 38px; height: 38px; }
}

.sgf__frame--empty { background: var(--sec-bg, var(--plum)); }

.sgf__note {
  margin: 0;
  padding: 0 24px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 2;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 45%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .sgf__play { transition: background-color .18s ease; }
  .sgf__play:hover, .sgf__play:active { transform: none; }
}
