/* Featured video stage — Karry Kraze–style scroll-snap carousel */

.fs-shell {
  /* Bleed past #main frame padding so cards meet the screen-frame on both sides */
  width: calc(100% + 2 * var(--bpb-frame-edge-x, 0px));
  max-width: none;
  margin: 0.75rem calc(-1 * var(--bpb-frame-edge-x, 0px)) 2rem;
  padding: 0.5rem 0 1rem;
  overflow: hidden;
  box-sizing: border-box;
}

.fs-status {
  margin: 2rem auto;
  text-align: center;
  font-family: var(--bpb-font-body);
  color: var(--bpb-ink);
  background: rgba(212, 184, 150, 0.75);
  border: var(--bpb-border);
  border-radius: var(--bpb-radius-panel);
  padding: 1rem 1.25rem;
  max-width: 28rem;
}

/* Native horizontal track — padding creates side peeks; shell clips them at the page frame */
.fs-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.75rem 7.5vw 1.25rem;
  /* Hidden until JS centers the active slide — avoids “slide in from the right” */
  opacity: 0;
}

.fs-track.is-ready {
  opacity: 1;
}

.fs-track::-webkit-scrollbar {
  display: none;
}

.fs-track--snap {
  scroll-snap-type: x mandatory;
}

.fs-track--no-transition .fs-slide {
  transition: none !important;
}

/* Each slide = full plate card; inactive slightly scaled — no dim underlap */
.fs-slide {
  position: relative;
  flex: 0 0 auto;
  width: 90vw;
  max-width: 90vw;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  transform-origin: center center;
  transform: scale(0.9);
  margin-inline: 0;
  opacity: 0.55;
  filter: none;
  transition:
    transform 0.45s ease,
    opacity 0.45s ease;
  z-index: 1;
  cursor: var(--bpb-cursor-pointer);
  user-select: none;
  /* Keep peek art from painting under the active card */
  isolation: isolate;
}

.fs-slide.is-active {
  transform: scale(1);
  opacity: 1;
  filter: none;
  z-index: 10;
  cursor: var(--bpb-cursor-default);
}

.fs-slide:not(.is-active):hover {
  transform: scale(0.9);
  opacity: 0.85;
  filter: none;
  z-index: 5;
  cursor: var(--bpb-cursor-pointer);
}

/* —— Loading skeleton (uses shared .bpb-skel) —— */
.fs-skel-wrap {
  width: 100%;
}

.fs-slide--skel {
  cursor: var(--bpb-cursor-default);
  pointer-events: none;
}

.fs-focus--skel .fs-skel-media {
  background: rgba(40, 28, 18, 0.35);
}

.fs-skel-media__fill {
  position: absolute;
  inset: 4%;
  width: auto;
  height: auto;
  border-radius: 0.3rem;
}

.fs-focus--skel .fs-focus__header,
.fs-focus--skel .fs-focus__main {
  gap: 0.45rem;
}

.fs-skel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.7rem;
  margin-top: auto;
}

.fs-skel-btn {
  width: 100%;
}

/* —— Video + info: info tucks under video (old plate overlap) —— */
.fs-focus {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.72fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  width: 100%;
  aspect-ratio: 2136 / 688;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  container-type: inline-size;
  container-name: fs-focus;
  /* How much of the info sheet slides under the video (fraction of the grid cell) */
  --fs-info-tuck-n: 0.16;
  --fs-info-tuck: calc(100% * var(--fs-info-tuck-n));
  --fs-frame-pad: clamp(0.85rem, 1.26cqw, 1.45rem);
  /* Fluid type — the max is the 1440p card. Narrower cards, including 1080p, scale down. */
  --fs-text-title: clamp(1.05rem, 2.4cqw, 1.85rem);
  --fs-text-class: clamp(0.88rem, 1.5cqw, 1.15rem);
  --fs-text-blurb: clamp(0.78rem, 1.3cqw, 1rem);
  --fs-text-btn: clamp(0.85rem, 1.46cqw, 1.15rem);
  --fs-btn-h: clamp(2.15rem, 3.7cqw, 2.85rem);
  --fs-icon-class: clamp(1.25rem, 2.2cqw, 1.75rem);
  --fs-icon-btn: clamp(1rem, 1.64cqw, 1.3rem);
  --fs-op-w: clamp(3.2rem, 5.5cqw, 5rem);
  --fs-op-clearance: clamp(4.25rem, 6.3cqw, 5.75rem);
  --fs-op-right: clamp(1.5rem, 3.2cqw, 2.5rem);
}

