/* ===== Shorts carousel (Swiper) ===== */
.work-carousel {
    position: relative;
    margin-bottom: 40px;
    padding-bottom: 40px; /* room for pagination dots */
}

.wg-swiper {
    overflow: hidden; 
}

.work-carousel .swiper-slide {
    height: auto; 
}

.work-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.work-carousel__arrow svg { width: 20px; height: 20px; }

.work-carousel__arrow--prev { left: -60px; }
.work-carousel__arrow--next { right: -60px; }

.work-carousel__arrow.swiper-button-disabled {
    opacity: .35;
    cursor: default;
}

@media (max-width: 480px) {
    .work-carousel__arrow { width: 36px; height: 36px; }
    .work-carousel__arrow svg { width: 16px; height: 16px; }
}

/* Swiper's own pagination bullets — restyled to match dark theme */
.work-carousel .swiper-pagination-bullet {
    background: rgba(255,255,255,.3);
    opacity: 1;
}
.work-carousel .swiper-pagination-bullet-active {
    background: #fff;
    width: 22px;
    border-radius: 4px;
}

/* ===== Shared item styles ===== */
.work-item__thumb-wrap {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
}

.work-item__thumb-wrap::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.65));
}

.work-item__thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
    opacity: 0.8;
}

.work-item__thumb-wrap:hover img { transform: scale(1.05); opacity: 1; }

.work-item--short .work-item__thumb-wrap,
.work-item--carousel .work-item__thumb-wrap { aspect-ratio: 395 / 526; }

.work-item--grid .work-item__thumb-wrap { aspect-ratio: 16 / 9; }

.work-item__time {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.work-item__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
}

.work-item__play-icon svg { width: 22px; height: 22px; }

/* Overlay title (carousel/shorts cards) */
.work-item__overlay-text {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    width: 100%;
    padding: 16px;
}

