/*
 * Galerijen ([gallery]). Kolommen volgen de instelling in de galerij-editor
 * (gallery-columns-1 t/m 9). Ze zijn breder dan de tekstkolom.
 *
 * Aanpassen:
 *   --ob-cols   aantal kolommen (wordt per galerij gezet)
 *   --ob-gap    ruimte tussen de foto's
 *   --ob-ratio  vorm van de tegels, bv. 3 / 2, 4 / 3 of 1 / 1
 */
.gallery {
	--ob-cols: 3;
	--ob-gap: clamp(0.5rem, 1.5vw, 1rem);
	--ob-ratio: 3 / 2;

	display: grid;
	grid-template-columns: repeat(var(--ob-cols), minmax(0, 1fr));
	gap: var(--ob-gap);
	align-items: start;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-top: var(--wp--preset--spacing--40, 2rem);
	margin-bottom: var(--wp--preset--spacing--40, 2rem);
}
.gallery br { display: none; }

.gallery-columns-1 { --ob-cols: 1; }
.gallery-columns-2 { --ob-cols: 2; }
.gallery-columns-3 { --ob-cols: 3; }
.gallery-columns-4 { --ob-cols: 4; }
.gallery-columns-5 { --ob-cols: 5; }
.gallery-columns-6 { --ob-cols: 6; }
.gallery-columns-7 { --ob-cols: 7; }
.gallery-columns-8 { --ob-cols: 8; }
.gallery-columns-9 { --ob-cols: 9; }

/* Tablet: maximaal 3 kolommen. Mobiel: 2 kolommen. */
@media (min-width: 600px) and (max-width: 1023px) {
	.gallery-columns-4, .gallery-columns-5, .gallery-columns-6,
	.gallery-columns-7, .gallery-columns-8, .gallery-columns-9 { --ob-cols: 3; }
}
@media (max-width: 599px) {
	.gallery:not(.gallery-columns-1) { --ob-cols: 2; }
}

.gallery-item {
	margin: 0;
	min-width: 0;
	float: none;
	width: auto;
}
.gallery-icon { margin: 0; }
.gallery-icon a {
	display: block;
	overflow: hidden;
	background: #d9d4cb;
}
.gallery-icon img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--ob-ratio);
	object-fit: cover;
	border: 0;
	transition: opacity 0.2s ease;
}
.gallery-icon a:hover img { opacity: 0.88; }
.gallery-icon a:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}
.gallery-caption {
	margin: 0.4rem 0 0;
	font-size: 0.875rem;
	line-height: 1.4;
	opacity: 0.8;
}

/* ---------- Bijlagepagina (foto groot) ---------- */
.ob-attachment { margin: 0 0 1.25rem; }
.ob-attachment a { display: block; }
.ob-attachment img {
	display: block;
	width: 100%;
	height: auto;
}
.ob-attachment figcaption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	opacity: 0.8;
}
.ob-attachment__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin: 0 0 2rem;
	font-weight: 600;
}
