/* =========================================================================
   PROJECT DETAIL PAGE REDESIGN (Stink Studios x JvM Style)
   ========================================================================= */

/* 1. Hero Section (The "Stink" Look) */
.project-hero {
    position: relative;
    width: 100%;
    height: 90vh;
    /* Dominates the screen */
    min-height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Text sits at the bottom */
    padding: 100px 5% 2rem;
    /* Top padding to clear navbar */
    /* Standard margins */
    overflow: hidden;
    background: var(--bg-color);
    /* Fallback */
}

/* The Massive Title */
.project-title {
    font-size: clamp(5rem, 16vw, 25rem);
    /* Massive scaling */
    line-height: 0.75;
    font-weight: 300;
    /* Thinner (Stink Style) */
    text-transform: uppercase;
    letter-spacing: -0.05em;
    /* Tighter for thin font */
    color: var(--accent-color);
    position: relative;
    z-index: 10;
    /* Must sit ON TOP of image */
    margin: 0;
    margin-left: -0.05em;
    /* Optical alignment */
    pointer-events: none;
    /* Let clicks pass through if needed */
    mix-blend-mode: normal;
}

/* The Layered Image/Video */
.hero-media-wrapper {
    position: absolute;
    top: 62px;
    left: 0;
    /* Full cover */
    width: 100%;
    /* Overlap Logic for Desktop: shorter image -> text overhangs */
    height: 75%;
    z-index: 1;
    /* Behind text */
    overflow: hidden;
}

.hero-media-wrapper img,
.hero-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    /* Crop top black bar */
    filter: brightness(0.9);
}

/* 2. Intro Section (Cinema Style) */
.project-intro {
    padding: 8rem 5%;
    display: grid;
    grid-template-columns: 300px 1fr;
    /* Metadata | Description */
    gap: 6rem;
    align-items: flex-start;
    background: var(--bg-color);
    position: relative;
    z-index: 5;
}

/* Metadata Block */
.project-meta {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.meta-item label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    /* Grey/lighter */
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.meta-item span {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Description Text */
.project-description {
    font-size: clamp(1.5rem, 2.5vw, 2.8rem);
    /* Large, editorial reading size */
    line-height: 1.3;
    font-weight: 400;
    /* Slightly lighter body */
    max-width: 40ch;
    /* Optimal line length for large text */
}

/* 3. Cinema Video Player (Full Width / Wide) */
.cinema-player-section {
    width: 100%;
    padding: 0 0 8rem;
    /* Bottom spacing */
    background: var(--bg-color);
}

.cinema-video-wrapper {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
}

.cinema-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. Project Gallery (Large Screenshots) */
.project-gallery {
    padding: 0 5% 8rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    /* Big spacing between images */
    background: var(--bg-color);
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.5s ease;
}

.gallery-caption {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 2px;
    /* Slight optical alignment */
}

/* 5. Mobile Responsiveness */
/* 5. Mobile Responsiveness */
@media (max-width: 968px) {
    .project-hero {
        height: 70vh;
        justify-content: flex-end;
        position: relative;
        display: flex;
        background: var(--bg-color);
        padding-top: 80px;
        /* Fix Navbar Overlap */
        box-sizing: border-box;
    }

    .hero-media-wrapper {
        width: 100%;
        height: 70%;
        top: 62px;
        position: absolute;
    }

    .hero-media-wrapper img,
    .hero-media-wrapper video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1.3);
        /* Zoom to crop letterboxing black bars */
        transform-origin: center;
    }

    .project-title {
        font-size: 17vw;
        line-height: 0.85;
        font-weight: 900;
        /* Bold font as requested */
        color: var(--accent-color);
        position: absolute;
        /* Force absolute for overlap */
        bottom: 15%;
        /* Sit over the image edge (image is 80% tall) */
        left: 5%;
        width: auto;
        margin: 0;
        margin-left: -0.05em;
        z-index: 10;
        pointer-events: none;
        text-align: left;
        white-space: nowrap;
    }

    .project-intro {
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 4rem;
        padding: 4rem 5%;
    }

    .project-description {
        font-size: 1.5rem;
    }
}

/* Split Grid for Socials Hero */
.hero-split-grid {
    display: flex;
    width: 100%;
    height: 100%;
}

.split-hero-img {
    flex: 1;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================
   3. Split Project Details (Magazine Style)
   ========================================= */
.project-details-split {
    display: grid;
    grid-template-columns: 40% 60%;
    /* Left: Text, Right: Video */
    gap: 4rem;
    max-width: 1400px;
    /* Spacious width */
    margin: 0 auto;
    padding: 6rem 5%;
    /* Generous whitespace */
    align-items: start;
    /* Align to top */
    padding-bottom: 0;
    /* Remove bottom padding as we use gap/margin between items now */
    margin-bottom: 8rem;
    /* Spacing between projects */
}

/* Global CTA Section */
.global-cta-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5% 4rem;
    /* Below styling, aligns with grid */
    /* Padding bottom gives space before first project */
}

