/*--------------------------------------------------------------
 * Scrolling Photos Widget — Nordic Elementor
 *------------------------------------------------------------*/

.nordic-sp {
    width: 100%;
}

/* ── Main Layout ───────────────────────────────────────────── */
.nordic-sp-layout {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 60px;
    align-items: center;
}

/* ── Left: Text Content ────────────────────────────────────── */
.nordic-sp-text {
    padding-right: 20px;
}

.nordic-sp-subtitle {
    font-size: 18px;
    font-style: italic;
    color: #B8860B;
    margin-bottom: 8px;
}

.nordic-sp-title {
    font-size: 42px;
    font-weight: 900;
    color: #000;
    margin: 0 0 24px;
    line-height: 1.15;
}

.nordic-sp-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 32px;
}

.nordic-sp-desc p {
    margin-bottom: 12px;
}

.nordic-sp-btn {
    display: inline-block;
    padding: 14px 32px;
    background-color: #FF3333;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border-radius: 30px;
    transition: opacity 0.2s, transform 0.2s;
}

.nordic-sp-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Right: Photo Columns Container ────────────────────────── */
.nordic-sp-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 600px;
    overflow: hidden;
    position: relative;

    /* Fade mask: gradient at top and bottom */
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

/* ── Individual Column ─────────────────────────────────────── */
.nordic-sp-col {
    overflow: hidden;
    position: relative;
    height: 100%;
}

.nordic-sp-strip {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Photo Item ────────────────────────────────────────────── */
.nordic-sp-photo {
    flex-shrink: 0;
}

.nordic-sp-photo img {
    width: 100%;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    /* Show ~3 photos at a time:
       Container height is 600px, with 2 gaps of 16px = 32px,
       so each photo ≈ (600 - 32) / 3 ≈ 189px.
       We use a fixed height calculation instead of aspect-ratio
       so that exactly 3 photos fit the visible area. */
    height: calc((100cqh - 32px) / 3);
}

/* Container query fallback — use the parent column height */
.nordic-sp-col {
    container-type: size;
}

/* If container queries are not supported, use a fixed approach */
@supports not (container-type: size) {
    .nordic-sp-photo img {
        /* 600px container - 32px gaps = 568px / 3 ≈ 189px */
        height: 189px;
    }
}

/* ── Scroll-Up Animation ──────────────────────────────────── */
.nordic-sp-col--up .nordic-sp-strip {
    animation: nsp-scroll-up var(--nsp-speed, 20s) linear infinite;
}

@keyframes nsp-scroll-up {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* ── Scroll-Down Animation ─────────────────────────────────── */
.nordic-sp-col--down .nordic-sp-strip {
    animation: nsp-scroll-down var(--nsp-speed, 20s) linear infinite;
}

@keyframes nsp-scroll-down {
    0% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

/* ── Pause on Hover ────────────────────────────────────────── */
.nordic-sp[data-pause="true"] .nordic-sp-photos:hover .nordic-sp-strip {
    animation-play-state: paused;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991px) {
    .nordic-sp-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .nordic-sp-text {
        padding-right: 0;
        text-align: center;
    }

    .nordic-sp-photos {
        height: 400px;
    }

    @supports not (container-type: size) {
        .nordic-sp-photo img {
            /* 400px - 32px gaps = 368px / 3 ≈ 122px */
            height: 122px;
        }
    }

    .nordic-sp-title {
        font-size: 32px;
    }
}

@media (max-width: 767px) {
    .nordic-sp-photos {
        height: 320px;
        gap: 12px;
    }

    @supports not (container-type: size) {
        .nordic-sp-photo img {
            /* 320px - 24px gaps = 296px / 3 ≈ 99px */
            height: 99px;
        }
    }

    .nordic-sp-photo img {
        border-radius: 12px;
        height: calc((100cqh - 24px) / 3);
    }

    .nordic-sp-title {
        font-size: 28px;
    }
}
