/* ==========================================================================
   Alpenzaun Slider — editorial hero
   Brand palette
     --az-black:      #141414
     --az-terracotta: #f04e23
     --az-dark-red:   #772008
     --az-khaki:      #3d403a
     --az-white:      #f6f5f2
     --az-steel:      #9c9c95
   ========================================================================== */

.az-slider,
.az-slider * {
    box-sizing: border-box;
}

.az-slider {
    --az-black:      #141414;
    --az-terracotta: #f04e23;
    --az-dark-red:   #772008;
    --az-khaki:      #3d403a;
    --az-white:      #f6f5f2;
    --az-steel:      #9c9c95;

    --az-pad-x: clamp(20px, 3vw, 48px);
    --az-pad-y: clamp(40px, 7vh, 96px);
    --az-rail-w: 48px;

    position: relative;
    width: 100%;
    height: clamp(560px, 82vh, 880px);
    overflow: hidden;
    font-family: 'Instrument Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--az-black);
    color: var(--az-white);
    isolation: isolate;
}

/* --------------------------------------------------------------------------
   Brand rail (left vertical, desktop only)
   -------------------------------------------------------------------------- */
.az-slider__rail {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--az-rail-w);
    height: 100%;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: var(--az-pad-y) 0;
    pointer-events: none;
    color: var(--az-white);
}

.az-slider__rail-line {
    flex: 1;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.35), transparent);
}

.az-slider__rail-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}

/* --------------------------------------------------------------------------
   Track + slides
   -------------------------------------------------------------------------- */
.az-slider__track {
    position: relative;
    width: 100%;
    height: 100%;
}

.az-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 700ms ease, visibility 0s linear 700ms;
    pointer-events: none;
}

.az-slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity 700ms ease, visibility 0s linear 0s;
    pointer-events: auto;
    z-index: 1;
}

/* Background */
.az-slide__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.az-slide__video,
.az-slide__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.az-slide__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.az-slide__content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: var(--az-pad-y) var(--az-pad-x) calc(var(--az-pad-y) + 56px);
    padding-left: calc(var(--az-pad-x) + var(--az-rail-w));
}

.az-slide__inner {
    width: 100%;
    max-width: min(820px, 90%);
    color: var(--az-white);
}

/* Stagger animation */
.az-slide.is-active .az-slide__inner > * {
    animation: az-fadeup 850ms cubic-bezier(.2,.7,.2,1) backwards;
}
.az-slide.is-active .az-slide__eyebrow  { animation-delay:  80ms; }
.az-slide.is-active .az-slide__title    { animation-delay: 200ms; }
.az-slide.is-active .az-slide__desc     { animation-delay: 360ms; }
.az-slide.is-active .az-slide__features { animation-delay: 460ms; }
.az-slide.is-active .az-slide__ctas     { animation-delay: 580ms; }

@keyframes az-fadeup {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Eyebrow tag */
.az-slide__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 8px 14px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--az-white);
    margin-bottom: clamp(14px, 1.8vh, 20px);
}

.az-slide__eyebrow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--az-terracotta);
    box-shadow: 0 0 0 4px rgba(240, 78, 35, 0.18);
    animation: az-pulse 2.4s ease-in-out infinite;
}

@keyframes az-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(240, 78, 35, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(240, 78, 35, 0.05); }
}

/* Title */
.az-slide__title {
    display: block;
    line-height: 0.95;
}

.az-slide__title-top,
.az-slide__title-bottom {
    display: block;
    margin: 0;
    text-transform: uppercase;
    color: var(--az-white);
    text-shadow: 0 2px 32px rgba(0, 0, 0, 0.35);
    word-break: keep-all;
    overflow-wrap: normal;
}

.az-slide__title-top {
    font-weight: 300;
    font-size: clamp(1.8rem, 4.2vw, 4rem);
    letter-spacing: 0;
    opacity: 0.95;
    line-height: 0.98;
}

