/* HookainSwiper Styles – Multi-Theme Version */

.hk-swiper-portlet {
    position: relative;
    width: 100%;
    max-width: 100%;
    /* aspect-ratio helps stabilize, but min-height allows settings to grow it */
    aspect-ratio: 1440 / 560;
    min-height: clamp(var(--hk-height-mobile, 340px), 52vw, var(--hk-height-desktop, 560px));
    /* background removed */
    /* Removed paint containment to allow shadows and "peek" slides to be visible */
    contain: layout;
    overflow: visible; /* Allow shadows and peek to bleed out if needed */
}

/* Theme: Carousel (Peek) needs to see neighbors */
.hk-theme-carousel,
.hk-theme-carousel-light {
    overflow: visible;
}

.hk-theme-carousel .hk-swiper-instance,
.hk-theme-carousel-light .hk-swiper-instance {
    overflow: visible;
}

.hk-theme-double-banner {
    overflow: hidden;
}

.hk-swiper-portlet .hk-swiper-instance {
    display: block;
    position: relative;
    width: 100%;
    min-height: inherit;
    height: 100%;
    z-index: 1;
}

.hk-swiper-portlet .swiper-wrapper,
.hk-swiper-portlet .swiper-slide,
.hk-swiper-portlet .hk-slide {
    height: 100%;
}

/* Preview & Pre-Init stability (CLS Fix) */
.hk-swiper-portlet:not([data-hk-init="1"]) .swiper-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-wrapper {
    justify-content: flex-start;
    transform: translate3d(9%, 0, 0);
}

.hk-swiper-portlet:not([data-hk-init="1"]) .swiper-slide {
    display: none;
}

/* Show neighbors immediately if Carousel theme is active */
.hk-theme-carousel:not([data-hk-init="1"]) .swiper-slide:nth-child(1),
.hk-theme-carousel:not([data-hk-init="1"]) .swiper-slide:nth-child(2),
.hk-theme-carousel:not([data-hk-init="1"]) .swiper-slide:nth-child(3),
.hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-slide:nth-child(1),
.hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-slide:nth-child(2),
.hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-slide:nth-child(3) {
    display: block;
    width: 82%;
    flex-shrink: 0;
}

.hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-slide:nth-child(1) {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.hk-swiper-portlet:not([data-hk-init="1"]) .swiper-slide:first-child {
    display: block;
}

.hk-swiper-portlet .hk-swiper-instance {
    overflow: hidden;
    touch-action: pan-y;
}

.hk-theme-carousel .hk-swiper-instance,
.hk-theme-carousel-light .hk-swiper-instance {
    overflow: visible;
}

/* Pre-init stability for Double Banner */
.hk-theme-double-banner:not([data-hk-init="1"]) .swiper-wrapper {
    display: flex;
    gap: 1px;
}

.hk-theme-double-banner:not([data-hk-init="1"]) .swiper-slide {
    display: block;
    flex: 0 0 calc(50% - 0.5px);
    width: calc(50% - 0.5px);
}

/* ─── BASE SLIDE ─── */
.hk-slide {
    position: relative;
    width: 100%;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hk-slide-image-link {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    text-decoration: none;
}

.hk-slide-picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hk-slide-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    backface-visibility: hidden;
}

/* ─── THEME: HERO (Default) ─── */
.hk-theme-hero .hk-slide-picture,
.hk-theme-hero .hk-slide-image-link {
    position: absolute;
    inset: 0;
}

/* Ken Burns (only for Hero) */
.hk-has-kenburns.hk-theme-hero .hk-slide-img {
    transform: scale(1);
}
.hk-has-kenburns.hk-theme-hero .swiper-slide-active .hk-slide-img {
    transition: transform 8s ease;
    transform: scale(1.12);
}

/* Overlay (Linear for Hero) */
.hk-has-overlay.hk-theme-hero .hk-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 40%, transparent 100%);
}

/* ─── THEME: CAROUSEL (Peek) ─── */
.hk-theme-carousel .swiper-slide {
    width: 82%; /* Allow peek */
    transition:
        transform 420ms cubic-bezier(.22, 1, .36, 1),
        opacity 420ms cubic-bezier(.22, 1, .36, 1);
    opacity: 0.4;
    transform: translate3d(0, 0, 0) scale(0.94);
    will-change: transform, opacity;
}

.hk-theme-carousel .swiper-slide-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.hk-theme-carousel .hk-slide {
    /* border-radius removed */
    overflow: hidden;
    /* box-shadow removed */
}

