/*
 * jumble page — Instagram-style square-tile grid of photos + videos.
 *
 * Cadence and gap size mirror Instagram: three columns on desktop AND
 * mobile (Instagram never breaks its 3-col rhythm), 1px-ish gap so
 * tiles read as a composition rather than a gallery of cards. Each
 * tile is a strict square via aspect-ratio; media inside covers the
 * square with object-fit: cover so aspect ratios are always uniform
 * on the grid surface (users click through to see the full aspect
 * when it matters).
 */


/* === Hide the redundant "jumble" h1 — all viewports ==================
   Same idiom as .shop > .h1, .about > .h1, .catalogue > .h1. Kept in
   markup for SEO / screen readers, hidden visually. */
.jumble > .h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* === Optional intro paragraph ======================================== */
.jumble-intro {
  max-width: 36rem;
  margin: 0 0 2rem;
  font-size: .9rem;
  color: var(--color-text-grey);
  line-height: 1.5;
}


/* === The grid ========================================================
   Three equal columns, tiny gap. Uses grid rather than flex so tiles
   stay perfectly aligned when the media inside varies in aspect ratio
   or when videos start playing. */
.jumble-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}


/* === Each tile — square container ==================================== */
.jumble-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-light);
  margin: 0;
}


/* === Media inside — cover the square ================================
   Absolute positioning inside a position:relative tile locks the
   inner media to the tile's aspect-ratio-computed dimensions. This
   avoids a CSS quirk where a <video> or an <a><img> with height:100%
   sometimes falls back to the media's intrinsic height when the
   parent's height is derived from aspect-ratio rather than an
   explicit pixel value — the reason one tile in Peter's first upload
   rendered taller than its neighbours. */
.jumble-tile > a,
.jumble-tile > img,
.jumble-tile > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.jumble-tile img,
.jumble-tile video {
  object-fit: cover;
}
.jumble-tile a {
  cursor: zoom-in;
  border-bottom: 0;
  text-decoration: none;
  transition: opacity .18s ease;
}
.jumble-tile a:hover {
  opacity: .9;
}


/* === Small play indicator on video tiles ============================
   Native <video controls> paints its own controls inside the tile
   once tapped; the pre-play state relies on the poster-frame preview
   Kirby generates. A tiny corner marker helps the eye distinguish a
   video tile from a still at a glance while browsing. */
.jumble-tile--video::after {
  content: "▶";
  position: absolute;
  top: .5rem;
  right: .5rem;
  color: var(--color-white);
  font-size: .8rem;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  pointer-events: none;
}
