/* A vanilla port of reactbits.dev's current Tilted Card CSS, adapted the same way as the other
   two effects on this test page: sized to fill a square grid-cell tile (aspect-ratio: 1) instead
   of the original demo's fixed 300x300px figure. displayOverlayContent's whole code path
   (.tilted-card-overlay in the original CSS) is dropped entirely since it's unused here — the
   image itself is what rotates/scales directly (no separate .tilted-card-inner wrapper needed,
   since that wrapper's only other job in the original was giving the optional overlay the same
   3D space to sit in). Deliberately NOT clipped (no overflow:hidden on .tilted-card-tile) — same
   reasoning as everywhere else this project has used Tilted Card: the hover scale/tilt needs room
   to bulge slightly past its own resting footprint, which a clipping ancestor would cut off. In
   this specific grid (gap: 0, tiles edge-to-edge) that bulge visually overlaps whichever
   neighbour is closest, same as the small Music-timeline tiles elsewhere on this site — the
   hover z-index lift (in js/tilted-card-spring.js) is what makes that overlap read as "this one
   popped forward" rather than a stray rendering glitch. */
.tilted-card-tile {
  position: relative;
  aspect-ratio: 1;
}

/* margin:0 — a plain <figure> carries the browser's own default UA margin (16px top/bottom,
   40px left/right in every mainstream browser), which was the actual cause of the "gap between
   rows" in this gap:0 grid: every tile was quietly padded away from its neighbours by that
   default, not by anything this file set. */
.tilted-card-figure {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  perspective: 800px;
}

.tilted-card-figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  will-change: transform;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.tilted-card-caption {
  pointer-events: none;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 4px;
  background-color: #fff;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: #2d2d2d;
  opacity: 0;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
  .tilted-card-caption {
    display: none;
  }
}
