/* ============================================================================
   Link highlights on a bio page: pulse, shake, glow and spotlight.

   A highlight is a per-link setting (config.links[].highlight, Helpers\
   BioSchedule::HIGHLIGHTS). BioPageRenderer::rowChrome() puts
   `bio-hl bio-hl--{style}` on the link's own row: a link row, a product or
   Amazon card, a video card, a music card. This sheet is linked only by a page
   that has such a row (and by the editor, whose canvas previews them), so a
   page without highlights pays nothing for it.

   Rules of the house:
   - The ring and the glow are box-shadows, layered OVER the row's resting
     shadow (--bio-hl-rest) so a highlighted card keeps its depth. Never an
     outline: that is the keyboard focus ring, and an animated outline would
     hide it.
   - The colour is the row's own fill when the owner gave it one (--bl-bg),
     else the theme accent, so the effect belongs to the button it is on.
   - prefers-reduced-motion: pulse and shake stop, glow becomes a still ring.
   - A still ring is written as `.phone-inner .bio-hl.bio-hl--x`: the themed
     card rules of the public sheet set a shadow of their own with that much
     weight (`.phone-inner[data-theme-card] .bio-music-card`), and this sheet
     loads after it, so equal weight is enough to stay on top.
   ============================================================================ */

.bio-hl {
  --bio-hl: var(--bl-bg, var(--bio-accent, #4c7cf5));
  /* A shadow that draws nothing, so the lists below stay valid without one. */
  --bio-hl-rest: 0 0 #0000;
}
/* The rows that rest on a shadow of their own (the25-bio-public.css). */
:where(.bio-link-block:not(.bio-link-block--single)) .bio-link-row.bio-hl,
.amazon-card.bio-hl {
  --bio-hl-rest: var(--bio-rest-shadow, 0 0 #0000);
}

/* ── Pulse: a ring leaves the row and fades, about every two seconds ────── */
@keyframes bio-hl-pulse {
  0%        { box-shadow: var(--bio-hl-rest), 0 0 0 0 var(--bio-hl); transform: scale(1); }
  14%       { transform: scale(1.02); }
  30%       { transform: scale(1); }
  70%, 100% { box-shadow: var(--bio-hl-rest), 0 0 0 12px transparent; transform: scale(1); }
}
.bio-hl--pulse { animation: bio-hl-pulse 2.2s ease-out infinite; }

/* ── Shake: a short wiggle, then a long rest ────────────────────────────── */
@keyframes bio-hl-shake {
  0%, 16%, 100% { transform: translateX(0) rotate(0); }
  2%  { transform: translateX(-5px) rotate(-.8deg); }
  5%  { transform: translateX(5px) rotate(.8deg); }
  8%  { transform: translateX(-4px) rotate(-.5deg); }
  11% { transform: translateX(3px) rotate(.3deg); }
  14% { transform: translateX(-1px); }
}
.bio-hl--shake { animation: bio-hl-shake 4.5s ease-in-out 1s infinite; }

/* ── Glow: a ring with a halo that breathes ─────────────────────────────── */
@keyframes bio-hl-glow {
  0%, 100% { box-shadow: var(--bio-hl-rest), 0 0 0 2px var(--bio-hl), 0 0 8px 0 var(--bio-hl); }
  50%      { box-shadow: var(--bio-hl-rest), 0 0 0 2px var(--bio-hl), 0 0 20px 3px var(--bio-hl); }
}
.phone-inner .bio-hl.bio-hl--glow {
  box-shadow: var(--bio-hl-rest), 0 0 0 2px var(--bio-hl), 0 0 12px 1px var(--bio-hl);
  animation: bio-hl-glow 2.6s ease-in-out infinite;
}

/* ── Spotlight: no motion, more room ────────────────────────────────────────
   The featured one of a set: a still ring, a taller row and a larger label.
   In a grid it takes the whole width, so it reads as the headline tile. */
.phone-inner .bio-hl.bio-hl--spotlight {
  box-shadow: var(--bio-hl-rest), 0 0 0 2px var(--bio-hl);
}
.bio-link-row.bio-hl--spotlight {
  min-height: calc(var(--bio-row-min, 50px) + 18px);
  padding-top: 13px;
  padding-bottom: 13px;
}
.bio-link-row.bio-hl--spotlight .bio-link-row-title {
  font-size: 1.14em;
  font-weight: 700;
}
.bio-link-block--layout-grid .bio-link-list > .bio-hl--spotlight,
.amazon-grid > .bio-hl--spotlight,
.bio-video-block--layout-grid .bio-video-list > .bio-hl--spotlight {
  grid-column: 1 / -1;
}
/* A product card across the whole grid would be one enormous square photo:
   lay it on its side instead, picture left, title and price stacked beside
   it (rows 2 and 3 of four, so the pair sits in the middle of the card). */
.bio-amazon-block--layout-grid .amazon-grid > .amazon-card.bio-hl--spotlight {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  grid-template-rows: 1fr auto auto 1fr;
  column-gap: 12px;
  row-gap: 4px;
}
.bio-amazon-block--layout-grid .amazon-grid > .amazon-card.bio-hl--spotlight > .amazon-thumb {
  grid-column: 1;
  grid-row: 1 / span 4;
}
.bio-amazon-block--layout-grid .amazon-grid > .amazon-card.bio-hl--spotlight > .amazon-title {
  grid-column: 2;
  grid-row: 2;
  margin-top: 0;
  min-height: 0;
}
.bio-amazon-block--layout-grid .amazon-grid > .amazon-card.bio-hl--spotlight > .product-price {
  grid-column: 2;
  grid-row: 3;
}
.amazon-card.bio-hl--spotlight .amazon-title {
  font-size: 1.1em;
  font-weight: 700;
}
/* A strip that scrolls sideways has no rows to span. */
.bio-link-block--carousel .bio-link-list > .bio-hl--spotlight,
.bio-amazon-block--layout-carousel .amazon-grid > .bio-hl--spotlight {
  grid-column: auto;
}

@media (prefers-reduced-motion: reduce) {
  .bio-hl--pulse,
  .bio-hl--shake {
    animation: none;
  }
  .phone-inner .bio-hl.bio-hl--glow {
    animation: none;
    box-shadow: var(--bio-hl-rest), 0 0 0 2px var(--bio-hl);
  }
}
