/* ==========================================================================
   Next Project — auto-navigation section at the bottom of project pages.
   See next-project.js for the JS logic.
   ========================================================================== */

.next-project {
    position: relative;
    background-color: var(--color-bg-secondary);
    padding: 80px 0 0;
    text-align: center;
    overflow: hidden;
    transition: background-color 0.3s ease;
    z-index: 1;
    cursor: pointer;
}

.next-project-inner {
    max-width: 930px;
    margin: 0 auto;
    padding: 0 65px;
}

.next-project-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 450;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
    transition: color 0.3s ease;
}

.next-project-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 38px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text-primary);
    letter-spacing: -0.57px;
    margin: 0 0 30px;
    transition: color 0.3s ease;
}

/* Progress bar */
.next-project-progress {
    max-width: 200px;
    height: 3px;
    background-color: var(--color-bg-detail);
    border-radius: 2px;
    margin: 0 auto 40px;
    overflow: hidden;
    opacity: 0;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.next-project.counting .next-project-progress {
    opacity: 1;
}

.next-project-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--color-text-secondary);
    border-radius: 2px;
    animation: next-project-fill 3s linear forwards;
    animation-play-state: paused;
    transition: background-color 0.3s ease;
}

.next-project.counting .next-project-progress-bar {
    animation-play-state: running;
}

@keyframes next-project-fill {
    to { width: 100%; }
}

/* Hero image preview */
.next-project-image {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.next-project-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: top;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.next-project-image img.loaded {
    opacity: 1;
}

/* Hero transition — hide real hero and its container while clone animates */
.hero-transitioning .project-hero-image {
    opacity: 0 !important;
}

.hero-transitioning .project-hero {
    background-color: transparent !important;
}

/* Hero transition clone — fixed-position overlay used by transitionToNextProject
   in project.js. Dimensions/position are set inline per-transition; this class
   provides the base visual treatment and timing. */
.hero-transition-clone {
    position: fixed;
    z-index: 9999;
    object-fit: cover;
    object-position: top;
    border-radius: 14px;
    pointer-events: none;
    transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .next-project {
        padding: 60px 0 0;
    }

    .next-project-inner {
        padding: 0 30px;
    }

    .next-project-title {
        font-size: 28px;
    }

    .next-project-image img {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .next-project {
        padding: 40px 0 0;
    }

    .next-project-inner {
        padding: 0 20px;
    }

    .next-project-title {
        font-size: 22px;
    }

    .next-project-progress {
        margin-bottom: 30px;
    }

    .next-project-image img {
        height: 200px;
    }
}
