/* eSKay Productions: the pieces every video page uses.
   1. The video card (thumbnail with the title under it)
   2. The bubble that pops up and plays a video
   3. The layout of a category page (heading, grid of cards, buttons at the foot)
   Needs /assets/site.css loaded first. */

/* ================= 1. the video card ================= */
/* steel edge with two corners machined off, like the lit buttons. Its sizes follow --cw,
   the width of the card, which the carousel or grid around it sets. */
.card-btn {
  --cut: clamp(14px, calc(var(--cw) * .034), 26px);
  display: block;
  width: 100%;
  padding: 2px;
  border: 0;
  cursor: pointer;
  text-align: left;
  background: var(--steel-edge);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.card-btn:focus-visible { outline: none; background: var(--eggshell); }
.card-in {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #1d1e21 0%, #0c0c0e 100%);
  clip-path: polygon(calc(var(--cut) - 1px) 0, 100% 0, 100% calc(100% - var(--cut) + 1px), calc(100% - var(--cut) + 1px) 100%, 0 100%, 0 calc(var(--cut) - 1px));
}
.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out);
  -webkit-user-drag: none;
  user-select: none;
}
.card-btn:hover .thumb img, .card-btn:focus-visible .thumb img { transform: scale(1.045); }
.thumb::after { /* a little shade at the foot of the picture so the running time reads */
  content: "";
  position: absolute;
  inset: 60% 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55));
  pointer-events: none;
}
/* play dial: appears when the card is pointed at */
.play {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 1;
  width: clamp(48px, calc(var(--cw) * .115), 88px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.8);
  opacity: 0;
  background: conic-gradient(from 200deg, #f4f5f6, #7b7f86, #26272b, #c9ccd1, #54575d, #f4f5f6, #8a8e95, #2c2d31, #dcdee1, #f4f5f6);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .7);
  transition: transform .35s var(--ease-out), opacity .35s;
}
.play::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 22%, #33343a 0%, #0d0d0e 62%, #000 100%);
  box-shadow: inset 0 0 18px rgba(224, 32, 27, .6);
  transition: box-shadow .3s;
}
.play::after {
  content: "";
  position: absolute;
  left: 39%; top: 31%;
  width: 30%; height: 38%;
  background: var(--eggshell);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: background-color .3s;
}
.card-btn:hover .play, .card-btn:focus-visible .play { opacity: 1; transform: translate(-50%, -50%); }
.card-btn:hover .play::before, .card-btn:focus-visible .play::before { box-shadow: inset 0 0 26px rgba(255, 42, 28, .95); }
.card-btn:hover .play::after, .card-btn:focus-visible .play::after { background: var(--red-hot); }
.dur, .covered {
  position: absolute;
  z-index: 1;
  font-size: clamp(11px, calc(var(--cw) * .018), 13.5px);
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
}
.dur { right: 10px; bottom: 9px; padding: 5px 7px; background: rgba(0, 0, 0, .78); font-variant-numeric: tabular-nums; }
.covered {
  left: 0; top: clamp(14px, calc(var(--cw) * .04), 30px);
  padding: 6px 12px 6px 10px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ee2c22, #a30d0c);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.cap { display: block; padding: clamp(10px, calc(var(--cw) * .022), 17px) clamp(12px, calc(var(--cw) * .028), 22px) clamp(13px, calc(var(--cw) * .028), 22px); }
.cap-name {
  display: block;
  font-size: clamp(15px, calc(var(--cw) * .032), 24.5px);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.12;
  text-transform: uppercase;
  color: #fcf8ea;
  text-wrap: balance;
}
.cap-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: .55em;
  font-size: clamp(10.5px, calc(var(--cw) * .0172), 13.5px);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}
