/* Works page specific styles */

.content-container {
    z-index: 12;
}

.works-section {
    padding: 2rem 0 4rem;
}

.works-title {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-heading-large);
    line-height: var(--line-height-heading-large);
    color: var(--color-text-primary);
    margin-bottom: 2rem;
}


/* Updated grid layout to match design */

.works-grid {
    display: flex;
    gap: 3rem;
}

.works-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* Update the gap for left column */

.works-column:first-child {
    gap: 2.5rem;
}


/* Update the gap for right column */

.works-column:last-child {
    gap: 3.5rem;
}

.work-item {
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    opacity: 0;
    transform: translateY(20px);
    animation: workItemFadeIn 0.5s ease forwards;
}


/* Staggered animation for work items */

.works-column:first-child .work-item:nth-child(1) {
    animation-delay: 0.1s;
}

.works-column:first-child .work-item:nth-child(2) {
    animation-delay: 0.2s;
}

.works-column:first-child .work-item:nth-child(n+3) {
    animation-delay: 0.3s;
}

.works-column:last-child .work-item:nth-child(1) {
    animation-delay: 0.4s;
}

.works-column:last-child .work-item:nth-child(2) {
    animation-delay: 0.5s;
}

.works-column:last-child .work-item:nth-child(n+3) {
    animation-delay: 0.6s;
}

@keyframes workItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-link {
    display: block;
    text-decoration: none;
    color: var(--color-text-primary);
}

.work-image-container {
    position: relative;
    margin-bottom: 0.5rem;
    aspect-ratio: 16 / 9;
    perspective: 1000px;
}


/* Image stack container */

.work-image-stack {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    background: #C7C3B8;
    z-index: 15;
}

.work-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.5s ease;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
    opacity: 0;
    z-index: 12;
}


/* First image is visible by default */

.work-image-1 {
    opacity: 1;
    z-index: 15;
}


/* Position each image with specific offsets on hover or active state for touch devices */

.work-item:hover .work-image {
    filter: grayscale(0);
    opacity: 1;
}

.work-item:hover .work-image-1 {
    z-index: 15;
    transform: translateX(-6px) translateY(-6px);
    transition-delay: 0s;
}

.work-item:hover .work-image-2 {
    z-index: 14;
    transform: translateX(0) translateY(0);
    transition-delay: 0.03s;
}

.work-item:hover .work-image-3 {
    z-index: 13;
    transform: translateX(6px) translateY(6px);
    transition-delay: 0.06s;
}


/* Update work-title styles */

.work-title {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-heading-medium);
    line-height: var(--line-height-heading-medium);
    letter-spacing: 0px;
    color: var(--color-text-primary);
}


/* Responsive styles */

@media (max-width: 768px) {
    .works-grid {
        flex-direction: column;
        gap: 2rem;
    }
    .works-column {
        gap: 2rem;
    }
}


/* Add margin-top to first item in right column on desktop */

@media (min-width: 769px) {
    .works-column:last-child .work-item:first-child {
        margin-top: 5rem;
    }
}