/* home.css
 *
 * Homepage-only layout. Tokens and shared components come from
 * assets/site.css (linked first via brand_head()). Don't redefine tokens
 * here — add to the shared sheet if a new one is needed.
 *
 * The gallery is a coverflow driven by home.js, which sets each card's
 * transform / filter / opacity / z-index and the stage height inline.
 * The geometry below (absolute centering, card widths, stage heights, nav
 * `top`) is what home.js measures against — restyle freely, but change
 * those numbers with care.
 */

body { padding: 0; }

/* The page wrapper and top bar (.page-wrap, .top-bar, .headshot, .identity,
   .tagline) and the nav bar (.site-nav, .nav-link, .on-air) are shared with
   /hospitality and /store, and live in assets/site.css. */

/* --- LIVE SECTION (only rendered while live on Twitch) --- */
.live-section {
  max-width: 880px;
  margin: 0 auto 48px;
  scroll-margin-top: 24px;
}

.live-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.live-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.live-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  box-shadow: 0 0 28px 6px var(--glow);
}

.live-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.live-cta {
  margin-top: 16px;
}

/* --- GALLERY SECTION --- */
.gallery-viewport {
  position: relative;
}

/* The rotator stage. Cards are positioned absolutely, dead center, and
   home.js transforms each one (translateX/scale/rotateY/blur/opacity)
   based on its distance from the active index. Fixed height because
   absolutely-positioned children don't contribute to layout height. */
.gallery-stage {
  position: relative;
  height: 560px; /* fallback until home.js measures the active card */
  perspective: 1400px;
  touch-action: pan-y;
  transition: height 0.3s ease;
}

.gallery-stage:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 6px;
}

.gallery-item {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Base (mobile) size; desktop gets a bigger one in the min-width query. */
  width: min(300px, 72vw);
  background: var(--card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  /* home.js sets transform/filter/opacity/z-index per-frame; this just
     smooths the transition between states. */
  transition: transform 0.4s ease, filter 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
  will-change: transform, filter, opacity;
}

.gallery-item.is-active {
  cursor: default;
  box-shadow: 0 0 28px 6px var(--glow);
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 0;
}

.item-date {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
}

/* Media sits in the gradient frame, inset from the card edge */
.gallery-media {
  position: relative;
  aspect-ratio: 1 / 1;
  margin: 10px 16px 0;
  background: var(--gradient);
  overflow: hidden;
}

.gallery-media img,
.gallery-media iframe {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: cover;
  display: block;
  border: 0;
  background: #000;
}

/* Clickable YouTube thumbnail facade — swapped for a live iframe on click */
.video-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.play-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}

.video-facade:hover .play-glyph {
  transform: translate(-50%, -50%) scale(1.08);
}

/* Small, decorative signal that a linked-out Instagram post is a Reel
   (no embed to hang a real play control on — see index.php). */
.reel-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  pointer-events: none;
}

.gallery-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* One look per kind: track = filled gradient (the thing for sale),
   DJ set = outlined orange, video / other = outlined ink. */
.kind-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--ink-soft);
  color: var(--ink-soft);
}

.kind-badge--track {
  background: var(--gradient);
  border-color: transparent;
  color: var(--ink);
}

.kind-badge--dj-set {
  border-color: var(--orange);
  color: #b8600f;
}

.item-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.item-description {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Track-card sample player — same look as the /lps player, card-sized.
   Behavior lives in home.js. */
.preview-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #faf6ee;
  border: 1px solid var(--rule);
  padding: 8px 10px;
}

.preview-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: var(--ink);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.preview-play-btn:hover {
  transform: scale(1.05);
}

.preview-player .preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* Pinned YouTube comment — manual field, see gallery-data.php */
.pinned-comment {
  border-left: 2px solid var(--gold);
  padding-left: 10px;
}

.pinned-comment-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pinned-comment p {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pinned-comment cite {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-style: normal;
  margin-top: 2px;
}

/* Card CTA: same gradient primary button as the rest of the site */
.buy-btn {
  display: block;
  text-align: center;
  margin-top: auto;
  padding: 12px;
  background: var(--gradient);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  text-transform: uppercase;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s;
}

.buy-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 16px 2px var(--glow);
}

/* Instagram's CTA is a lighter-weight action than buy/subscribe, so it
   doesn't get the full-width treatment. */
.buy-btn--compact {
  display: inline-block;
  align-self: center;
  padding: 10px 20px;
}

/* Prev/next controls: text buttons like every other control here, styled
   as quiet white secondaries so navigation doesn't compete with the CTAs.
   home.js positions them horizontally next to the active card; vertical
   position is a fixed `top` so they don't bounce as card heights change.
   z-index is above every card's range (home.js caps around 100). */
.gallery-nav {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%); /* home.js overrides with the real horizontal offset */
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  z-index: 200;
  white-space: nowrap;
}

.nav-glyph {
  display: inline-block;
  padding: 12px 19px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: color 0.2s, box-shadow 0.2s;
}

.gallery-nav:hover .nav-glyph {
  color: var(--gold);
  box-shadow: 0 0 16px 2px var(--glow);
}

.gallery-nav:disabled {
  cursor: default;
}

.gallery-nav:disabled .nav-glyph {
  opacity: 0.45;
}

.gallery-nav:disabled:hover .nav-glyph {
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* --- FOOTER (on the photo) --- */
.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-credit {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.footer-lockup {
  height: 30px;
  width: auto;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.25));
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  .live-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  /* Cards are narrower here (min(300px, 72vw)), so shorter too. */
  .gallery-stage {
    height: 500px;
  }

  /* Reserve a band above the stage for the nav row — there's no side room
     on a phone. */
  .gallery-viewport {
    margin-top: 64px;
  }

  .gallery-nav {
    top: -48px;
  }
}

@media (min-width: 641px) {
  /* Let cards scale up with the viewport on desktop. */
  .gallery-item {
    width: clamp(380px, 30vw, 520px);
  }

  .gallery-stage {
    height: 650px; /* fallback until home.js measures the active card */
  }
}
