/* ═══════════════════════════════════════
   GALLERY PAGE STYLES
   ═══════════════════════════════════════ */

.page-gallery {
    --bg: #ffffff;
    /* Explicit white background as requested */
    background: var(--bg);
    color: var(--dark);
    /* Dark text for white background */
    min-height: 100vh;
}

.gallery-main {
    position: relative;
    padding-top: calc(var(--nav-h) + 4rem);
    padding-bottom: 6rem;
    min-height: 80vh;
    overflow: hidden;
}

/* Animated ambient background */
.gallery-bg-glow {
    position: absolute;
    top: 20%;
    left: 45%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    animation: slowDrift 20s ease-in-out infinite alternate;
}

@keyframes slowDrift {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-40%, -40%) scale(1.1);
    }
}

.gallery-page-header {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.gallery-page-header .page-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
}

.gallery-page-header .page-subtitle {
    color: #444;
    /* Dark gray for readability on white */
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Full gallery grid structure */
.gallery-page-grid {
    position: relative;
    z-index: 2;
    margin-top: 5rem;
    display: grid;
    /* Masonry-lite structure using grid */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #111;
    /* Aspect ratio fallback, will be styled by JS based on index for variety */
    aspect-ratio: 1;
    transform: translateY(20px);
    opacity: 0;
    animation: photoFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.gallery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(201, 168, 76, 0.1);
    opacity: 0;
    transition: opacity var(--trans);
    pointer-events: none;
}

.gallery-card:hover::after {
    opacity: 1;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter var(--trans);
    will-change: transform;
}

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

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .gallery-page-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
        margin-top: 3rem;
    }
}

@media (max-width: 480px) {
    .gallery-main {
        padding-top: calc(var(--nav-h) + 2rem);
    }

    .gallery-page-grid {
        grid-template-columns: 1fr;
    }

    .gallery-card {
        aspect-ratio: 4/3;
    }
}