/* =====================================================================
   BC Experience (v1.1) — Banyan Courtyard
   Figma: section H-04, frame 2359 × 1066: the gallery photographs under
   black 50%; "EXPERIENCE LUXURY" (Cormorant Garamond 400 48, tracking
   56%, baseline 359), paragraph (Inter 400 20/24, 1101 wide, baselines
   446/470/494), four features (Inter 500 20, 122 apart, baseline 612).
   Desktop sizes = Figma px × --bc-u. ≤1024px uses fixed px.

   Motion (when its container comes right after the BC Gallery container
   in the hero → intro → gallery chain): the gallery stays where it is and
   darkens; then the heading dissolves out of blur (centre letters first),
   the paragraph follows, and the features arrive one by one with fine
   dividers drawing between them. Everything follows the scroll.
   ===================================================================== */

/* The Elementor container around it: no padding, full width. */
.e-con:has(> .elementor-widget-bc-experience),
.e-con:has(> .e-con-inner > .elementor-widget-bc-experience) {
  padding: 0 !important;
  --padding-top: 0px;
  --padding-right: 0px;
  --padding-bottom: 0px;
  --padding-left: 0px;
}
.e-con:has(> .e-con-inner > .elementor-widget-bc-experience) > .e-con-inner {
  max-width: none !important;
  padding: 0 !important;
}
.elementor-widget-bc-experience {
  width: 100%;
}

.bc-xp {
  --bc-u: calc(100vw / 2359);
  --bc-h: 100svh;
  --bc-xhold: 130svh;      /* stage mode: scroll length of the entrance + a short rest */
  --bc-shade: 0.5;
  --bc-ink: #fff;
  --bc-ls: 0.56em;

  position: relative;
  display: block;
  width: 100%;
  height: var(--bc-h);
  min-height: 560px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow: clip;
  color: var(--bc-ink);
}

.bc-xp .bc-xp__stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overflow: clip;
  background: #0d0b09;     /* on its own (no gallery behind) */
}
.bc-xp .bc-xp__shade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: var(--bc-shade);
  pointer-events: none;
}

/* ---------- Content ---------- */
.bc-xp .bc-xp__inner {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 213.3 * var(--bc-u));   /* heading box top = Figma 319.7 */
  padding: 0 24px;
  text-align: center;
}

.bc-xp .bc-xp__title,
.bc-xp h2.bc-xp__title,
.bc-xp h3.bc-xp__title {
  margin: 0;
  padding: 0;
  font-family: "Cormorant Garamond", "Cormorant", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: max(calc(48 * var(--bc-u)), 26px);
  line-height: 1;
  letter-spacing: var(--bc-ls);
  text-transform: uppercase;
  text-align: center;
  font-kerning: none;
  color: var(--bc-ink);
}
.bc-xp .bc-xp__name {
  display: block;
  word-spacing: var(--bc-ls);
}
.bc-xp .bc-xp__word {
  display: inline-block;
  white-space: nowrap;
}
.bc-xp .bc-xp__ch {
  display: inline-block;
  margin-right: calc(var(--k, 0) * 1em);
}
.bc-xp .bc-xp__word .bc-xp__ch:last-child {
  margin-right: calc(-1 * var(--bc-ls));
}

.bc-xp p.bc-xp__text,
.bc-xp .bc-xp__text {
  max-width: max(calc(1101 * var(--bc-u)), 640px);
  margin: calc(59.02 * var(--bc-u)) auto 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 300;   /* white on dark renders heavier than in Figma — 300 matches its look */
  font-style: normal;
  font-size: max(calc(20 * var(--bc-u)), 15px);
  line-height: 1.2;
  letter-spacing: 0;
  font-variation-settings: "opsz" 14;
  text-align: center;
  color: var(--bc-ink);
}

.bc-xp ul.bc-xp__features,
.bc-xp .bc-xp__features {
  display: flex;
  justify-content: center;
  gap: max(calc(122 * var(--bc-u)), 40px);
  margin: calc(95.99 * var(--bc-u)) 0 0;
  padding: 0;
  list-style: none;
}
.bc-xp li.bc-xp__feature,
.bc-xp .bc-xp__feature {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: max(calc(20 * var(--bc-u)), 15px);
  line-height: 1;
  letter-spacing: 0;
  font-variation-settings: "opsz" 14;
  white-space: nowrap;
  color: var(--bc-ink);
}
.bc-xp .bc-xp__feature::before {
  display: none;
}
/* fine dividers between the features (added) */
.bc-xp .bc-xp__feature + .bc-xp__feature::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(-0.5 * max(calc(122 * var(--bc-u)), 40px));
  width: 1px;
  height: max(calc(18 * var(--bc-u)), 12px);
  margin-top: calc(-0.5 * max(calc(18 * var(--bc-u)), 12px));
  background: rgba(255, 255, 255, 0.38);
  transform-origin: 50% 50%;
}


