/*
 * Photo gallery «En imágenes» (data-section «En imágenes», pattern transpirenaica/photo-gallery).
 * Ported from base.css and mobile.css of 01-transpirenaica-en-moto with docs/class-map.md:
 * .galeria → .photo-gallery, .galeria__grid → .photo-gallery__grid, .galeria__item → each figure.wp-block-image.
 *
 * The grid is a core/gallery (figure.wp-block-gallery.has-nested-images.is-cropped.photo-gallery__grid):
 * - core makes it a flex row and prints its gap in .wp-block-gallery.wp-block-gallery-N (0,2,0, after this file),
 *   so display and gap go with three classes;
 * - core sizes each photo with figure.wp-block-image:not(#individual-image){width:calc(…)} (1,3,1 and more):
 *   min-width:100% fills the grid cell without !important, whatever the number of photos or columns;
 * - the 4:3 frame goes on the figure (core gives the img height:100% and flex:1 inside the link), and the
 *   gallery aligns its items to the start: core copies align-self:inherit to each photo.
 */

.photo-gallery {
	background: var(--white);
}

.photo-gallery .wp-block-gallery.photo-gallery__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--space-3);
	align-items: start;
	margin: 0;
}

.photo-gallery__grid figure.wp-block-image {
	min-width: 100%;
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	line-height: 0;
	border-radius: var(--radius-media);
}

.photo-gallery__grid figure.wp-block-image > a {
	display: block;
	height: 100%;
	min-height: 0;
}

.photo-gallery__grid figure.wp-block-image img {
	width: 100%;
	height: 100%;
	min-height: 0;
	object-fit: cover;
}

/* Tablet (768–1100 px): 3 columns. */
@media (max-width: 1100px) and (min-width: 768px) {
	.photo-gallery .wp-block-gallery.photo-gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Mobile (≤767 px): 2 columns, 8 px gap. */
@media (max-width: 767px) {
	.photo-gallery .wp-block-gallery.photo-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-2);
	}
}