/* ─── THEME: CAROUSEL LIGHT (Stable, no Swiper runtime) ─── */
.hk-theme-carousel-light .hk-swiper-instance {
    overflow: hidden;
    touch-action: pan-y;
}

.hk-theme-carousel-light .swiper-wrapper {
    display: flex;
    align-items: stretch;
    gap: 20px;
    height: 100%;
    transition-property: transform;
    transition-timing-function: cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
}

.hk-theme-carousel-light .swiper-slide {
    flex: 0 0 82%;
    width: 82%;
    opacity: 0.46;
    transform: translate3d(0, 0, 0) scale(0.94);
    transition:
        transform 420ms cubic-bezier(.22, 1, .36, 1),
        opacity 420ms cubic-bezier(.22, 1, .36, 1);
}

.hk-theme-carousel-light .swiper-slide-active,
.hk-theme-carousel-light .swiper-slide.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.hk-theme-carousel-light .hk-slide {
    /* border-radius removed */
    overflow: hidden;
    /* box-shadow removed */
}

.hk-theme-carousel-light .hk-light-clone {
    pointer-events: none;
}

/* ─── THEME: SPLIT (Side-by-Side) ─── */
.hk-theme-split {
    --hk-split-bg-start: var(--hookain-accent-light, #fdeaed);
    --hk-split-bg-end: var(--hookain-vape-light, #e8f8fb);
    --hk-split-accent: var(--hookain-accent, #e2233b);
    --hk-split-image-share: 47%;
    background: linear-gradient(105deg, var(--hk-split-bg-start) 0%, var(--hk-split-bg-end) 100%);
    overflow: hidden;
}

.hk-theme-split .hk-swiper-instance {
    overflow: hidden;
}

.hk-theme-split .hk-slide {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: clamp(1.75rem, 4vw, 4.5rem);
    padding: clamp(1.4rem, 3vw, 3rem) clamp(1.4rem, 4vw, 4.25rem);
    background:
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.42), transparent 30%),
        linear-gradient(105deg, var(--hk-split-bg-start) 0%, var(--hk-split-bg-end) 100%);
}

.hk-theme-split.hk-split-right .hk-slide {
    flex-direction: row-reverse;
}

.hk-theme-split .hk-slide-image-link,
.hk-theme-split .hk-slide-picture {
    position: relative;
    flex: 0 0 var(--hk-split-image-share);
    width: var(--hk-split-image-share);
    height: auto;
    min-height: 0;
}

.hk-theme-split .hk-slide-image-link {
    display: flex;
    align-items: center;
}

.hk-theme-split .hk-slide-picture {
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.36);
    box-shadow: 0 16px 42px rgba(22, 23, 28, 0.08);
}

.hk-theme-split .hk-slide-img {
    object-fit: cover;
    object-position: center;
}

.hk-theme-split .hk-slide-content {
    position: relative;
    flex: 1 1 auto;
    width: calc(100% - var(--hk-split-image-share));
    max-width: 760px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(1.5rem, 4vw, 4.75rem) 0;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
    color: #16171c;
}

.hk-theme-split.hk-align-center .hk-slide-content {
    align-items: center;
    text-align: center;
}

.hk-theme-split.hk-align-right .hk-slide-content {
    align-items: flex-end;
    text-align: right;
}

