/* ============================================================
   GSAP Elementor Suite v4 — Stylesheet
   Baseline layout only. Colors/sizes controlled by Elementor.
   ============================================================ */

/* ── Global ─────────────────────────────────────────────── */
.gses-sg-grid,
.gses-counter-grid { display: grid; }

/* FOUC prevention lives near the bottom of the file. */

/* ── 1. Stagger Grid ─────────────────────────────────────── */
.gses-sg-grid {
  width: 100%;
  overflow: visible;
}

.gses-sg-item {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform var(--gses-sg-hover-duration, 0.3s) ease, box-shadow var(--gses-sg-hover-duration, 0.3s) ease, border-color var(--gses-sg-hover-duration, 0.3s) ease, background-color var(--gses-sg-hover-duration, 0.3s) ease;
  text-decoration: none;
  color: inherit;
}

[data-widget="stagger-grid"],
.gses-sg-grid {
  overflow: visible;
}
.gses-sg-item:hover {
  transform: translateY(var(--gses-sg-hover-y, -6px)) scale(var(--gses-sg-hover-scale, 1)) rotate(var(--gses-sg-hover-rotate, 0deg));
}

.gses-sg-image-top { overflow: hidden; position: relative; z-index: 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.gses-sg-image-top img { display: block; width: 100%; transition: transform 0.5s ease, opacity 0.35s ease; backface-visibility: hidden; -webkit-backface-visibility: hidden; }

/* Hover image swap */
.gses-sg-img-primary { position: relative; z-index: 1; opacity: 1; }
.gses-sg-img-hover   { position: absolute; inset: 0; z-index: 2; opacity: 0; object-fit: cover; width: 100%; height: 100%; pointer-events: none; }
.gses-sg-has-hover-img:hover .gses-sg-img-hover   { opacity: 1; }
.gses-sg-has-hover-img:hover .gses-sg-img-primary { opacity: 0; }

.gses-sg-content,
.gses-sg-icon,
.gses-sg-number {
  position: relative;
  z-index: 3;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.gses-sg-content { flex: 1; display: flex; flex-direction: column; }
.gses-sg-title   { margin: 0; transition: color 0.3s ease; }
.gses-sg-desc    { margin: 0; transition: color 0.3s ease; }
.gses-sg-number  { display: block; font-weight: 700; transition: color 0.3s ease; }
.gses-sg-icon    { display: inline-flex; align-items: center; transition: transform 0.3s ease, color 0.3s ease; }
.gses-sg-icon-circle { border-radius: 50%; }

.gses-sg-readmore {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; font-weight: 600; margin-top: auto;
  color: inherit; cursor: pointer;
}
.gses-sg-arrow { display: inline-flex; transition: transform 0.3s ease; }

/* ── 2. Animated Counter ─────────────────────────────────── */
.gses-counter-grid { width: 100%; }

.gses-counter-item {
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.gses-counter-icon-left  .gses-counter-item { flex-direction: row; align-items: center; }
.gses-counter-icon-right .gses-counter-item { flex-direction: row-reverse; align-items: center; }

.gses-counter-number  { display: flex; align-items: baseline; flex-wrap: wrap; }
.gses-counter-prefix  { order: 0; }
.gses-counter-value   { order: 1; }
.gses-counter-suffix  { order: 2; }
.gses-counter-label,
.gses-counter-sublabel{ display: block; }
.gses-counter-icon    { display: inline-flex; align-items: center; }

/* ── 3. SplitText ────────────────────────────────────────── */
.gses-split-line,
.gses-split-word,
.gses-split-char { display: inline-block; }
.gses-split-line { display: block; }
.gses-st-highlight { color: var(--gses-st-highlight-color, #ef4444); }
.gses-st-highlight .gses-split-word,
.gses-st-highlight .gses-split-char { color: inherit; }

/* ── 4. Progress Bars ────────────────────────────────────── */
.gses-progress-bars { display: grid; width: 100%; }

.gses-pb-item { position: relative; }
.gses-pb-header { display: flex; justify-content: space-between; align-items: center; }
.gses-pb-label-wrap { display: flex; align-items: center; gap: 6px; flex: 1; }
.gses-pb-icon    { display: inline-flex; align-items: center; }
.gses-pb-label   { font-weight: 600; }
.gses-pb-sublabel { display: block; opacity: 0.65; }
.gses-pb-value   { font-weight: 700; white-space: nowrap; }
.gses-pb-value-on { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.gses-pb-value-center { position: absolute; text-align: center; display: flex; flex-direction: column; align-items: center; }

/* Horizontal */
.gses-pb-track { overflow: hidden; position: relative; border-radius: 100px; }
.gses-pb-fill  { height: 100%; width: 0; border-radius: inherit; position: relative; transition: background-color 0.3s; }

/* Vertical */
.gses-pb-track-vertical { overflow: hidden; position: relative; border-radius: 100px; }
.gses-pb-track-vertical .gses-pb-fill { width: 100%; height: 0; position: absolute; bottom: 0; }

/* Circular */
.gses-pb-circular { position: relative; display: inline-flex; align-items: center; justify-content: center; }

/* Striped */
.gses-pb-striped .gses-pb-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.18) 0px, rgba(255,255,255,0.18) 8px, transparent 8px, transparent 16px
  );
  background-size: 22px 22px;
}
.gses-pb-striped-animate .gses-pb-fill::after { animation: gses-stripes 0.6s linear infinite; }
@keyframes gses-stripes { to { background-position: 22px 0; } }
.gses-pb-track.gses-pb-glow { box-shadow: 0 0 16px var(--bar-color, currentColor); }
.gses-pb-circular.gses-pb-glow .gses-pb-circular-fill { filter: drop-shadow(0 0 6px var(--bar-color, currentColor)); }

/* ── 5. Timeline ─────────────────────────────────────────── */
.gses-tl-wrapper { position: relative; display: flex; flex-direction: column; width: 100%; }
.gses-tl-line-wrap {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.gses-tl-line-track { position: relative; width: 2px; height: 100%; overflow: hidden; }
.gses-tl-wrapper[data-line-style="dashed"] .gses-tl-line-track,
.gses-tl-wrapper[data-line-style="dashed"] .gses-tl-line-fill {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 12px, transparent 12px 20px);
  mask-image: repeating-linear-gradient(to bottom, #000 0 12px, transparent 12px 20px);
}
.gses-tl-wrapper[data-line-style="dotted"] .gses-tl-line-track,
.gses-tl-wrapper[data-line-style="dotted"] .gses-tl-line-fill {
  -webkit-mask-image: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 9px);
  mask-image: repeating-linear-gradient(to bottom, #000 0 3px, transparent 3px 9px);
}
.gses-tl-line-fill { position: absolute; inset: 0; transform-origin: top center; }
.gses-tl-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}
.gses-tl-dot-wrap { grid-column: 2; grid-row: 1; display: flex; justify-content: center; }
.gses-tl-dot  { position: relative; z-index: 1; flex-shrink: 0; border-radius: 50%; }
.gses-tl-card {
  display: block;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.gses-tl-side-left .gses-tl-card { grid-column: 1; grid-row: 1; }
.gses-tl-side-right .gses-tl-card { grid-column: 3; grid-row: 1; }
.gses-tl-date,
.gses-tl-title { margin: 0; }
.gses-tl-desc { margin: 0; }
.gses-tl-image { display: block; width: 100%; height: auto; }
.gses-tl-dot.is-pulsing { animation: gses-tl-pulse 1.4s ease-in-out infinite; }
.gses-tl-dot-square .gses-tl-dot { border-radius: 0; }
.gses-tl-dot-diamond .gses-tl-dot-wrap { transform: rotate(45deg); }
@keyframes gses-tl-pulse { 0%,100%{ box-shadow: 0 0 0 0 currentColor; } 50%{ box-shadow: 0 0 0 8px transparent; } }

@media (max-width: 767px) {
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-line-wrap { left: 8px; transform: none; }
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-item {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
  }
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-dot-wrap { grid-column: 1; }
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-card,
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-side-left .gses-tl-card,
  .gses-tl-wrapper[data-mobile-collapse="yes"] .gses-tl-side-right .gses-tl-card { grid-column: 2; }
}

/* ── 6. DrawSVG ──────────────────────────────────────────── */
.gses-draw-svg svg { overflow: visible; }

/* ── 7. MorphSVG ─────────────────────────────────────────── */
.gses-morph-svg svg { overflow: visible; }

/* ── 8. ScrambleText ─────────────────────────────────────── */
.gses-scramble { display: block; min-height: 1em; }
.gses-scramble-caret { display: inline-block; animation: gses-blink 1s step-end infinite; }
@keyframes gses-blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* ── 9. Marquee ──────────────────────────────────────────── */
.gses-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Fade edge masks */
.gses-marquee-fade {
  --fade-size: 80px;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black var(--fade-size),
    black calc(100% - var(--fade-size)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black var(--fade-size),
    black calc(100% - var(--fade-size)),
    transparent 100%
  );
}

/* Vertical marquees need vertical mask */
.gses-marquee[data-direction="up"].gses-marquee-fade,
.gses-marquee[data-direction="down"].gses-marquee-fade {
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black var(--fade-size),
    black calc(100% - var(--fade-size)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black var(--fade-size),
    black calc(100% - var(--fade-size)),
    transparent 100%
  );
}

.gses-marquee-row { width: 100%; }

.gses-marquee-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  align-items: center;
  will-change: transform;
}

.gses-marquee[data-direction="up"]   .gses-marquee-track,
.gses-marquee[data-direction="down"] .gses-marquee-track {
  flex-direction: column;
  width: 100%;
  height: max-content;
}

.gses-marquee-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  gap: 8px;
  white-space: nowrap;
  transition: color 0.25s ease;
}
.gses-marquee-item img { display: block; object-fit: contain; }
.gses-marquee-sep { display: inline-flex; align-items: center; flex-shrink: 0; }

/* ── 10. 3D Tilt Card ────────────────────────────────────── */
.gses-tilt-grid {
  display: grid;
  width: 100%;
  overflow: visible;
  padding: 16px;
  margin: -16px;
}
.gses-tilt-anim {
  display: block;
  max-width: 100%;
  width: 100%;
  overflow: visible;
}
.gses-tilt-grid .gses-tilt-anim {
  min-width: 0;
}
.gses-tilt-grid .gses-tilt-outer {
  width: 100%;
  max-width: none !important;
}

.gses-tilt-outer {
  perspective: 1000px;
  display: block;
  cursor: pointer;
  overflow: visible;
  transform-style: preserve-3d;
  contain: layout;
  /* Outer is the perspective container only — never paint a background here.
     Prevents themes/Elementor parent rules from leaking a "box behind" the card. */
  background: transparent;
}

.gses-tilt-inner {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transform: translate3d(0,0,0) rotateX(0deg) rotateY(0deg) scale(1);
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}

.gses-tilt-glare-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  z-index: 10;
}
.gses-tilt-glare {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  opacity: 0.14;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 18%, rgba(255,255,255,0.9) 45%, transparent 68%);
}

