
/* =========================================
   COMBINED WORK SHOWCASE
   ========================================= */

.work-showcase {
    --work-cream: var(--color-cream, #F4F1EA);
    --work-black: var(--color-black, #0A0A0A);
    --work-yellow: var(--color-brand, #FAED25);

    background: var(--work-black);
    color: var(--work-cream);
}

/* Shared heading */

.work-showcase-intro {
    padding: 78px 6% 12px;
    max-width: 1520px;
    margin: 0 auto;
}

.work-showcase-intro .landscape-eyebrow {
    display: block;
    margin-bottom: 14px;
    color: var(--work-yellow);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}

.work-showcase-intro h2 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: .98;
    letter-spacing: -.065em;
    font-weight: 900;
    color: var(--work-cream);
}

.work-showcase-intro h2 span {
    color: var(--work-yellow);
}

.work-showcase-intro p {
    margin: 18px 0 0;
    font-size: 15px;
    opacity: .72;
}

/* =========================================
   PORTRAIT VIDEO CAROUSEL
   ========================================= */

.youtube-section {
    padding: 20px 1.5rem 62px;
    background: var(--work-black);
    color: var(--work-cream);
}

.youtube-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.youtube-grid-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 4px 28px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}

.youtube-grid-wrapper::-webkit-scrollbar {
    display: none;
}

.youtube-grid {
    display: flex;
    align-items: stretch;
    gap: 24px;
    width: max-content;
}

.youtube-card {
    position: relative;
    flex: 0 0 280px;
    width: 280px;
    max-width: 280px;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border: 1px solid rgba(244, 241, 234, .12);
    border-radius: 5px;
    background: #141414;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.youtube-card iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (hover: hover) and (pointer: fine) {
    .youtube-card:hover {
        transform: translateY(-6px);
        border-color: var(--work-yellow);
        box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
    }
}

/* Carousel arrows */

.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--work-yellow);
    border-radius: 50%;
    background: var(--work-yellow);
    color: var(--work-black);
    cursor: pointer;
    transition:
        background .25s ease,
        color .25s ease,
        transform .25s ease;
}

.scroll-arrow::before {
    content: "";
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.scroll-arrow:hover {
    background: var(--work-black);
    color: var(--work-yellow);
    transform: translateY(-50%) scale(1.08);
}

.scroll-arrow.left {
    left: 8px;
}

.scroll-arrow.left::before {
    transform: rotate(-135deg);
    margin-left: 4px;
}

.scroll-arrow.right {
    right: 8px;
}

.scroll-arrow.right::before {
    transform: rotate(45deg);
    margin-right: 4px;
}

/* =========================================
   LANDSCAPE VIDEO SHOWCASE
   ========================================= */

.landscape-work-section {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 76px 6% 86px;
    background: var(--black);
    color: var(--work-cream);
}

.landscape-video-stage {
    max-width: 1400px;
    margin: 0 auto;
}

.landscape-video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.landscape-video-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    border-radius: 5px;
    background: #151515;
    cursor: pointer;
    transition:
        transform .35s ease,
        opacity .35s ease,
        border-radius .35s ease;
}

.landscape-video-frame,
.landscape-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.landscape-video-frame iframe {
    display: block;
    border: 0;
    pointer-events: none;
}

.landscape-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    padding: 22px;
    color: #fff;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, .82),
        rgba(0, 0, 0, .18) 58%,
        transparent
    );
    pointer-events: none;
    transition: opacity .3s ease;
}

.landscape-video-overlay h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(17px, 1.7vw, 25px);
    line-height: 1.1;
    font-weight: 800;
}

.landscape-expand-label {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
}

.landscape-close {
    display: none;
}

/* Hover preview; click is handled by JavaScript */