/* Left Column: Text Content */
.details-text-col {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    /* Space between Fact block and Story */
}

/* Hard Facts Block */
.hard-facts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-family: 'Inter', sans-serif;
}

.fact-item {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.fact-label {
    font-weight: 700;
    margin-right: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

/* Storytelling Text */
.project-story p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* Right Column: Integrated Video */
.details-video-col {
    position: relative;
    width: 100%;
    /* Clean integration: No decorative borders/shadows needed for "Magazine" look, 
       but a subtle shadow helps lift it */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    /* Slight softening */
    overflow: hidden;
}

.details-video-col video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* Responsive */
@media (max-width: 968px) {
    .project-details-split {
        grid-template-columns: 1fr;
        /* Stack */
        gap: 3rem;
        padding: 4rem 5%;
    }

    .project-details-split {
        display: flex;
        flex-direction: column;
    }
}

/* =========================================
   4. Magazine Wrap Layout (L-Shape)
   ========================================= */
/* =========================================
   4. Magazine Wrap Layout (L-Shape + Auto Zig-Zag)
   ========================================= */
/* =========================================
   4. Magazine Wrap Layout (Master Text Wrap)
   ========================================= */
/* =========================================
   4. Magazine Wrap Layout (Master Text Wrap)
   ========================================= */
.project-details-magazine {
    display: block;
    /* Allows text to wrap */
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5% 4rem;
    margin-bottom: 8rem;
    border-bottom: 2px solid #000;
    overflow: hidden;
    /* Clear floats */
}

/* FIX: Override global max-width to allow full wrap */
.project-details-magazine p {
    max-width: 100%;
}

/* Remove spacing for the last section to avoid white block before footer */
.project-details-magazine:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
}

/* Media Column (Video) - Global Rules */
.magazine-media {
    width: 50%;
    /* Exact 50% per user request */
    float: right;
    /* Default: Odd Projects (Right) */
    margin-left: 30px;
    /* Fixed 30px gap */
    margin-bottom: 1.5rem;
    /* Space before text wraps under */

    /* Clean integration */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;

    /* Aspect Ratio & Fit Fix */
    aspect-ratio: 16/9;

    /* Force Hardware Accel for Clipping */
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

/* 9:16 Vertical Mode for Socials */
/* 9:16 Vertical Mode for Socials */
.magazine-media.vertical-media {
    aspect-ratio: 9/16 !important;
    width: 25%;
    height: auto !important;
    max-height: none !important;
    /* Push towards center */
    margin-right: 12%;
    margin-left: 60px;
    /* More breathing room for text */
}

.magazine-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

/* Text Styling */
.magazine-text {
    display: contents;
}

.project-details-magazine .hard-facts {
    margin-bottom: 2rem;
    border-left: 3px solid red;
    /* Prominent 3px border */
    padding-left: 1.5rem;
}

/* AUTOMATIC ZIG-ZAG LOGIC (Float Based) */

/* Odd Sections (1, 3, 5...) => Video Right */
/* (Handled by default .magazine-media float: right) */

/* Even Sections (2, 4, 6...) => Video Left */
section.project-details-magazine:nth-of-type(even) .magazine-media {
    float: left;
    margin-right: 30px;
    /* Fixed 30px gap */
    margin-left: 0;
}

/* Specific centering for Vertical Media on Left (Even) */
section.project-details-magazine:nth-of-type(even) .magazine-media.vertical-media {
    margin-left: 12%;
    margin-right: 60px;
}

/* --- MOBILE OPTIMIZATION PROMPT (Overrides) --- */
@media (max-width: 768px) {

    /* 1. Project List: Stack Video & Text */
    .magazine-media,
    .magazine-media.vertical-media,
    section.project-details-magazine:nth-of-type(even) .magazine-media,
    section.project-details-magazine:nth-of-type(even) .magazine-media.vertical-media {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        height: auto !important;
        max-height: none !important;
    }

    .magazine-media.vertical-media {
        aspect-ratio: 9/16 !important;
        width: 100% !important;
    }

    .project-details-magazine {
        display: flex;
        flex-direction: column;
        padding: 0 20px;
        /* Safety Padding */
    }

    .hard-facts {
        margin-top: 0;
        width: 100%;
        border-left: 3px solid red;
        /* Keep red line */
    }

    .project-story {
        width: 100%;
        padding-right: 0;
    }

    /* Socials Hero: Hide Center Image (Hero 2) on Mobile for 50/50 Split of Hero 1 & 3 */
    .hero-split-grid .split-hero-img:nth-child(2) {
        display: none;
    }

    /* Force strict 50% width for remaining images (ignore intrinsic size) */
    .hero-split-grid .split-hero-img {
        flex: 1 1 0px !important;
        width: 50% !important;
        max-width: 50% !important;
    }
}