/* Gallery & Lightbox styles extracted from styles.css */
.gallery {
    background-color: var(--color-primary-alt);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 64px 80px;
    box-sizing: border-box;
}

.gallery-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(var(--section-max), 100%);
    margin-inline: auto;
}

/* Header layout: inline on desktop, stacked on mobile */
.gallery-header {
    width: 100%;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.gallery-header h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw + 0.5rem, 3.5rem);
    line-height: 1.1;
    color: #fff;
}

.gallery-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.gallery-item {
    position: relative;
    padding: 0;
    background: #000;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    border: none;
    /* Remove default button border causing grey edges */
    appearance: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .3s ease;
}

.gallery-item:hover img,
.gallery-item:focus img {
    transform: scale(1.05);
}

.gallery-quote {
    margin: 6px 0 0 0;
    font-style: normal;
    line-height: 1.5;
    display: block;
    color: #fff;
    text-align: left;
    opacity: 0.9;
}

/* Lightbox styles */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 1400;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.lightbox:not([hidden]) {
    display: flex;
}

.lightbox__img-wrapper {
    max-width: min(900px, 90vw);
    max-height: 80vh;
    width: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox__img-wrapper img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

@media (max-height: 600px) {
    .lightbox__img-wrapper {
        max-height: 70vh;
    }

    .lightbox__img-wrapper img {
        max-height: 70vh;
    }
}

.lightbox__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.lightbox__close:hover,
.lightbox__close:focus {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .gallery {
        padding: 72px 20px 48px;
    }

    .gallery-header {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        row-gap: 8px;
        margin-bottom: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-quote {
        /* keep a tidy single-line if desired */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}