/* Project Detail Page Styles */

/* Initial Visibility for Animation */
.project-detail-page .main-container main>section {
    opacity: 0;
    will-change: opacity, transform;
}


/* Base Overlay Tweaks */
.project-detail-page .topo-container {
    /* opacity: .5; */
    height: 75%;
}

/* Project Hero */
.project-hero {
    padding: 20vh 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-title {
    font-size: 56px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 32px;
    color: #000;
    max-width: 720px;
    text-align: left;
    width: 100%;
}

h2.project-subtitle {
    font-size: 24px;
    font-weight: 600;
    font-family: "Roboto Slab", serif;
    width: 100%;
    max-width: 720px;
    margin-bottom: 24px;
    text-align: left;
}

.project-intro {
    font-size: 22px;
    line-height: 1.5;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    color: #111;
    text-align: left;
}

/* Stacked Content Layout */
.project-content-stack {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 120px;
}

.project-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 120px;
    width: 100%;
}

.project-image-container {
    width: 100%;
    max-width: 960px;
    height: auto;
    border-radius: var(--image-border-radius);
    overflow: hidden;
    background-color: #f5f5f7;
    position: relative;
    cursor: pointer;
}

.project-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transform: scale(1.1);
    /* Provide bleed for parallax movement */
    will-change: transform;
}

.project-text-block {
    max-width: 720px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.project-content-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}

.project-text-block h4.project-content-title {
    font-size: 18px;
    font-weight: 600;
    width: 100%;
    max-width: 720px;
    /* margin-bottom: 24px; */
    text-align: left;
}

.project-text-block ul {
    padding-left: 12px;
}


/* Utilities */
.spacer-large {
    height: 120px;
}


/* Responsive */
@media (max-width: 768px) {



    .project-detail-page .topo-container {
        height: 85%;
    }

    .project-hero {
        padding: 0px 24px 60px;
        min-height: 95vh;
        justify-content: end;
    }

    .project-title {
        font-size: 32px;
        margin-bottom: 24px;
        font-weight: 600;
    }

    .project-intro {
        font-size: 18px;
        line-height: 1.4;
    }

    h2.project-subtitle {
        font-size: 20px;
        font-weight: 600;
        font-family: "Roboto Slab", serif;
        width: 100%;
        max-width: 720px;
        margin-bottom: 24px;
        text-align: left;
        line-height: 1.3;
    }

    .project-content-stack {
        padding: 0;
        gap: 64px;
    }

    .project-item {
        gap: 64px;
    }

    .project-text-block {
        font-size: 16px;
        padding: 0 24px;
    }

    .project-image-container {
        width: 100%;
        height: auto;
        border-radius: var(--image-border-radius);
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .project-image-container img {
        width: auto;
        height: auto;
        display: block;
        max-height: 480px;
    }

}

/* --------------------------------------------------------- */
/* Gallery Section */
/* --------------------------------------------------------- */
.gallery-section {
    padding: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    user-select: none;
    cursor: grab;
    overscroll-behavior-x: none;
}

.gallery-section.is-dragging {
    cursor: grabbing !important;
}

.gallery-section.is-dragging .gallery-item {
    cursor: grabbing !important;
}

.gallery-wrapper {
    width: 100%;
    /* Removed fixed height, let it be defined by items */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    gap: 8px;
    /* Updated gap */

    /* Align to left with consistent padding */
    padding-left: 40px;
    padding-right: 40px;

    width: max-content;
    /* Ensure track spans full width of items */
    align-items: center;

}

.gallery-item {
    width: 50vh;
    height: 50vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--image-border-radius);
    cursor: pointer;
    background: #f0f0f0;
    max-width: 620px;
    max-height: 620px;
    transition: filter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Focus Effect: Saturate/Desaturate other items when track is hovered */
.gallery-track:hover .gallery-item {
    filter: saturate(.2);
    /* opacity: 0.8; */
    /* Slightly less opaque to separate from background */
}

.gallery-track .gallery-item:hover {
    filter: saturate(1);
    opacity: 1;
}

.gallery-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-img {
    width: 120%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    /* Parallax and Scale handled in one transform to match index.html logic */
    transform: translateX(var(--bg-tx, 0px)) scale(1.02);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    will-change: transform;
}

/* Hover Zoom Out to match home page logic */
.gallery-item:hover .gallery-img {
    transform: translateX(var(--bg-tx, 0px)) scale(1.0);
}

/* --------------------------------------------------------- */
/* Lightbox Overlay */
/* --------------------------------------------------------- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    /* Initial color for GSAP animation */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    pointer-events: none;
    /* transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.4s; */
}

.lightbox-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    width: 100vw;
    height: 100vh;
    position: relative;
    pointer-events: none;
}

.lightbox-img {
    position: absolute;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: none;
    user-select: none;
    pointer-events: none;
}

/* Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

/* Hide arrows on mobile */
@media (max-width: 768px) {
    .lightbox-nav-btn {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }
}

/* --------------------------------------------------------- */
/* Responsive Tweak for Gallery */
/* --------------------------------------------------------- */
@media (max-width: 768px) {

    /* Focus Effect: Saturate/Desaturate other items when track is hovered */
    .gallery-track:hover .gallery-item {
        filter: saturate(1);
        /* opacity: 0.8; */
        /* Slightly less opaque to separate from background */
    }

    .gallery-track .gallery-item:hover {
        filter: saturate(1);
        opacity: 1;
    }

    .gallery-track {
        padding-left: 24px;
        padding-right: 24px;
    }

    .gallery-item {
        width: 66vw;
        height: 66vh;
    }
}