/**
 * Banner Stack Module
 * Stack-based hover images: last 3 visible, new image on top, smooth transitions.
 */

.banner-stack-section {
    min-height: 100vh;
    padding: 120px 2rem;
    background-color: #000000;
    background-image: url("../Images/section2-lines-background.svg");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* White dot that follows cursor with lag - images open at this dot */
.banner-stack-section .banner-stack-cursor-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.banner-stack-section.banner-stack-hover .banner-stack-cursor-dot {
    opacity: 0;
}

.banner-stack-section .banner-stack-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 240px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-stack-section .banner-stack-text {
    position: relative;
    z-index: 1;
    text-align: center;
}

.banner-stack-section .banner-stack-text .banner-stack-headline {
    font-family: 'Lora', serif;
    font-size: 95px;
    font-weight: 400;
    line-height: 190px;
    color: #ffffff;
    margin: 0;
}

.banner-stack-section .banner-stack-text .banner-stack-headline-line {
    display: block;
}

@media (min-width: 992px) and (max-width: 1280px) {
    .banner-stack-section .banner-stack-text .banner-stack-headline {
        font-size: 75px;
    }
}

/* Stack wrapper - above text (higher z-index), clips to section */
.banner-stack-section .banner-stack-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

/* Single stacked image - positioned inside section only, natural aspect ratio */
.banner-stack-section .stack-image-wrap {
    position: absolute;
    width: auto;
    height: auto;
    max-width: 150px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
    transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-stack-section .stack-image-wrap.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.banner-stack-section .stack-image-wrap img {
    width: auto;
    height: auto;
    max-width: 150px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: block;
    vertical-align: bottom;
}

/*
 * Lines as same-size background images so they match at the boundary.
 * Use two images with identical dimensions (e.g. 1920x400px):
 * - lines-stack.png: black background + lines (stack section bottom)
 * - lines-express.png: white background + lines (next section top)
 */

/* Next section sits under the line so the line “continues” onto it */
.section-after-stack {
    position: relative;
    z-index: 1;
    background-color: #ffffff;
}

/* Desktop stack: hide below 992px (cursor effect not available) */
@media (max-width: 991px) {
    .banner-stack-section {
        display: none;
    }
}

/* Mobile section: flash rotation, visible below 992px only */
.banner-stack-mobile {
    display: none;
    background-color: #000;
    padding: 80px 24px;
    text-align: center;
}

.banner-stack-mobile .banner-stack-mobile-title {
    font-family: 'Lora', serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 50px; /* 8px extra */
    color: #ffffff;
    margin: 0;
}

/* With break: visible below 576px only */
.banner-stack-mobile .banner-stack-mobile-title-no-break {
    display: none;
}

/* Without break: visible 576px–991px only */
@media (min-width: 576px) and (max-width: 991px) {
    .banner-stack-mobile .banner-stack-mobile-title-with-break {
        display: none;
    }

    .banner-stack-mobile .banner-stack-mobile-title-no-break {
        display: block;
    }
}

.banner-stack-mobile .banner-stack-mobile-flash {
    margin: 40px 0;
    position: relative;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-stack-mobile .banner-stack-mobile-flash-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-stack-mobile .banner-stack-mobile-flash-inner img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
}

.banner-stack-mobile .banner-stack-mobile-flash-inner img.is-active {
    opacity: 1;
    z-index: 1;
}

.banner-stack-mobile .banner-stack-mobile-flash-overlay {
    display: none;
}

@media (max-width: 991px) {
    .banner-stack-mobile {
        display: block;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .banner-stack-mobile {
        padding: 100px 50px;
    }

    .banner-stack-mobile .banner-stack-mobile-title {
        font-size: 56px;
        line-height: 64px; /* 8px extra */
    }

    .banner-stack-mobile .banner-stack-mobile-flash {
        max-width: 320px;
        min-height: 480px;
    }
}

/* Up to 576px: title stays 42px (base). Flash max-width and min-height. */
@media (max-width: 576px) {
    .banner-stack-mobile .banner-stack-mobile-flash {
        max-width: 250px;
        min-height: 375px !important;
    }
}
