/**
 * Course slider image lightbox (V4 homepage)
 */

.course-slider-lightbox {
    position: fixed;
    inset: 0;
    z-index: 11050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.course-slider-lightbox[hidden] {
    display: none !important;
}

.course-slider-lightbox.is-open {
    animation: course-slider-lightbox-fade-in 0.28s ease;
}

.course-slider-lightbox.is-closing {
    animation: course-slider-lightbox-fade-out 0.22s ease forwards;
}

.course-slider-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 15, 36, 0.88);
    backdrop-filter: blur(3px);
}

.course-slider-lightbox__panel {
    position: relative;
    z-index: 2;
    width: min(960px, 100%);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    border: 3px solid var(--knu-gold);
}

.course-slider-lightbox__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 31, 73, 0.88);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.course-slider-lightbox__close:hover,
.course-slider-lightbox__close:focus-visible {
    background: var(--knu-orange);
    transform: scale(1.04);
}

.course-slider-lightbox__figure {
    margin: 0;
}

.course-slider-lightbox__media {
    background: #001739;
    line-height: 0;
}

.course-slider-lightbox__image {
    width: 100%;
    max-height: min(68vh, 720px);
    object-fit: contain;
    object-position: center top;
    display: block;
    margin: 0 auto;
}

.course-slider-lightbox__caption {
    padding: 1.1rem 1.25rem 1.35rem;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-top: 3px solid var(--knu-gold);
}

.course-slider-lightbox__badge {
    display: inline-block;
    margin-bottom: 0.55rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--knu-gold);
    color: #1a1200;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.course-slider-lightbox__title {
    margin: 0 0 0.4rem;
    color: var(--knu-blue-dark);
    font-size: clamp(1.15rem, 2.4vw, 1.65rem);
    font-weight: 900;
    line-height: 1.2;
}

.course-slider-lightbox__subtitle {
    margin: 0 0 0.95rem;
    color: var(--knu-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.course-slider-lightbox__subtitle:empty {
    display: none;
}

.course-slider-lightbox__badge[hidden],
.course-slider-lightbox__subtitle[hidden],
.course-slider-lightbox__cta[hidden] {
    display: none !important;
}

.course-slider-lightbox__cta {
    font-weight: 800;
    border-radius: 8px;
    padding: 0.6rem 1.1rem;
}

html.course-slider-lightbox-active body {
    overflow: hidden;
}

@keyframes course-slider-lightbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes course-slider-lightbox-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (max-width: 767.98px) {
    .course-slider-lightbox {
        padding: 0.5rem;
    }

    .course-slider-lightbox__panel {
        max-height: calc(100vh - 1rem);
        border-radius: 10px;
    }

    .course-slider-lightbox__caption {
        padding: 0.95rem 1rem 1.1rem;
    }

    .course-slider-lightbox__image {
        max-height: 52vh;
    }
}
