/* Scrollable Gallery Styles */
.scrollable-gallery {
    padding: 4rem 0;
    overflow: hidden;
}

.gallery-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.rectangle-parent {
    display: flex;
    gap: 1.5rem;
    cursor: none;
    padding: 2rem 0;
    user-select: none;
}

.rectangle-parent:active {
    cursor: none;
}

.rectangle {
    width: 320px;
    height: 480px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rectangle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rectangle:hover::before {
    opacity: 1;
}

.project-info-panel {
    margin: 3rem auto 0;
    padding: 2.25rem 2.5rem;
    max-width: 980px;
    user-select: none;
    -webkit-user-select: none;

    /* Truly transparent panel (no tinted fill) */
    background: transparent;
    background: rgba(10, 10, 12, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 26px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.info-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.project-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-year,
.project-type {
    padding: 0.25rem 0.75rem;
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    color: var(--accent-blue);
}

.project-title-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: fit-content;
    margin: 0 auto;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-description-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-title,
.project-description {
    margin: 0;
}

.project-title {
    font-size: 2rem;
    font-weight: var(--font-weight-semibold);
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
    white-space: nowrap;
}

.project-description {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.title-overlay,
.description-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Slight bleed to avoid 1px lines from subpixel rounding during transforms */
    height: calc(100% + 2px);
    top: -1px;
    pointer-events: none;
    transform-origin: top;
    /* Keep overlays fully offscreen when idle (prevents “1px line” flicker) */
    transform: translate3d(0, 110%, 0);
    will-change: transform;
    backface-visibility: hidden;
}

.title-overlay {
    background: var(--white);
}

.description-overlay {
    background: var(--secondary-color);
}

.project-tags {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags .tag {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    color: var(--primary-color);
    transition: var(--transition);
}

.project-tags .tag:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: rgba(74, 144, 226, 0.3);
    color: var(--accent-blue);
}

/* DynamicSlide Animation */
@keyframes DynamicSlide {
    0% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
    39% {
        transform: translateY(0%) scaleY(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-20%) scaleY(1);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
}

@keyframes overlay-slide {
    0% {
        opacity: 1;
        transform: translate3d(0, 110%, 0) scaleY(1);
    }
    40% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scaleY(1);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, -110%, 0) scaleY(1);
    }
}

/* Responsive adjustments for scrollable gallery */
@media (max-width: 768px) {
    .scrollable-gallery {
        padding: 2rem 0;
    }
    
    .gallery-container {
        padding: 0 1rem;
    }
    
    .rectangle {
        width: 280px;
        height: 420px;
    }
    
    .rectangle-parent {
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .project-info-panel {
        margin-top: 2rem;
        padding: 1.5rem 1.25rem;
        border-radius: 22px;
    }
    
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .rectangle {
        width: 240px;
        height: 360px;
    }
    
    .rectangle-parent {
        gap: 0.75rem;
    }
}