.fs-lane {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
}

.fs-lane--video {
  display: flex;
  align-items: center;
  /* Hug the info seam so tuck still sits under the framed edge */
  justify-content: flex-end;
  align-self: stretch;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.fs-lane--info {
  display: block;
  z-index: 1;
  /* Slightly smaller sheet, vertically centered, tucked under video */
  align-self: center;
  height: 90%;
  max-height: 90%;
  min-height: 0;
  box-sizing: border-box;
  isolation: isolate;
  width: calc(100% + var(--fs-info-tuck));
  margin-left: calc(-1 * var(--fs-info-tuck));
  --fs-op-clearance: clamp(4.25rem, 6.3cqw, 5.75rem);
  /* Extra inset so sticker stroke / serifs don’t clip on the gold rim */
  --fs-sheet-pad-x: clamp(0.52rem, 1.42cqw, 0.82rem);
  --fs-sheet-pad-y: clamp(0.95rem, 2.52cqw, 1.45rem);
  --fs-stroke-bleed: 0.14em;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background-color: transparent;
  background-image: url("../../../assets/theme/ui/ui-character-sheet.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.fs-lane--info::after {
  content: none;
}

/* Center copy in the visible (non-tucked) part of the sheet — equal pad L/R */
.fs-focus__stitch {
  position: absolute;
  z-index: 1;
  top: var(--fs-sheet-pad-y);
  right: var(--fs-sheet-pad-x);
  bottom: var(--fs-sheet-pad-y);
  /* Tuck is N of the grid cell; panel is (1+N) cells wide → visible starts at N/(1+N) of panel */
  left: calc(
    100% * var(--fs-info-tuck-n) / (1 + var(--fs-info-tuck-n)) + var(--fs-sheet-pad-x)
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.35rem;
  box-sizing: border-box;
  /* Symmetric bleed so sticker stroke isn’t clipped */
  padding: 0.2rem var(--fs-stroke-bleed) 0.25rem;
  overflow: hidden;
  border: 0;
}

.fs-focus__header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.fs-focus__main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.fs-lane--info:has(.fs-op-badge) .fs-focus__header .fs-focus__title {
  padding-right: var(--fs-op-clearance);
  box-sizing: border-box;
}

.fs-op-badge {
  position: absolute;
  top: calc(var(--fs-sheet-pad-y) - 0.35rem);
  right: var(--fs-op-right);
  left: auto;
  z-index: 4;
  width: var(--fs-op-w);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(20, 10, 5, 0.4));
}

/* Frame + embed share true 16:9 — height fills the stage, width shrinks (no pillarbox) */
.fs-focus__media {
  position: relative;
  z-index: 1;
  isolation: isolate;
  border: 0;
  border-radius: 0.35rem;
  overflow: hidden;
  background: #0a0705;
  height: 100%;
  width: auto;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  align-self: stretch;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

/* Frame2 rim hugs the video only */
.fs-focus__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: url("../../../assets/theme/ui/ui-screen-frame.png") center / 100% 100% no-repeat;
}

.fs-focus__thumb,
.fs-focus__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 0.2rem;
}

.fs-focus__thumb {
  object-fit: cover;
  object-position: center;
}

.fs-focus__header > *,
.fs-focus__main > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.fs-rule {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  flex: 0 0 auto;
  color: #ffecdc;
  opacity: 0.75;
}

.fs-rule__line {
  flex: 1 1 auto;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    currentColor 8%,
    currentColor 92%,
    transparent 100%
  );
  position: relative;
}

/* Only the outer ends get arrowheads — bare ::before/::after + solid borders
   paint stray squares on the inner ends. */
