/* A VIDEO LINK IS MEDIA (lane MEDIA, Steven 16 November 2026: "video links
   are media, why are the videos not showing").
   The tile app/services/video_links.py draws wherever an agent's words name
   a video: our copy of the thumbnail across the box with a stroke-only play
   mark, the title and maker under it, a quiet "Open on YouTube". A tap
   swaps the button for the provider's own player (static/js/yt-facade.js).
   With no copy of the thumbnail the tile is plain: the link's own words and
   the play mark, never a broken picture. Tokens only. */
.vid-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  margin: var(--space-3) 0 0;
}
.vid-tile__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-secondary);
}
.vid-tile__play {
  text-decoration: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.vid-tile__play:focus-visible {
  outline: 2px solid var(--interactive-focus-ring);
  outline-offset: 2px;
}
.vid-tile__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vid-tile__frame .vid-tile__thumb ~ .vid-tile__mark {
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-black) 72%, transparent);
  color: var(--color-white);
}
/* the mark is drawn in white over a picture, whatever colour the page around it sets */
.vid-tile__frame .vid-tile__thumb ~ .vid-tile__mark :is(circle, path) { stroke: var(--color-white); }
/* a page that sizes every picture in a piece (the whole-artifact view) never
   resizes the tile's own */
.vid-tile__frame > .vid-tile__play > img.vid-tile__thumb {
  width: 100%;
  height: 100%;
  max-width: none;
}
.vid-tile__plain {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  font: var(--font-medium) var(--text-base)/var(--leading-snug) var(--font-body);
  color: var(--text-primary);
  text-align: left;
  overflow-wrap: anywhere;
}
.vid-tile__mark {
  position: relative;
  width: var(--size-16);
  height: var(--size-16);
}
.vid-tile__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.vid-tile__cap {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
}
.vid-tile__title {
  font: var(--font-medium) var(--text-base)/var(--leading-snug) var(--font-body);
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.vid-tile__by,
.vid-tile__open,
.art-link__site {
  font: var(--font-normal) var(--text-sm)/var(--leading-snug) var(--font-body);
  color: var(--text-secondary);
}
.vid-tile__open {
  align-self: flex-start;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* A note about one video: the video is the note's face, the headline under
   it; the note grows to hold both instead of its square */
.skim.skim--video > .skim__block { aspect-ratio: auto; justify-content: flex-start; }
.skim__video { width: 100%; }
.skim__video .vid-tile { margin: 0; }

/* THE MEDIA IS ON THE NOTE (lane VIDEOCARD, 17 November 2026; Steven: "I
   DON'T SEE THE VIDEOS HERE ON SCREEN. WHY?" and "I WANT THE MEDIA ON THE
   NOTES."). A story note whose See details piece shows media
   (app/services/note_media.py) wears it where the empty square was: the
   media under its kicker, the headline under the media. A video is its picture with the play mark (one tap plays it
   in place, yt-facade.js); a picture or a PDF's first page fills the
   space from its top. The tile's own title line stays under See details. */
.skim.skim--media > .skim__block {
  /* grows to hold the media, the headline and a pick's button (a square
     with its overflow hidden would cut them) */
  aspect-ratio: auto;
  justify-content: flex-start;
  gap: var(--space-3);
}
.skim--media .skim__media {
  position: relative;
  display: flex;
  flex: none;
  /* 4:3, so the carousel's arrows (centred on the square) sit on the
     picture, never over the headline */
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-secondary);
}
.skim--media .skim__media .vid-tile { flex: 1 1 auto; margin: 0; gap: 0; }
.skim--media .skim__media .vid-tile__frame {
  flex: 1 1 auto;
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
}
.skim--media .skim__media .vid-tile__cap { display: none; }
/* YouTube's own thumbnail is 4:3 with the 16:9 picture banded inside it:
   drawn a third larger, the bands fall outside the frame */
.skim--media .skim__media [data-vid-provider="youtube"] .vid-tile__thumb { transform: scale(1.34); }
.skim--media .skim__media-pic,
.skim--media .skim__media-vid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: top;
}
.skim--media .skim__media-vid { background: var(--color-black); object-fit: contain; }
.skim--media .skim__media + .skim__headline { margin-top: auto; }
