/* Albums grid */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.album-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Square thumbnail crop without stretching; max 600x600 */
.album-card a {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 600px;
    max-height: 600px;
    overflow: hidden;
}

.album-card a img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* cover & crop */
    object-position: center;
    display: block;
}

.album-title {
    margin-top: 8px;
    text-align: center;
}

/* --- Justified layout for album pages (keep albums-list as-is) --- */
#album-grid.albums-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#album-grid .album-card {
    align-items: stretch; /* let anchors define width */
}

/* Each item gets fixed row height; width is auto from image ratio */
#album-grid .album-card a {
    display: block;
    height: var(--jg-row-height, 220px);
    width: auto;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    overflow: hidden;
}

#album-grid .album-card a img {
    height: 100%;
    max-width: none !important;
    object-position: center;
    display: block;
}

/* Hide captions under thumbnails on album page */
#album-grid .album-title {
    display: none;
}

/* Inline photo blocks: same style as main album grid, no captions */
.albums-grid-inline {
    margin: 1.5em 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.albums-grid-inline .album-card {
    align-items: stretch;
}

.albums-grid-inline .album-card a,
.albums-grid-inline .album-card .album-thumb-no-click {
    display: block;
    height: var(--jg-row-height, 220px);
    width: auto;
    max-width: none;
    aspect-ratio: auto;
}

.albums-grid-inline .album-card a img,
.albums-grid-inline .album-card .album-thumb-no-click img {
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
    display: block;
}

.albums-grid-inline .album-title {
    display: none;
}

.album-thumb-no-click {
    overflow: hidden;
    cursor: default;
    pointer-events: none;
}
