/* IB Case Study Scroll – base styles. Elementor controls override these via {{WRAPPER}} selectors. */

.ib-cs {
  position: relative;
  width: 100%;
  --ib-dur: 0.75s;
  --ib-ease: cubic-bezier(0.77, 0, 0.18, 1);
  --ib-ld: 1;  /* left side direction  (1 = content leaves upward)  */
  --ib-rd: 1;  /* right side direction (1 = image leaves downward) */
}
.ib-cs *, .ib-cs *::before, .ib-cs *::after { box-sizing: border-box; }

.ib-cs .ib-scroll-section {
  position: sticky;
  top: 10vh;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: row;
}

/* ---------- Left panel ---------- */
.ib-cs .ib-left {
  width: 50%;
  height: 100%;
  background: #000;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  overflow: hidden;
  z-index: 2;
}

.ib-cs .ib-circle {
  position: absolute;
  border-radius: 50%;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}
.ib-cs .ib-circle-1 { width: 420px; height: 420px; top: -80px; right: -60px; }
.ib-cs .ib-circle-2 { width: 280px; height: 280px; bottom: 60px; left: -80px; }

.ib-cs .ib-center {
  width: 300px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

/* ---------- Heading ---------- */
.ib-cs .ib-heading-wrap {
  position: relative;
  width: 410px;
  max-width: none;
  height: 86px;
  margin: 0;
  overflow: hidden;
  align-self: flex-start;
}
.ib-cs .ib-heading {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  text-align: left;
  font-family: "Gambetta Font", Georgia, serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 300;
  line-height: 30px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #c9a96e;
  opacity: 0;
  transform: translateY(calc(100% * var(--ib-ld)));
  transition: transform var(--ib-dur) var(--ib-ease), opacity var(--ib-dur) var(--ib-ease);
}
.ib-cs .ib-heading.is-one-line { display: flex; align-items: flex-end; }
.ib-cs .ib-heading.is-before { transform: translateY(calc(-100% * var(--ib-ld))); }
.ib-cs .ib-heading.is-active { opacity: 1; transform: none; }

/* ---------- Card stack ---------- */
.ib-cs .ib-card-stack {
  position: relative;
  width: 300px;
  max-width: 100%;
  height: 400px;
  align-self: flex-start;
}
.ib-cs .ib-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(100% * var(--ib-ld)));
  transition: transform var(--ib-dur) var(--ib-ease), opacity var(--ib-dur) var(--ib-ease);
}
.ib-cs .ib-card.is-before { transform: translateY(calc(-100% * var(--ib-ld))); }
.ib-cs .ib-card.is-active { opacity: 1; transform: none; pointer-events: auto; }

.ib-cs .ib-thumb { width: 100%; height: 342px; overflow: hidden; }
.ib-cs .ib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ib-cs .ib-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.ib-cs .ib-location {
  font-family: "Manrope", sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
}

/* ---------- Gradient pill buttons (arrow + CTA) ---------- */
.ib-cs .ib-btn {
  --ib-c1: rgba(0, 0, 0, 0.5);
  --ib-c2: #a50000;
  --ib-stop: 45.35%;
  --ib-ang: 90deg;
  background-image:
    linear-gradient(var(--ib-ang), var(--ib-c1) var(--ib-stop), var(--ib-c2) 100%),
    linear-gradient(var(--ib-ang), var(--ib-c1) 0%, var(--ib-c2) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 1px solid transparent;
  border-radius: 85px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #fff;
  text-decoration: none;
  position: relative;
  box-sizing: border-box;
}
.ib-cs .ib-arrow {
  width: 70px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ib-cs .ib-arrow svg { width: 26px; height: auto; display: block; fill: currentColor; stroke: currentColor; }
.ib-cs .ib-arrow i { font-size: 16px; line-height: 1; }

.ib-cs .ib-cta-wrap { margin-top: 28px; align-self: flex-start; position: relative; z-index: 3; }
.ib-cs .ib-cta {
  display: inline-block;
  padding: 8px 20px;
  font-family: "Gambetta Font", Georgia, serif;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Dots ---------- */
.ib-cs .ib-dots { display: flex; gap: 8px; margin-top: 32px; position: relative; z-index: 3; }
.ib-cs .ib-dot {
  height: 2px;
  width: 24px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.4s, width 0.4s;
}
.ib-cs .ib-dot.is-active { background: #c9a96e; width: 48px; }

/* ---------- Right panel ---------- */
.ib-cs .ib-right {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.ib-cs .ib-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(calc(-100% * var(--ib-rd)));
  transition: transform calc(var(--ib-dur) + 0.1s) var(--ib-ease), opacity calc(var(--ib-dur) + 0.1s) var(--ib-ease);
}
.ib-cs .ib-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib-cs .ib-slide.is-before { transform: translateY(calc(100% * var(--ib-rd))); }
.ib-cs .ib-slide.is-active { opacity: 1; transform: none; }

.ib-cs .ib-counter {
  position: absolute;
  bottom: 32px;
  left: 32px;
  z-index: 3;
  font-family: "Cormorant Garamond", serif;
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Mobile (also controllable from Elementor responsive controls) ---------- */
@media (max-width: 767px) {
  .ib-cs .ib-center,
  .ib-cs .ib-heading-wrap,
  .ib-cs .ib-card-stack { width: 100%; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ib-cs .ib-heading, .ib-cs .ib-card, .ib-cs .ib-slide, .ib-cs .ib-dot { transition: none; }
}