.hk-theme-split .hk-slide-title,
.hk-theme-split .hk-slide-text,
.hk-theme-split .hk-slide-button-wrap {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.hk-theme-split .swiper-slide-active .hk-slide-title,
.hk-theme-split .swiper-slide-active .hk-slide-text,
.hk-theme-split .swiper-slide-active .hk-slide-button-wrap {
    opacity: 1;
    transform: translateY(0);
}

.hk-theme-split .swiper-slide-active .hk-slide-text { transition-delay: 0.1s; }
.hk-theme-split .swiper-slide-active .hk-slide-button-wrap { transition-delay: 0.2s; }

.hk-theme-split .hk-slide-title {
    max-width: 11ch;
    margin: 0 0 1rem;
    color: var(--slide-color, #16171c) !important;
    font-size: clamp(2.9rem, 5.8vw, 6.15rem);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: 0;
}

.hk-theme-split .hk-slide-text {
    max-width: 46ch;
    margin-bottom: 1.65rem;
    color: #3c3e45 !important;
    font-size: clamp(1rem, 1.2vw, 1.16rem);
    line-height: 1.62;
}

.hk-theme-split .hk-slide-button-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hk-theme-split .hk-slide-button {
    min-height: 3.05rem;
    border: 1px solid var(--hk-split-accent);
    border-radius: 999px !important;
    padding: 0.88rem 1.65rem;
    background: var(--hk-split-accent);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0;
}

.hk-theme-split .hk-slide-button:hover,
.hk-theme-split .hk-slide-button:focus {
    border-color: #16171c;
    background: #16171c;
    color: #ffffff;
}

/* Secondary CTA (double-button) */
.hk-slide-button--secondary {
    border: 1px solid currentColor !important;
    background: transparent !important;
    color: inherit !important;
}

.hk-theme-split .hk-slide-button--secondary {
    border-color: rgba(22, 23, 28, 0.28) !important;
    color: #16171c !important;
}

.hk-slide-button--secondary:hover,
.hk-slide-button--secondary:focus,
.hk-theme-split .hk-slide-button--secondary:hover,
.hk-theme-split .hk-slide-button--secondary:focus {
    border-color: #16171c !important;
    background: #16171c !important;
    color: #ffffff !important;
}

/* ─── THEME: DOUBLE BANNER ─── */
.hk-theme-double-banner .hk-swiper-instance {
    overflow: hidden;
}

.hk-theme-double-banner .swiper-wrapper,
.hk-theme-double-banner .swiper-slide {
    height: 100%;
}

.hk-theme-double-banner .swiper-slide {
    background: #101010;
}

.hk-theme-double-banner .hk-slide {
    overflow: hidden;
}

.hk-theme-double-banner .hk-slide-picture,
.hk-theme-double-banner .hk-slide-image-link {
    position: absolute;
    inset: 0;
}

.hk-has-overlay.hk-theme-double-banner .hk-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.44) 55%, rgba(0, 0, 0, 0.72) 100%),
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 40%);
}

.hk-theme-double-banner .hk-slide-content {
    bottom: 10%;
    left: 8%;
    max-width: 76%;
}

.hk-theme-double-banner .hk-slide-title {
    font-size: clamp(1.5rem, 2.1vw, 2.45rem);
    margin-bottom: 0.45rem;
}

.hk-theme-double-banner .hk-slide-text {
    font-size: clamp(0.92rem, 1vw, 1.05rem);
    margin-bottom: 1rem;
}

.hk-theme-double-banner .swiper-button-prev,
.hk-theme-double-banner .swiper-button-next {
    width: 42px;
    height: 42px;
    margin-top: -21px;
}

