/* opther page*/


/* --- WORK (PORTFOLIO) PAGE STYLES --- */

body.work-page {
    overflow: hidden;
}

/* 1. SCROLL CONTAINER */
.gallery-wrapper {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100vh;
    width: 100%;
    /* SNAP ON, SMOOTH OFF (Fixes mousewheel jitter) */
    scroll-snap-type: x mandatory;
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.gallery-wrapper::-webkit-scrollbar {
    display: none;
}

.gallery-wrapper.active {
    cursor: grabbing;
    scroll-snap-type: none;
}

/* 2. SLIDES */
.work-slide {
    min-width: 100vw;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5vw;
    padding-top: 80px;
}

/* 3. INDEX SLIDE */
.index-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.index-title h1 {
    font-size: clamp(50px, 6vw, 100px);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.015em;
    margin-bottom: 30px;
    color: #111;
}

.index-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
}

.index-link {
    display: flex;
    align-items: flex-start;
    /* Aligns number to top */
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: 0.3s;
}

/* Wrapper for Title + Category */
.index-text-col {
    display: flex;
    flex-direction: column;
}

.i-name {
    font-size: 25px;
    font-weight: 600;
    color: #999;
    line-height: 1.2;
    transition: 0.3s;
}

.i-cat {
    font-size: 12px;
    text-transform: uppercase;
    color: #69645e;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 5px;
    transition: 0.3s;
}

.index-num {
    font-size: 12px;
    font-weight: 700;
    margin-right: 15px;
    color: var(--accent);
    opacity: 0.5;
    margin-top: 6px;
    /* Visual alignment with the name */
}

/* Hover Effects */
.index-link:hover {
    padding-left: 10px;
    border-color: var(--accent);
}

.index-link:hover .i-name {
    color: #111;
}

.index-link:hover .i-cat {
    color: var(--accent);
}

/* 4. PROJECT GRID */
.project-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 60px;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    pointer-events: none;
}

/* 5. IMAGE */
.work-img-container {
    width: 100%;
    height: 90vh;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    cursor: zoom-in;
    pointer-events: auto;
    margin-bottom: 90px;
}

.work-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.2, 1, 0.3, 1), filter 0.5s ease;
    transform: scale(1.1);
    filter: grayscale(100%);
}

.work-img-container:hover .work-img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.in-view .work-img {
    transform: scale(1);
}

/* 6. TEXT CONTENT */
.work-text-container {
    opacity: 0.5;
    transform: translateX(40px);
    transition: all 0.8s ease;
    pointer-events: auto;
}

.in-view .work-text-container {
    opacity: 1;
    transform: translateX(0);
}

.work-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.work-title {
    font-size: clamp(40px, 5vw, 80px);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 30px;
    letter-spacing: -0.015em;
    color: #111;
}

.work-desc {
    font-size: 18px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 30px;
    max-width: 450px;
}

.work-tags {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: #111;
    padding-top: 20px;
    border-top: 2px solid var(--accent);
    display: inline-block;
    letter-spacing: 1px;
}

/* 7. LIGHTBOX (FIXED: Massive Image) */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: #111;
    font-size: 50px;
    cursor: pointer;
    line-height: 1;
    transition: 0.3s;
    z-index: 220;
}

.lightbox-close:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

/* WIDE CONTAINER */
.lb-container {
    display: flex;
    flex-direction: row;
    width: 98vw;
    /* Almost full width */
    max-width: none;
    /* Uncap the width */
    height: 90vh;
    gap: 30px;
}

/* MAIN STAGE (75%) */
.lb-main-stage {
    flex: 4;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Pushes image to left edge */
}

.lightbox-img {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
    object-position: left center;
    /* Anchors image to left */
    box-shadow: none;
    /* Cleaner look for big images */
    transform: scale(1);
    /* Full size */
    transition: opacity 0.2s ease;
}

/* SIDEBAR (25%) */
.lb-bento-sidebar {
    flex: 1;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
    gap: 10px;
    grid-auto-flow: dense;
    align-content: start;
    overflow-y: auto;
}

.lb-bento-sidebar::-webkit-scrollbar {
    display: none;
}

.lb-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.lb-thumb:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.lb-thumb.active {
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: 0 0 0 3px var(--accent);
    z-index: 2;
}

/* Bento Spans */
.lb-thumb:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.lb-thumb:nth-child(3n) {
    grid-row: span 2;
}

/* 8. UI ELEMENTS */
.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #f0f0f0;
    z-index: 50;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* Scroll Indicator (Right) */
.scroll-indicator-large {
    position: absolute;
    bottom: 50px;
    right: 50px;
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    pointer-events: auto;
    cursor: pointer;
    animation: pulseRing 2s infinite;
    transition: 0.3s;
}

.scroll-indicator-large:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.scroll-indicator-large::after {
    content: '→';
    font-size: 40px;
    color: var(--accent);
    font-weight: 300;
    padding-bottom: 4px;
}

/* Back Button (Left) - VISIBLE */
.back-to-index {
    position: absolute;
    bottom: 80px;
    left: 50px;
    z-index: 90;
    /* High Z-Index to ensure clickability */
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #111;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-to-index.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.back-to-index:hover {
    color: var(--accent);
}

