/*
 * Gallery entries (/galerias/{slug}/, body.single-gallery). No approved design of their own: they reuse the
 * pieces of the approved pages (see inc/gallery-single.php).
 *
 * - Hero: the compact hero of Preguntas / Galerías (sections/compact-hero.css) with the modifier hero--gallery.
 *   The H1 is the full title of the entry («Transpirenaica Trail Septiembre 2026»), so it uses the h2 scale to
 *   keep the 480 / 340 px hero of the design; the eyebrow «Galerías» links back to the index. Without featured
 *   image GB removes the photo and the forest background of .hero remains.
 * - Content: a cream rounded band (same rhythm as .section .section--rounded) in the 1200 px container; the
 *   summary paragraphs at the size of the Galerías lead (720 px), then the photos.
 * - Photos: block style «Rejilla de fotos» of core/gallery (is-style-photo-grid), the grid of «En imágenes»
 *   (sections/photo-gallery.css): 4 columns, 12 px gap, 4:3 crop, 12 / 10 px radius; 3 columns on tablet,
 *   2 with 8 px on mobile. Three classes on the gallery beat core's per-gallery gap (.wp-block-gallery-N,
 *   0,2,0, printed after this file); min-width:100% beats core's figure width (1,3,1) without !important.
 * - Closing band: the Hook Element prints the synced «Cierre: inscripción» after the article, inside
 *   main.site-main, whose direct children get GP's 20 px margin-bottom: removed here.
 */

/* Hero */
.hero--gallery .hero__title {
	font-size: var(--fs-h2);
	line-height: 1;
	text-wrap: balance;
}

.hero--gallery .hero__eyebrow a,
.hero--gallery .hero__eyebrow a:is(:hover, :focus, :active, :visited) {
	color: var(--mustard);
}

.hero--gallery .hero__eyebrow a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
	transition: text-decoration-color .2s ease;
}

.hero--gallery .hero__eyebrow a:is(:hover, :focus-visible) {
	text-decoration-color: var(--mustard);
}

.hero--gallery .hero__eyebrow {
	margin-bottom: var(--space-1);
}

/* Content band */
.single-gallery .site-main > * {
	margin-bottom: 0;
}

/* position:relative without z-index: the band paints over the hero by source order, and the closing band that
   follows climbs over it (a z-index here would hide its rounded corners). */
.single-gallery .site-main .inside-article {
	position: relative;
	margin-top: calc(var(--radius-section) * -1);
	padding: var(--space-section) 0 calc(var(--space-section) + var(--radius-section));
	border-radius: var(--radius-section) var(--radius-section) 0 0;
	background: var(--cream);
}

.single-gallery .site-main .entry-content {
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.single-gallery .entry-content > p {
	max-width: 720px;
	margin: 0 0 var(--space-5);
	font-size: var(--fs-lead);
	line-height: 1.55;
	font-weight: 500;
	color: var(--ink);
	text-wrap: pretty;
}

.single-gallery .entry-content > :last-child {
	margin-bottom: 0;
}

.single-gallery .entry-content > p + :not(p) {
	margin-top: var(--space-8);
}

.single-gallery .entry-content > :not(p) + p {
	margin-top: var(--space-8);
}

/* Photo grid: block style «Rejilla de fotos» */
.wp-block-gallery.has-nested-images.is-style-photo-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--space-3);
	align-items: start;
}

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

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

.is-style-photo-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) {
	.wp-block-gallery.has-nested-images.is-style-photo-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

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

	.single-gallery .entry-content > p + :not(p),
	.single-gallery .entry-content > :not(p) + p {
		margin-top: var(--space-7);
	}
}
