/* NxGen Addons — Cinematic Hero Banner
   BEM + CSS custom properties
   Refactored 1.0.13 — Responsive visible thumbnails, Layout B no-gap, mobile fixes, Elementor re-init
*/

/* =========================
   Variables & Base
========================= */
.nx-chb {
    --chb-transition-bg: 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    --chb-overlay-default: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 100%);
    min-height: 100vh; /* fallback before Elementor responsive selector fires */
}

.nx-chb-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    font-family: var(--mx-font-family);
}

/* =========================
   Base Container
========================= */
.nx-chb {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* =========================
   Background Slides
========================= */
.nx-chb__backgrounds {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.nx-chb__bg {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--chb-transition-bg);
    will-change: opacity;
}

.nx-chb__bg.is-active { opacity: 1; }

.nx-chb__bg--image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.nx-chb__bg--video-wrap { overflow: hidden; }

.nx-chb__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   Overlay
========================= */
.nx-chb__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: var(--chb-overlay-default); /* default; overridden by Elementor Group_Control_Background */
}

/* Overlay background is now managed by Elementor's Group_Control_Background selector */

/* =========================
   Container & Content
========================= */
.nx-chb__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    display: block;
    /* vertical offset uses CSS clamp() to enforce boundaries; no overflow:hidden needed here */
}

/* ── Position wrapper ─────────────────────────────────────────────────
   Spans the full usable width. Uses column-flex so align-items drives
   horizontal placement of the inner .nx-chb__content block.          */
.nx-chb__content-pos {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* default: left */
    padding: 80px 0; /* hero vertical breathing room */
}
.nx-chb--align-center .nx-chb__content-pos { align-items: center; }
.nx-chb--align-right  .nx-chb__content-pos { align-items: flex-end; }

.nx-chb__content {
    /* width + max-width driven by Elementor responsive selector */
    /* 80% = 80% of 1400px = 1120px; 100% = full hero width */
    flex-shrink: 0;
}

/* Text alignment within the content block */
.nx-chb--align-center .nx-chb__content { text-align: center; }
.nx-chb--align-right  .nx-chb__content { text-align: right; }

/* Center heading/subheading blocks (they have max-width so need auto margins) */
.nx-chb--align-center .nx-chb__heading,
.nx-chb--align-center .nx-chb__subheading { margin-left: auto; margin-right: auto; }
.nx-chb--align-right  .nx-chb__heading,
.nx-chb--align-right  .nx-chb__subheading { margin-left: auto; margin-right: 0; }

.nx-chb__btn-wrap { display: flex; justify-content: flex-start; } /* left: default */
.nx-chb--align-center .nx-chb__btn-wrap { justify-content: center; }
.nx-chb--align-right  .nx-chb__btn-wrap { justify-content: flex-end; }

/* =========================
   Typography
========================= */
.nx-chb__heading {
    font-size: clamp(32px, 5vw, 64px);
    font-weight: var(--mx-weight-bold);
    line-height: var(--mx-leading-tight);
    margin: 0 0 var(--mx-gap) 0;
}

.nx-chb__subheading {
    font-size: clamp(var(--mx-font-base), 2vw, var(--mx-font-lg));
    line-height: var(--mx-leading-relaxed);
    margin: 0 0 var(--mx-gap-xl) 0;
    opacity: 0.85;
}

.nx-chb__description {
    margin: 0 0 var(--mx-gap-xl) 0;
    line-height: var(--mx-leading-relaxed);
}

/* =========================
   Button
========================= */
.nx-chb__btn-wrap {
    display: flex;
    gap: var(--mx-gap);
    flex-wrap: wrap;
    margin-bottom: var(--mx-gap-xl);
}

.nx-chb__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: var(--mx-radius);
    font-size: var(--mx-font-base);
    font-weight: var(--mx-weight-semibold);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--mx-transition), color var(--mx-transition), border-color var(--mx-transition), transform var(--mx-transition);
    outline: none;
    line-height: 1;
}

