/* Gallery index intro */
.gallery-index-intro {
    max-width: var(--max-width);
    margin: 0 auto 4rem;
    padding: 0 2.4rem;
    text-align: center;
}

@media (max-width: 600px) {
    .gallery-index-intro {
        padding-top: 2.4rem;
    }
}

.gallery-index-intro p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.6rem;
    color: var(--color-text);
    line-height: 1.7;
    margin: 0;
}

.gallery-index-author {
    font-size: 1.3rem;
    color: var(--color-midgrey);
    margin-top: 0.8rem;
    display: inline-block;
}

/* Gallery grid — CSS columns masonry */
.gallery-grid {
    column-count: 3;
    column-gap: 1.2rem;
    margin-bottom: 4.8rem;
}

.gallery-item {
    display: block;
    break-inside: avoid;
    margin-bottom: 1.2rem;
    overflow: hidden;
    background: var(--color-lightgrey);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

.gallery-item:hover img {
    opacity: 0.9;
}

/* Gallery header */
.gallery-header {
    max-width: var(--max-width);
    margin: 0 auto 4rem;
    padding: 0 2.4rem;
    text-align: center;
}

@media (max-width: 600px) {
    .gallery-header {
        padding-top: 2.4rem;
    }
}

.gallery-title {
    font-size: 4rem;
    margin-bottom: 1.2rem;
}
.gallery-excerpt {
    font-size: 1.6rem;
    color: var(--color-midgrey);
}

.gallery-header time {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--color-midgrey);
    opacity: 0.7;
}

/* Inline image rows (1–3 images per row) */
.img-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.img-row-item {
    flex: 1;
    min-width: 0;
    display: block;
    overflow: hidden;
    cursor: zoom-in;
    position: relative;
    color: transparent;
}

.img-row-item::before {
    content: "";
    position: absolute;
    inset: -10px;
    background: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(12px);
    z-index: 0;
}

.img-row-item picture {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
}

.img-row-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
    color: transparent;
    font-size: 0;
}

.img-row-item:hover img {
    opacity: 0.92;
}

.gallery-content {
    margin-top: 3.2rem;
}

.gallery-content .gh-content {
    font-size: var(--font-size-base);
    font-family: var(--font-sans);
}

.gallery-content .gh-content p {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

/* PhotoSwipe overrides */
.pswp__bg {
    background: #000;
}
.pswp__caption__center {
    font-size: 1.4rem;
    text-align: center;
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        column-count: 1;
    }
}
