/* ============================
   GALERIJ (galerij.html)
   ============================ */
body#galerij main {
    display: block;
    margin: 0;
}

.gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    /* Each image keeps its own aspect-ratio instead of being stretched to
       match the tallest cell in its row (which matters here since a group
       can mix landscape and portrait photos). */
    align-items: start;
}

.gallery__grid img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 0.75rem;
    box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.15);
    border-top: 5px solid var(--group-color, #ccc);
    transition: transform 0.3s;
}

.gallery__grid img:hover {
    transform: scale(1.03);
}

.gallery__img--portrait {
    aspect-ratio: 2 / 3 !important;
}

/* Tablet: max-width 1024px */
@media (max-width: 1024px) {
    .gallery__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet/large phone: max-width 768px */
@media (max-width: 768px) {
    .gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

/* Smartphone: max-width 600px */
@media (max-width: 600px) {
    .gallery__grid {
        grid-template-columns: 1fr;
    }
}