.nx-chb__btn:focus-visible { box-shadow: var(--mx-focus); }
.nx-chb__btn:active { transform: translateY(1px); }

.nx-chb__btn-icon-inner { display: inline-flex; align-items: center; line-height: 1; }
.nx-chb__btn-icon-inner svg,
.nx-chb__btn-icon-inner i { width: 1em; height: 1em; color: currentColor; fill: currentColor; }

/* =========================
   Entrance Animations
========================= */
.nx-chb__subheading.nx-chb__animate,
.nx-chb__heading.nx-chb__animate,
.nx-chb__description.nx-chb__animate,
.nx-chb__btn-wrap.nx-chb__animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.nx-chb__subheading.nx-chb__animate.is-visible { opacity: 1; transform: translateY(0); transition-delay: 0s; }
.nx-chb__heading.nx-chb__animate.is-visible    { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.nx-chb__description.nx-chb__animate.is-visible{ opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.nx-chb__btn-wrap.nx-chb__animate.is-visible   { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }

/* =========================
   Progress Bar
========================= */
.nx-chb__progress-bar {
    height: 3px;
    flex: 1;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    min-width: 40px;
}

.nx-chb__progress-fill {
    height: 100%;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.1s linear;
}

/* =========================
   Nav Wrap & Controls
========================= */
.nx-chb__nav-wrap {
    position: absolute;
    bottom: 30px;
    right: 40px;
    z-index: 10;
    display: inline-grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--mx-gap-sm);
}

.nx-chb__bottom-bar {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--mx-gap-sm);
}

.nx-chb__controls {
    display: flex;
    flex-direction: row;
    gap: var(--mx-gap-sm);
    align-items: center;
    flex-shrink: 0;
}

.nx-chb__arrow {
    width: 42px;
    height: 42px;
    border-radius: var(--mx-radius-full);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--mx-transition), border-color var(--mx-transition);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0;
    line-height: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.nx-chb__arrow:hover                      { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.4); }
.nx-chb__arrow:focus                       { outline: none; box-shadow: none; }
.nx-chb__arrow:active                      { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); box-shadow: none; }
.nx-chb__arrow:focus:not(:focus-visible)   { box-shadow: none; }
.nx-chb__arrow:focus-visible               { box-shadow: var(--mx-focus); }

.nx-chb__arrow svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =========================
   Thumbnail Carousel
========================= */
.nx-chb__thumbs-carousel {
    overflow: hidden; /* viewport clip — track slides inside this boundary */
    position: relative;
    grid-column: 1 / -1;
    /* Hover clearance (Option A): padding opens clip room above the track;
       matching negative margin restores visual tile position. 14px > 9px lift + scale. */
    padding-top: 14px;
    margin-top: -14px;
    /* width set by JS to show exactly visibleCount thumbnails */
}

.nx-chb__thumbs-track {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    position: relative;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    /* will-change removed — it promoted track to a GPU compositing layer that
       blocked backdrop-filter on child tiles from sampling the hero background */
}





/* =========================
   Thumbnail — Base Glass Card
========================= */
.nx-chb__thumb {
    flex-shrink: 0;
    /* clip-path instead of overflow:hidden — maintains rounded corners WITHOUT
       creating a compositing isolation that would block backdrop-filter blur */
    clip-path: inset(0 round 14px);
    border-radius: 14px; /* matches clip-path radius so border follows rounded shape */
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition:
        transform    0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.28s ease,
        opacity      0.28s ease,
        box-shadow   0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        clip-path    0.28s ease;
    /* will-change: transform removed — nested GPU layers blocked backdrop-filter from sampling hero */
    display: flex;
    /* Glass background — strong frosted blur samples the hero behind the card */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(32px) saturate(180%) brightness(1.05);
    -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(1.05);
    -webkit-tap-highlight-color: transparent;
}