.fs-rule__line:first-child::before,
.fs-rule__line:last-child::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  transform: translateY(-50%);
}

.fs-rule__line:first-child::before {
  left: 0;
  border-width: 3.5px 7px 3.5px 0;
  border-color: transparent currentColor transparent transparent;
}

.fs-rule__line:last-child::after {
  right: 0;
  border-width: 3.5px 0 3.5px 7px;
  border-color: transparent transparent transparent currentColor;
}

.fs-rule__motif {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 0.9rem;
  display: block;
}

.fs-rule__motif--diamond {
  width: 0.55rem;
  height: 0.55rem;
}

.fs-focus__title {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  /* Reserve 2-line height; single-line titles sit just above the rule */
  min-height: calc(1.18em * 2);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: var(--bpb-font-display);
  /* Scales with the card (fs-focus is a size container) — rem alone won’t follow screen */
  font-size: var(--fs-text-title);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.03em;
  color: var(--bpb-label-fill, #fffaf0);
}

.fs-focus__title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  /* Line-clamp clips shadows — keep glyphs inset inside the clamp box */
  padding-inline: var(--fs-stroke-bleed);
  /* Sticker recipe — same ring as nav banners; heft from outline not Bold */
  color: var(--bpb-label-fill, #fffaf0);
  text-shadow: var(--bpb-label-stroke);
}

.fs-focus__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem 0.65rem;
  margin: 0;
  flex: 0 0 auto;
  padding-inline: var(--fs-stroke-bleed);
  box-sizing: border-box;
}

.fs-class {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  /* Baskerville italic + sticker stroke (same outline recipe as title) */
  color: var(--bpb-label-fill, #fffaf0);
  font-family: var(--bpb-font-body);
  font-size: var(--fs-text-class);
  font-style: italic;
  font-weight: 400;
  text-shadow: var(--bpb-label-stroke);
}

.fs-class__name {
  letter-spacing: 0.01em;
  color: inherit;
  text-shadow: inherit;
}

.fs-class__icon {
  width: var(--fs-icon-class);
  height: var(--fs-icon-class);
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(20, 12, 6, 0.25));
}

.fs-focus__blurb {
  margin: 0;
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  font-family: var(--bpb-font-body);
  font-size: var(--fs-text-blurb);
  font-weight: 400;
  line-height: 1.35;
  color: var(--bpb-label-fill, #fffaf0);
  text-shadow: var(--bpb-label-stroke);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  box-sizing: border-box;
  padding-inline: var(--fs-stroke-bleed);
}

.fs-focus__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: stretch;
  column-gap: 0.7rem;
  width: 100%;
  max-width: 100%;
  margin-top: auto;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.fs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: 100%;
  height: var(--fs-btn-h);
  margin: 0;
  padding: 0 0.75em;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: none;
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--bpb-label-fill, #fffaf0);
  font-family: var(--bpb-font-display);
  font-size: var(--fs-text-btn);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1;
  text-decoration: none;
  text-shadow: var(--bpb-label-stroke);
  box-shadow: none;
  transition: filter 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
  overflow: hidden;
}

.fs-btn--watch {
  background-image: url("../../../assets/theme/ui/ui-btn-crimson.png");
}

.fs-btn--build {
  background-image: url("../../../assets/theme/ui/ui-btn-steel.png");
}

.fs-btn:hover {
  filter: brightness(1.1);
  color: #fff;
}

.fs-btn:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}

.fs-btn__icon {
  display: block;
  width: var(--fs-icon-btn);
  height: var(--fs-icon-btn);
  flex: 0 0 auto;
}

