/* Inline theatre (direction B §5.6): the film grows where it sits; night dims what is under it to 35%. Tokens live in system.css. */

.field.is-theatre {
  z-index: 60;
}
/* The reel's player is the field: a night backing with the 16:9 picture centred in it. The box holds the picture and its controls. */
.band__player {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--night);
  transform-origin: 0 0;
  container-type: size;
}
.band__box {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100cqw, calc(100cqh * 16 / 9));
  height: min(100cqh, calc(100cqw * 9 / 16));
}

.theatre-dim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--night);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--fall) linear;
}
.theatre-dim.is-on {
  opacity: 0.65;
}

.theatre-player {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 200ms linear;
}
.theatre-player.is-ready {
  opacity: 1;
}

/* An open film takes the room its placement gives a theatre, at 16:9: its grid cell, or its wrapper's, spans the row. */
.film.is-open {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.brief__frame:has(> .film.is-open),
.case__film:has(> .film.is-open) {
  grid-column: 1 / -1;
}
.row__media:has(> .film.is-open) {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}
/* js/music.js sets each wall tile's width in --w; an open tile takes the whole wall row over it. */
.wall.is-justified > .tile:has(> .film.is-open) {
  width: 100%;
}
.row:has(> .row__media > .film.is-open) > :not(.row__media) {
  grid-row: auto;
}
.theatre-close {
  --hh: 44px;
  position: absolute;
  left: calc(var(--hh) * 2.25);
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  height: var(--hh);
  padding: 0 calc(var(--hh) * 0.25 + 14px) 0 20px;
  font-size: 14px;
  line-height: 1;
  font-variation-settings:
    'wdth' 100,
    'wght' 650;
}
/* Keyboard focus draws the tab's own ring: a 2px polygon outside the control. A pointer open draws none. */
.theatre-close:focus-visible {
  outline: none;
}
.theatre-close:focus-visible::after {
  --k: 2px;
  content: '';
  position: absolute;
  inset: -5px;
  z-index: -2;
  background: var(--night-ink);
  clip-path: polygon(
    evenodd,
    0 0,
    calc(100% - var(--s)) 0,
    100% 100%,
    0 100%,
    0 0,
    var(--k) var(--k),
    calc(100% - var(--s) - var(--k) * 0.78) var(--k),
    calc(100% - var(--k) * 1.28) calc(100% - var(--k)),
    var(--k) calc(100% - var(--k)),
    var(--k) var(--k)
  );
}
/* On phone the player's progress rail sits low in a 16:9 frame: the close steps down into the controls row, clear of it. */
@media (max-width: 599px) {
  .theatre-close {
    --hh: 36px;
    left: 99px;
    bottom: 4px;
  }
}