.nx-chb__thumb.is-visible { opacity: 0.58; } /* all thumbs always in DOM; track translates to show active at far-left */
.nx-chb__thumb.is-active  { opacity: 1; border-color: rgba(255, 255, 255, 0.7); }
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover { opacity: 1; }

/* =========================
   Layout A — Image Top / Text Bottom
========================= */
.nx-chb__thumb--bottom {
    flex-direction: column;
    width: 130px; /* default — overridden by Elementor Tile Width selector */
    /* height controlled by Elementor responsive selector */
}

.nx-chb__thumb--bottom .nx-chb__thumb-img-wrap {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    /* gap on parent .nx-chb__thumb--bottom creates separation — no border needed */
}

.nx-chb__thumb--bottom .nx-chb__thumb-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nx-chb__thumb--bottom .nx-chb__thumb-content {
    flex-shrink: 0;
    padding: 7px 9px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Transparent — the glass card below provides all the frosted-glass styling */
    background: transparent;
    /* border follows image-wrap (see border-bottom on img-wrap below) */
}

/* =========================
   Layout B — Image Left / Text Right
========================= */
.nx-chb__thumb--right {
    flex-direction: row;
    align-items: stretch;
    width: 240px; /* default — overridden by Elementor Tile Width selector */
    /* height controlled by Elementor responsive selector */
}

.nx-chb__thumb--right .nx-chb__thumb-img-wrap {
    width: 42%;
    flex-shrink: 0;
    overflow: hidden;
    height: auto; /* allow align-items:stretch to fill full tile height when min-height set via Elementor */
    /* gap on parent .nx-chb__thumb--right creates separation — no border needed */
}

.nx-chb__thumb--right .nx-chb__thumb-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nx-chb__thumb--right .nx-chb__thumb-content {
    flex: 1;
    padding: 9px 28px 9px 10px; /* right padding leaves room for CTA */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

/* =========================
   Thumbnail Text
========================= */
.nx-chb__thumb-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-chb__thumb-desc {
    display: block;
    overflow: hidden;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.4;
    word-break: break-word;
}

.nx-chb__thumb--clone {
    pointer-events: none; /* clones are visual-only; no interaction */
    user-select: none;
}


/* =============================================================
   Layout C — Vertical Carousel (left or right edge)
   ============================================================= */








/* Vertical thumbnail tile: image left, text right */


/* =========================
   CTA Arrow Button
========================= */
.nx-chb__thumb-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
    transition: background var(--mx-transition), transform var(--mx-transition);
    position: absolute;
    z-index: 5;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nx-chb__thumb-cta:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.08);
}

/* CTA arrow — bottom-right of card, never overlapping text */
.nx-chb__thumb--bottom .nx-chb__thumb-cta,
.nx-chb__thumb--right  .nx-chb__thumb-cta {
    bottom: 7px;
    right: 7px;
}

/* Reserve right-side space in content text so text never runs under the CTA */
.nx-chb__thumb--bottom.has-cta .nx-chb__thumb-content { padding-right: 9px; padding-bottom: 40px; }
.nx-chb__thumb--right.has-cta  .nx-chb__thumb-content { padding-right: 32px; padding-bottom: 36px; }

/* =========================
   Accessibility
========================= */
.nx-chb__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   Responsive — Tablet
========================= */
@media (max-width: 1024px) {
    .nx-chb__container { padding: 60px 40px; }
    .nx-chb__thumb--bottom { width: 115px; }
    .nx-chb__thumb--right  { width: 210px; }

}