.work-item--carousel .work-item__title {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

/* Below-image title (grid cards) — white */
.work-item--grid .work-item__title {
    margin-top: 10px;
    font-size: 15px;
    color: #fff;
    position: absolute;
    bottom: 0;
    left: 15px;
}

.work-gallery__empty { color: #fff; }

/* ===== Latest Release grid ===== */
.work-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    position: relative;
    min-height: 100px;
    grid-auto-rows: min-content;
}

@media (max-width: 480px) {
	.work-video-modal__close {
    top: 40px !important;
    right: 10px !important;
}
    .work-gallery__grid { grid-template-columns: minmax(0, 1fr); }
    .work-carousel__arrow--prev { left: 0px; }
.work-carousel__arrow--next { right: 0px; }
}

.work-item { min-width: 0; min-height: 0; }

.work-gallery__load-more-wrap { text-align: center; margin-top: 30px; }

.work-load-more-btn {
    padding: 10px 30px !important;
    border: none !important;
    background: transparent;
    cursor: pointer;
    border-radius: 0 !important;
    text-transform: uppercase;
    font-size: 13px !important;
    color: #ffffff !important;
    letter-spacing: 3px;
}
.work-load-more-btn:hover {
    background-color: transparent !important;
}

/* ===== Video modal ===== */
.work-video-modal { position: fixed; inset: 0; z-index: 9999; display: none; }
.work-video-modal.is-open { display: block; }
.work-video-modal__overlay { position: absolute; inset: 0; background: #000000f2; }

.work-video-modal__inner {
    position: relative;
    max-width: 1152px;
    width: 90%;
    margin: 0 auto;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh;
}

.work-video-modal__iframe-wrap {
    position: relative;
    height: 648px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}
.work-video-modal__iframe-wrap iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.work-video-modal__close {
    position: absolute;
    top: 20px;
    right: -30px;
    background: none;
    border: none !important;
    z-index: 99;
    transform: scale(2);
    color: #fff;
    cursor: pointer;
}
.work-video-modal__close svg { stroke: #fff !important; }
button.work-video-modal__close:hover { background-color: transparent; }

body.work-modal-open { overflow: hidden; }

/* ===== Card entrance animation (slide + fade up) ===== */
.work-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.work-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Respect users who've asked for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .work-item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}




/* ===== Video popup: previous / next ===== */

.work-video-modal {
    /* One place for the video height; desktop keeps your 648px, shorter screens shrink to fit. */
    --wg-modal-h: min(648px, calc(100dvh - 130px));
    /* Desktop: space between the video and the half-visible neighbours. */
    --wg-peek-gap: 64px;
    overflow: hidden;
    /* some themes cap the width/margins of everything inside page content; the popup must stay full-screen */
    max-width: none !important;
    margin: 0 !important;
}

.work-video-modal__iframe-wrap {
    height: var(--wg-modal-h);
    /* the video's thumbnail (set by the JS) shows here until the player has loaded */
    background: #000 center / cover no-repeat;
}

.work-video-modal__iframe-wrap iframe {
    transition: opacity .35s ease;
}

.work-video-modal__iframe-wrap iframe.is-loading {
    opacity: 0;
}

/* Nothing extra shows unless there is more than one video to move between. */
.work-video-modal__bar,
.work-video-modal__peek {
    display: none !important;
}

/* Round arrow buttons. These are <div role="button">, so theme button styles can't touch them. */
.work-video-modal__arrow {
    box-sizing: border-box;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s ease, opacity .2s ease;
}

.work-video-modal__arrow svg {
    width: 22px;
    height: 22px;
}

.work-video-modal__arrow:hover {
    background: rgba(255, 255, 255, .28);
}

.work-video-modal__arrow.is-disabled {
    opacity: .3;
    cursor: default;
    pointer-events: none;
}

.work-video-modal__counter {
    min-width: 56px;
    text-align: center;
    color: #fff;
    font-size: 14px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

/* ---- Desktop: half-visible neighbours + arrows at the screen edges ---- */
@media (min-width: 769px) {
    /* Slightly narrower video so the neighbours have room to peek in from the sides. */
    .work-video-modal__inner {
        width: min(1152px, 68vw);
        max-width: none;
    }

    .work-video-modal.has-nav .work-video-modal__bar {
        display: contents !important; /* arrows + counter position themselves against the popup */
    }

    .work-video-modal.has-nav .work-video-modal__peek {
        display: block !important;
        position: absolute;
        top: 50%;
        width: 100%;
        height: var(--wg-modal-h);
        border-radius: 10px;
        overflow: hidden;
        background: #111;
        opacity: .35;
        cursor: pointer;
    }

    .work-video-modal__peek--prev {
        right: calc(100% + var(--wg-peek-gap));
        transform: translateY(-50%) scale(.88);
        transform-origin: right center;
    }

    .work-video-modal__peek--next {
        left: calc(100% + var(--wg-peek-gap));
        transform: translateY(-50%) scale(.88);
        transform-origin: left center;
    }

    .work-video-modal__peek img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: none;
    }

    .work-video-modal__arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
    }

    .work-video-modal__arrow--prev { left: 24px; }
    .work-video-modal__arrow--next { right: 24px; }

    .work-video-modal__counter {
        position: absolute;
        bottom: 28px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 5;
    }

    /* ---- Slide animation between videos (the JS adds / removes these classes) ---- */
    .work-video-modal__iframe-wrap,
    .work-video-modal__peek {
        transition: transform .5s cubic-bezier(.45, 0, .2, 1), opacity .5s ease;
    }

    .work-video-modal.has-nav .work-video-modal__peek:hover {
        opacity: .6;
    }

    .work-video-modal.has-nav .work-video-modal__peek.is-empty {
        visibility: hidden;
    }

    /* Next: current video slides left into the "previous" spot, the next one slides into the middle. */
    .work-video-modal.has-nav.is-sliding-next .work-video-modal__iframe-wrap {
        transform: translateX(calc(var(--wg-shift) * -1)) scale(.88);
        opacity: .35;
    }
    .work-video-modal.has-nav.is-sliding-next .work-video-modal__peek--next {
        transform: translate(calc(var(--wg-slot) * -1), -50%) scale(1);
        opacity: 1;
    }
    .work-video-modal.has-nav.is-sliding-next .work-video-modal__peek--prev {
        transform: translate(calc(var(--wg-slot) * -1), -50%) scale(.88);
        opacity: 0;
    }

    /* Previous: the mirror image. */
    .work-video-modal.has-nav.is-sliding-prev .work-video-modal__iframe-wrap {
        transform: translateX(var(--wg-shift)) scale(.88);
        opacity: .35;
    }
    .work-video-modal.has-nav.is-sliding-prev .work-video-modal__peek--prev {
        transform: translate(var(--wg-slot), -50%) scale(1);
        opacity: 1;
    }
    .work-video-modal.has-nav.is-sliding-prev .work-video-modal__peek--next {
        transform: translate(var(--wg-slot), -50%) scale(.88);
        opacity: 0;
    }

    /* After a slide: snap everything back instantly, then fade the new neighbour in. */
    .work-video-modal.is-reset .work-video-modal__iframe-wrap,
    .work-video-modal.is-reset .work-video-modal__peek {
        transition: none !important;
    }
    .work-video-modal.has-nav .work-video-modal__peek.is-fresh {
        opacity: 0;
    }
}

/* ---- Mobile: the video exactly as before, arrows + counter in a bar below it ---- */
@media (max-width: 768px) {
    .work-video-modal {
        /* 648px like before, only shrinking on short screens so the bar below always fits */
        --wg-modal-h: min(648px, calc(100dvh - 170px));
    }

    /* no thumbnail behind the player on mobile: plain black while it loads, as before */
    .work-video-modal__iframe-wrap {
        background-image: none !important;
    }

    .work-video-modal.has-nav .work-video-modal__bar {
        display: flex !important;
        position: absolute;
        left: 0;
        right: 0;
        bottom: max(20px, env(safe-area-inset-bottom));
        z-index: 5;
        align-items: center;
        justify-content: center;
        gap: 24px;
    }
}

@media (min-width: 769px) {
    .work-video-modal.is-short {
        --wg-modal-h: min(760px, calc(100dvh - 110px));
    }

    .work-video-modal.is-short .work-video-modal__inner {
        width: calc(var(--wg-modal-h) * 9 / 16); /* 9:16, the shape of a Short */
    }
}
.work-video-modal__iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}