/* ===== CSS3 CoverFlow — adapted for portfolio ===== */

/* Wrapper scoped to avoid clashing with site globals */
.coverflow-wrapper {
    position: relative;
    width: 100%;
    height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* 3‑D stage */
.coverflow {
    position: relative;
    width: 100%;
    height: 100%;

    -webkit-perspective: 600px;
    -moz-perspective: 600px;
    perspective: 600px;
}

/* Each cover / album card */
.coverflow section {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;

    width: 200px;
    height: 200px;

    margin-left: -100px;
    margin-top: -100px;

    background-color: #111;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .55);

    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    transform-style: preserve-3d;

    -webkit-transition: all 350ms cubic-bezier(.25, .8, .25, 1);
    -moz-transition: all 350ms cubic-bezier(.25, .8, .25, 1);
    -ms-transition: all 350ms cubic-bezier(.25, .8, .25, 1);
    -o-transition: all 350ms cubic-bezier(.25, .8, .25, 1);
    transition: all 350ms cubic-bezier(.25, .8, .25, 1);

    /* Reflection (WebKit only) */
    -webkit-box-reflect: below 4px -webkit-gradient(linear, left top, left bottom,
            from(transparent),
            color-stop(0.55, transparent),
            to(rgba(255, 255, 255, .25)));
}

/* Video covers */
.coverflow section video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    pointer-events: none;
}

/* Cross-browser reflection fallback (non‑WebKit) */
.coverflow section::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    height: 60%;
    border-radius: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    -webkit-transform: scaleY(-1);
    transform: scaleY(-1);
    opacity: .15;
    filter: blur(1px);
    -webkit-mask-image: linear-gradient(to bottom, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
    mask-image: linear-gradient(to bottom, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
    pointer-events: none;
}

/* Hide reflection in WebKit (native -box-reflect is used) */
@supports (-webkit-box-reflect: below 0) {
    .coverflow section::after {
        display: none;
    }
}

/* Active / center cover glow */
.coverflow section.cf-active {
    box-shadow:
        0 0 60px rgba(11, 206, 175, .18),
        0 18px 50px rgba(0, 0, 0, .45);
    cursor: pointer;
}

/* ===== Floating arrow controls ===== */
.cf-arrow {
    position: absolute;
    bottom: 30px;
    z-index: 50;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .5);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s ease, background .25s ease, color .25s ease, border-color .25s ease;
    text-decoration: none;
}

.coverflow-wrapper:hover .cf-arrow {
    opacity: 1;
}

.cf-arrow:hover {
    background: rgba(11, 206, 175, .25);
    border-color: rgba(11, 206, 175, .5);
    color: #fff;
}

.cf-arrow-left {
    left: 350px;
}

.cf-arrow-right {
    right: 350px;
}

/* ===== Back to Albums button ===== */
.back-btn-wrap {
    display: none;
    position: absolute;
    top: 100px;
    left: 150px;
    z-index: 100;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    cursor: pointer;
    transition: all .25s ease;
}

.back-btn i {
    font-size: 14px;
}

.back-btn:hover {
    color: #fff;
    background: rgba(11, 206, 175, .2);
    border-color: rgba(11, 206, 175, .4);
}

/* Video popup (Magnific Popup inline) */
.cf-video-popup {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Dynamic lightbox sizing based on orientation */
.mfp-wrap img.landscape-media,
.cf-video-popup video.landscape-media {
    width: 1280px !important;
    height: 720px !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

.mfp-wrap img.portrait-media,
.cf-video-popup video.portrait-media {
    width: 720px !important;
    height: 1280px !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

/* Play icon overlay on video covers */
.cf-video::before {
    content: "\25B6";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, .7);
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
    transition: opacity .25s ease;
}

.cf-video.cf-active::before {
    opacity: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .coverflow-wrapper {
        height: 320px;
    }

    .coverflow section {
        width: 200px;
        height: 200px;
        margin-left: -100px;
        margin-top: -100px;
    }

    .cf-arrow {
        width: 28px;
        height: 28px;
        font-size: 12px;
        opacity: 1;
    }

    .cf-arrow-left {
        left: 40px;
    }

    .cf-arrow-right {
        right: 40px;
    }
}

@media (max-width: 480px) {
    .coverflow-wrapper {
        height: 260px;
    }

    .coverflow section {
        width: 160px;
        height: 160px;
        margin-left: -80px;
        margin-top: -80px;
    }

    .cf-arrow {
        width: 24px;
        height: 24px;
        font-size: 10px;
        margin-top: -10px;
    }

    .cf-arrow-left {
        left: 20px;
    }

    .cf-arrow-right {
        right: 20px;
    }
}