.fs-btn__icon--img {
  display: block;
  width: var(--fs-icon-btn);
  height: var(--fs-icon-btn);
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* Desktop: wider center card + more side padding = KK peeks */
@media (min-width: 768px) {
  .fs-track {
    padding-left: 10%;
    padding-right: 10%;
  }

  .fs-slide {
    width: 60%;
    max-width: 60%;
  }
}

@media (max-width: 1100px) {
  .fs-focus {
    grid-template-columns: 1fr;
    aspect-ratio: auto;
    gap: 0.65rem;
    padding: 0;
    --fs-info-tuck-n: 0;
    --fs-info-tuck: 0%;
  }

  .fs-lane--video {
    z-index: 1;
    padding: 0;
    min-height: 0;
    justify-content: center;
  }

  .fs-focus__media {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .fs-lane--info {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-left: 0;
    height: auto;
    max-height: none;
    min-height: 0;
    align-self: stretch;
  }

  .fs-focus__stitch {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    inset: auto;
    width: auto;
    height: auto;
    margin: var(--fs-sheet-pad-y) var(--fs-sheet-pad-x);
    padding: 0.15rem 0.05rem 0.1rem;
  }

  .fs-focus__actions {
    justify-items: stretch;
  }

  .fs-btn {
    width: 100%;
    height: var(--fs-btn-h);
    text-align: center;
  }
}

/* 720p: tighter sheet and smaller type. 1080p and up keep the fluid card scale. */
@media (max-width: 1366px) and (min-width: 768px) {
  .fs-track {
    gap: 0.4rem;
    padding-left: 5%;
    padding-right: 5%;
  }

  .fs-focus {
    --fs-text-title: clamp(0.92rem, 2.05cqw, 1.35rem);
    --fs-text-class: clamp(0.75rem, 1.25cqw, 0.95rem);
    --fs-text-blurb: clamp(0.7rem, 1.1cqw, 0.86rem);
    --fs-text-btn: clamp(0.72rem, 1.15cqw, 0.95rem);
    --fs-btn-h: clamp(1.75rem, 3cqw, 2.2rem);
    --fs-icon-class: clamp(1rem, 1.8cqw, 1.35rem);
    --fs-icon-btn: clamp(0.85rem, 1.4cqw, 1.05rem);
  }

  .fs-lane--info {
    --fs-sheet-pad-y: clamp(0.55rem, 1.5cqw, 0.85rem);
    --fs-sheet-pad-x: clamp(0.4rem, 1cqw, 0.6rem);
  }

  .fs-focus__stitch,
  .fs-focus__main {
    gap: 0.18rem;
  }

  .fs-focus__header {
    gap: 0.22rem;
  }

  .fs-focus__title {
    min-height: 0;
  }

  .fs-focus__actions {
    column-gap: 0.4rem;
  }

  .fs-focus__meta {
    gap: 0.25rem 0.4rem;
  }
}

/* Phone: one video card, with the next one peeking so the row still swipes. */
@media (max-width: 767px) {
  .fs-shell {
    margin-bottom: 1.15rem;
  }

  .fs-track {
    gap: 0.65rem;
    padding: 0.35rem 0.75rem 0.65rem;
  }

  .fs-slide {
    width: 74vw;
    max-width: 74vw;
    transform: scale(0.97);
    opacity: 0.82;
  }

  .fs-slide.is-active {
    transform: scale(1);
    opacity: 1;
  }

  .fs-slide:not(.is-active):hover {
    transform: scale(0.97);
    opacity: 0.92;
  }

  .fs-focus__blurb {
    -webkit-line-clamp: 2;
  }

  .fs-focus__title {
    min-height: 0;
  }

  .fs-focus__media:not(:has(iframe)) .fs-focus__play {
    display: block;
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: color-mix(in srgb, #3c261d 72%, transparent);
    box-shadow: 0 0 0 2px #eac914;
    pointer-events: none;
  }

  .fs-focus__play::before {
    content: "";
    position: absolute;
    left: 1.08rem;
    top: 0.78rem;
    border-style: solid;
    border-width: 0.58rem 0 0.58rem 0.95rem;
    border-color: transparent transparent transparent #ffecdc;
  }
}

.fs-focus__play {
  display: none;
}

/* Tablet portrait: one card you can read, with a slim peek of the next. */
@media (max-width: 1100px) and (min-width: 901px) {
  .fs-shell {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .fs-track {
    gap: 0.85rem;
    padding-left: 4%;
    padding-right: 4%;
  }

  .fs-slide {
    width: 88%;
    max-width: 88%;
  }
}