.az-slide__title-bottom {
    font-weight: 700;
    font-size: clamp(2.6rem, 8vw, 7rem);
    letter-spacing: -0.025em;
    line-height: 0.9;
    margin-top: 2px;
}

/* Description */
.az-slide__desc {
    margin: clamp(6px, 0.8vh, 10px) 0 0;
    max-width: 56ch;
    font-size: clamp(0.98rem, 1.15vw, 1.125rem);
    line-height: 1.5;
    color: rgba(255,255,255,0.88);
    font-weight: 400;
    text-shadow: 0 1px 16px rgba(0,0,0,0.3);
}

/* Features */
.az-slide__features {
    list-style: none;
    margin: clamp(4px, 0.6vh, 8px) 0 0 !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.az-slide__features li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.92rem, 1.05vw, 1.02rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.005em;
    text-shadow: 0 1px 14px rgba(0,0,0,0.35);
}

.az-check {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--az-terracotta);
    filter: drop-shadow(0 2px 6px rgba(240, 78, 35, 0.45));
    transition: transform 280ms cubic-bezier(.2,.7,.2,1);
}

.az-slide__features li:hover .az-check {
    transform: scale(1.1) rotate(-6deg);
}

/* CTAs */
.az-slide__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
}

.az-slide__btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
    cursor: pointer;
}

.az-slide__btn svg {
    width: 16px;
    height: 16px;
    transition: transform 220ms ease;
}

/* Primary — strong white outline, hover fills white */
.az-slide__btn--primary {
    background: rgba(20, 20, 20, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: 1.5px solid #fff;
    position: relative;
}

/* Terracotta accent dot — adds brand presence without overwhelming */
.az-slide__btn--primary::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--az-terracotta);
    margin-right: 2px;
    transition: background 220ms ease, transform 220ms ease;
}

.az-slide__btn--primary:hover,
.az-slide__btn--primary:focus-visible {
    background: #fff;
    color: var(--az-black) !important;
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    outline: none;
}

.az-slide__btn--primary:hover span,
.az-slide__btn--primary:hover svg,
.az-slide__btn--primary:focus-visible span,
.az-slide__btn--primary:focus-visible svg {
    color: var(--az-black) !important;
    stroke: var(--az-black);
}

.az-slide__btn--primary:hover::before,
.az-slide__btn--primary:focus-visible::before {
    background: var(--az-terracotta);
    transform: scale(1.3);
}

.az-slide__btn--primary:hover svg,
.az-slide__btn--primary:focus-visible svg {
    transform: translateX(4px);
}

/* Ghost — subtle outline, lighter than primary */
.az-slide__btn--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.az-slide__btn--ghost:hover,
.az-slide__btn--ghost:focus-visible {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    outline: none;
}

/* --------------------------------------------------------------------------
   Bottom controls — counter, progress, arrows, dots
   -------------------------------------------------------------------------- */
.az-slider__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    padding: 0 var(--az-pad-x) clamp(24px, 4vh, 40px);
    padding-left: calc(var(--az-pad-x) + var(--az-rail-w));
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 24px;
    pointer-events: none;
}

.az-slider__controls > * {
    pointer-events: auto;
}

/* Counter 01 / 03 */
.az-slider__counter {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--az-white);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    font-variant-numeric: tabular-nums;
}

.az-slider__counter-current {
    color: var(--az-terracotta);
    font-weight: 700;
    font-size: 15px;
}

.az-slider__counter-divider {
    width: 22px;
    height: 1px;
    background: rgba(255,255,255,0.45);
}

.az-slider__counter-total {
    color: rgba(255,255,255,0.55);
}

/* Progress bar — fills with autoplay */
.az-slider__progress {
    position: relative;
    height: 1px;
    background: rgba(255,255,255,0.18);
    overflow: hidden;
}

.az-slider__progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--az-terracotta);
    transition: width 80ms linear;
}

