/* ──────────────────────────────────────────────────────────────────────────
   minibar.css — a minute of every show, from anywhere on the site

   The three-clip player on the home page is the one thing on this site that
   turns a stranger into a listener: they press it, they hear a real voice,
   and the "listen free" link stops being a leap of faith. This makes that
   available on every cover in the catalogue.

   Two pieces:
     .mini-play   a gold play button sitting on a cover
     .mbar        one sticky bar at the foot of the window, carrying the
                  waveform, the clock and -- when the minute runs out -- the
                  two links the whole site exists to send people to

   The bar is deliberately the only place sound comes from. A grid of 79
   covers that could each start their own audio is a page people close.
   ────────────────────────────────────────────────────────────────────────── */

/* ── the button on a cover ────────────────────────────────────────────── */

.mini-play {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--gold); color: var(--on-copper);
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  /* hidden until the cover is hovered on a mouse, always visible on touch
     (see the coarse-pointer block) -- a permanent button on all 79 tiles
     turns the catalogue into a wall of controls */
  opacity: 0; transform: scale(.7);
  transition: opacity .3s ease, transform .4s cubic-bezier(.22,1.5,.4,1),
              background .3s ease;
  z-index: 3;
}
.mini-play svg { width: 20px; height: 20px; fill: currentColor;
  transform: translateX(2px); }        /* optical centring of the triangle */
.mini-play[data-on] svg { transform: none; }
.mini-play:hover { background: var(--gold-light); transform: scale(1.08); }
.mini-play:focus-visible { opacity: 1; transform: scale(1);
  outline: 3px solid var(--gold-light); outline-offset: 4px; }

.bk-card:hover .mini-play,
.tile-wrap:hover .mini-play,
.mini-play[data-on] { opacity: 1; transform: scale(1); }
.mini-play[data-on] { background: var(--gold-light); }
/* the ring says "this is the one playing" from across a scrolled grid */
.mini-play[data-on]::after { content: ""; position: absolute; inset: -6px;
  border-radius: 50%; border: 2px solid var(--gold);
  animation: mini-pulse 1.9s ease-out infinite; }
@keyframes mini-pulse {
  0%   { transform: scale(.92); opacity: .75; }
  100% { transform: scale(1.4);  opacity: 0; }
}

/* books.html styles .bk-art img but never the box, so the box has no
   containing block of its own to position the button against */
.bk-art { position: relative; }

/* The whole-tile anchor on shows.html cannot hold a nested button -- a
   <button> inside an <a> is invalid and dead in Safari -- so the script
   wraps the anchor and lays a transparent cap over just the square cover.
   The cap, rather than the wrap, because the wrap also contains the show
   name and centring in it would sit the button low on the art. */
.tile-wrap { position: relative; }
.tile-cap { position: absolute; top: 0; left: 0; right: 0; aspect-ratio: 1;
  display: grid; place-items: center; pointer-events: none; }
.tile-cap .mini-play { position: static; margin: 0; pointer-events: auto; }

/* a one-line nudge under each card, because a button that only appears on
   hover is invisible to anyone who has not moved the mouse yet */
.mini-hint { font-family: 'DM Sans', sans-serif; font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  display: inline-flex; align-items: center; gap: .36rem;
  background: none; border: 0; padding: .1rem 0; cursor: pointer; }
.mini-hint::before { content: "\25B6"; font-size: .6em; }
.mini-hint:hover { color: var(--sage); }
.mini-hint:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (hover: none), (pointer: coarse) {
  .mini-play { opacity: 1; transform: scale(1); }
}

/* ── the sticky bar ───────────────────────────────────────────────────── */

.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: rgba(5,15,16,.93);
  /* no backdrop blur: a fixed blurred bar re-blurs the page under it on
     every scroll frame, and at .93 opacity the blur was barely visible */
  border-top: 1px solid rgba(255,227,191,.26);
  color: var(--ivory);
  transform: translateY(110%);
  transition: transform .5s cubic-bezier(.22,1,.3,1);
}
.mbar[data-open] { transform: none; }
.mbar-in { max-width: 1180px; margin: 0 auto;
  padding: .7rem clamp(.9rem,3vw,1.8rem);
  display: flex; align-items: center; gap: clamp(.7rem,2vw,1.2rem); }

.mbar-art { flex: none; width: 46px; height: 46px; border-radius: 9px;
  overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.mbar-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.mbar-btn { flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--gold); color: var(--on-copper);
  display: grid; place-items: center; transition: background .3s, transform .3s; }
.mbar-btn:hover { background: var(--gold-light); transform: scale(1.06); }
.mbar-btn svg { width: 16px; height: 16px; fill: currentColor;
  transform: translateX(2px); }
.mbar-btn[data-on] svg { transform: none; }

.mbar-meta { flex: none; min-width: 0; max-width: 24ch; }
.mbar-title { font-family: 'Cormorant Garamond', serif; font-size: 1.08rem;
  font-weight: 600; line-height: 1.2; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar-sub { font-family: 'DM Sans', sans-serif; font-size: .66rem;
  letter-spacing: .13em; text-transform: uppercase; margin: .12rem 0 0;
  color: var(--gold-light); }

.mbar-wave { flex: 1; min-width: 60px; height: 38px; display: block;
  cursor: pointer; }
.mbar-time { flex: none; font-family: 'DM Sans', sans-serif; font-size: .74rem;
  font-variant-numeric: tabular-nums; color: rgba(243,241,236,0.78); }

.mbar-cta { display: flex; gap: .5rem; flex: none; }
.mbar-cta a { font-family: 'DM Sans', sans-serif; font-size: .78rem;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: .52rem .95rem; border-radius: 999px;
  transition: background .3s, color .3s, transform .3s; }
.mbar-cta .m-gold { background: var(--gold); color: var(--on-copper); }
.mbar-cta .m-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.mbar-cta .m-ghost { border: 1px solid rgba(30,59,61,.28);
  color: rgba(243,241,236,.82); }
.mbar-cta .m-ghost:hover { border-color: var(--gold); color: var(--gold-light); }

.mbar-x { flex: none; background: none; border: 0; cursor: pointer;
  color: rgba(243,241,236,0.78); font-size: 1.1rem; line-height: 1;
  padding: .3rem .1rem; }
.mbar-x:hover { color: var(--ivory); }

/* when the minute is up the bar stops being a player and becomes the ask */
.mbar[data-done] .mbar-sub { color: var(--ivory); }
.mbar[data-done] .mbar-wave { opacity: .35; }

/* Phones: the waveform and the clock are the first things to go. What has
   to survive at 380px is the cover, the title and the two links -- the bar
   is a conversion surface that happens to play audio, not the reverse. */
@media (max-width: 900px) {
  .mbar-time { display: none; }
  .mbar-meta { max-width: 14ch; }
  .mbar-cta a { padding: .5rem .72rem; font-size: .72rem; }
}
@media (max-width: 640px) {
  .mbar-wave, .mbar-art { display: none; }
  .mbar-in { gap: .6rem; padding: .6rem .8rem; }
  .mbar-meta { flex: 1; max-width: none; }
}

/* the mobile sticky CTA sales.js draws would sit on top of the bar */
body[data-mbar] .sticky-cta { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .mbar { transition: none; }
  .mini-play, .mini-play:hover, .mbar-btn:hover { transition: none; transform: none; }
  .mini-play[data-on]::after { animation: none; }
  .bk-card:hover .mini-play, .tile-wrap:hover .mini-play { transform: none; }
}
