/* ---------------------------------------------------------------------------
   scene-tabs — tabbed scene carousel: photo + floating product-UI panel per
   scene, tab row on desktop, swipeable cards on phones.

   Loaded by resources/views/components/sections/scene-tabs.blade.php.
   Plain CSS — no Tailwind @apply here.
   Bump the ?v in that component's <link> whenever this file changes.

   Layout switches on the stage's own width (container "scene-tabs", 760px),
   not the viewport, and the script in the component uses the same threshold.
   Page CSS that styles the panel contents can query the same container, and
   "st-slide" for the width of a single phone card.
--------------------------------------------------------------------------- */

.section-scene-tabs {
  --st-ink: #17223a;
  --st-muted: #738095;
  --st-rule: #dfe6f1;
  --st-panel-ink: #303846;
  --st-panel-bg: #eff2f7;
  --st-shadow: 0 8px 22px rgba(23, 34, 58, 0.05);
}

.section-scene-tabs .st-stage {
  container: scene-tabs / inline-size;
  color: var(--st-ink);
}

.section-scene-tabs .st-title {
  margin: 0 auto 24px;
  text-align: center;
}

/* ---- phones: swipeable scene cards ---- */
.section-scene-tabs .st-track {
  --st-slide-width: clamp(272px, 85vw, 370px);
  --st-gutter: calc((100vw - var(--st-slide-width)) / 2);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 32px;
  width: 100vw;
  margin-inline: calc((100% - 100vw) / 2);
  padding: 0 var(--st-gutter) 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--st-gutter);
  scrollbar-width: none;
  isolation: isolate;
}

.section-scene-tabs .st-track::-webkit-scrollbar {
  display: none;
}

.section-scene-tabs .st-slide {
  flex: 0 0 var(--st-slide-width);
  min-width: 0;
  container: st-slide / inline-size;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.section-scene-tabs .st-visual {
  position: relative;
  width: 100%;
  height: 455px;
  isolation: isolate;
}

.section-scene-tabs .st-photo {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  max-width: none;
  height: 215px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 10px;
  box-shadow: var(--st-shadow);
}

.section-scene-tabs .st-photo-frame {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  height: 215px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--st-shadow);
}

.section-scene-tabs .st-photo-frame .st-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-position: var(--st-frame-position, center);
  transform: scale(var(--st-frame-scale, 1));
  transform-origin: var(--st-frame-origin, center);
  border-radius: 0;
  box-shadow: none;
}

/* Laid out at 1/0.84 of the card and scaled down, so the panel keeps its
   desktop proportions inside a phone card. */
.section-scene-tabs .st-panel {
  position: absolute;
  z-index: 3;
  top: 185px;
  left: 0;
  width: calc(100% / 0.84);
  padding: 12px;
  border-radius: 12px;
  background: var(--st-panel-bg);
  color: var(--st-panel-ink);
  font-size: 14px;
  line-height: 1.4;
  transform: scale(0.84);
  transform-origin: top left;
}

