/* ==========================================================================
   Hero Slider Widget — Styles
   ========================================================================== */

/* ---------- Base ---------- */
.hs-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Height/aspect-ratio set by Elementor selectors */
}

/* Full-width breakout — stretches past parent padding/max-width.
   Toggled via Elementor prefix_class on the widget wrapper.
   Uses left+transform instead of margin so it works in both LTR and RTL. */
.hs-fullwidth-yes .hs-slider {
    width: 100vw;
    max-width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

/* ---------- Track ---------- */

/* Slide transition mode */
.hs-slider[data-transition="slide"] .hs-track {
    display: flex;
    height: 100%;
    direction: ltr;
}

/* Fade transition mode */
.hs-slider[data-transition="fade"] .hs-track {
    position: relative;
    height: 100%;
}

/* ---------- Slides ---------- */
.hs-slide {
    position: relative;
    overflow: hidden;
}

/* Restore page text direction inside slides for RTL sites.
   The track is forced to direction:ltr for translateX math,
   but content must honour the document's own direction.      */
[dir="rtl"] .hs-slider .hs-slide {
    direction: rtl;
    text-align: right;
}

/* Slide mode */
.hs-slider[data-transition="slide"] .hs-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}

/* Fade mode */
.hs-slider[data-transition="fade"] .hs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--hs-speed, 600ms) ease;
    pointer-events: none;
    z-index: 0;
}

.hs-slider[data-transition="fade"] .hs-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* ---------- Image ---------- */
/* Specificity bumped to 0-2-0 to override Elementor / theme
   global  .elementor img { height:auto }  (0-1-1).           */
.hs-slider .hs-slide__img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* ---------- Overlay ---------- */
.hs-slide__overlay {
    position: absolute;
    inset: 0;
    background-color: var(--hs-overlay-color, transparent);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Stretched Link ---------- */
.hs-slide__stretched-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    text-decoration: none;
    outline: none;
}

.hs-slide__stretched-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -4px;
}

/* ---------- Content ---------- */
.hs-slide__content {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: var(--hs-justify, center);
    align-items: var(--hs-align, center);
    padding: 2em;
    pointer-events: none;
}

.hs-slide__content-inner {
    pointer-events: none;
    text-align: var(--hs-text-align, center);
}

/* Allow interactive elements to capture clicks above the stretched link */
.hs-slide__button {
    pointer-events: auto;
    position: relative;
}

.hs-slide__title {
    margin: 0 0 0.5em;
    color: #fff;
    font-size: 2.5em;
    line-height: 1.2;
}

.hs-slide__desc {
    margin: 0 0 1.25em;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125em;
    line-height: 1.5;
}

.hs-slide__button {
    display: inline-block;
    padding: 0.8em 1.75em;
    background-color: #fff;
    color: #111;
    text-decoration: none;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hs-slide__button:hover {
    opacity: 0.88;
}

.hs-slide__button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ---------- Arrows ---------- */
.hs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
}

.hs-arrow:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.hs-arrow:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.hs-arrow svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.hs-arrow--prev {
    left: 1rem;
}

.hs-arrow--next {
    right: 1rem;
}

/* ---------- Dots ---------- */
.hs-dots {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
}

.hs-dot {
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.hs-dot.is-active {
    background-color: #fff;
    border-color: #fff;
    transform: scale(1.15);
}

.hs-dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ---------- Progress Bar ---------- */
.hs-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 4;
    background-color: rgba(255, 255, 255, 0.2);
}

.hs-progress__bar {
    height: 100%;
    background-color: #fff;
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
}

.hs-progress__bar.is-running {
    animation: hs-progress-fill var(--hs-autoplay-delay, 5000ms) linear forwards;
}

@keyframes hs-progress-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ---------- Transition helpers ---------- */

/* Applied by JS only during an active transition — enables will-change */
.hs-slider[data-transition="slide"].is-transitioning .hs-track {
    will-change: transform;
}

.hs-slider[data-transition="fade"].is-transitioning .hs-slide {
    will-change: opacity;
}

/* ---------- Single-slide fallback ---------- */
.hs-slider[data-total="1"] .hs-arrow,
.hs-slider[data-total="1"] .hs-dots,
.hs-slider[data-total="1"] .hs-progress {
    display: none;
}

/* ---------- RTL ---------- */
.hs-slider[dir="rtl"] .hs-arrow--prev {
    left: auto !important;
    right: var(--hs-arrow-offset, 16px) !important;
}

.hs-slider[dir="rtl"] .hs-arrow--next {
    right: auto !important;
    left: var(--hs-arrow-offset, 16px) !important;
}

.hs-slider[dir="rtl"] .hs-arrow svg {
    transform: scaleX(-1);
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .hs-slider[data-transition="slide"] .hs-track {
        transition-duration: 0ms !important;
    }

    .hs-slider[data-transition="fade"] .hs-slide {
        transition-duration: 0ms !important;
    }

    .hs-progress__bar.is-running {
        animation: none;
        transform: scaleX(1);
    }

    .hs-arrow,
    .hs-dot,
    .hs-slide__button {
        transition-duration: 0ms !important;
    }
}

/* ---------- Mobile (≤767px) — smaller nav controls ---------- */
@media (max-width: 767px) {
    .hs-arrow {
        display: none;
    }

    .hs-dot {
        width: 8px;
        height: 8px;
        border-width: 1.5px;
    }

    .hs-dots {
        bottom: 0.75rem;
        gap: 0.375rem;
    }
}