.gses-tilt-badge {
  display: inline-flex;
  align-items: center;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.gses-tilt-content-layer {
  transform-style: preserve-3d;
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gses-tilt-icon   { display: inline-flex; align-items: center; }
.gses-tilt-eyebrow { display: block; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75em; }
.gses-tilt-title  { margin: 0; }
.gses-tilt-desc   { margin: 0; }

/* ── 11. Magnetic Button ─────────────────────────────────── */
.gses-mag-wrap {
  display: flex;
  position: relative;
}

.gses-mag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  white-space: nowrap;
  will-change: transform;
  transform: translate3d(0,0,0) rotate(0deg) scale(1);
  transform-origin: center center;
  font-family: inherit;
  line-height: 1;
}

.gses-mag-btn-inner {
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.gses-mag-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.gses-mag-text { display: inline-block; }

/* ── Reduced-motion global override ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gses-respect-reduced-motion [data-widget],
  .gses-respect-reduced-motion [data-gses-animation] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .gses-respect-reduced-motion .gses-tilt-inner {
    transform: none !important;
  }
}

/* ── Prevent flash of invisible elements before JS runs (FOUC guard) ─── */
/*
 * The JS IIFE adds .gses-js to <html> immediately on script execution.
 * Any [data-widget] or [data-gses-animation] element without data-gses-init
 * is hidden until GSAP initialises it and sets data-gses-init="1".
 * If GSAP fails (CDN down, JS error), revealStatic() removes .gses-js so
 * nothing stays hidden permanently.
 *
 * NOT wrapped in prefers-reduced-motion — the rule must fire even in that
 * case; the reduced-motion path in JS calls reveal() + markInit() immediately
 * so elements are visible at their natural state without any animation.
 */
.gses-js [data-widget]:not([data-gses-init]),
.gses-js [data-gses-animation]:not([data-gses-init]),
.gses-js .gses-marquee:not([data-gses-init]) {
  opacity: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ── Prevent x-axis entry animations from causing a horizontal scrollbar ── */
/*
 * `overflow-x: clip` is used instead of `overflow-x: hidden` because:
 *  - hidden creates a new formatting context that breaks position:sticky inside
 *  - clip clips the overflowing content WITHOUT creating a scroll container
 * This prevents 40px x-offset animations from adding a right-side scrollbar
 * while keeping sticky headers and fixed children working normally.
 */
[data-widget]:not([data-widget="tilt-card"]):not([data-widget="stagger-grid"]) {
  overflow-x: clip;
}

[data-widget="tilt-card"],
.gses-tilt-outer,
[data-widget="stagger-grid"],
.gses-sg-grid {
  overflow: visible;
}

/* Utility: suppress CSS transitions during GSAP scroll-reveal so the CSS
   transition engine doesn't fight GSAP's per-frame transform updates.
   Added/removed via JS classList — more reliable than GSAP's clearProps
   which doesn't handle the non-animated 'transition' CSS property. */
.gses-no-transition,
.gses-no-transition * {
  transition: none !important;
}
