@layer base, components, utilities, route;
@layer route {
    #home-gallery-page {
        background: linear-gradient(135deg, var(--bg-main), var(--surface-alt));
        min-height: 100vh;
        padding-bottom: 5rem;
    }

    .gallery-hero-section {
        background-color: var(--bg-main);
        padding: 140px 0 80px 0;
        border-bottom: 1px solid var(--surface-alt);
    }

    .gallery-hero-title {
        font-size: 40px;
        font-weight: 600;
        color: var(--primary);
        margin-bottom: 24px;
        line-height: 1.2;
        animation: slideDown 0.6s ease-out;
    }

    .gallery-hero-subtitle {
        font-size: 1.2rem;
        color: var(--text-muted);
        max-width: 700px;
        margin: 0 auto;
        line-height: 1.6;
        animation: fadeIn 0.8s ease-out;
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2.5rem;
        padding: 2rem 0;
    }

    .gallery-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 20px;
        overflow: hidden;
        box-shadow: var(--shadow-soft);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp 0.6s forwards;
    }

    .gallery-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px -15px rgba(74, 144, 226, 0.2);
        border-color: var(--primary);
    }

    .gallery-img-container {
        position: relative;
        overflow: hidden;
        padding-top: 65%; /* Aspect Ratio 16:10 */
        background: var(--surface-alt);
    }

    .gallery-img-container img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    .gallery-card:hover .gallery-img-container img {
        transform: scale(1.08);
    }

    .gallery-content {
        padding: 1.75rem;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .gallery-content h3 {
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--text-main);
        margin-bottom: 0;
        transition: color 0.3s ease;
    }

    .gallery-card:hover .gallery-content h3 {
        color: var(--primary);
    }

    .gallery-content p {
        color: var(--text-muted);
        font-size: 0.95rem;
        line-height: 1.5;
        margin: 0 0 0.75rem 0;
    }

    /* Staggered animation delay for cards */
    .gallery-card:nth-child(1) { animation-delay: 0.1s; }
    .gallery-card:nth-child(2) { animation-delay: 0.15s; }
    .gallery-card:nth-child(3) { animation-delay: 0.2s; }
    .gallery-card:nth-child(4) { animation-delay: 0.25s; }
    .gallery-card:nth-child(5) { animation-delay: 0.3s; }
    .gallery-card:nth-child(6) { animation-delay: 0.35s; }
    .gallery-card:nth-child(7) { animation-delay: 0.4s; }
    .gallery-card:nth-child(8) { animation-delay: 0.45s; }
    .gallery-card:nth-child(9) { animation-delay: 0.5s; }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-30px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes fadeInUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @media (max-width: 768px) {
        .gallery-hero-title {
            font-size: 2.25rem;
        }
        .gallery-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }
    }
}
