/*
 * Page-specific styles for the Product Template Expansion Detail page.
 * Sandbox-only reference at /product-template-expansion-detail
 * (and rendered for any /products/:product/expansions/:slug match).
 *
 * Port of the handoff's inline <style> block in
 * `Imaginando Product Template Expansion Detail.html`. `--pack-hue`
 * cascades from `<main>` through every selector below that uses
 * var(--pack-hue) — every pack shares the site's global --accent
 * (set once below, no per-pack value), so recolouring the whole page
 * (and every expansion pack) is a one-line change to --accent in style.css.
 *
 * Already in /style.css (intentionally NOT duplicated):
 *   :root tokens, html/body/a/button resets, ::selection, .mono, .wrap,
 *   .btn / .btn.primary / .btn.outline / .btn.ghost / .btn .arrow,
 *   .section, .reveal, .sblock.warm overrides.
 *
 * --pack-hue chain:
 *   main { --pack-hue: var(--accent); }     ← set below
 *     .pkhero-bg, .pkhero h1 em, .btn.primary, .btn.outline, .pkhero-art,
 *     .pack-name, .wave-strip, .pkhero-stats .num em, .sec-head h2 em,
 *     .scene:hover, .buy-box (border tint),
 *     ::selection
 */

/* ============================================================
 * --pack-hue scoping. Same value everywhere on this page — the global
 * --accent — for :root (nav/footer) and main alike.
 * ============================================================ */
:root { --pack-hue: var(--accent); }
main { --pack-hue: var(--accent); }

/* ============================================================
 * Section heading override — expansion-detail uses a slightly
 * tighter scale than product pages (32px → 56px clamp vs the
 * 38px → 72px elsewhere) because the hero already owns the
 * display-h1 slot.
 * ============================================================ */
.sec-head { margin-bottom: 36px; flex-wrap: wrap; }
.sec-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
  text-wrap: balance;
}
.sec-head h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--pack-hue); }
.sec-head .meta {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: right;
  max-width: 30ch;
}

/* ============================================================
 * HERO (.pkhero) — crumbs + display headline + lede + art panel
 * + stats strip. Two-column on desktop, stacked on mobile.
 * ============================================================ */
.pkhero {
  position: relative;
  padding: 48px 0 96px;
  border-bottom: 0.5px solid var(--line);
  overflow: hidden;
}
.pkhero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 80% 25%, color-mix(in oklab, var(--pack-hue) 20%, transparent), transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 85%, color-mix(in oklab, var(--pack-hue) 10%, transparent), transparent 60%);
}
.crumbs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--fg-faint);
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--fg-faint); }
.crumbs .here { color: var(--fg); }

.pkhero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: end;
  position: relative;
}
@media (max-width: 1000px) {
  .pkhero-grid { grid-template-columns: 1fr; gap: 40px; align-items: start; }
}

.pkhero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(64px, 10vw, 160px);
  line-height: 0.86;
  letter-spacing: -0.04em;
  margin: 0;
  color: var(--fg);
  text-wrap: balance;
}
.pkhero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--pack-hue); }
.pkhero h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 22px 0 0;
  color: var(--fg);
  max-width: 24ch;
}
.pkhero .lede {
  margin: 22px 0 0;
  color: var(--fg-dim);
  font-size: 16.5px;
  line-height: 1.6;
  max-width: 48ch;
  text-wrap: pretty;
}
.pkhero-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
  align-items: center;
}
.pkhero-actions .price-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-left: 6px;
}
.pkhero-actions .price-tag em {
  color: var(--pack-hue);
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-right: 4px;
  font-style: normal;
}
/* Sale strike-through on the hero price-tag. The route handler
 * renders `<s>€X.XX</s>` after the headline price when the addon's
 * one_time_original_price is set and higher than one_time_price. */
.pkhero-actions .price-tag s {
  color: var(--fg-faint);
  text-decoration: line-through;
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: -0.005em;
  margin-right: 4px;
}

/* ============================================================
 * HERO ART PANEL — CSS-generated cover for the template. Per
 * pack, swap to a real cover.jpg in a future iteration.
 * ============================================================ */
