.gallery {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(24px, 4vw, 40px);
    padding: clamp(24px, 4vw, 40px) clamp(16px, 11vw, 160px);
    box-sizing: border-box;
}

.photo {
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: clamp(10px, 1.5vw, 16px);
    box-sizing: border-box;
    background-color: #FFFFFF;
    box-shadow: var(--shadow-soft);
}

.photo:nth-child(odd) {
    align-self: flex-start;
}

.photo:nth-child(even) {
    align-self: flex-end;
}

/* Photos are 512px tall on large screens and shrink to fit small ones (keeping their proportions) */
.photo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(512px, 70vh);
}

.photo figcaption {
    margin-top: 8px;
    color: #000000;
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

/* Phones: every photo centred and as wide as the screen allows */
@media screen and (max-width: 600px) {
    .photo,
    .photo:nth-child(odd),
    .photo:nth-child(even) {
        align-self: center;
    }
}
