/* Gallery page styles */

.gallery-intro {
    padding: clamp(1.6rem, 4vw, 3.2rem);
}

.gallery-intro h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 0.95;
    text-wrap: balance;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--size-4);
}

.gallery-card {
    display: grid;
    margin: 0;
    border: 1px solid var(--site-border);
    border-radius: 20px;
    overflow: hidden;
    background: var(--site-panel);
    box-shadow: var(--site-shadow-soft);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.1);
}

.gallery-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-placeholder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}

.gallery-card-caption {
    padding: var(--size-4) var(--size-4) var(--size-5);
}

.gallery-card-caption h3 {
    font-size: 1.2rem;
    line-height: 1.2;
}

.gallery-card-caption p {
    color: var(--site-text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.gallery-cta {
    padding: clamp(1.6rem, 4vw, 3rem);
    text-align: center;
}

.gallery-cta h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
    text-wrap: balance;
}

.gallery-cta .lede {
    max-width: 52ch;
    margin: 0 auto;
}

.gallery-cta .button-row {
    justify-content: center;
}

@media (max-width: 920px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 580px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 250ms ease;
    cursor: pointer;
}

.gallery-lightbox--open {
    background: rgba(0, 0, 0, 0.85);
}

.gallery-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 300ms ease, transform 300ms ease;
}

.gallery-lightbox--open img {
    opacity: 1;
    transform: scale(1);
}