.pkhero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 0.5px solid var(--line-strong);
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 25%, color-mix(in oklab, var(--pack-hue) 35%, transparent), transparent 55%),
    radial-gradient(circle at 80% 70%, color-mix(in oklab, var(--pack-hue) 20%, transparent), transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px),
    linear-gradient(180deg, var(--card-2), var(--bg));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 80px color-mix(in oklab, var(--pack-hue) 18%, transparent);
}
.pkhero-art .pack-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(48px, 7vw, 88px);
  letter-spacing: 0.05em;
  color: var(--pack-hue);
  text-shadow: 0 0 40px color-mix(in oklab, var(--pack-hue) 40%, transparent);
  text-align: center;
}
.pkhero-art .wave-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 80px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.pkhero-art .wave-strip span {
  flex: 1;
  background: var(--pack-hue);
  border-radius: 1px;
}

/* ============================================================
 * Cover-image variant. When the API supplies a `meta.header` or
 * `meta.cover` image, the template adds `.has-cover` to .pkhero-art
 * and renders an `<img>`. Drop the CSS gradient + wordmark so the
 * photo carries the whole panel, clean.
 * ============================================================ */
.pkhero-art.has-cover {
  /* Real cover present: show it clean — no pack-hue colour overlay, no
   * wordmark (see .pack-name display:none below). Keep only the outer
   * shadow/glow ring from the base .pkhero-art rule. */
  background: none;
}
.pkhero-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
/* Hide the over-large CSS pack-name overlay when there's a real
 * cover — the image already shows the pack art; the centered text
 * would just compete with it. */
.pkhero-art.has-cover .pack-name { display: none; }

/* ============================================================
 * HERO PACK-STATS — compact metrics row in the text column, between
 * the body copy and the CTA. Left-aligned inline {number + label} items sized to
 * their content (never stretched), so a pack with 1–4 stats reads
 * tight-left instead of a full-width strip stretching a lone stat
 * across the hero. Items are separated by spacing (not rules) so any
 * count and any wrap stay clean; the numbers' display size groups each
 * pair. `.num em` picks up the per-pack hue like the price tag.
 * ============================================================ */
.pkhero-stats {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 30px;
  row-gap: 16px;
}
.pkhero-stats li {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.pkhero-stats .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.pkhero-stats .num em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--pack-hue);
}
.pkhero-stats .lbl {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ============================================================
 * PREVIEW — a single SoundCloud set player, centred at a capped
 * width. (The former right-hand "about the pack" column was sample
 * copy the API never overrode, so it was dropped. Rather than
 * stretch the player edge-to-edge — which reads massive — we cap it
 * and centre it, so the section stays balanced with no filler.)
 * ============================================================ */
.pk-split { display: block; }
.sc-frame {
  border: 0.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  height: 520px;
  max-width: 820px;
  margin-inline: auto;
}
.sc-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============================================================
 * TRAILER — CSS placeholder (no real video for the template).
 * Same chrome as product pages' `.tpl-trailer`, but with the
 * play-button + timecode + stamp stamped over a gradient frame.
 * ============================================================ */
.trailer {
  position: relative;
  border: 0.5px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  overflow: hidden;
  aspect-ratio: 21 / 9;
}
/* When a real YouTube URL is wired (via +ytPoster), drop the 21:9
 * marquee aspect-ratio for the standard 16:9 — that's what the
 * poster thumbnail expects. */
.trailer.has-embed { aspect-ratio: 16 / 9; }
.trailer.has-embed .yt-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.trailer .ph {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 50% 50%, color-mix(in oklab, var(--pack-hue) 14%, transparent), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, var(--card-2), var(--bg));
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.trailer .stamp {
  position: absolute;
  bottom: 18px;
  left: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  background: rgba(0, 0, 0, 0.55);
  border: 0.5px solid var(--line);
  padding: 5px 9px;
  border-radius: 6px;
}
.trailer .timecode {
  position: absolute;
  top: 18px;
  right: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pack-hue);
  background: rgba(0, 0, 0, 0.55);
  border: 0.5px solid var(--line);
  padding: 5px 9px;
  border-radius: 6px;
}