.section-scene-tabs .st-panel h3 {
  margin: 0 0 10px;
  color: var(--st-panel-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-scene-tabs .st-copy {
  max-width: 315px;
  padding-top: 20px;
}

.section-scene-tabs .st-copy h3 {
  margin: 0 0 17px;
  color: var(--st-ink);
  font-size: 23px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.65px;
}

.section-scene-tabs .st-copy p {
  margin: 0;
  color: var(--st-muted);
  font-size: 16px;
  line-height: 1.55;
}

.section-scene-tabs .st-tabs {
  display: none;
}

/* Keyboard-only: hidden until it takes focus. */
.section-scene-tabs .st-play {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.section-scene-tabs .st-play:focus-visible {
  position: relative;
  display: block;
  width: max-content;
  height: auto;
  min-height: 40px;
  margin: 14px auto 0;
  padding: 8px 12px;
  overflow: visible;
  border-radius: 8px;
  clip-path: none;
  background: var(--color-white);
  color: var(--color-blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.section-scene-tabs button:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 4px;
}

.section-scene-tabs .st-track:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

/* The page gutter is 16px here: cards start on the content edge and the row
   runs out to the right edge of the screen, so the next card peeks in. */
@media (max-width: 600px) {
  .section-scene-tabs .st-track {
    --st-slide-width: 70vw;
    width: calc(100% + 16px);
    margin: 0;
    padding: 0 calc(100% - var(--st-slide-width)) 7px 0;
    gap: 18px;
    scroll-padding-left: 0;
  }

  .section-scene-tabs .st-slide {
    scroll-snap-align: start;
  }

  .section-scene-tabs .st-copy h3 {
    font-size: 22px;
  }
}

/* ---- desktop: one scene at a time, tab row below ---- */
@container scene-tabs (min-width: 760px) {
  .section-scene-tabs .st-title {
    margin-bottom: 36px;
  }

  /* Every scene sits in the same grid cell, so switching crossfades without
     the height jumping. */
  .section-scene-tabs .st-track {
    display: grid;
    width: 100%;
    margin-inline: 0;
    padding: 0;
    overflow: visible;
    scroll-padding-inline: 0;
  }

  .section-scene-tabs .st-slide {
    grid-area: 1 / 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
  }

  .section-scene-tabs .st-slide.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  .section-scene-tabs .st-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1072px;
    height: 455px;
    margin: 0 auto;
  }

  /* Panel and photo are offset 22px in opposite directions and overlap by
     28px, so the two read as one staggered composition. */
  .section-scene-tabs .st-panel {
    position: relative;
    top: -22px;
    flex: none;
    width: 480px;
    max-width: 50%;
    min-height: 365px;
    margin-right: -28px;
    padding: 20px;
    border-radius: 14px;
    background: transparent;
    transform: none;
  }

  .section-scene-tabs .st-panel h3 {
    margin-bottom: 18px;
    font-size: 20px;
  }

  .section-scene-tabs .st-photo,
  .section-scene-tabs .st-photo-frame {
    position: relative;
    z-index: 2;
    top: 22px;
    flex: none;
    width: 400px;
    max-width: 42%;
    height: 425px;
    border-radius: 12px;
  }

  .section-scene-tabs .st-slide--photo-first .st-photo,
  .section-scene-tabs .st-slide--photo-first .st-photo-frame {
    order: -1;
    margin-right: -28px;
  }

  .section-scene-tabs .st-slide--photo-first .st-panel {
    margin-right: 0;
  }

  .section-scene-tabs .st-copy {
    display: none;
  }

  .section-scene-tabs .st-tabs {
    display: grid;
    grid-template-columns: repeat(var(--st-count, 4), minmax(0, 1fr));
    gap: 32px;
    margin-top: 48px;
  }

  .section-scene-tabs .st-tab {
    position: relative;
    align-self: stretch;
    padding: 19px 0 0;
    border: 0;
    border-top: 3px solid var(--st-rule);
    border-radius: 0;
    background: none;
    color: #27344d;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .section-scene-tabs .st-tab[aria-selected="true"]::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: var(--color-blue);
    transform-origin: left center;
  }

  .section-scene-tabs .is-playing .st-tab[aria-selected="true"]::before {
    animation: st-progress 5s linear forwards;
  }

  .section-scene-tabs .st-tab:hover .st-tab-title,
  .section-scene-tabs .st-tab[aria-selected="true"] .st-tab-title {
    color: var(--color-blue);
  }

  .section-scene-tabs .st-tab-title {
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: -0.35px;
  }

  .section-scene-tabs .st-tab-copy {
    display: block;
    color: var(--st-muted);
    font-size: 15px;
    line-height: 1.55;
  }
}

@keyframes st-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-scene-tabs .st-track {
    scroll-behavior: auto !important;
  }

  .section-scene-tabs .st-slide {
    transition: none !important;
  }

  .section-scene-tabs .is-playing .st-tab[aria-selected="true"]::before {
    animation: none;
  }
}