.back-to-index::before {
    content: '←';
    font-size: 18px;
    transition: transform 0.3s;
}

.back-to-index:hover::before {
    transform: translateX(-5px);
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        border-color: #ddd;
    }

    50% {
        transform: scale(1.05);
        border-color: var(--accent);
    }

    100% {
        transform: scale(1);
        border-color: #ddd;
    }
}

/* MOBILE OVERRIDE */
@media (max-width: 1299px) {
    body.work-page {
        overflow: auto;
    }

    .gallery-wrapper {
        flex-direction: column;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        height: auto;
    }

    .work-slide {
        min-width: 100%;
        min-height: unset;
        padding: 100px 20px 40px 20px;
        flex-direction: column;
    }

    .project-grid,
    .index-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .index-list {
        text-align: left;
    }

    .work-img-container {
        height: 50vh;
    }

    .work-text-container {
        transform: none;
        opacity: 1;
    }

    /* Hide desktop controls */
    .scroll-indicator-large,
    .back-to-index {
        display: none;
    }

    /* Lightbox Mobile */
    .lightbox {
        padding: 0;
    }

    .lb-container {
        flex-direction: column;
        width: 100%;
        height: 100%;
        padding: 60px 20px 20px 20px;
        gap: 20px;
    }

    .lb-main-stage {
        flex: 2;
        width: 100%;
    }

    .lb-bento-sidebar {
        flex: 1;
        width: 100%;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 80px;
        align-content: start;
    }
}


/* =========================================
   Post Navigation (Top & Bottom)
   ========================================= */

/* 1. Top "Escape Hatch" Link */
.nav-back-top {
    display: inline-block;
    margin-bottom: 30px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-back-top:hover {
    color: #ff5a00;
    transform: translateX(-5px);
    /* Subtle slide left */
}

/* 2. Bottom Navigation Area */
.blog-footer-nav {
    margin-top: 100px;
    padding-top: 60px;
    border-top: 1px solid #eee;
}

.nav-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* The Large Links */
.back-link-large,
.next-link-large {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: opacity 0.3s ease;
}

.back-link-large:hover,
.next-link-large:hover {
    opacity: 0.6;
    /* Simple fade effect */
}

/* Labels (Tiny text) */
.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 600;
}

/* Titles (Big text) */
.nav-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

/* Right align the "Next" button */
.next-link-large {
    text-align: right;
}

/* Mobile: Stack them */
@media (max-width: 1299px) {
    .nav-split {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }

    .next-link-large {
        text-align: left;
        /* Align left on mobile for consistency */
    }
}

/* =========================================
   Full Screen Lightbox (White/Blur Theme)
   ========================================= */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* 1. White Background with slight transparency */
    background: rgba(255, 255, 255, 0.92);

    /* 2. The Blur Effect (Frosted Glass) */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Safari Support */

    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;

    /* 3. Layout: Align Left */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Push content to left */
    padding-left: 8vw;
    /* Variable spacing from left edge */

    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    /* Limit width so it doesn't hit the right side close button */
    max-width: 80vw;
    max-height: 85vh;
    object-fit: contain;

    /* Softer shadow for light background */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    border-radius: 2px;

    transform: scale(0.98) translateX(-20px);
    /* Start slightly left */
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.lightbox-overlay.active img {
    transform: scale(1) translateX(0);
}

/* Close Button (Dark color for white bg) */
.lb-close-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    color: #111;
    /* Dark text */
    font-size: 50px;
    font-weight: 300;
    line-height: 0.5;
    cursor: pointer;
    opacity: 1;
    transition: transform 0.3s ease, color 0.3s ease;
}

.lb-close-btn:hover {
    color: #ff5a00;
    transform: rotate(90deg);
}

/* Mobile: Center it again because left-align looks broken on phones */
@media (max-width: 1299px) {
    .lightbox-overlay {
        justify-content: center;
        padding-left: 0;
        padding: 20px;
    }

    .lightbox-overlay img {
        max-width: 100%;
    }
}

/* Thumbnail Grid Container */
.project-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    /* Space from tags */
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Individual Thumbnail */
.p-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    /* Tastefully dimmed */
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.p-thumb:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.p-thumb.active {
    opacity: 1;
    border-color: #ff5a00;
    /* Brand accent color */
    transform: translateY(0);
}

/* Ensure Main Image transitions smoothly */
.work-img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    /* FIX: Combine both transitions so neither one breaks */
    /* 1. Transform (for the smooth hover scale) */
    /* 2. Opacity (for the thumbnail swap fade) */
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
}

/* Social Icons Container */
.footer-socials {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    gap: 15px;
    padding-bottom: 5px;
    /* Aligns visually with the last line of text */
}


@media (max-width: 1299px) {
    .progress-bar-container {
        display: none;
    }

    .index-list {
        padding: 0
    }

    .work-img-container {
        display: none;
    }


    .project-thumbnails {
        margin: 20px 20px;
        flex-wrap: wrap;
    }

    .work-tags {
        margin: 0 20px;
    }

    .work-desc {
        margin: 0 20px 20px 20px;
    }

}