/* Photo mosaic with text: "Wij zijn DERF" on the home page (photos left) and
   "Over de voorstelling" on show pages (.mosaic--text-left, photos right).
   The large photo runs off the edge of the screen, the second overlaps it with
   a paper border, the third sits apart. Placed on a grid of small rows, so the
   text never stretches the photos and no fixed heights leave gaps. */

.mosaic {
    display: grid;
    gap: var(--space-xl);
}

.mosaic-text .prose,
.mosaic-text .entry-text-style {
    margin: 0;
}

.mosaic-photos {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 1.5rem;
    column-gap: var(--space-xs);
}

.mosaic-img {
    position: relative;
    overflow: hidden;
    background-color: var(--line);
}

.mosaic-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mosaic-img--1 {
    grid-column: 1 / 11;
    grid-row: 1 / 10;
    margin-left: calc(-1 * var(--bleed));
}

.mosaic-img--2 {
    grid-column: 6 / 13;
    grid-row: 8 / 17;
    z-index: 1;
    border: var(--space-xs) solid var(--paper);
}

.mosaic-img--3 {
    grid-column: 1 / 6;
    grid-row: 11 / 18;
}

/* Photos on the right: mirror the placement and bleed to the right edge. */
.mosaic--text-left .mosaic-img--1 {
    grid-column: 3 / 13;
    margin-left: 0;
    margin-right: calc(-1 * var(--bleed));
}

.mosaic--text-left .mosaic-img--2 {
    grid-column: 1 / 8;
}

.mosaic--text-left .mosaic-img--3 {
    grid-column: 8 / 13;
}

/* Fewer photos: the first one alone, or the first two. */
.mosaic-photos:has(.mosaic-img--1:last-child) {
    grid-auto-rows: auto;
}

.mosaic-photos:has(.mosaic-img--1:last-child) .mosaic-img--1 {
    grid-row: auto;
    aspect-ratio: 3 / 2;
}

@media (min-width: 1024px) {
    .mosaic {
        grid-template-columns: repeat(12, 1fr);
        column-gap: var(--space-md);
        align-items: start;
    }

    .mosaic > .mosaic-photos {
        grid-column: 1 / span 7;
        grid-row: 1;
        grid-auto-rows: 2rem;
        column-gap: var(--space-sm);
    }

    .mosaic > .mosaic-text {
        grid-column: 9 / -1;
        grid-row: 1;
        padding-top: var(--space-xl);
    }

    .mosaic--text-left > .mosaic-text {
        grid-column: 1 / span 6;
        padding-top: 0;
    }

    .mosaic--text-left > .mosaic-photos {
        grid-column: 8 / -1;
    }

    .mosaic-img--2 {
        border-width: var(--space-sm);
    }
}
