/* Short-Form.

   The tall film is the pivot of the composition and is always shown whole, at 9:16. On
   one side stands the name of whatever is playing, in the upright grotesk the site uses
   for things; on the other its running time, at the same scale, in the italic the site
   uses for every time. This is a medium counted in seconds. */

.shorts-entry{
  max-width:none;
  margin:var(--space-section, 96px) auto;
  padding:0;
}
.shorts-entry-copy{margin:0 0 clamp(22px,3vw,36px)}
.shorts-entry-copy .section-rule{margin-bottom:16px}
.shorts-kicker{
  margin:0;
  font-size:12px;
  color:var(--muted, #8a8882);
}
/* The chapter is named by its kicker; the large type belongs to whichever film is playing. */
.sf-heading{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;
}

.sf{
  --film-h:min(78svh,760px);
  --film-w:calc(var(--film-h) * 9 / 16);
  --dir:1;                          /* 1 going on to the next film, -1 going back */
  display:grid;
  grid-template-columns:minmax(0,1.3fr) var(--film-w) minmax(0,.7fr);
  grid-template-rows:auto minmax(0,1fr) auto;
  column-gap:clamp(28px,4.2vw,64px);
}

/* ---------- The name ---------- */
.sf-name{
  grid-column:1;grid-row:1;
  position:relative;
  margin:0;
  container-type:inline-size;
}
.sf-name-set{
  display:block;
  font-family:var(--font-sans);
  font-weight:500;
  letter-spacing:-.055em;
  line-height:.9;
  color:var(--ink);
  font-size:clamp(3rem,15vw,10.5rem);
  font-size:clamp(3rem,calc(100cqw / 3.86),10.5rem);
  margin-left:-.06em;
}
.sf-line{
  /* Each line is a slot the word rolls through when the film changes. */
  display:block;
  overflow:hidden;
  padding:.04em .08em .13em .06em;
  margin:-.04em 0 -.13em;
  white-space:nowrap;
}
.sf-roll{display:block}
.sf-word{display:inline-block}
.sf-name-set.is-leaving{position:absolute;left:0;top:0;right:0;pointer-events:none}

/* ---------- The film ---------- */
.sf-film{grid-column:2;grid-row:1 / 4}
.sv-stage{
  position:relative;
  width:var(--film-w);
  height:var(--film-h);
  background:#0b0c0d;
  overflow:hidden;
  border-radius:4px;
  outline:none;
  touch-action:pan-y;
  -webkit-tap-highlight-color:transparent;
}
.sv-stage:focus-visible{outline:2px solid var(--ink);outline-offset:5px}
.sv-video,
.sv-ghost{
  position:absolute;inset:0;
  width:100%;height:100%;
  display:block;
  object-fit:contain;      /* the box is exactly 9:16, so nothing is cropped and nothing is barred */
  background:#0b0c0d;
}
.sv-ghost{z-index:1;pointer-events:none}
.sv-ghost[hidden]{display:none}
.sv-preload{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.sv-hits{position:absolute;inset:0;z-index:3;display:grid;grid-template-columns:28% 44% 28%}
.sv-hit{appearance:none;border:0;background:transparent;padding:0;margin:0;cursor:pointer}
.sv-hit-left{cursor:w-resize}
.sv-hit-right{cursor:e-resize}
.sv-pause-hint{
  position:absolute;z-index:4;left:50%;top:50%;
  width:64px;height:64px;margin:-32px 0 0 -32px;
  display:grid;place-items:center;
  border-radius:50%;
  background:rgba(12,12,11,.5);
  color:#f7f5f0;font-size:17px;letter-spacing:.08em;
  pointer-events:none;
}
.sv-pause-hint[hidden]{display:none}
.sf.is-closed .sv-stage{opacity:.6}

/* ---------- The running time ---------- */
.sf-time{
  grid-column:3;grid-row:3;
  align-self:end;
  margin:0;
  container-type:inline-size;
  text-align:right;
  line-height:.74;
  color:var(--ink);
}
.sf-time .tc{
  display:inline-block;
  font-size:clamp(4rem,16vw,13rem);
  font-size:clamp(4rem,calc(100cqw / 1.72),13rem);
  letter-spacing:-.02em;
  margin:0 -.03em -.085em 0;
}

/* ---------- Sound and link ---------- */
.sf-side{
  grid-column:3;grid-row:1;
  display:flex;flex-direction:column;align-items:flex-start;gap:14px;
  padding-top:4px;
}
.sv-mute{
  appearance:none;border:0;background:none;padding:0;margin:0;cursor:pointer;
  display:inline-flex;align-items:center;gap:9px;
  font:inherit;font-size:12px;letter-spacing:.01em;color:var(--ink);
}
.sv-mute svg{width:18px;height:18px;display:block;flex:none}
.sv-mute .icon-mute{display:none}
.sv-mute[aria-pressed="true"] .icon-mute{display:block}
.sv-mute[aria-pressed="true"] .icon-unmute{display:none}
.sv-mute:focus-visible{outline:2px solid var(--ink);outline-offset:5px}
.sf .sv-link{
  --underline-rest:rgba(41,42,40,.28);
  font-size:12px;font-weight:500;color:var(--ink);
  display:inline-block;
}
.sf .sv-link[hidden]{display:none}

/* ---------- The four, in the order they play ---------- */
.sf-index{
  grid-column:1;grid-row:3;
  align-self:end;
  display:grid;
  max-width:27rem;
  margin:0;
}
.sv-pick{
  appearance:none;border:0;background:none;margin:0;cursor:pointer;
  position:relative;
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;column-gap:8px;
  padding:11px 0 12px;
  border-top:1px solid var(--line);
  font:inherit;font-size:15px;letter-spacing:-.01em;line-height:1.2;text-align:left;
  color:var(--muted-strong);
  transition:color var(--dur-quick,.2s) ease;
}
.sv-pick:last-child{border-bottom:1px solid var(--line)}
.sv-pick:hover,
.sv-pick[aria-selected="true"]{color:var(--ink)}
.sv-pick:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.sv-pick .tc{font-size:18px;line-height:1}
/* How far through the playing film is, drawn on its own rule. */
.sv-pick::after{
  content:"";
  position:absolute;left:0;right:0;top:-1px;
  height:1px;
  background:var(--ink);
  transform:scaleX(0);
  transform-origin:left center;
}
.sv-pick[aria-selected="true"]::after{transform:scaleX(var(--p,0))}

/* ---------- Changing film: the type rolls, the film slides (shorts.js) ---------- */
@media (prefers-reduced-motion:no-preference){
  @keyframes sf-roll-in{from{transform:translate3d(0,calc(var(--dir) * 108%),0)}}
  @keyframes sf-roll-out{to{transform:translate3d(0,calc(var(--dir) * -108%),0)}}
  .sf-name-set.is-entering .sf-roll{
    animation:sf-roll-in .52s var(--ease) backwards;
    animation-delay:calc(var(--i,0) * 55ms + 40ms);
  }
  .sf-name-set.is-leaving .sf-roll{
    animation:sf-roll-out .3s var(--ease-inout) forwards;
    animation-delay:calc(var(--i,0) * 40ms);
  }
}
/* ---------- Two columns: the film on the right, everything else beside it ---------- */
@media(max-width:1000px){
  .sf{
    --film-h:min(74svh,660px);
    grid-template-columns:minmax(0,1fr) var(--film-w);
    grid-template-rows:auto auto minmax(0,1fr) auto;
    column-gap:clamp(24px,4vw,40px);
    row-gap:18px;
  }
  .sf-name{grid-column:1;grid-row:1}
  .sf-film{grid-column:2;grid-row:1 / 5}
  .sf-side{grid-column:1;grid-row:2}
  .sf-time{grid-column:1;grid-row:3;align-self:end;text-align:left}
  .sf-time .tc{font-size:clamp(4rem,calc(100cqw / 2.6),9rem);margin-left:-.04em}
  .sf-index{grid-column:1;grid-row:4;max-width:none}
}

/* ---------- Phone: a stack, with the time running down the film's side ---------- */
@media(max-width:700px){
  .sf{
    --film-w:min(calc(100vw - 32px - 62px),calc(74svh * 9 / 16));
    --film-h:calc(var(--film-w) * 16 / 9);
    grid-template-columns:var(--film-w) minmax(0,1fr);
    grid-template-rows:auto auto auto auto;
    column-gap:12px;
    row-gap:14px;
  }
  /* One line whatever the name, so nothing is held empty above it and the film does not
     move when the name changes. */
  .sf-name{grid-column:1 / 3;grid-row:1}
  .sf-name-set{font-size:clamp(2.2rem,14.4vw,4.6rem);font-size:clamp(2.2rem,calc(100cqw / 6.5),4.6rem);white-space:nowrap}
  .sf-line{display:inline-block;vertical-align:bottom}
  .sf-line + .sf-line{margin-left:.2em}
  .sf-film{grid-column:1;grid-row:2}
  .sf-side{display:contents}
  .sv-mute{grid-column:2;grid-row:2;align-self:start;justify-self:center;padding:6px}
  .sv-mute-label{display:none}
  .sv-mute svg{width:22px;height:22px}
  .sf-time{
    grid-column:2;grid-row:2;
    align-self:end;justify-self:center;
    writing-mode:vertical-rl;
    text-align:left;
    line-height:1;
    container-type:normal;
  }
  .sf-time .tc{font-size:clamp(3rem,13.5vw,3.6rem);margin:0}
  .sf .sv-link{grid-column:1 / 3;grid-row:3;justify-self:start}
  .sf-index{grid-column:1 / 3;grid-row:4}
  .sv-pick{padding:13px 0 14px;font-size:16px}
}
