/* Hild House aspect-ratio fill slider — independent of .hildhouse-carousel / majad slider */

.hildhouse-aspect-slider-wrapper {
    --aspect-slider-ratio: 16 / 9;
    --aspect-slider-track-height: 500px;
    background-color: #EBE4D4;
    padding: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}


.hildhouse-aspect-slider {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    padding-top: 80px;
    padding-bottom: 40px;
    box-sizing: border-box;
}

.hildhouse-aspect-slider .splide__track {
    border-radius: 0;
    overflow: hidden;
    position: relative;
    height: var(--aspect-slider-track-height);
}

.hildhouse-aspect-slider .splide__list {
    height: 100%;
    align-items: stretch;
}

.hildhouse-aspect-slider .splide__track::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    background: linear-gradient(to right, transparent, #EBE4D4);
    pointer-events: none;
    z-index: 5;
}

.hildhouse-aspect-slider .splide__slide {
    position: relative;
    height: 100%;
    width: auto;
    aspect-ratio: var(--aspect-slider-ratio);
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.hildhouse-aspect-slider .splide__slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 40px solid #D9D0BD;
    border-right: 40px solid transparent;
    z-index: 3;
    pointer-events: none;
    opacity: 0.6;
    transition: border-width 0.3s ease;
}

.hildhouse-aspect-slider .splide__slide:hover::before {
    border-top-width: 70px;
    border-right-width: 70px;
}

.hildhouse-aspect-slider .splide__slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
}

.hildhouse-aspect-slide-zoom {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    appearance: none;
    -webkit-appearance: none;
}

.hildhouse-aspect-slide-zoom:focus-visible {
    outline: 2px solid #777B61;
    outline-offset: -2px;
}

/* Lightbox overlay */
.hildhouse-aspect-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.hildhouse-aspect-lightbox.is-open {
    display: flex;
}

.hildhouse-aspect-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 18, 0.88);
}

.hildhouse-aspect-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1400px);
    height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
}

.hildhouse-aspect-lightbox__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: auto;
    height: auto;
    padding: 4px;
    border: 0;
    background: transparent;
    color: rgba(235, 228, 212, 0.75);
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.hildhouse-aspect-lightbox__close:hover,
.hildhouse-aspect-lightbox__close:focus,
.hildhouse-aspect-lightbox__close:focus-visible,
.hildhouse-aspect-lightbox__close:active {
    color: rgba(235, 228, 212, 0.95);
    background: transparent;
    border: 0;
    outline: none;
    box-shadow: none;
}

.hildhouse-aspect-lightbox__stage {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    cursor: zoom-in;
}

.hildhouse-aspect-lightbox.is-touch .hildhouse-aspect-lightbox__stage {
    touch-action: manipulation;
    cursor: default;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.hildhouse-aspect-lightbox__stage.is-zoomed {
    cursor: grab;
}

.hildhouse-aspect-lightbox__stage.is-dragging {
    cursor: grabbing;
}

.hildhouse-aspect-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.05s linear;
    user-select: none;
    -webkit-user-drag: none;
}

.hildhouse-aspect-lightbox.is-touch .hildhouse-aspect-lightbox__img {
    transition: none;
}

html.hildhouse-aspect-lightbox-open,
html.hildhouse-aspect-lightbox-open body {
    overflow: hidden;
}

/* On touch devices, allow the page to pinch-zoom while lightbox is open */
html.hildhouse-aspect-lightbox-open.hildhouse-aspect-lightbox-pinch,
html.hildhouse-aspect-lightbox-open.hildhouse-aspect-lightbox-pinch body {
    overflow: visible;
    touch-action: pinch-zoom;
}

/* Navigation arrows — above the slides */
.hildhouse-aspect-slider .splide__arrows {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.hildhouse-aspect-slider .splide__arrow {
    width: 50px;
    height: 50px;
    background-color: #EBE4D4;
    border: 1px solid #777b61ba;
    opacity: 0.7;
    border-radius: 0;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
}

.hildhouse-aspect-slider .splide__arrow:hover {
    background-color: #D9D0BD;
    border-color: #777B61;
}

.hildhouse-aspect-slider .splide__arrow svg {
    display: none;
}

.hildhouse-aspect-slider .splide__arrow--next::before,
.hildhouse-aspect-slider .splide__arrow--prev::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 14px;
    background-image: url('https://hildhouse.ee/wp-content/uploads/2025/12/Vector-84-1.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.hildhouse-aspect-slider .splide__arrow--next::before {
    transform: translate(-50%, -50%);
}

.hildhouse-aspect-slider .splide__arrow--prev::before {
    transform: translate(-50%, -50%) scaleX(-1);
}

.hildhouse-aspect-slider .splide__pagination {
    position: absolute;
    bottom: -10px;
    right: 30px;
    left: auto;
    width: auto;
    z-index: 10;
    padding-right: calc((100vw - 1400px) / 2);
}

.hildhouse-aspect-slider .splide__pagination__page {
    width: 10px;
    height: 10px;
    background-color: #D9D0BD;
    border-radius: 50%;
    margin: 0 5px;
    opacity: 1;
    transition: all 0.3s ease;
}

.hildhouse-aspect-slider .splide__pagination__page.is-active {
    background-color: #8B9A6B;
    transform: scale(1.2);
}

.hildhouse-aspect-slider .splide__pagination__page:hover {
    background-color: #A8B88A;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .hildhouse-aspect-slider-wrapper {
        padding-left: 10px;
        height: auto;
    }

    .hildhouse-aspect-slider {
        height: auto;
    }

    .hildhouse-aspect-slider .splide__track {
        height: auto;
    }

    .hildhouse-aspect-slider .splide__list {
        height: auto;
        align-items: stretch;
    }

    /* Slightly wider than the viewport so the next slide peeks in */
    .hildhouse-aspect-slider .splide__slide {
        height: auto;
        width: calc(100vw + 40px);
        max-width: none;
        aspect-ratio: var(--aspect-slider-ratio);
    }

    .hildhouse-aspect-slider .splide__track::after {
        width: 100px;
    }

    .hildhouse-aspect-slider .splide__arrow {
        width: 40px;
        height: 40px;
    }

    .hildhouse-aspect-slider .splide__arrow--next::before,
    .hildhouse-aspect-slider .splide__arrow--prev::before {
        width: 20px;
        height: 12px;
    }

    .hildhouse-aspect-slider .splide__pagination {
        bottom: 20px;
        right: 20px;
        padding-right: 0;
    }
}