/* ─── CONTENT (Universal) ─── */
.hk-slide-content {
    position: absolute;
    z-index: 2;
    bottom: 18%;
    left: 10%;
    max-width: 520px;
    color: var(--slide-color, #fff);
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity .8s ease, transform .8s ease;
}

.hk-slide-content.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.hk-align-center .hk-slide-content {
    left: 50%;
    text-align: center;
    transform: translate3d(-50%, 40px, 0);
}
.hk-align-center .hk-slide-content.is-active { transform: translate3d(-50%, 0, 0); }

.hk-align-right .hk-slide-content {
    right: 10%;
    left: auto;
    text-align: right;
}

.hk-slide-title {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.6rem;
    color: var(--slide-color, inherit) !important;
}
.hk-slide-text {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 1.2rem;
    color: var(--slide-color, inherit) !important;
}

/* ─── UI ELEMENTS (FIXED: Small arrows, blur background) ─── */
.hk-swiper-portlet .swiper-button-prev,
.hk-swiper-portlet .swiper-button-next {
    position: absolute;
    top: 50%;
    margin-top: -22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.hk-swiper-portlet .swiper-button-prev {
    left: 16px;
    right: auto;
}

.hk-swiper-portlet .swiper-button-next {
    right: 16px;
    left: auto;
}

.hk-theme-carousel .swiper-button-prev,
.hk-theme-carousel .swiper-button-next,
.hk-theme-carousel-light .swiper-button-prev,
.hk-theme-carousel-light .swiper-button-next {
    opacity: 1;
    visibility: visible;
}

.hk-theme-carousel .swiper-button-lock,
.hk-theme-carousel-light .swiper-button-lock {
    display: flex;
}

.hk-swiper-portlet .swiper-button-prev:hover,
.hk-swiper-portlet .swiper-button-next:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.hk-swiper-portlet .swiper-pagination {
    position: absolute;
    right: 0;
    bottom: 18px;
    left: 0;
    z-index: 5;
    width: 100%;
    text-align: center;
}

/* Force icons to be small (Brute force for all versions of Swiper) */
.hk-swiper-portlet .swiper-button-prev::after,
.hk-swiper-portlet .swiper-button-next::after {
    font-size: 14px !important;
    font-weight: bold;
    line-height: 1;
}

.hk-swiper-portlet .swiper-button-prev svg,
.hk-swiper-portlet .swiper-button-next svg,
.hk-swiper-portlet .swiper-button-prev i,
.hk-swiper-portlet .swiper-button-next i {
    width: 14px !important;
    height: 14px !important;
    font-size: 14px !important;
    color: #fff !important;
}

.hk-swiper-portlet .swiper-pagination-bullet {
    background: #fff;
    width: 10px;
    height: 10px;
    opacity: 0.5;
    transition: all 0.3s ease;
}
.hk-swiper-portlet .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

.hk-theme-split .swiper-button-prev,
.hk-theme-split .swiper-button-next {
    top: auto;
    bottom: 18px;
    width: 36px;
    height: 36px;
    margin-top: 0;
    border: 1px solid rgba(22, 23, 28, 0.08);
    background: rgba(255, 255, 255, 0.42);
    color: #16171c;
}

.hk-theme-split .swiper-button-prev {
    left: calc(50% - 76px);
}

.hk-theme-split .swiper-button-next {
    right: calc(50% - 76px);
}

.hk-theme-split .swiper-button-prev:hover,
.hk-theme-split .swiper-button-next:hover {
    background: rgba(255, 255, 255, 0.76);
    transform: none;
}

.hk-theme-split .swiper-button-prev::after,
.hk-theme-split .swiper-button-next::after,
.hk-theme-split .swiper-button-prev svg,
.hk-theme-split .swiper-button-next svg,
.hk-theme-split .swiper-button-prev i,
.hk-theme-split .swiper-button-next i {
    color: #16171c !important;
}

.hk-theme-split .swiper-pagination {
    bottom: 26px;
    pointer-events: none;
}

.hk-theme-split .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    background: rgba(22, 23, 28, 0.22);
    opacity: 1;
}

.hk-theme-split .swiper-pagination-bullet-active {
    width: 32px;
    border-radius: 999px;
    background: var(--hk-split-accent);
    transform: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 991px) {
    .hk-theme-carousel .swiper-slide { width: 90%; }
    .hk-theme-carousel-light:not([data-hk-init="1"]) .swiper-wrapper {
        transform: translate3d(5%, 0, 0);
    }
    .hk-theme-carousel-light .swiper-slide {
        flex-basis: 90%;
        width: 90%;
    }
    .hk-theme-double-banner:not([data-hk-init="1"]) .swiper-slide {
        flex-basis: 100%;
        width: 100%;
    }
    .hk-theme-double-banner .hk-slide-content {
        left: 6%;
        right: 6%;
        max-width: none;
    }
    .hk-theme-split .hk-slide {
        flex-direction: column !important;
        gap: 1.35rem;
        padding: 1.25rem 1.1rem 4.5rem;
    }
    .hk-theme-split .hk-slide-image-link,
    .hk-theme-split .hk-slide-picture {
        flex: none;
        width: 100%;
        height: min(46vw, 320px);
        order: 1;
    }
    .hk-theme-split .hk-slide-content {
        flex: none;
        width: 100%;
        max-width: none;
        min-height: 0;
        order: 0;
        padding: 0.75rem 0 0;
    }
    .hk-theme-split .hk-slide-title {
        max-width: 12ch;
        font-size: clamp(2.35rem, 9vw, 4.2rem);
    }
}

@media (max-width: 600px) {
    .hk-swiper-portlet {
        aspect-ratio: 4 / 5;
        min-height: 420px;
        /* Ensure it's not pulled up by parent negative margins */
        margin-top: 0 !important;
    }
    .hk-theme-double-banner .hk-slide-title {
        font-size: clamp(1.5rem, 7vw, 2.05rem);
    }
    .hk-theme-split .hk-slide-picture {
        border-radius: 4px;
    }
    .hk-theme-split .hk-slide-text {
        font-size: 0.96rem;
    }
    .hk-slide-content { bottom: 8%; left: 6%; max-width: 88%; }
    .hk-slide-title { font-size: 1.8rem; }
    .hk-swiper-portlet:not(.hk-theme-split) .swiper-button-prev,
    .hk-swiper-portlet:not(.hk-theme-split) .swiper-button-next {
        display: none;
    }
}

/* ─── WORD-BY-WORD REVEAL ANIMATION ─── */
.hk-slide-content.hk-word-animation {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.hk-slide-content.hk-word-animation .hk-word {
    display: inline-block;
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition: opacity 0.65s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: calc(var(--word-index) * 0.035s);
    will-change: opacity, transform;
}

.hk-slide-content.hk-word-animation.is-active .hk-word {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