/* ============================================================
 * ARTIST — "About the artist" banner card (ported from the design
 * handoff's updated Artist()). content/<lang>/authors.yml supplies
 * `banner` / `logo` / `bio` per curator — all three OPTIONAL and
 * independent. A curator missing one just renders nothing for that
 * piece (no placeholder box/label) — with everything missing, the
 * card falls back to just the curator name (.art-name) on the bare
 * flat --card surface.
 * `.has-banner .art-body p` is pinned to the dark-theme literal
 * rather than var(--fg-dim) — a real photo + scrim is always dark
 * regardless of site theme, so light mode must not flip the text dark
 * too. Without a banner the card is a flat --card surface, so body
 * copy stays on the normal themed color.
 * ============================================================ */
.artist {
  position: relative;
  border: 0.5px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  min-height: 420px;
  display: flex;
  align-items: flex-end;
}
.artist .art-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  z-index: 0;
}
.artist .art-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(10, 10, 12, 0.95) 0%,
      rgba(10, 10, 12, 0.86) 34%,
      rgba(10, 10, 12, 0.42) 64%,
      rgba(10, 10, 12, 0.12) 100%
    ),
    linear-gradient(0deg, rgba(10, 10, 12, 0.55), transparent 45%);
}
.artist .art-inner {
  position: relative;
  z-index: 2;
  padding: 44px 48px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.artist .art-logo {
  height: 60px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  object-position: left;
  filter: drop-shadow(0 6px 22px rgba(0, 0, 0, 0.55));
}
/* Curator name — shown only when there's no wordmark logo (the logo
 * carries the name via its alt). Keeps the name in the accessible/
 * indexable DOM for logo-less curators instead of relying on the
 * background-image banner (invisible to screen readers and crawlers).
 * Pinned light on has-banner for the same reason as .art-body p. */
.artist .art-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.artist.has-banner .art-name { color: rgba(244, 241, 234, 0.92); }
.artist .art-body { display: flex; flex-direction: column; gap: 12px; }
.artist .art-body p {
  margin: 0;
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
  text-wrap: pretty;
}
.artist.has-banner .art-body p { color: rgba(244, 241, 234, 0.62); }
@media (max-width: 760px) {
  .artist { min-height: 0; }
  .artist .art-bg { object-position: center top; }
  .artist .art-scrim {
    background: linear-gradient(
      180deg,
      rgba(10, 10, 12, 0.62),
      rgba(10, 10, 12, 0.9) 55%,
      rgba(10, 10, 12, 0.95)
    );
  }
  .artist .art-inner { padding: 28px 24px; max-width: none; }
  .artist .art-logo { height: 46px; }
  .artist .art-name { font-size: 22px; }
}

/* ============================================================
 * RELATED packs — uses the shared `.exp` cover-card component
 * (public/style.css + views/site/_sections/_expansions.pug), so it
 * matches the product page's expansions grid exactly (full-bleed cover,
 * price-pill overlay, no image padding). No bespoke card CSS here — see
 * the markup in product-template-expansion-detail.pug (`.exp-grid`).
 * ============================================================ */

/* ============================================================
 * BUY BOX — sticky-feeling CTA card under the related grid.
 * Carries the page's --pack-hue as a tinted background gradient
 * + border accent.
 * ============================================================ */
.buy-box {
  margin-top: 24px;
  padding: 28px 32px;
  border: 0.5px solid color-mix(in oklab, var(--pack-hue) 30%, var(--line));
  border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in oklab, var(--pack-hue) 10%, var(--card)), var(--card));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 700px) { .buy-box { grid-template-columns: 1fr; } }
.buy-box .buy-label {
  color: var(--pack-hue);
  display: block;
}
.buy-box .price { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.buy-box .price .num {
  font-family: var(--display);
  font-weight: 500;
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--fg);
}
.buy-box .price .pack-of {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  text-transform: uppercase;
}
.buy-box .price .strike {
  font-family: var(--display);
  font-size: 18px;
  color: var(--fg-faint);
  text-decoration: line-through;
  align-self: baseline;
}
.buy-box .req {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  text-transform: uppercase;
  margin-top: 8px;
  display: block;
}
.buy-box .req em {
  color: var(--pack-hue);
  font-family: var(--mono);
  font-style: normal;
  font-weight: 500;
}
.buy-actions { display: flex; gap: 10px; flex-wrap: wrap; }