.cap-meta:empty { display: none; }
.cap-client { color: #ff5648; }
.cap-tag { color: var(--steel); }
.cap-client + .cap-tag { padding-left: 12px; border-left: 1px solid rgba(241, 242, 244, .35); }
@media (max-width: 900px) {
  .cap-meta { flex-direction: column; }
  .cap-client + .cap-tag { padding-left: 0; border-left: 0; }
}

/* ================= 2. the bubble: a video, its title and what Sean did on it ================= */
.bubble {
  --ar: 1.7778; /* shape of the video, width over height */
  width: min(94vw, 1080px, calc(58svh * var(--ar)));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  overflow: visible;
  color: var(--eggshell);
  background: none;
}
.bubble.is-rich { width: min(94vw, 1080px, calc(43svh * var(--ar))); }
.bubble.is-tall { width: fit-content; max-width: 94vw; }
.bubble::backdrop {
  background: rgba(10, 3, 5, .74);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}
.bubble[open] { animation: bubble-in .55s cubic-bezier(.3, 1.35, .5, 1) both; }
.bubble[open]::backdrop { animation: fade .4s both; }
.bub-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2vh, 22px);
  max-height: 94svh;
  padding: clamp(12px, 1.4vw, 18px);
  overflow: auto;
  border-radius: clamp(24px, 3vw, 40px);
  background: linear-gradient(140deg, rgba(255, 255, 255, .2) 0%, rgba(60, 14, 20, .55) 30%, rgba(18, 14, 16, .72) 64%, rgba(255, 255, 255, .13) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(1.8);
  backdrop-filter: blur(26px) saturate(1.8);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .62),
    inset 1.5px 0 0 rgba(255, 255, 255, .24),
    inset 0 -1.5px 0 rgba(255, 255, 255, .16),
    inset -1.5px 0 0 rgba(255, 255, 255, .1),
    inset 0 30px 44px -30px rgba(255, 255, 255, .28),
    inset 0 -50px 70px -46px rgba(224, 32, 27, .5),
    0 0 70px rgba(255, 42, 28, .22),
    0 40px 90px -20px rgba(0, 0, 0, .9);
}
.bub-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ar);
  overflow: hidden;
  border-radius: clamp(14px, 1.9vw, 24px);
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 14px 34px rgba(0, 0, 0, .6);
}
.bub-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bub-info { padding: 0 clamp(6px, 1vw, 14px) clamp(8px, 1vw, 14px); }
.bub-name {
  margin: 0;
  font-size: clamp(20px, 2.5vw, 34px);
  font-weight: 900;
  font-stretch: 118%;
  line-height: 1.06;
  text-transform: uppercase;
  color: #fcf8ea;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.bub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: .7em 0 0;
  font-size: clamp(11.5px, 1.1vw, 14.5px);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.bub-meta .cap-tag { color: #c5c8ce; }
.bub-meta .cap-client + .cap-tag { padding-left: 12px; border-left: 1px solid rgba(241, 242, 244, .35); }
.bub-rows { display: grid; gap: clamp(12px, 1.6vh, 18px); margin-top: clamp(14px, 2vh, 22px); }
.bub-label {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: .02em;
  color: rgba(240, 234, 214, .78);
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 7px 12px 6px;
  font-size: clamp(11.5px, 1.05vw, 13.5px);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: .09em;
  line-height: 1.15;
  text-transform: uppercase;
  color: #fcf8ea;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(241, 242, 244, .34);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.cov-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cov {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 15px 7px 12px;
  border: 0;
  cursor: pointer;
  font-size: clamp(11.5px, 1.05vw, 13.5px);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: .09em;
  line-height: 1.15;
  text-align: left;
  text-transform: uppercase;
  color: var(--eggshell);
  background: linear-gradient(180deg, #e3261d, #a30d0c);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: background .2s, color .2s;
}
.cov::before { content: ""; flex: none; width: 9px; height: 11px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.cov:hover, .cov:focus-visible { outline: none; background: var(--eggshell); color: #a30d0c; }
.cov[aria-pressed="true"] { background: var(--eggshell); color: #17060a; }
.cov[aria-pressed="true"]::before { width: 10px; height: 10px; clip-path: none; background: var(--red); border-radius: 50%; }
.cov-back { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(241, 242, 244, .4); }
.cov-back::before { clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.cov-list:empty, .press-list:empty { display: none; }
/* written coverage: the outlet, a line on what it said, and an arrow out to the article */
.press-list { display: grid; gap: 7px; }
.cov-list + .press-list { margin-top: 9px; }
.press {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 10px 44px 10px 14px;
  text-decoration: none;
  color: var(--eggshell);
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 0 0 1px rgba(241, 242, 244, .3), inset 3px 0 0 var(--red);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  transition: background .2s, color .2s;
}
.press-outlet {
  font-size: 11.5px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #ff6a5e;
  transition: color .2s;
}
.press-note { font-size: clamp(13.5px, 1.15vw, 15px); font-weight: 500; line-height: 1.35; color: #fcf8ea; transition: color .2s; }
.press::after { /* an arrow pointing up and out: this leaves the site */
  content: "";
  position: absolute;
  right: 17px; top: 50%;
  width: 9px; height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translateY(-50%);
}
.press:hover, .press:focus-visible { outline: none; background: var(--eggshell); color: #a30d0c; }
.press:hover .press-outlet, .press:focus-visible .press-outlet { color: #a30d0c; }
.press:hover .press-note, .press:focus-visible .press-note { color: #17060a; }
.bub-close {
  position: absolute;
  top: -16px; right: -16px;
  z-index: 2;
  width: 52px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: conic-gradient(from 200deg, #f4f5f6, #7b7f86, #26272b, #c9ccd1, #54575d, #f4f5f6, #8a8e95, #2c2d31, #dcdee1, #f4f5f6);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .7);
  transition: transform .35s var(--ease-out);
}
.bub-close::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background:
    linear-gradient(var(--eggshell), var(--eggshell)) center / 44% 3px no-repeat,
    linear-gradient(var(--eggshell), var(--eggshell)) center / 3px 44% no-repeat,
    radial-gradient(circle at 50% 22%, #33343a 0%, #0d0d0e 62%, #000 100%);
  transform: rotate(45deg);
  transition: transform .45s var(--ease-out), filter .3s;
}
.bub-close:hover, .bub-close:focus-visible { outline: none; transform: scale(1.1); }
.bub-close:hover::before, .bub-close:focus-visible::before { transform: rotate(135deg); filter: sepia(1) saturate(9) hue-rotate(-28deg); }
.bub-close:focus-visible { outline: 2px solid var(--eggshell); outline-offset: 3px; }

/* upright videos: the player stands on the left, the write-up beside it */
.bubble.is-tall .bub-shell { grid-template-columns: auto minmax(0, 340px); align-items: center; }
.bubble.is-tall .bub-frame { width: auto; height: min(94svh - 36px, 800px); }
@media (max-width: 900px) {
  .bubble, .bubble.is-rich { width: min(94vw, calc(52svh * var(--ar))); }
  .bubble.is-tall { width: min(94vw, 480px); }
  .bubble.is-tall .bub-shell { grid-template-columns: minmax(0, 1fr); }
  .bubble.is-tall .bub-frame { height: 60svh; margin: 0 auto; max-width: 100%; }
  .bub-close { top: -26px; right: -6px; width: 46px; }
}
@keyframes bubble-in {
  from { opacity: 0; transform: scale(.55); border-radius: 50%; }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ================= 3. a category page: heading, grid of cards, buttons at the foot ================= */
/* Each band of the page is a <section class="guide vsec">. Add "vsteel" for the charcoal one. */
.vsec { padding-left: var(--pad); padding-right: var(--pad); }
.vsec-first { padding-top: calc(var(--bar-h) + clamp(56px, 7vh, 72px)); }
.vsec > * { position: relative; z-index: 1; }
/* brushed charcoal with red heat at the top, and a soft light that follows the pointer */
.vsteel {
  background:
    radial-gradient(86% 560px at 50% 0, rgba(224, 32, 27, .42), transparent 72%),
    radial-gradient(60% 480px at 100% 100%, rgba(90, 10, 21, .6), transparent 72%),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(255, 255, 255, .02) 2px 3px),
    linear-gradient(180deg, #303136 0, #26272b 520px, #1a1b1e 100%);
  box-shadow: inset 0 -18px 30px -18px rgba(0, 0, 0, .85);
}
.vsec > .vglow {
  position: absolute;
  left: -380px; top: -380px;
  z-index: 0;
  width: 760px; height: 760px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .1), rgba(255, 90, 70, .05) 50%, transparent);
  transition: opacity .5s;
  will-change: transform;
}
.vsec.is-lit > .vglow { opacity: 1; }

/* the small line over a title ("POLITICS") is a .guide-sub; this trims its top margin */
.vkicker { margin-top: 0; margin-bottom: clamp(10px, 1.5vh, 16px); }
/* the line under a title: role and dates, or a description. Two parts get a red double bar between them */
.vrole {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px clamp(14px, 1.8vw, 26px);
  margin: clamp(12px, 1.8vh, 20px) auto 0;
  font-size: clamp(11.5px, 1.25vw, 18px);
  font-weight: 500;
  font-stretch: 125%;
  letter-spacing: .2em;
  line-height: 1.4;
  text-transform: uppercase;
  color: rgba(240, 234, 214, .6); /* kept quiet: it sits under a title and should not compete with it */
  transition: opacity 1s .3s, transform 1s .3s var(--ease-out);
}
.vrole i {
  flex: none;
  width: 11px; height: 1.25em;
  border-left: 2px solid var(--red);
  border-right: 2px solid var(--red);
  opacity: .85;
  transform: skewX(-18deg);
}
.js .guide:not(.is-in) .vrole { opacity: 0; transform: translateY(14px); }
@media (max-width: 900px) {
  /* no room for both parts on one line: they stack, and the double bar goes */
  .vrole { flex-direction: column; letter-spacing: .16em; }
  .vrole i { display: none; }
}

/* the grid of cards */
.vgrid {
  --cw: 320px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: clamp(14px, 1.7vw, 24px);
  max-width: 1400px;
  margin: clamp(20px, 3vh, 34px) auto 0;
  padding: 0;
  text-align: left;
}
.vgrid li {
  display: flex;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .6));
  transition: transform .4s var(--ease-out), filter .4s, opacity .6s;
}
.vgrid li:hover, .vgrid li:focus-within {
  transform: translateY(-5px);
  filter: drop-shadow(0 0 20px rgba(255, 42, 28, .55)) drop-shadow(0 18px 20px rgba(0, 0, 0, .7));
}
.vgrid .cap-name { font-size: 15.5px; }
.vgrid .cap-meta { flex-direction: column; gap: 1px; font-size: 11px; }
.vgrid .cap-client + .cap-tag { padding-left: 0; border-left: 0; } /* grid cards are narrow: client and series sit on separate lines */
/* cards rise into place as they scroll into view */
.js .vgrid li:not(.is-in) { opacity: 0; transform: translateY(20px); }
.vgrid li.is-in { transition-delay: calc(var(--col, 0) * 70ms), 0s, calc(var(--col, 0) * 70ms); }
.vgrid li.is-in:hover { transition-delay: 0s; }
@media (max-width: 640px) {
  /* two to a row on phones, with tighter lettering */
  .vgrid { --cw: 170px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vgrid .card-btn { --cut: 10px; }
  .vgrid .cap { padding: 8px 9px 10px; }
  .vgrid .cap-name { font-size: 11.5px; font-stretch: 100%; text-wrap: wrap; }
  .vgrid .cap-meta { font-size: 9px; letter-spacing: .08em; }
  .vgrid .play { width: 38px; }
  .vgrid .dur { right: 5px; bottom: 5px; padding: 3px 5px; font-size: 10px; }
  .vgrid .covered { top: 8px; padding: 4px 9px 4px 6px; font-size: 8.5px; }
}

/* the buttons at the foot of a category page */
.vfoot { padding-top: clamp(30px, 4.5vh, 52px); padding-bottom: clamp(40px, 6vh, 72px); }
.vfoot .guide-grid { margin: 0 auto; }

/* the small tab on the left edge of a category page: back to the video hub. It slips away
   once the big button at the foot of the page is nearly in view. Added by /assets/video-kit.js. */
.vhub {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 40;
  padding: 2px 2px 2px 0;
  text-decoration: none;
  color: var(--eggshell);
  background: var(--steel-edge);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transform: translateY(-50%);
  transition: opacity .5s, transform .5s var(--ease-out), visibility 0s;
}
.vhub-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 13px 7px 12px 6px;
  background: linear-gradient(90deg, #17060a 0%, #4a0b12 100%);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  transition: background .25s;
}
.vhub-in::before { /* a small arrow pointing back */
  content: "";
  width: 7px; height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(2px) rotate(45deg);
}
.vhub-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg); /* reads from the bottom up, like the spine of a book */
  font-size: 11px;
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.vhub:hover, .vhub:focus-visible { outline: none; transform: translate(3px, -50%); }
.vhub:hover .vhub-in, .vhub:focus-visible .vhub-in { background: linear-gradient(90deg, #a30d0c 0%, #e3261d 100%); }
.vhub:focus-visible { background: var(--eggshell); }
.vhub.is-away { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-100%, -50%); transition: opacity .5s, transform .5s var(--ease-out), visibility 0s .5s; }
@media (max-width: 640px) {
  .vhub-in { padding: 11px 5px 10px 4px; gap: 7px; }
  .vhub-text { font-size: 10px; letter-spacing: .14em; }
}

@media (prefers-reduced-motion: reduce) {
  .vhub, .vhub.is-away { transition: none; }
  .thumb img, .play, .bub-close, .bub-close::before, .vgrid li, .vrole, .vsec > .vglow { transition: none; }
  .bubble[open], .bubble[open]::backdrop { animation: none; }
}
