/**
 * GIMUR Child: densitat (base comuna a totes les pàgines).
 *
 * Objectiu: la mateixa informació en menys pantalles. Es carrega després de
 * gimur-styles.css (mu-plugin) i en compacta els espais sense editar-lo.
 * Moltes regles porten !important perquè les originals també en porten;
 * vegeu MIGRACIO.md per a la llista de regles de l'original que cal treure.
 *
 * Fitxers:
 *   compact.css  base: ritme, separadors, capçaleres de pàgina, peu
 *   home.css     portada i bloc compacte d'àrees de recerca
 *   about.css    pàgina About
 *   pages.css    notícies, socis/aliances, recursos, events, join us
 */

:root {
	/* Espais heretats de gimur-styles, compactats. Els tokens --gx-* viuen a system.css. */
	--gimur-space-xl: 1.75rem;
	--gimur-space-2xl: 2.5rem;
	--gimur-space-section: 3rem;
}

/* ---------------------------------------------------------------------------
 * 1. Separadors (wp:spacer)
 * L'original els limita a clamp(2rem,5vw,4.5rem) i deixa lliures els de dins
 * dels covers. Ara tots queden curts: el ritme el posen les seccions.
 * ------------------------------------------------------------------------- */
.wp-block-spacer {
	max-height: clamp(0.5rem, 1.6vw, 1.5rem) !important;
}
.wp-block-cover .wp-block-spacer,
.wp-block-cover__inner-container .wp-block-spacer {
	max-height: clamp(0.5rem, 2vw, 2rem) !important;
}

.wp-block-separator.is-style-wide {
	margin-top: 1.25rem;
	margin-bottom: 1.25rem;
}

/* ---------------------------------------------------------------------------
 * 2. Capçaleres de pàgina (primer cover de cada pàgina interior)
 * ------------------------------------------------------------------------- */
.entry-content > .wp-block-cover:first-child,
.site-content > .wp-block-cover:first-child,
:is(main, section).wp-block-group > .wp-block-cover:first-child,
.wp-block-cover.gx-about-hero {
	min-height: clamp(160px, 15vw, 210px) !important;
	padding-top: 1.5rem !important;
	padding-bottom: 1.5rem !important;
}
.entry-content > .wp-block-cover:first-child h1,
:is(main, section).wp-block-group > .wp-block-cover:first-child h1 {
	font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem) !important;
	line-height: 1.08;
	margin: 0;
}
/* La pàgina de socis deixava 24px + 50px de marge damunt del cover */
:is(main, section).site-content:has(> .wp-block-cover:first-child) {
	padding-top: 0 !important;
}

/* Text d'entrada just després del cover */
.entry-content > .wp-block-cover:first-child + .wp-block-spacer,
.entry-content > .wp-block-cover:first-child + p,
:is(main, section).wp-block-group > .wp-block-cover:first-child + .wp-block-spacer {
	margin-top: var(--gx-section) !important;
}
.entry-content > .wp-block-cover:first-child + .wp-block-spacer + p {
	margin-top: 0 !important;
}

/* Final de pàgina: l'original sumava 80px de plantilla + separadors */
:is(main, section).site-content {
	padding-bottom: var(--gx-section) !important;
}
.entry-content > :last-child {
	margin-bottom: 0 !important;
}

/* Títols de secció dins del contingut */
.entry-content h2.has-max-48-font-size {
	font-size: var(--gx-h2) !important;
}

/* ---------------------------------------------------------------------------
 * 4. Peces comunes del redisseny (capçalera de secció, enllaç "veure més")
 * ------------------------------------------------------------------------- */
.gx-head {
	gap: 0.25rem 1.5rem;
	margin-bottom: 0.75rem;
}
.gx-head > * {
	margin: 0 !important;
}
.gx-h2,
h2.gx-h2 {
	font-family: var(--gx-serif);
	font-size: var(--gx-h2) !important;
	line-height: 1.15 !important;
	letter-spacing: -0.02em;
	color: var(--gimur-primary);
	text-wrap: balance;
	margin: 0 0 0.5rem;
}
.gx-lead {
	color: var(--gx-muted) !important;
	max-width: 62ch;
	margin-top: 0 !important;
	margin-bottom: 1rem !important;
}
.gx-more {
	font-size: 1rem;
	font-weight: 500;
}
/* Un sol subratllat: el de l'enllaç del sistema (blau amb subratllat taronja), sense vora afegida. */
.entry-content .gx-more a:not(.wp-block-button__link) {
	display: inline-block;
	padding: 0.35rem 0;
}

/* Separadors sobrants: el que va just després de la capçalera i l'últim de la pàgina */
.entry-content > .wp-block-cover:first-child + .wp-block-spacer {
	margin-top: 1.25rem !important;
}
.entry-content > .wp-block-spacer:last-child,
.entry-content > .wp-block-group > .wp-block-spacer:last-child {
	display: none !important;
}


/* Interlineat de lectura: 1.6 en lloc de 1.7 (llegible i més compacte) */
.entry-content p,
.entry-content li {
	line-height: 1.6;
}
@media (max-width: 781px) {
	.entry-content > p,
	.entry-content > .wp-block-group > p {
		font-size: 1.0625rem;
	}
}
@media (max-width: 781px) {
	.entry-content > .wp-block-cover:first-child,
	:is(main, section).wp-block-group > .wp-block-cover:first-child,
	.wp-block-cover.gx-about-hero {
		min-height: 140px !important;
	}
	.entry-content p {
		margin-bottom: 1em;
	}
	.wp-block-separator.is-style-wide {
		margin-top: 0.75rem;
		margin-bottom: 0.75rem;
	}
}