@media (hover: hover) and (pointer: fine) {
    .landscape-video-card:hover:not(.is-expanded) {
        transform: translateY(-6px);
    }

    .landscape-expand-label {
        opacity: 0;
        transform: translateY(6px);
        transition: opacity .25s ease, transform .25s ease;
    }

    .landscape-video-card:hover:not(.is-expanded)
    .landscape-expand-label {
        opacity: 1;
        transform: translateY(0);
    }

    .landscape-work-section.has-expanded-video {
        min-height: 520px;
    }

    .landscape-work-section.has-expanded-video
    .landscape-video-grid {
        display: block;
    }

    .landscape-work-section.has-expanded-video
    .landscape-video-card:not(.is-expanded) {
        display: none;
    }

    .landscape-work-section.has-expanded-video
    .landscape-video-card.is-expanded {
        position: absolute;
        inset: 0;
        z-index: 10;
        width: 100%;
        height: 100%;
        min-height: 520px;
        aspect-ratio: auto;
        border-radius: 0;
        transform: none;
    }

    .landscape-video-card.is-expanded
    .landscape-video-frame iframe {
        pointer-events: auto;
    }

    .landscape-video-card.is-expanded
    .landscape-video-overlay {
        opacity: 0;
    }

    .landscape-video-card.is-expanded:hover
    .landscape-video-overlay {
        opacity: 1;
    }

    .landscape-video-card.is-expanded .landscape-close {
        position: absolute;
        top: 24px;
        right: 24px;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: 1px solid rgba(255, 255, 255, .6);
        border-radius: 50%;
        background: var(--work-yellow);
        color: #000;
        font-size: 27px;
        cursor: pointer;
        pointer-events: auto;
    }
}

/* =========================================
   RESPONSIVE LAYOUT
   ========================================= */

@media (max-width: 1024px) {
    .landscape-video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .work-showcase-intro {
        padding: 56px 20px 8px;
    }

    .work-showcase-intro h2 {
        font-size: clamp(36px, 10vw, 48px);
    }

    .work-showcase-intro p {
        font-size: 13px;
    }

    .youtube-section {
        padding: 12px 1rem 38px;
    }

    .youtube-grid {
        gap: 16px;
    }

    .youtube-card {
        flex-basis: 220px;
        width: 220px;
        max-width: 220px;
    }

    .scroll-arrow {
        display: none;
    }

    .landscape-work-section {
        padding: 42px 0 48px;
    }

    .landscape-video-stage {
        overflow: visible;
    }

    .landscape-video-grid {
        display: flex;
        gap: 14px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 20px 12px;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .landscape-video-grid::-webkit-scrollbar {
        display: none;
    }

    .landscape-video-card {
        flex: 0 0 86%;
        max-width: 430px;
        aspect-ratio: 16 / 9;
        scroll-snap-align: start;
        cursor: default;
    }

    .landscape-video-overlay {
        padding: 16px;
    }

    .landscape-video-overlay h3 {
        font-size: 20px;
    }

    .landscape-expand-label {
        display: none;
    }

    .landscape-video-card .landscape-close {
        display: none !important;
    }

    /* Preserve the swipeable carousel on touch devices. */
    .landscape-work-section.has-expanded-video
    .landscape-video-grid {
        display: flex;
    }

    .landscape-work-section.has-expanded-video
    .landscape-video-card {
        position: relative;
        inset: auto;
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
        border-radius: 5px;
    }

    .landscape-work-section.has-expanded-video
    .landscape-video-card:not(.is-expanded) {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .youtube-grid-wrapper {
        scroll-behavior: auto;
    }

    .youtube-card,
    .landscape-video-card,
    .landscape-video-overlay {
        transition: none;
    }
}


.youtube-grid-wrapper {
    /* Prevent CSS smooth scrolling from delaying JS frame-by-frame updates */
    scroll-behavior: auto !important; 
    
    /* Enable GPU layer allocation for smoother scrolling rendering */
    will-change: scroll-position; 
    
    /* Hide scrollbars cleanly across browsers */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.youtube-grid-wrapper::-webkit-scrollbar {
    display: none;
}