/* =========================
   Responsive — Mobile
========================= */
@media (max-width: 768px) {
    .nx-chb__container { padding: 50px 24px 200px; }
    .nx-chb__heading   { font-size: clamp(28px, 8vw, 48px); }

    .nx-chb__nav-wrap  { right: 20px; bottom: 24px; max-width: calc(100% - 40px); overflow: visible; }

    .nx-chb__thumb--bottom { width: 96px; }

    /* Layout B stays horizontal on tablet/mobile — image left, text right */
    .nx-chb__thumb--right { width: 150px; }

    .nx-chb__arrow { width: 38px; height: 38px; }

    /* Carousel cannot exceed nav-wrap width on mobile */
    .nx-chb__thumbs-carousel { max-width: 100%; }

    /* Layout C — Mobile: maintain the horizontal strip, adjust spacing */
    /* Touch-friendly arrow size */
    /* Progress bar fill — horizontal, left-to-right */
}

@media (max-width: 480px) {
    .nx-chb__container { padding: 40px 20px 200px; }
    .nx-chb__heading   { font-size: clamp(28px, 10vw, 44px); }
    .nx-chb__nav-wrap  { right: 16px; bottom: 20px; }

    .nx-chb__thumb--bottom { width: 82px; }
    .nx-chb__thumb--right  { width: 140px; } /* horizontal tile — keep image-left layout */

    .nx-chb__thumb-title { font-size: 12px; }
    .nx-chb__thumb-desc  { display: none; }

    .nx-chb__arrow     { width: 34px; height: 34px; }
    .nx-chb__arrow svg { width: 14px; height: 14px; min-width: 14px; min-height: 14px; }
}


/* ═══════════════════════════════════════════════════════════════
   CINEMATIC HOVER & INTERACTIVITY ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Shimmer overlay (angled specular highlight, reveals on hover) ── */
.nx-chb__thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0.07) 45%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 2;
}
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover::before { opacity: 1; }

/* ── General hover: border glow + deeper shadow ── */
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover {
    border-color: rgba(255, 255, 255, 0.60);
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.46),
        0 6px 18px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* ── Layout A & B (horizontal): LIFT UP on hover ── */
.nx-chb__thumb--bottom:not(.nx-chb__thumb--clone):not(.is-active):hover,
.nx-chb__thumb--right:not(.nx-chb__thumb--clone):not(.is-active):hover {
    transform: translateY(-9px) scale(1.03);
}



/* ── Image zoom inside thumbnail on hover ── */
.nx-chb__thumb-img-wrap img {
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover .nx-chb__thumb-img-wrap img {
    transform: scale(1.10);
}

/* ── Text brightening on hover ── */
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover .nx-chb__thumb-title {
    color: rgba(255, 255, 255, 1);
}
.nx-chb__thumb:not(.nx-chb__thumb--clone):hover .nx-chb__thumb-desc {
    color: rgba(255, 255, 255, 0.92);
}

/* ── Active tile: breathing glow (box-shadow only, no border conflict) ── */
@keyframes nx-chb-thumb-glow {
    0%, 100% {
        box-shadow:
            0 16px 48px rgba(0, 0, 0, 0.35),
            0 4px 14px rgba(0, 0, 0, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }
    50% {
        box-shadow:
            0 18px 52px rgba(0, 0, 0, 0.38),
            0 4px 14px rgba(0, 0, 0, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.55),
            0 0 0 2px rgba(255, 255, 255, 0.12),
            0 0 24px rgba(255, 255, 255, 0.08);
    }
}
.nx-chb__thumb.is-active {
    animation: nx-chb-thumb-glow 3s ease-in-out infinite;
    cursor: default;
}

/* ── Arrow buttons: scale + brighten on hover ── */
.nx-chb__arrow {
    transition:
        transform  0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity    0.22s ease,
        background 0.22s ease;
}
.nx-chb__arrow:hover {
    transform: scale(1.14);
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.22);
}
.nx-chb__arrow:active {
    transform: scale(0.94);
    transition-duration: 0.1s;
}

/* Clones: pointer-events disabled so they can't be accidentally clicked;
   overflow:hidden on the carousel clips them outside the viewport */
.nx-chb__thumb--clone {
    pointer-events: none;
}

/* Vertical-left: tile shifts RIGHT on hover → open right clearance */
