/* =========================================================================
   NOBP 504 — POLAROID DECK
   Cream paper, photograph in the top portion, handwriting on the chin.
   Positions come from polaroid-deck.js; nothing here animates a card,
   because a CSS transition would fight the spring.
   ========================================================================= */
.deck {
  /* ── the only two size numbers in this file ──────────────────────────────
     Everything below derives from them. They used to be repeated as literal
     clamp() calls in three rules; editing one and forgetting the others left
     the card off-centre on the stage, which is a bug you can only see at
     certain viewport widths. */
  --pol-w: clamp(270px, 64vw, 400px);        /* card width - the ONE number */

  /* The stage used to get its own independent clamp(), so it was sized
     against the viewport while the card was sized against the viewport
     separately - and the two disagreed. At 1440px the stage came out 560px
     tall around a 371px card, leaving ~190px of empty stage between the
     photograph and the arrows.

     It derives from the card now, so the gap is a constant at every width.
     A card is its width + 35px (13px top padding, the square photograph and
     the handwritten chin); 62px leaves ~27px of slack for the 1.2deg tilt
     and the 5px lift on the neighbours. */
  --stage-h: calc(var(--pol-w) + 62px);

  position: relative;
  margin: 0 auto;
  padding: 4px 0 0;
  touch-action: pan-y;          /* vertical page scroll survives a sideways drag */
  outline: none;
}
.deck:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 6px; border-radius: 8px; }

.deck-stage {
  position: relative;
  /* z-index, not just position, and that matters: it makes the stage its own
     stacking context, so the cards' z-indexes are sorted among THEMSELVES and
     can never compete with the fixed site header (z-index 100 in nobp.css).
     Without this the centre card tied the header at 100 and, being later in
     the document, painted over it as the deck scrolled past. */
  z-index: 0;
  height: var(--stage-h);
  display: block;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.deck.is-dragging .deck-stage { cursor: grabbing; }

.pol {
  position: absolute;
  top: 50%; left: 50%;
  margin: 0;
  width: var(--pol-w);
  /* The centre of the card sits on the centre of the stage; the script's
     translate is measured from there. */
  margin-left: calc(var(--pol-w) / -2);
  margin-top: calc(var(--stage-h) / -2 + 10px);
  background: var(--cream, #f7f0df);
  padding: 13px 13px 0;
  border-radius: 3px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.44), 0 2px 5px rgba(0,0,0,0.3);
  will-change: transform, opacity;
  /* NO TRANSITION. See the note at the top of polaroid-deck.js. */
}
.pol-shot {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #241f18;
}
.pol-shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}
.pol-chin {
  font-family: 'Caveat', 'Bradley Hand', cursive;
  font-size: clamp(17px, 2.5vw, 22px);
  line-height: 1.15;
  color: #2b241a;
  text-align: center;
  padding: 9px 4px 14px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pol.is-centre { box-shadow: 0 16px 40px rgba(0,0,0,0.52), 0 3px 8px rgba(0,0,0,0.34); }

/* ── credit + controls ─────────────────────────────────────────────────── */
.deck-credit {
  margin: 8px auto 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247,240,223,0.72);
  min-height: 20px;
  max-width: 46ch;
}
.deck-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}
.deck-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(217,166,46,0.5);
  background: rgba(0,0,0,0.3);
  color: var(--gold, #d9a62e);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.deck-btn:hover { background: rgba(217,166,46,0.16); }
.deck-btn:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }

.deck-hint { text-align: center; font-size: 12.5px; color: rgba(247,240,223,0.5); margin-top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .pol { box-shadow: 0 8px 20px rgba(0,0,0,0.4); }
}
