/*
 * M.A.K. Galerie — exhibition wall, physically scaled artwork rows.
 * Used only on /oeuvres. All artwork notice / modal styles are untouched.
 *
 * Each ROW preserves the centimetre ratios of its artworks, but inherits
 * a common reference scale to avoid oversized reproductions. Rows aim
 * for 86% width, with a restrained height and generous whitespace.
 *
 * No-JS fallback: an accessible three-column grid with no missing works.
 * With JS, balanced artist-aware rows contain at most three artworks.
 */
.mak-index {
    max-width: 1540px;
    margin-inline: auto;
    padding: clamp(28px, 3.8vw, 58px) clamp(22px, 4.8vw, 76px) clamp(110px, 12vw, 175px);
}
.mak-index .mak-index__logo { display: block; width: 112px; margin-inline: auto; }
.mak-index .mak-index__logo img { display: block; width: 100%; height: auto; }
.mak-index .mak-index__heading {
    margin: clamp(56px, 6.8vw, 102px) auto clamp(96px, 10vw, 150px);
    text-align: center;
}
.mak-index__eyebrow {
    display: block;
    color: #777;
    font-size: 10px;
    font-weight: 740;
    letter-spacing: .14em;
}
.mak-index .mak-index__heading h1 {
    margin: 12px 0 0;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 520;
    line-height: 1.03;
    letter-spacing: -.047em;
}
.mak-index .mak-index__empty { text-align: center; }
.mak-index__catalogue { width: 100%; min-width: 0; }

/* Fully functional fallback: maximum three works across. */
.mak-index .mak-index__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(80px, 9vw, 142px) clamp(32px, 4vw, 65px);
    align-items: end;
    width: 100%;
    min-width: 0;
}
.mak-index .mak-index__card {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
}
.mak-index__card-body,
.mak-index__work-link { display: block; width: 100%; min-width: 0; }
.mak-index__image-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
}
.mak-index .mak-index__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
}
.mak-index .mak-index__image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: none;
    transition: opacity .25s ease;
}
.mak-index__work-link:hover .mak-index__image img { opacity: .83; }
.mak-index__image-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 5;
    border: 1px solid #e9e9e9;
    color: #c0c0c0;
    font-size: 12px;
    font-weight: 480;
    letter-spacing: .13em;
}
/* The sole visible label is the artist, centered directly under the image. */
.mak-index__caption {
    width: 100%;
    min-width: 0;
    padding-top: 17px;
    text-align: center;
}
.mak-index .mak-index__artist-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: .97;
    overflow-wrap: anywhere;
}
.mak-index .mak-index__artist-name .mak-artist__first,
.mak-index .mak-index__artist-name .mak-artist__last {
    display: block;
    max-width: 100%;
}
.mak-index .mak-index__artist-name .mak-artist__first-initial { font-size: 9.5px; }
.mak-index .mak-index__artist-name .mak-artist__first-rest,
.mak-index .mak-index__artist-name .mak-artist__last-initial,
.mak-index .mak-index__artist-name .mak-artist__last-rest {
    font-size: clamp(11.5px, 1vw, 14.5px);
}
.mak-index__work-link:focus-visible { outline-offset: 8px; }

/*
 * Enhanced exhibition rows: their art stages share the same height, so
 * reproductions are vertically CENTERED (not top or bottom justified).
 * Caption boxes share the same height, and their labels are bottom-aligned:
 * every surname's last baseline falls on exactly the same horizontal axis.
 */
.mak-index .mak-index__grid[data-layout="rows"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(78px, 7.2vw, 120px);
}
.mak-index .mak-index__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: var(--mak-row-gap, 40px);
    width: 100%;
    min-width: 0;
}
.mak-index .mak-index__row > .mak-index__card {
    flex: 0 0 var(--mak-card-width, auto);
    width: var(--mak-card-width, auto);
    max-width: 100%;
    min-width: 0;
}
.mak-index .mak-index__row .mak-index__image-stage {
    height: var(--mak-row-art-height, auto);
}
.mak-index .mak-index__row .mak-index__image {
    width: var(--mak-art-width, 100%);
    height: var(--mak-art-height, auto);
    flex: 0 0 auto;
}
.mak-index .mak-index__row .mak-index__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mak-index .mak-index__row .mak-index__image-placeholder {
    height: 100%;
    aspect-ratio: auto;
}
.mak-index .mak-index__row .mak-index__caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: var(--mak-row-caption-height, auto);
    min-height: 0;
    padding-top: 16px;
}
.mak-index .mak-index__row .mak-index__artist-name {
    flex: 0 0 auto;
    justify-content: flex-end;
}
@media (max-width: 1020px) {
    .mak-index .mak-index__grid:not([data-layout="rows"]) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mak-index .mak-index__grid[data-layout="rows"] { gap: 90px; }
}
@media (max-width: 760px) {
    .mak-index { padding-inline: 24px; }
    .mak-index .mak-index__heading { margin-block: 62px 86px; }
    .mak-index .mak-index__grid:not([data-layout="rows"]) {
        grid-template-columns: minmax(0, 1fr);
        gap: 76px;
    }
    .mak-index .mak-index__grid[data-layout="rows"] { gap: 68px; }
    .mak-index .mak-index__row { justify-content: center; }
    .mak-index .mak-index__artist-name .mak-artist__first-rest,
    .mak-index .mak-index__artist-name .mak-artist__last-initial,
    .mak-index .mak-index__artist-name .mak-artist__last-rest { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .mak-index .mak-index__image img { transition: none; }
}
