/**
** BASE
**/

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

/* Initial Visibility for Animation — hero group only */
.project-detail-page .project-hero>.project-title,
.project-detail-page .project-hero>.project-subtitle,
.project-detail-page .project-hero>.project-intro,
.project-detail-page .project-hero>.hero-scroll-indicator,
.project-detail-page .project-image-block-page {
    opacity: 0;
    will-change: opacity, transform;
}

/**
** HERO
**/
.project-hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-32);
}

.project-title {
    font-size: var(--display-xl-size);
    font-weight: var(--display-xl-weight);
    letter-spacing: var(--display-xl-letter-spacing);
    line-height: 1;
    color: var(--text-high);
    max-width: 908px;
    text-align: center;
    width: 100%;
}

h6.project-subtitle {
    width: 100%;
    max-width: 908px;
    text-align: center;
    color: var(--text-medium);
    font-weight: 550;
}

.project-intro {
    font-size: var(--body-xl-size);
    line-height: 1.5;
    font-weight: var(--body-xl-weight);
    width: 100%;
    max-width: 816px;
    color: var(--text-medium);
    text-align: center;
    margin: 0px auto;
}

.hero-scroll-indicator {
    color: var(--text-low);
    position: relative;
    top: 10vh;
    width: 64px;
    height: 64px;
    border: 1px solid var(--border-low);
    display: flex;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 100%;
    background: var(--layer-ground-level-0);
}

/**
** CONTENT
**/
.project-content-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px 148px 128px;
    gap: var(--spacing-180);
}

h6.project-content-title {
    color: var(--text-high);
}

.project-text-block {
    max-width: 816px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-24);
}

.project-image-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 816px;
    gap: 12px;
}

.project-image-block-page {
    max-width: 1380px;
}

.project-image-container {
    width: 100%;
    aspect-ratio: 327 / 192;
    background-color: var(--layer-ground-level-1);
    position: relative;
    cursor: url(../images/Common/cursor-open-5.svg) 12 12, auto;
    border-radius: 12px;
    border: 1px solid var(--border-low);
    overflow: hidden;
}

.project-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.2);
    will-change: transform;
    transition: transform 0.8s var(--easing-in);
}

.project-image-container:hover>img {

    transform: scale(1.22) !important;

}

.project-image-alt {
    font-size: var(--caption-size);
    line-height: var(--caption-line-height);
    font-weight: var(--caption-weight);
    color: var(--text-low);
    width: 100%;
    text-align: left;
    margin: 0px;
}

.project-image-zoom {
    scale: 1;
    width: auto;
    height: auto;
    position: absolute;
    right: var(--spacing-16);
    bottom: var(--spacing-16);
    display: none;
}

.project-image-zoom .zoom-icon {
    width: auto;
    height: auto;
    transform: scale(1);
}

.project-image-block-page .project-image-alt {
    padding: 0 var(--spacing-20);
}

.project-content-text,
.project-text-block ul {
    font-size: var(--body-size);
    line-height: 1.75;
    color: var(--text-medium);
    text-align: left;
}

.project-text-block ul {
    padding-left: var(--spacing-32);
}

.project-text-block ul li {
    padding-bottom: var(--spacing-12);
}

/**
** TEAM
**/
.project-team {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-48);
    padding: var(--spacing-64) var(--spacing-24);
}

.team-title {
    color: var(--text-high);
    width: 100%;
    max-width: 816px;
}

.team-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 816px;
    gap: var(--spacing-24);
}

.team-member {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
    text-decoration: none;
}

.member-name {
    font-size: var(--body-size);
    font-weight: 500;
    line-height: 1.1;
    color: var(--text-high);
    white-space: nowrap;
    overflow: hidden;
}

.member-role {
    font-size: var(--body-size);
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-low);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.member-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}



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

/**
** GALLERY
**/
.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: url('../images/Common/point.svg') 12 12, grabbing !important;
    overscroll-behavior-x: none;
}

.gallery-section.is-dragging {
    cursor: url('../images/Common/cursor-LR-3.svg') 20 12, auto !important;
}

.gallery-section.is-dragging .gallery-item {
    cursor: url('../images/Common/cursor-LR-3.svg') 22 12, auto !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: 60vh;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--image-border-radius);
    cursor: url('../images/Common/cursor-open-5.svg') 12 12, auto;
    background: var(--layer-ground-level-1);
    max-width: 620px;
    max-height: 620px;
    border: 1px solid var(--border-low);
    transition: border 0.8s var(--easing-in);
}

