﻿

.banner-slider {
    --banner-ratio: 1920 / 700; 
    --banner-ratio-mobile: 4 / 3; 
    position: relative;
    width: 100%;
    background: #f4f4f4;
    overflow: hidden;
}

.banner-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: var(--banner-ratio);
    max-height: 640px;
    touch-action: pan-y; /* vertical scroll still works, horizontal swipe handled by JS */
    user-select: none;
}

/* loading skeleton (shown until the first banner image is ready) */
.banner-slider.is-loading .banner-viewport {
    background: linear-gradient(100deg, #f1f1f1 30%, #fafafa 50%, #f1f1f1 70%);
    background-size: 200% 100%;
    animation: bannerShimmer 1.4s linear infinite;
}

@keyframes bannerShimmer {
    to {
        background-position: -200% 0;
    }
}

/* ---------- slides (cross-fade) ---------- */
.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility 0s linear .8s;
}

    .banner-slide.is-active {
        opacity: 1;
        visibility: visible;
        z-index: 1;
        transition: opacity .8s ease, visibility 0s;
    }

    .banner-slide a,
    .banner-slide .banner-nolink {
        display: block;
        width: 100%;
        height: 100%;
    }

    .banner-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        -webkit-user-drag: none;
    }
   
}
/* ---------- arrows ---------- */
.banner-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--ink, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 6px 24px rgba(0, 0, 0, .08));
    opacity: 0;
    transition: opacity .25s ease, background .2s ease, color .2s ease;
}

    .banner-arrow:hover,
    .banner-arrow:focus-visible {
        background: var(--red-primary, #e63946);
        color: #fff;
    }

    .banner-arrow.prev {
        left: 20px;
    }

    .banner-arrow.next {
        right: 20px;
    }

.banner-slider:hover .banner-arrow,
.banner-slider:focus-within .banner-arrow {
    opacity: 1;
}

/* ---------- dots ---------- */
.banner-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .6);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: width .3s ease, background .3s ease;
}

    .banner-dot.is-active {
        width: 28px;
        border-radius: 6px;
        background: var(--red-primary, #e63946);
    }

/* ---------- responsive ---------- */
@media (max-width: 768px) {
    .banner-viewport {
        aspect-ratio: var(--banner-ratio-mobile);
        max-height: 70vh;
    }

    /* no hover on touch devices: keep the arrows small and visible */
    .banner-arrow {
        width: 34px;
        height: 34px;
        margin-top: -17px;
        opacity: 1;
    }

        .banner-arrow.prev {
            left: 10px;
        }

        .banner-arrow.next {
            right: 10px;
        }

    .banner-dots {
        bottom: 10px;
        gap: 8px;
    }

    .banner-dot {
        width: 8px;
        height: 8px;
    }

        .banner-dot.is-active {
            width: 22px;
        }
}

@media (prefers-reduced-motion: reduce) {
    .banner-slide,
    .banner-slide.is-active {
        transition: none;
    }

    .banner-slider.is-loading .banner-viewport {
        animation: none;
    }
}

/* Mobile banner: compact height, next section directly below */
@media (max-width: 768px) {
    .banner-slider {
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .banner-viewport {
        width: 100%;
        aspect-ratio: 1528 / 660;
        height: auto;
        max-height: none;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    .banner-slide {
        position: absolute;
        inset: 0;
        height: 100%;
    }

        .banner-slide a,
        .banner-slide .banner-nolink {
            display: block;
            width: 100%;
            height: 100%;
        }

        .banner-slide img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
        }

    .banner-dots {
        bottom: 8px;
    }
    .banner-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        margin-top: 0;
        z-index: 3;
    }

        .banner-arrow.prev {
            left: 10px;
            right: auto;
        }

        .banner-arrow.next {
            right: 10px;
            left: auto;
        }
}


