/**
 * Aidem Stacked Cards Scroller — dedicated styles
 *
 * Scope: .assc-* only. No global resets. No shared-runtime overrides.
 * Separate from, and independent of, the Scroll Card Flipper (.ascf-*).
 */

/* Force the widget itself to stretch to its full container width. Without
   this, a widget dropped into an Elementor Flexbox Container (rather than
   a legacy Section/Column) can size to its own content instead of the
   container's width — which for this widget means shrinking down to just
   the card deck's width, taking the title/CTA down with it. */
.elementor-widget-aidem_stacked_cards_scroller {
  width: 100%;
}
.elementor-widget-aidem_stacked_cards_scroller > .elementor-widget-container {
  width: 100%;
}

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.assc-section {
  width: 100%;
  min-height: var(--assc-section-min-height, 100svh);
  position: relative;
  overflow: hidden;
}

/* ── Section title (static, stays on screen for the whole pin) ──────────── */
.assc-heading-wrap {
  position: absolute;
  top: var(--assc-heading-top, 40px);
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
}
.assc-heading-wrap * {
  pointer-events: auto;
}
.assc-heading-title {
  margin: 0;
  padding: 0 2rem;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

/* ── Title entrance effects ──────────────────────────────────────────────
   Applied once, when the heading scrolls into view (JS toggles the
   .assc-in-view class via IntersectionObserver — vanilla, no GSAP needed).
   Duration is controllable per-instance via --assc-title-fx-duration. ── */

/* Slide Up: starts below, rises + fades in */
.assc-heading-wrap[data-title-fx="slide_up"] .assc-heading-title {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--assc-title-fx-duration, 0.7s) ease, transform var(--assc-title-fx-duration, 0.7s) ease;
}
.assc-heading-wrap[data-title-fx="slide_up"].assc-in-view .assc-heading-title {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Down: starts above, drops + fades in */
.assc-heading-wrap[data-title-fx="slide_down"] .assc-heading-title {
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity var(--assc-title-fx-duration, 0.7s) ease, transform var(--assc-title-fx-duration, 0.7s) ease;
}
.assc-heading-wrap[data-title-fx="slide_down"].assc-in-view .assc-heading-title {
  opacity: 1;
  transform: translateY(0);
}

/* Fade In — Word by Word: each .assc-heading-word (added by JS) fades up
   in sequence, staggered by its own --assc-word-i index. */
.assc-heading-wrap[data-title-fx="fade_words"] .assc-heading-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--assc-title-fx-duration, 0.7s) ease, transform var(--assc-title-fx-duration, 0.7s) ease;
  transition-delay: calc(var(--assc-word-i, 0) * 0.09s);
}
.assc-heading-wrap[data-title-fx="fade_words"].assc-in-view .assc-heading-word {
  opacity: 1;
  transform: translateY(0);
}

/* ── CTA button (static, stays on screen for the whole pin) ───────────────
   The button itself is Elementor's own .elementor-button markup, so it
   automatically picks up the site's global Button style (Site Settings →
   Buttons) — no colour/typography rules are set here on purpose. Only
   position/layout for this widget's wrapper is handled below. */
.assc-cta-wrap {
  position: absolute;
  bottom: var(--assc-cta-bottom, 40px);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
.assc-cta-wrap * {
  pointer-events: auto;
}
.assc-cta-wrap .elementor-button-wrapper {
  display: inline-block;
}

/* ── Stage: centres the deck ─────────────────────────────────────────────── */
.assc-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--assc-section-min-height, 100svh);
  padding: 2rem;
  position: relative;
}

/* ── Deck: fixed footprint that every card sits inside, overlapping ─────── */
.assc-deck {
  position: relative;
  width: var(--assc-card-w, 400px);
  height: var(--assc-card-h, 560px);
}

/* ── Card outer wrapper — scroll-progress transforms land here (JS) ─────── */
.assc-card-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  will-change: transform, opacity;
}

/* ── Float wrapper — continuous idle bob, independent of scroll ─────────── */
.assc-card-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: assc-float var(--assc-float-speed, 4s) ease-in-out infinite alternate;
  animation-delay: var(--assc-float-delay, 0s);
}

@keyframes assc-float {
  0%   { transform: translateY(calc(var(--assc-float-amount, 10px) * -1)); }
  100% { transform: translateY(var(--assc-float-amount, 10px)); }
}

/* ── Flip mechanics — 3D rotation lands on .assc-flip-inner only (JS) ───── */
.assc-flip-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  perspective: 1500px;
}

.assc-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Card faces (front / back) ───────────────────────────────────────────── */
.assc-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border-radius: var(--assc-card-radius, 20px);
  background-color: var(--assc-face-bg, #16213e);
  display: flex;
  flex-direction: column;
}

.assc-face--front {
  transform: translateZ(1px);
}

.assc-face--back {
  transform: translateZ(-1px) rotateY(180deg);
}

/* Editor-only static preview of the top card's back face
   (toggled server-side by the Preview Back Face in Editor switch). */
.assc-section.assc-preview-back .assc-card-item[data-index="0"] {
  opacity: 1;
}
.assc-section.assc-preview-back .assc-card-item[data-index="0"] .assc-flip-inner {
  transform: rotateY(180deg);
}

/* ── Background image layer ──────────────────────────────────────────────── */
.assc-face-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ── Content body ────────────────────────────────────────────────────────── */
.assc-face-body {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.assc-face-body * {
  pointer-events: auto;
}

/* ── Title wrap ──────────────────────────────────────────────────────────── */
.assc-title-wrap {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* ── Short text wrap ─────────────────────────────────────────────────────── */
.assc-text-wrap {
  position: absolute;
  bottom: 32px;
  left: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* ── Title ───────────────────────────────────────────────────────────────── */
.assc-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2.2rem);
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

/* ── Short text ──────────────────────────────────────────────────────────── */
.assc-text {
  margin: 0;
  font-size: clamp(0.85rem, 1.2vw, 1.05rem);
  color: #b0b0b0;
  line-height: 1.6;
}

/* ── Editor notice (shown when < 3 cards) ────────────────────────────────── */
.assc-editor-notice {
  padding: 20px;
  background: rgba(255, 180, 0, 0.15);
  border: 1px solid rgba(255, 180, 0, 0.4);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
}
