.gallery-collage-card {
    position: relative;
    isolation: isolate;
    --collage-width: min(52%, 12rem);
}

.gallery-card-collage,
.gallery-collage-card::before {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    inline-size: var(--collage-width);
    border-start-end-radius: inherit;
    border-end-end-radius: inherit;
    pointer-events: none;
}

.gallery-card-collage {
    z-index: -2;
    block-size: 100%;
    object-fit: cover;
    /* Inset the artwork without resizing it. The card's rounded-3xl radius is 1.5rem. */
    clip-path: inset(1px round calc(1.5rem - 1px) 0 0 calc(1.5rem - 1px));
    mask-image: linear-gradient(to right, #000 40%, rgb(0 0 0 / 92%) 65%, rgb(0 0 0 / 64%) 83%, transparent);
    filter: saturate(.72);
}

.gallery-collage-card::before {
    content: '';
    z-index: -1;
    background: linear-gradient(to left, #fff, rgb(255 255 255 / 93%) 30%, rgb(255 255 255 / 84%) 60%, rgb(255 255 255 / 49%));
}

.gallery-collage-card .text-accent {
    color: #ae3027;
}

.gallery-collage-card p:not(.text-accent) {
    font-weight: 600;
}

html:not(.a11y-contrast) .gallery-collage-card :is(h3, p) {
    text-shadow: 0.5px 0 #fff, -0.5px 0 #fff, 0 0.5px #fff, 0 -0.5px #fff;
}

@media (hover: hover) and (pointer: fine) {
    .gallery-card-collage { filter: grayscale(1); }
    .gallery-collage-card:is(:hover, :focus-visible) .gallery-card-collage { filter: none; }
    .gallery-collage-card:hover:not(:focus-visible)::before { opacity: .97; }
}

@media (prefers-reduced-motion: no-preference) {
    .gallery-card-collage { transition: filter 200ms ease; }
    .gallery-collage-card::before { transition: opacity 200ms ease; }
}

.a11y-contrast .gallery-card-collage,
.a11y-contrast .gallery-collage-card::before {
    display: none;
}
