/* ================================================
   Widget 2 — Numbered Card Slider
   ecs-numbered.css  (v3 — number typography + bg image support)
   ================================================ */

/* ── Wrapper ── */
.ecsn-wrapper {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* ── Nav row ── */
.ecsn-nav-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.ecsn-nav-arrow {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1.5px solid #ddd;
  background: #f0eeec;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, border-color .25s, color .25s;
  flex-shrink: 0;
  line-height: 1;
}
.ecsn-nav-arrow:hover { background: #7c2d55; border-color: #7c2d55; color: #fff; }
.ecsn-nav-arrow i,
.ecsn-nav-arrow svg { pointer-events: none; }

/* ── Clip wrapper
      overflow-x: hidden  → hides cards scrolled off left/right
      overflow-y: visible → lets the scale-up card breathe top/bottom    ── */
.ecsn-track-clip {
  overflow-x: hidden;
  overflow-y: visible;
  padding-top: 12px;
  padding-bottom: 12px;
  margin-top: -12px;
  margin-bottom: -12px;
}

/* ── Track ── */
.ecsn-track {
  display: flex;
  gap: 16px;
  min-height: 300px;
  align-items: center;   /* vertically centre so scale expands equally up and down */
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 50px;
  padding-bottom: 50px;
}
.ecsn-track::-webkit-scrollbar { display: none; }

/* ── Card base ── */
.ecsn-card {
  position: relative;
  flex: 1 0 200px;
  min-width: 200px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  background: #e8e5e2;
  /* Scale grows upward from bottom — matches reference screenshot */
  transform-origin: center bottom;
  /* GSAP owns background-color — no CSS transition for it */
  will-change: transform, background-color;
  transition: box-shadow .3s ease;
}

.ecsn-card:focus-visible {
  box-shadow: 0 0 0 3px #7c2d55;
}

/* ══════════════════════════════════════════════
   BACKGROUND IMAGE LAYER
   Absolutely fills the card behind all content.
   GSAP fades opacity 0→1 when card becomes active.
   ═══════════════════════════════════════════ */
.ecsn-bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;           /* GSAP animates this — start hidden */
  z-index: 0;
  /* Subtle zoom on the image itself when active — pure CSS, no JS needed */
  transition: transform 0.7s ease;
  transform: scale(1);
}
.ecsn-card.is-active .ecsn-bg-img {
  transform: scale(1.06);   /* gentle Ken Burns effect */
}

/* ── Overlay — sits between image and text to ensure contrast ── */
.ecsn-bg-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.35); /* overridden by Elementor selector */
  z-index: 1;
  pointer-events: none;
  /* Only show overlay when image is present and card is active */
  opacity: 0;
  transition: opacity 0.4s ease;
}
.ecsn-card.is-active.has-bg-image .ecsn-bg-overlay {
  opacity: 1;
}

/* ── Inner content (above bg image + overlay) ── */
.ecsn-inner {
  position: relative;
  z-index: 2;           /* above .ecsn-bg-img (z:0) and .ecsn-bg-overlay (z:1) */
  height: 100%;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  box-sizing: border-box;
}

/* ── Title ── */
.ecsn-title {
  font-size: 18px;
  font-weight: 700;
  color: #3a3a3a;
  line-height: 1.3;
  position: relative;
  z-index: 2;
  /* GSAP animates colour — no CSS colour transition */
}

/* ── Description (hidden until active, GSAP animates in) ── */
.ecsn-desc {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, .85);
  line-height: 1.65;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
}

/* ── Button ── */
.ecsn-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border: 1.5px solid rgba(255, 255, 255, .6);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  width: fit-content;
  cursor: pointer;
  position: relative;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: background .25s;
  pointer-events: none;
}
.ecsn-btn:hover { background: rgba(255, 255, 255, .15); }

/* ══════════════════════════════════════════════
   GHOST NUMBER
   Sits at z-index 1 — above bg image (z:0),
   below overlay (z:1) only if card has image;
   use z-index 3 so it's always above overlay.
   ═══════════════════════════════════════════ */
.ecsn-number {
  position: absolute;
  bottom: -18px;
  right: 8px;
  /* ── Typography defaults (overridden by Elementor Group_Control_Typography) ── */
  font-size: 140px;
  font-weight: 900;
  line-height: 1;
  /* ── Colour (overridden by Elementor colour controls + GSAP) ── */
  color: rgba(255, 255, 255, .55);
  /* ── Layout ── */
  pointer-events: none;
  user-select: none;
  z-index: 3;           /* above overlay so number is always visible */
  letter-spacing: -4px;
  overflow: visible;
  /* GSAP cross-fades colour on activate/deactivate */
}

/* ── Active card baseline (GSAP overrides bg-color at runtime) ── */
.ecsn-card.is-active {
  background: #7c2d55;
}
.ecsn-card.is-active .ecsn-title { color: #fff; }
.ecsn-card.is-active .ecsn-btn   { pointer-events: all; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .ecsn-card   { flex: 0 0 200px; }
  .ecsn-number { font-size: 100px; }
}
@media (max-width: 480px) {
  .ecsn-card   { flex: 0 0 170px; }
  .ecsn-number { font-size: 80px; }
  .ecsn-title  { font-size: 15px; }
}