.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.2;
    transition: scale 0.8s var(--easing-in);
    pointer-events: none;
    will-change: transform, scale;
}

/* Hover Zoom Out to match home page logic */
.gallery-item:hover .gallery-img {
    scale: 1.22;
}

/* .gallery-item:hover {
    border: 2px solid var(--border-highlight);
} */

/**
** LIGHTBOX
**/

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--layer-overlay-level-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: 0 20px 50px rgba(0, 0, 0, 0.3);
    user-select: none;
    pointer-events: auto;
    cursor: url('../images/Common/cursor-open-5.svg') 12 12, zoom-in;
    will-change: transform, left, top, width, height;
}

/* Navigation Buttons */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--layer-transparent-surface-level-3);
    border: 1px solid var(--transparent-light-08);
    color: var(--text-high);
    width: 60px;
    height: 60px;
    border-radius: 5%;
    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);
    opacity: 0;
}

.lightbox-nav-btn:hover,
.lightbox-close:hover {
    background: var(--icon-highlight);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn svg,
.lightbox-close svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--gray-50);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox-prev {
    left: var(--spacing-4);
}

.lightbox-next {
    right: var(--spacing-4);
}

.lightbox-close {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    background: var(--layer-transparent-surface-level-3);
    border: 1px solid rgba(255, 255, 255, 0.01);
    color: var(--text-high);
    width: 60px;
    height: 60px;
    border-radius: 5%;
    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);
    opacity: 0;
}

/* --- Desktop Title Toggle Base --- */
.nav-project-title-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    height: 100%;
}

.nav-project-title {
    font-size: var(--body-size);
    font-weight: 550;
    color: var(--text-high);
    opacity: 0;
    transform: translateY(200%);
    transition: transform 0.4s var(--easing-in), opacity 0.4s var(--easing-in);
    margin: 0;
}

/* Only apply desktop reveal when not on small screens where mobile rules apply */
@media (min-width: 769px) {
    .block-nav.show-title .nav-project-title {
        opacity: 1;
        transform: translateY(0);
    }
}

/***
****
**** RESPONSIVE MAX-WIDTH: 768px
****
***/
@media (max-width: 768px) {

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

    .project-hero {
        padding: 0 var(--spacing-24) var(--spacing-32) var(--spacing-24);
        align-items: start;
        justify-content: end;
    }

    .project-title,
    h6.project-subtitle,
    .project-intro {
        text-align: left;
    }

    .hero-scroll-indicator {
        top: 0;
        width: 48px;
        height: 48px;
    }

    .an-onboarding-journey .project-title {
        font-size: var(--display-lg-size);
    }

    .project-content-stack {
        padding: 0 0 var(--spacing-48);
        gap: var(--spacing-48);
    }

    .project-item {
        gap: 64px;
    }

    .project-text-block {
        padding: 0 var(--spacing-24);
        gap: var(--spacing-16);
    }

    .project-image-block {
        padding: var(--spacing-24);
    }

    .project-image-zoom .zoom-icon {
        height: 20px;
        width: 20px;
        transform: scale(1);
    }

    .project-image-zoom {
        display: block;
        right: var(--spacing-12);
        bottom: var(--spacing-12);
    }

    .project-image-block-page {
        padding: var(--spacing-4);
        padding-bottom: var(--spacing-24);
    }

    .lightbox-close {
        bottom: 60px;
        right: 0px;
        left: 0px;
        margin: auto;
        top: auto;
    }

    .project-team {
        gap: var(--spacing-32);

    }

    .lightbox-nav-btn {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

    /* 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: 80vw;
        height: 60vh;
        max-width: 400px;
        max-height: 600px;
    }

    /* Mobile Title Toggle */
    .nav-project-title-wrapper {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-120%);
        transition: transform 0.6s var(--easing-inout);
        pointer-events: none;
    }

    .nav-project-title {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
        margin: 0;
        text-align: center;
    }

    .block-nav.mobile-title-active .nav-project-title-wrapper {
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-identity,
    .nav-links {
        transition: transform .6s var(--easing-inout);
    }

    .block-nav.mobile-title-active .nav-identity,
    .block-nav.mobile-title-active .nav-links {
        transform: translateY(80px);
    }
}