/**
 * Hero Banner — images only.
 *
 * Markup is template-parts/sections/hero.php. The section renders the
 * merchant's desktop/mobile images in a native scroll-snap slider, with no
 * text, overlay or content block. Settings that still drive this section:
 *   --hero-height / --hero-height-mobile   hero_height_desktop / _mobile
 *   .is-slider + .hero-dots                two slides, autoplay, dots
 */

.codleade-hero-section {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--codleade-bg-secondary);
}

.hero-slider-wrapper {
    display: flex;
    width: 100%;
    /* The merchant's height (200–1000px), capped so a tall setting can never
       push the whole viewport past the fold on a short screen. */
    height: min(var(--hero-height, 500px), 88vh);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    will-change: scroll-position;
}

.hero-slider-wrapper::-webkit-scrollbar {
    display: none;
}

.hero-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    background-color: #f5f5f5;
    overflow: hidden;
}

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

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Navigation arrows ────────────────────────────────────────────────
 * Scoped to the hero so these rules cannot touch another slider's buttons.
 * Absolute against .codleade-hero-section, so they stay put while the
 * scroll-snap track moves underneath them. */
.codleade-hero-section .hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(253, 253, 253, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    color: #555;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.codleade-hero-section .hero-nav-prev {
    inset-inline-start: clamp(10px, 1.5vw, 20px);
}

.codleade-hero-section .hero-nav-next {
    inset-inline-end: clamp(10px, 1.5vw, 20px);
}

.codleade-hero-section .hero-nav svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.codleade-hero-section .hero-nav:hover {
    background: rgba(253, 253, 253, 0.95);
    color: #1a1a1a;
}

.codleade-hero-section .hero-nav:focus-visible {
    outline: 2px solid var(--codleade-brand);
    outline-offset: 2px;
}

[dir="rtl"] .codleade-hero-section .hero-nav svg {
    transform: scaleX(-1);
}

.hero-dots {
    position: absolute;
    bottom: clamp(14px, 1.6vw, 22px);
    inset-inline-start: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.hero-dot {
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    padding: 0;
    cursor: pointer;
}

.hero-dot.is-active {
    background: #fff;
    width: 34px;
}

@media (max-width: 767px) {
    .hero-slider-wrapper {
        /* Merchant height (150–600px), capped against the viewport. */
        height: min(var(--hero-height-mobile, 300px), 74vh);
    }

    .hero-dots {
        bottom: 14px;
        gap: 6px;
    }

    .hero-dot {
        width: 16px;
    }

    .hero-dot.is-active {
        width: 26px;
    }
}
