/* ==========================================
   WORK SECTION - TRIPLE COLUMN MATRIX
   ========================================== */

#work {
    background-color: #0b0b0b;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Master Grid Wrapper */
.work-grid-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* 55% Left Viewport / 45% Right Controls */
    width: 100vw;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    padding: 120px 60px 60px 60px; /* Top padding completely clears fixed nav */
    gap: 80px;
    box-sizing: border-box;
}

/* ==========================================
   COLUMN 1 (LEFT) - STATIC HIGH-RES MASTER VIEW
   ========================================== */

.work-showcase-column {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.work-section-title {
    margin: 0;
    padding: 0 0 50% 0;
    
    /* Typography & Visual Texture */
    font-family: "oscine", sans-serif;
    font-size: 3.5vw; /* Large, editorial presentation scale */
    font-weight: 300;
    line-height: 1;
    text-transform: lowercase;
    color: #ffffff;
    
    /* Functional Layout Safety */
    pointer-events: none; /* Allows mouse clicks to pass right through to links */
    z-index: 1;
}
.showcase-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    justify-content: center; 
    overflow: hidden; /* Prevent child components from bleeding past boundaries */
}
.work-section-title-inline {
    font-family: "oscine", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #ffffff;
    opacity: 0.5;
    margin: 0 0 16px 0; /* Tightened slightly for safety */
    flex-shrink: 0; /* CRITICAL: Prevents the title text from crushing when squeezed */
}

.showcase-frame {
    position: relative;
    width: 100%;
    
    /* 1. Remove the hardcoded aspect-ratio rule to allow vertical flex */
    aspect-ratio: auto; 
    
    /* 2. Lock maximum height based on viewport vertical availability */
    max-height: 40vh; /* Automatically shrinks the image frame on short laptops */
    
    background-color: #121212;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    flex-shrink: 1; /* Allows the image module to scale down first */
}

.showcase-frame img {
    width: 100%;
    height: 100%;
    min-height: 25vh; /* Keep a premium presentation base */
    object-fit: cover; /* Crops beautifully without breaking asset proportions */
    display: block;
    transition: opacity 0.3s ease;
}
.project-metadata {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    margin-top: 16px;
    flex-shrink: 0; /* Prevents text truncation loops during scaling */
}

/* ==========================================
   THE RIGHT SIDE - SUB-SPLIT (COLUMNS 2 & 3)
   ========================================== */

.work-interactive-column {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Split: Left side category indicators / Right side thumbnail track */
    gap: 40px;
    height: 100%;
    align-items: center;
}

/* --- COLUMN 2 (MIDDLE) - VERTICAL CATEGORY NAV INDICATORS --- */
.work-category-nav {
    display: flex;
    justify-content: flex-start;
}

.work-category-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.work-category-nav .cat-link {
    color: #ffffff;
    text-decoration: none;
    font-family: "oscine", sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    opacity: 0.25;
    transition: opacity 0.4s ease, font-weight 0.2s ease;
    white-space: nowrap;
}

.work-category-nav .cat-link.active {
    opacity: 1;
    font-weight: 700;
}

/* --- COLUMN 3 (RIGHT) - VIRTUAL WHEEL OF THUMBNAILS --- */
.work-scroll-window {
    position: relative;
    width: 100%;
    height: 70vh;          /* Explicitly bounds the tracking horizon */
    overflow: hidden;       /* Hides the massive trailing ribbon of thumbs */
    display: flex;
    align-items: center;    /* Keeps the active horizon dead center */
}

#master-project-view {
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 1;
    filter: blur(0px);
}

/* Class injected momentarily during the asset swap */
#master-project-view.fade-out {
    opacity: 0;
    filter: blur(5px); /* Optional: subtle professional lens defocus */
}

/* The actual track GSAP translates along the Y-axis */
.project-scroll-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3rem;            
    
    /* if I change this I will need to account for it in the project router */
    padding: calc(30vh - 80px) 0; 
}

/* Group container matching your markup structure */
.project-group {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 100%;
}

/* The Vertical Tap Target Stack */
.project-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    opacity: 0.2;
    filter: grayscale(100%);
    transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Centered Horizon Active Target Focus state */
.project-thumb.active {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05); /* Soft premium focus pop */
}

.meta-tags {
    font-size: .7rem;
    font-weight: 700;
}

.meta-title {
    font-family: "oscine", sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.3;
    color: #ffffff;
    margin: 10px 0 0 0;
    max-width: 90%;
    min-height: 4.55rem;

    /* ─── LINE CLAMP BLOCK STABILITY ─── */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Truncates cleanly at 2 lines */
    line-clamp: 2;         /* Modern standard fallback to clear modern linter warnings */
}

.meta-desc {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.6;
    color: #aaaaaa;
    margin: 0 0 10px 0;
    max-width: 85%;
    min-height: 4.56rem;

    /* ─── LINE CLAMP BLOCK STABILITY ─── */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* Truncates cleanly at 3 lines */
    line-clamp: 2;         /* Modern standard fallback to clear modern linter warnings */
}



/* ==========================================
   MOBILE RESPONSIVE OVERRIDES
   ========================================== */
@media (max-width: 767px) {
    /* Step 1: Strip the 1600px constraint and eliminate the left showcase column */
    .work-grid-container {
        grid-template-columns: 1fr; /* Fallback parent wrapper */
        width: 100vw;
        height: 100vh;
        padding: 90px 20px 20px 20px; /* Slightly tightened clearance for small viewports */
        gap: 0;
    }

    /* Force the master image showcase container out of the layout entirely */
    .work-showcase-column {
        display: none !important;
    }

    /* Step 2: Establish the precise 2-Column interactive grid on Mobile */
    .work-interactive-column {
        display: grid;
        grid-template-columns: 0.8fr 1.2fr; /* 40% Category Nav / 60% Thumbnail Track */
        gap: 20px;
        width: 100%;
        height: 100%;
        align-items: center;
    }

    /* Ensure the vertical indicator lists stay visible and crisp */
    .work-category-nav {
        display: flex !important;
        justify-content: flex-start;
    }

    .work-category-nav ul {
        gap: 1.2rem; /* Slightly tighter text lines for shorter viewports */
    }

    .work-category-nav .cat-link {
        font-size: 0.75rem; /* Downscaled slightly for mobile aspect preservation */
    }

    /* Constrain the bounding horizon box to a tighter height signature */
    .work-scroll-window {
        height: 50vh;
        display: flex;
        align-items: center;
    }

    /* Adjust padding logic to keep the center-horizon alignment accurate on mobile */
    .project-scroll-track {
        padding: calc(25vh - 50px) 0;
        gap: 2rem;
    }
    
    .project-group {
        gap: 2rem;
    }
}