/* Arrows — minimal */
.az-slider__arrows {
    display: flex;
    gap: 4px;
}

.az-slider__nav {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.az-slider__nav:hover,
.az-slider__nav:focus-visible {
    background: var(--az-white);
    border-color: var(--az-white);
    color: var(--az-black);
    outline: none;
}

.az-slider__nav svg {
    width: 18px;
    height: 18px;
}

/* Dots — line indicators */
.az-slider__dots {
    display: flex;
    gap: 6px;
}

.az-slider__dot {
    width: 22px;
    height: 2px;
    border-radius: 0;
    border: none;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    padding: 0;
    transition: background 280ms ease, width 280ms ease;
}

.az-slider__dot:hover {
    background: rgba(255,255,255,0.6);
}

.az-slider__dot.is-active {
    background: var(--az-terracotta);
    width: 36px;
}

/* --------------------------------------------------------------------------
   Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .az-slider {
        --az-rail-w: 0px;
        height: clamp(560px, 76vh, 720px);
    }

    .az-slider__rail { display: none; }

    .az-slide__content {
        padding-left: var(--az-pad-x);
    }

    .az-slider__controls {
        padding-left: var(--az-pad-x);
    }

    .az-slide__inner {
        max-width: 90%;
    }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .az-slider {
        height: 90vh;
        min-height: 580px;
        max-height: 800px;
        --az-pad-x: 22px;
        --az-pad-y: 28px;
    }

    .az-slide__content {
        padding: var(--az-pad-y) var(--az-pad-x) 130px;
    }

    .az-slide__inner {
        max-width: 100%;
    }

    .az-slide__eyebrow {
        font-size: 10px;
        letter-spacing: 0.16em;
        padding: 6px 12px 6px 11px;
        gap: 9px;
        margin-bottom: 16px;
    }

    .az-slide__eyebrow-dot {
        width: 6px;
        height: 6px;
        box-shadow: 0 0 0 3px rgba(240, 78, 35, 0.18);
    }

    .az-slide__title-top {
        font-size: 1.7rem;
    }

    .az-slide__title-bottom {
        font-size: clamp(2.5rem, 13vw, 4.2rem);
        line-height: 0.9;
        letter-spacing: -0.03em;
    }

    .az-slide__desc {
        font-size: 0.95rem;
        margin-top: 14px;
    }

    .az-slide__features {
        gap: 8px 18px;
        margin-top: 16px;
    }

    .az-slide__features li {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .az-check {
        width: 20px;
        height: 20px;
    }

    .az-slide__ctas {
        gap: 10px;
        margin-top: 22px;
        flex-direction: column;
        width: 100%;
    }

    .az-slide__btn {
        padding: 14px 22px;
        font-size: 0.78rem;
        width: 100%;
        justify-content: center;
    }

    /* Stronger gradient for mobile legibility */
    .az-slide__overlay {
        background: linear-gradient(180deg, rgba(20,20,20,0.05) 0%, rgba(20,20,20,0.45) 50%, rgba(20,20,20,0.78) 100%) !important;
    }
    .az-slide__overlay--side {
        display: none;
    }

    /* Controls stack */
    .az-slider__controls {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 12px 16px;
        padding-bottom: 22px;
    }

    .az-slider__counter {
        grid-column: 1;
        grid-row: 1;
        font-size: 11px;
    }

    .az-slider__progress {
        grid-column: 2;
        grid-row: 1;
    }

    .az-slider__dots {
        grid-column: 3;
        grid-row: 1;
    }

    .az-slider__arrows {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        gap: 8px;
    }

    .az-slider__nav {
        width: 38px;
        height: 38px;
    }

    .az-slider__dot { width: 16px; }
    .az-slider__dot.is-active { width: 26px; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .az-slide.is-active .az-slide__inner > * {
        animation: none;
    }
    .az-slide {
        transition: opacity 200ms linear;
    }
    .az-slide__eyebrow-dot {
        animation: none;
    }
}