/* =====================================================================
   STAGE MODE — pure CSS layout. Chain: Hero → Intro → Gallery → this.
   - the gallery container stays where it is: sticky, bottom-aligned
     (-160svh = 100svh screen − 260svh tall: the gallery's --bc-ghold)
   - this container is pulled up over it; its stage is pinned for
     --bc-xhold of scrolling; experience.js writes --p (0 → 1, one screen)
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {

  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) {
    position: sticky;
    top: -160svh;
  }
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con {
    margin-top: -100svh;
    z-index: 1;   /* same level as every later section: DOM order stacks them */
    pointer-events: none;
  }
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .elementor-widget-bc-experience {
    pointer-events: none;
  }

  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp {
    --p: 0;
    height: calc(100svh + var(--bc-xhold));
    min-height: 0;
    overflow: visible;
    pointer-events: none;
  }
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__stage {
    position: sticky;
    top: 0;
    height: 100svh;
    background: none;
  }
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp.is-in .bc-xp__stage {
    pointer-events: auto;
  }

  /* 1. the gallery darkens                        p 0.00 → 0.30 */
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__shade {
    --x: clamp(0, calc(var(--p) / 0.3), 1);
    opacity: calc(var(--bc-shade) * var(--x) * var(--x) * (3 - 2 * var(--x)));
  }
  /* 2. the heading dissolves out of blur, centre letters first
                                                    p 0.28 → 0.68 */
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__ch {
    --lp: clamp(0, calc((var(--p) - 0.28 - var(--d) * 0.12) / 0.28), 1);
    --e: calc(1 - (1 - var(--lp)) * (1 - var(--lp)));
    opacity: var(--lp);
    filter: blur(calc((1 - var(--e)) * 0.45em));
    transform: translate3d(calc(var(--o) * 0.08em * (1 - var(--e))), 0, 0);
  }
  /* 3. the paragraph follows                       p 0.46 → 0.74 */
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__text {
    --tp: clamp(0, calc((var(--p) - 0.46) / 0.28), 1);
    --te: calc(1 - (1 - var(--tp)) * (1 - var(--tp)));
    opacity: var(--tp);
    filter: blur(calc((1 - var(--te)) * 10px));
    transform: translate3d(0, calc((1 - var(--te)) * 14 * var(--bc-u)), 0);
  }
  /* 4. the features, one by one, dividers drawing between them
                                     feature i: p 0.60 + i·0.065 → +0.20 */
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__feature {
    --fq: clamp(0, calc((var(--p) - 0.6 - var(--i) * 0.065) / 0.2), 1);
    --fe: calc(1 - (1 - var(--fq)) * (1 - var(--fq)));
    opacity: var(--fq);
    filter: blur(calc((1 - var(--fe)) * 8px));
    transform: translate3d(0, calc((1 - var(--fe)) * 12 * var(--bc-u)), 0);
  }
  .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__feature + .bc-xp__feature::after {
    transform: scaleY(var(--fe));
  }

  @media (max-width: 1024px) {
    .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__text,
    .e-con:has(> .elementor-widget-bc-hero, > .e-con-inner > .elementor-widget-bc-hero):has(+ .e-con .bc-intro[data-anim="1"]) + .e-con:has(+ .e-con .bc-gal[data-anim="1"]) + .e-con:has(+ .e-con .bc-xp[data-anim="1"]) + .e-con .bc-xp .bc-xp__feature {
      transform: translate3d(0, calc((1 - var(--te, var(--fe))) * 10px), 0);
    }
  }
}


/* =====================================================================
   TABLETS (601–1024px)
   ===================================================================== */
@media (max-width: 1024px) {
  .bc-xp .bc-xp__inner {
    top: 50%;
    transform: translateY(calc(-50% - 36px));   /* clear of the booking buttons */
  }
  .bc-xp .bc-xp__title,
  .bc-xp h2.bc-xp__title,
  .bc-xp h3.bc-xp__title {
    font-size: clamp(22px, calc((100vw - 128px) / 18.76), 34px);
  }
  .bc-xp p.bc-xp__text,
  .bc-xp .bc-xp__text {
    max-width: 600px;
    margin-top: 28px;
    font-size: 16px;
    line-height: 1.55;
  }
  .bc-xp ul.bc-xp__features,
  .bc-xp .bc-xp__features {
    flex-wrap: wrap;
    gap: 14px 40px;
    margin-top: 34px;
  }
  .bc-xp li.bc-xp__feature,
  .bc-xp .bc-xp__feature {
    font-size: 15px;
  }
  .bc-xp .bc-xp__feature + .bc-xp__feature::after {
    left: -20px;
    height: 12px;
    margin-top: -6px;
  }
}

/* =====================================================================
   PHONES (≤600px) — heading on two lines, features two by two
   ===================================================================== */
@media (max-width: 600px) {
  .bc-xp .bc-xp__title,
  .bc-xp h2.bc-xp__title,
  .bc-xp h3.bc-xp__title {
    font-size: clamp(20px, calc((100vw - 72px) / 10.8), 30px);
    line-height: 1.7;
  }
  .bc-xp .bc-xp__word {
    display: block;
  }
  .bc-xp p.bc-xp__text,
  .bc-xp .bc-xp__text {
    margin-top: 18px;
    font-size: 14.5px;
  }
  .bc-xp ul.bc-xp__features,
  .bc-xp .bc-xp__features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
    margin-top: 28px;
  }
  .bc-xp li.bc-xp__feature,
  .bc-xp .bc-xp__feature {
    font-size: 14px;
    white-space: normal;
  }
  .bc-xp .bc-xp__feature + .bc-xp__feature::after {
    display: none;
  }
}