/* Efectes gwm-fx-* (vocabulari tancat: inc/efectes.php). Valors: variables
   --wp--custom--motion--* de theme.json i del kit. Portat del moviment de
   l'Aquarius.

   Regles de moviment:
   - L'estat amagat d'una entrada només existeix dins de
     `prefers-reduced-motion: no-preference` i amb una classe d'estat a <html>
     posada pel JS: .gwm-fx-sd (a més, dins de @supports view()) o .gwm-fx-io
     (fallback amb IntersectionObserver, que posa .is-in). Sense JS, sense
     suport, amb menys moviment o amb el nivell «none»: tot visible i quiet.
   - Un element amb entrada té el `transform` ocupat per l'animació: els
     hovers fan servir `translate`/`scale`/`rotate` o actuen sobre fills.
   - Cap avantpassat d'un element amb view() pot ser contenidor de scroll:
     per retallar, `overflow: clip`.
   - GOTCHA: les animacions de scroll van amb longhands, mai amb el shorthand
     `animation`: el minificador hi fusiona el timeline i el navegador
     descarta la declaració sencera.
   - Les entrades van amb `animation-fill-mode: backwards`: passat el rang,
     l'element torna al seu estil natural (transform none, sense clip-path);
     amb `both` quedaria una matriu identitat i un retall que talla l'ombra.
   - Entrada del kit i nivell: atributs data-gwm-kit-in i data-gwm-fx-level a
     <html> (functions.php), perquè el CSS no pot triar per valor de variable. */

:root {
	--gwm-fx-k: 1;
	--gwm-fx-dist: calc(var(--wp--custom--motion--distance) * var(--gwm-fx-k));
}
:root[data-gwm-fx-level="lively"] { --gwm-fx-k: 1.5; }

/* Una entrada lateral desplaça l'element abans d'entrar: sense retallar, una
   columna a la vora fa la pàgina més ampla que la finestra. `clip` i no
   `hidden`: no crea contenidor de scroll, així view() i sticky segueixen anant. */
.wp-site-blocks { overflow-x: clip; }

/* Entrades: estat de partida (o0/t0/c0) i d'arribada del retall (c1).
   Per defecte, «up» (també la del kit si no n'hi ha cap declarada). */
[class*="gwm-fx-in-"] {
	--gwm-fx-o0: 0;
	--gwm-fx-t0: translate3d(0, var(--gwm-fx-dist), 0);
	--gwm-fx-c0: none;
	--gwm-fx-c1: none;
	--gwm-fx-dur: var(--wp--custom--motion--duration-normal);
	--gwm-fx-end: 75%;
	--gwm-fx-d: 0;
}
.gwm-fx-in-fade, [data-gwm-kit-in="fade"] .gwm-fx-in-kit { --gwm-fx-t0: none; }
.gwm-fx-in-down, [data-gwm-kit-in="down"] .gwm-fx-in-kit { --gwm-fx-t0: translate3d(0, calc(-1 * var(--gwm-fx-dist)), 0); }
.gwm-fx-in-left, [data-gwm-kit-in="left"] .gwm-fx-in-kit { --gwm-fx-t0: translate3d(calc(-1 * var(--gwm-fx-dist)), 0, 0); }
.gwm-fx-in-right, [data-gwm-kit-in="right"] .gwm-fx-in-kit { --gwm-fx-t0: translate3d(var(--gwm-fx-dist), 0, 0); }
.gwm-fx-in-scale, [data-gwm-kit-in="scale"] .gwm-fx-in-kit { --gwm-fx-t0: scale(.9); }
.gwm-fx-in-zoom, [data-gwm-kit-in="zoom"] .gwm-fx-in-kit { --gwm-fx-o0: .15; --gwm-fx-t0: scale(var(--wp--custom--motion--zoom-from)); }
.gwm-fx-in-clip, [data-gwm-kit-in="clip"] .gwm-fx-in-kit { --gwm-fx-o0: 1; --gwm-fx-t0: none; --gwm-fx-c0: inset(16% 14%); --gwm-fx-c1: inset(0); }
[data-gwm-kit-in="none"] .gwm-fx-in-kit { --gwm-fx-o0: 1; --gwm-fx-t0: none; }

.gwm-fx-speed-fast { --gwm-fx-dur: var(--wp--custom--motion--duration-fast); --gwm-fx-end: 45%; }
.gwm-fx-speed-slow { --gwm-fx-dur: var(--wp--custom--motion--duration-slow); --gwm-fx-end: 100%; }
.gwm-fx-delay-1 { --gwm-fx-d: 1; }
.gwm-fx-delay-2 { --gwm-fx-d: 2; }
.gwm-fx-delay-3 { --gwm-fx-d: 3; }
.gwm-fx-delay-4 { --gwm-fx-d: 4; }

@keyframes gwm-fx-in {
	from { opacity: var(--gwm-fx-o0); transform: var(--gwm-fx-t0); clip-path: var(--gwm-fx-c0); }
	to { opacity: 1; transform: none; clip-path: var(--gwm-fx-c1); }
}
@keyframes gwm-fx-par { from { translate: 0 calc(-1 * var(--gwm-fx-par)); } to { translate: 0 var(--gwm-fx-par); } }
@keyframes gwm-fx-kb { from { scale: 1; } to { scale: calc(1 + .12 * var(--gwm-fx-k)); } }
@keyframes gwm-fx-glow { from { translate: -6% -4%; rotate: 0deg; } to { translate: 6% 5%; rotate: 25deg; } }
@keyframes gwm-fx-marquee { to { translate: -50% 0; } }
@keyframes gwm-fx-spin { to { rotate: var(--wp--custom--motion--spin); translate: 0 var(--gwm-fx-dist); } }

/* Scroll continu: el marc dona el timeline (view-timeline) i retalla. */
:is(.gwm-fx-scroll-parallax-soft, .gwm-fx-scroll-parallax-strong, .gwm-fx-scroll-kenburns):is(div, figure) {
	overflow: clip;
	view-timeline-name: --gwm-fx-frame;
}
.gwm-fx-scroll-parallax-soft { --gwm-fx-par: calc(var(--wp--custom--motion--parallax) * var(--gwm-fx-k)); --gwm-fx-zoom: 1.12; }
.gwm-fx-scroll-parallax-strong { --gwm-fx-par: calc(var(--wp--custom--motion--parallax) * 2 * var(--gwm-fx-k)); --gwm-fx-zoom: 1.25; }
.gwm-fx-scroll-sticky { position: sticky; top: var(--wp--preset--spacing--40); align-self: start; }

/* Hover i focus. */
.gwm-fx-hover-lift:is(:hover, :focus-within) { translate: 0 -6px; }
/* Ombres de token (custom.hover.shadowRest → custom.hover.shadow): una web hi
   pot posar l'ombra dura (var(--wp--preset--shadow--dura)). */
.gwm-fx-hover-shadow { box-shadow: var(--wp--custom--hover--shadow-rest); }
.gwm-fx-hover-shadow:is(:hover, :focus-within) { box-shadow: var(--wp--custom--hover--shadow); }
.gwm-fx-hover-img-zoom:is(.wp-block-image, .wp-block-cover), .gwm-fx-hover-img-zoom .wp-block-image { overflow: clip; }
.gwm-fx-hover-img-zoom:is(:hover, :focus-within) img { scale: 1.06; }
/* Capa en un grup: els fills s'apilen i l'últim (el text) va damunt de la
   foto, a baix, amb un vel. Amb hover: sense passar-hi, no es veu. */
.gwm-fx-hover-overlay:not(.wp-block-cover) {
	display: grid;
	overflow: clip;
	border-radius: var(--wp--custom--radius--medium);
}
.gwm-fx-hover-overlay:not(.wp-block-cover) > * { grid-area: 1 / 1; margin: 0; }
.gwm-fx-hover-overlay:not(.wp-block-cover) > .wp-block-image img { display: block; width: 100%; }
.gwm-fx-hover-overlay:not(.wp-block-cover) > :last-child:not(:first-child) {
	align-self: end;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--white);
	background-image: linear-gradient(to top, color-mix(in oklab, var(--wp--preset--color--ink) 85%, transparent), transparent);
}
.gwm-fx-hover-overlay:not(.wp-block-cover) > :last-child:not(:first-child) :is(h1, h2, h3, h4, h5, h6, a) { color: inherit; }
@media (hover: hover) {
	.gwm-fx-hover-overlay .wp-block-cover__inner-container,
	.gwm-fx-hover-overlay:not(.wp-block-cover) > :last-child { opacity: 0; }
	.gwm-fx-hover-overlay:is(:hover, :focus-within) .wp-block-cover__inner-container,
	.gwm-fx-hover-overlay:not(.wp-block-cover):is(:hover, :focus-within) > :last-child { opacity: 1; }
}
.gwm-fx-hover-arrow .wp-block-button__link::after {
	content: "\2192";
	content: "\2192" / "";
	display: inline-block;
	margin-inline-start: .5em;
}
.gwm-fx-hover-arrow .wp-block-button__link { white-space: nowrap; }
.gwm-fx-hover-arrow .wp-block-button__link:is(:hover, :focus)::after { translate: .3em 0; }
.gwm-fx-hover-underline a {
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 1px;
}
.gwm-fx-hover-underline a:is(:hover, :focus) { background-size: 100% 1px; }

/* Vius. */
.gwm-fx-live-glow { --gwm-fx-glow: var(--wp--preset--color--primary); position: relative; isolation: isolate; overflow: clip; }
/* Sobre un fons fosc (destacat, cover), el primari no es veuria: llum blanca. */
.gwm-fx-live-glow:is(.is-style-highlight, .wp-block-cover) { --gwm-fx-glow: var(--wp--preset--color--white); }
.gwm-fx-live-glow::before {
	content: "";
	position: absolute;
	inset: -25%;
	z-index: -1;
	pointer-events: none;
	background-image: radial-gradient(closest-side, color-mix(in oklab, var(--gwm-fx-glow) 30%, transparent), transparent);
}
.gwm-fx-live-marquee.is-ready { display: block; position: relative; overflow: clip; }
.gwm-fx-track {
	display: flex;
	width: max-content;
	gap: var(--wp--preset--spacing--50);
	padding-inline-end: var(--wp--preset--spacing--50);
}
.gwm-fx-track > * { flex: none; margin: 0; }
/* Els textos d'una franja (cinta de serveis) mai es parteixen: nom i motiu en
   una fila. Quieta (sense JS o amb menys moviment), la fila salta entre noms
   perquè tot es vegi sense desbordar la pantalla. */
.gwm-fx-live-marquee > p,
.gwm-fx-live-marquee > .gwm-fx-track > p { white-space: nowrap; }
.wp-block-group.gwm-fx-live-marquee:not(.is-ready) { flex-wrap: wrap; }
/* Teclat dins la franja: quieta, sencera i sense còpies, perquè l'enllaç enfocat es vegi. */
.gwm-fx-live-marquee:has(.gwm-fx-track :focus-visible) .gwm-fx-track { animation: none; flex-wrap: wrap; width: auto; }
.gwm-fx-live-marquee:has(.gwm-fx-track :focus-visible) .gwm-fx-track > [inert] { display: none; }
/* Botó de pausa a sota de la pista, a la dreta: mai damunt d'un logotip. */
.gwm-fx-pause {
	display: block;
	margin-block-start: var(--wp--preset--spacing--30);
	margin-inline-start: auto;
	padding: .25em .5em;
	font: inherit;
	line-height: 1;
	color: inherit;
	background-color: var(--wp--preset--color--surface);
	border: var(--wp--custom--border--width) solid currentColor;
	border-radius: var(--wp--custom--radius--small);
	cursor: pointer;
}
.gwm-fx-pause::before { content: "\275A\275A"; content: "\275A\275A" / ""; }
.gwm-fx-pause[aria-pressed="true"]::before { content: "\25B6"; content: "\25B6" / ""; }
/* Logotips en franja: mida de logo, quiets o lliscant. */
.gwm-fx-live-marquee :is(.wp-block-image, .wp-block-image img) { margin: 0; inline-size: clamp(7rem, 12vw, 11rem); }

/* Carrusel (gwm-carrusel.js): sense JS ja és una fila que es desplaça amb
   scroll-snap; el JS hi posa fletxes, teclat i arrossegament. No és un
   avantpassat de cap element amb view(): els fills no porten entrades. */
.gwm-carrusel {
	position: relative;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	/* Aire per a l'ombra de les targetes (la pista retalla); l'ample creix el
	   mateix perquè les targetes quedin alineades amb la capçalera. */
	padding: var(--wp--preset--spacing--30);
	scroll-padding-inline: var(--wp--preset--spacing--30);
}
.is-layout-constrained > .gwm-carrusel.alignwide { max-width: calc(var(--wp--style--global--wide-size) + 2 * var(--wp--preset--spacing--30)); }
.gwm-carrusel > * { flex: 0 0 min(85%, 26rem); margin: 0; scroll-snap-align: start; }
.gwm-carrusel.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.gwm-carrusel-nav {
	display: flex;
	justify-content: flex-end;
	gap: var(--wp--preset--spacing--30);
	margin-block-start: var(--wp--preset--spacing--40);
}
.gwm-carrusel-nav button {
	padding: .4em .8em;
	font: inherit;
	line-height: 1;
	color: inherit;
	background-color: var(--wp--preset--color--surface);
	border: var(--wp--custom--border--width) solid currentColor;
	border-radius: var(--wp--custom--radius--small);
	cursor: pointer;
}
.gwm-carrusel-nav button[aria-disabled="true"] { opacity: .4; cursor: default; }
.gwm-carrusel-nav button::before { content: "\2190"; content: "\2190" / ""; }
.gwm-carrusel-nav button + button::before { content: "\2192"; content: "\2192" / ""; }
@media (prefers-reduced-motion: no-preference) {
	.gwm-carrusel:not(.is-dragging) { scroll-behavior: smooth; }
}

/* Hero amb galeria: el carrusel fa de fons i el text va al damunt (mateixa
   cel·la de la graella). El text no tapa l'arrossegament, només els seus enllaços. */
.gwm-hero-galeria { display: grid; }
.gwm-hero-galeria > * { grid-area: 1 / 1; margin: 0; }
.gwm-hero-galeria > .gwm-carrusel { padding: 0; scroll-padding-inline: 0; }
.gwm-hero-galeria > .gwm-carrusel > * { flex-basis: 100%; }
.gwm-hero-galeria > .gwm-carrusel img { display: block; inline-size: 100%; block-size: min(80vh, 44rem); object-fit: cover; }
.gwm-hero-galeria > .wp-block-group:not(.gwm-carrusel) {
	z-index: 1;
	align-self: center;
	justify-self: start;
	max-inline-size: min(40rem, calc(100% - 2 * var(--wp--preset--spacing--50)));
	margin-inline-start: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--60);
	color: var(--wp--preset--color--white);
	background-color: color-mix(in oklab, var(--wp--preset--color--ink) 70%, transparent);
	border-radius: var(--wp--custom--radius--small);
	pointer-events: none;
}
.gwm-hero-galeria > .wp-block-group:not(.gwm-carrusel) :is(h1, h2, h3) { color: inherit; }
.gwm-hero-galeria > .wp-block-group:not(.gwm-carrusel) :is(a, button) { pointer-events: auto; }
.gwm-hero-galeria > .gwm-carrusel-nav { z-index: 1; align-self: end; justify-self: end; margin: var(--wp--preset--spacing--40); }

/* Vídeo (gwm-video.js): botó de pausa de la portada i finestra del vídeo. */
.gwm-video-pausa, .gwm-video-tanca {
	position: absolute;
	z-index: 2;
	inset-block-end: var(--wp--preset--spacing--40);
	inset-inline-end: var(--wp--preset--spacing--40);
	padding: .4em .6em;
	font: inherit;
	line-height: 1;
	color: var(--wp--preset--color--ink);
	background-color: var(--wp--preset--color--surface);
	border: var(--wp--custom--border--width) solid currentColor;
	border-radius: var(--wp--custom--radius--small);
	cursor: pointer;
}
.gwm-video-pausa::before { content: "\275A\275A"; content: "\275A\275A" / ""; }
.gwm-video-pausa[aria-pressed="true"]::before { content: "\25B6"; content: "\25B6" / ""; }
.gwm-video-dialog {
	inline-size: min(90vw, 64rem);
	margin: auto;
	max-inline-size: none;
	padding: 0;
	overflow: visible;
	background-color: var(--wp--preset--color--ink);
	border: 0;
}
.gwm-video-dialog::backdrop { background-color: color-mix(in oklab, var(--wp--preset--color--ink) 85%, transparent); }
.gwm-video-dialog video { display: block; inline-size: 100%; aspect-ratio: 16 / 9; }
.gwm-video-tanca { inset-block: calc(-1 * var(--wp--preset--spacing--60)) auto; inset-inline-end: 0; }
.gwm-video-tanca::before { content: "\2715"; content: "\2715" / ""; }

@media (prefers-reduced-motion: no-preference) {
	/* Entrades amb scroll-driven animations. */
	@supports (animation-timeline: view()) {
		.gwm-fx-sd :is([class*="gwm-fx-in-"]:not(.gwm-fx-stagger), .gwm-fx-stagger[class*="gwm-fx-in-"] > *) {
			animation-name: gwm-fx-in;
			animation-timing-function: linear;
			animation-fill-mode: backwards;
			animation-timeline: view();
			animation-range:
				entry calc((var(--gwm-fx-d) + var(--gwm-fx-i, 0)) * var(--wp--custom--motion--step))
				entry calc(var(--gwm-fx-end) + (var(--gwm-fx-d) + var(--gwm-fx-i, 0)) * var(--wp--custom--motion--step));
		}
		.gwm-fx-sd :is(.gwm-fx-scroll-parallax-soft, .gwm-fx-scroll-parallax-strong) :is(img, .wp-block-cover__image-background) {
			scale: var(--gwm-fx-zoom);
			animation-name: gwm-fx-par;
			animation-timing-function: linear;
			animation-fill-mode: both;
			animation-timeline: --gwm-fx-frame;
			animation-range: cover;
		}
		.gwm-fx-sd .gwm-fx-scroll-kenburns :is(img, .wp-block-cover__image-background) {
			animation-name: gwm-fx-kb;
			animation-timing-function: linear;
			animation-fill-mode: both;
			animation-timeline: --gwm-fx-frame;
			animation-range: cover;
		}
		/* Gir al llarg de la pàgina: a una imatge gira la foto (el bloc queda
		   lliure per a l'entrada); a un grup, el grup sencer. */
		.gwm-fx-sd :is(.wp-block-image.gwm-fx-scroll-spin img, .wp-block-group.gwm-fx-scroll-spin) {
			animation-name: gwm-fx-spin;
			animation-timing-function: linear;
			animation-fill-mode: both;
			animation-timeline: scroll(root);
		}
	}

	/* Fallback sense scroll-driven: IntersectionObserver posa .is-in. */
	.gwm-fx-io :is([class*="gwm-fx-in-"]:not(.gwm-fx-stagger), .gwm-fx-stagger[class*="gwm-fx-in-"] > *) {
		opacity: var(--gwm-fx-o0);
		transform: var(--gwm-fx-t0);
		clip-path: var(--gwm-fx-c0);
		transition-property: opacity, transform, clip-path, translate, box-shadow;
		transition-duration: var(--gwm-fx-dur), var(--gwm-fx-dur), var(--gwm-fx-dur), var(--wp--custom--motion--duration-fast), var(--wp--custom--motion--duration-fast);
		transition-timing-function: var(--wp--custom--motion--ease);
		transition-delay: calc((var(--gwm-fx-d) + var(--gwm-fx-i, 0)) * 90ms);
	}
	.gwm-fx-io :is([class*="gwm-fx-in-"].is-in:not(.gwm-fx-stagger), .gwm-fx-stagger[class*="gwm-fx-in-"].is-in > *) {
		opacity: 1;
		transform: none;
		clip-path: var(--gwm-fx-c1);
	}

	/* Primer mòdul: entra en carregar, sense esperar l'scroll i sense amagar-se mai. */
	:is(.gwm-fx-sd, .gwm-fx-io) :is(.gwm-fx-first:is([class*="gwm-fx-in-"]:not(.gwm-fx-stagger)), .gwm-fx-first :is([class*="gwm-fx-in-"]:not(.gwm-fx-stagger), .gwm-fx-stagger[class*="gwm-fx-in-"] > *)) {
		--gwm-fx-o0: 1;
		animation-name: gwm-fx-in;
		animation-duration: var(--gwm-fx-dur);
		animation-timing-function: var(--wp--custom--motion--ease);
		animation-delay: calc((var(--gwm-fx-d) + var(--gwm-fx-i, 0)) * 90ms);
		animation-fill-mode: backwards;
		animation-timeline: auto;
		animation-range: normal;
	}

	/* Ja pintat i a la vista quan arriba el JS: quiet. Ha de guanyar les tres
	   regles d'abans (mateixa especificitat que la del primer mòdul, i després). */
	:is(.gwm-fx-sd, .gwm-fx-io) :is(.gwm-fx-static[class*="gwm-fx-in-"]:not(.gwm-fx-stagger), .gwm-fx-static.gwm-fx-stagger[class*="gwm-fx-in-"] > *) {
		animation-name: none;
		opacity: 1;
		transform: none;
		clip-path: none;
	}

	:is(.gwm-fx-sd, .gwm-fx-io) .gwm-fx-live-glow::before {
		animation-name: gwm-fx-glow;
		animation-duration: 16s;
		animation-timing-function: ease-in-out;
		animation-iteration-count: infinite;
		animation-direction: alternate;
	}
	:is(.gwm-fx-sd, .gwm-fx-io) .gwm-fx-track {
		animation-name: gwm-fx-marquee;
		animation-duration: 30s;
		animation-timing-function: linear;
		animation-iteration-count: infinite;
	}
	.gwm-fx-live-marquee:is(:hover, :focus-within, .is-paused) .gwm-fx-track { animation-play-state: paused; }

	/* Transicions dels hovers (amb el nivell «none», canvi sec). */
	:root:not([data-gwm-fx-level="none"]) :is(.gwm-fx-hover-lift, .gwm-fx-hover-shadow) {
		transition-property: translate, box-shadow;
		transition-duration: var(--wp--custom--motion--duration-fast);
		transition-timing-function: var(--wp--custom--motion--ease);
	}
	:root:not([data-gwm-fx-level="none"]) :is(.gwm-fx-hover-img-zoom img, .gwm-fx-hover-underline a, .gwm-fx-hover-overlay .wp-block-cover__inner-container, .gwm-fx-hover-overlay:not(.wp-block-cover) > :last-child),
	:root:not([data-gwm-fx-level="none"]) .gwm-fx-hover-arrow .wp-block-button__link::after {
		transition-property: scale, translate, background-size, opacity;
		transition-duration: var(--wp--custom--motion--duration-fast);
		transition-timing-function: var(--wp--custom--motion--ease);
	}
}

/* Mòduls estàtics del pas 2 (llista-icones, linia-temps, mosaic, comparativa,
   valoracions, progres). Aquí i no a gwm-base.css, que només porta els dos
   retocs de la v2 (neteja.test.mjs). */
/* text-imatge-alternat: a l'HTML, totes les files imatge i després text (el
   mateix ordre apilat al mòbil); a partir del salt de columnes del nucli, la
   fila del mig gira la imatge a l'altra banda. */
@media (min-width: 782px) {
	.wp-block-columns.gwm-fila-inversa { flex-direction: row-reverse; }
}

/* llista-icones: número destacat en una pastilla rodona, al costat del text. */
.gwm-icona {
	display: grid;
	place-items: center;
	flex: none;
	inline-size: 3rem;
	block-size: 3rem;
	margin: 0;
	border-radius: 50%;
	font-family: var(--wp--preset--font-family--heading);
	color: var(--wp--preset--color--white);
	background-color: var(--wp--preset--color--primary);
}

/* linia-temps: línia vertical a l'inici i un punt per fita, centrat a la línia. */
.gwm-linia-temps {
	--gwm-lt-line: calc(var(--wp--custom--border--width) * 2);
	border-inline-start: var(--gwm-lt-line) solid var(--wp--preset--color--line);
	padding-inline-start: var(--wp--preset--spacing--50);
}
.gwm-linia-temps > * { position: relative; }
.gwm-linia-temps > *::before {
	content: "";
	position: absolute;
	inset-block-start: .6em;
	inset-inline-start: calc(-1 * (var(--wp--preset--spacing--50) + var(--gwm-lt-line) / 2 + .5rem));
	inline-size: 1rem;
	block-size: 1rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 .25rem var(--wp--preset--color--surface);
}

/* mosaic: maçoneria amb columnes CSS; una de cada tres, retallada en vertical. */
.gwm-mosaic {
	columns: 3 16rem;
	column-gap: var(--wp--preset--spacing--30);
}
.wp-block-group.gwm-mosaic > * {
	break-inside: avoid;
	margin-block: 0 var(--wp--preset--spacing--30);
}
.gwm-mosaic img { display: block; inline-size: 100%; }
.gwm-mosaic > :nth-child(3n+2) img { aspect-ratio: 3 / 4; block-size: auto; object-fit: cover; }

/* comparativa: la taula llisca en horitzontal en pantalles estretes. */
.wp-block-table.gwm-comparativa { overflow-x: auto; }
.gwm-comparativa table { min-inline-size: 36rem; }
.gwm-comparativa :is(th, td):not(:first-child) { text-align: center; }

/* valoracions */
.gwm-estrelles {
	letter-spacing: .1em;
	color: var(--wp--preset--color--primary);
}

/* progres: la barra és un grup buit; l'ompliment és el seu ::before, d'ample
   fix per classe (gwm-progres-5 … gwm-progres-100, de 5 en 5; sense classe, 0). Sense JS, sense
   suport o amb menys moviment, la barra es veu plena. Amb moviment, s'omple
   des de 0 amb l'entrada del seu fil (mateix rang que gwm-fx.css). */
.gwm-progres {
	--gwm-progres: 0%;
	block-size: .5rem;
	overflow: clip;
	border-radius: var(--wp--custom--radius--small);
	background-color: var(--wp--preset--color--line);
}
.gwm-progres::before {
	content: "";
	display: block;
	inline-size: var(--gwm-progres);
	block-size: 100%;
	border-radius: inherit;
	background-color: var(--wp--preset--color--primary);
	transform-origin: 0 50%;
}
.gwm-progres-5 { --gwm-progres: 5%; }
.gwm-progres-10 { --gwm-progres: 10%; }
.gwm-progres-15 { --gwm-progres: 15%; }
.gwm-progres-20 { --gwm-progres: 20%; }
.gwm-progres-25 { --gwm-progres: 25%; }
.gwm-progres-30 { --gwm-progres: 30%; }
.gwm-progres-35 { --gwm-progres: 35%; }
.gwm-progres-40 { --gwm-progres: 40%; }
.gwm-progres-45 { --gwm-progres: 45%; }
.gwm-progres-50 { --gwm-progres: 50%; }
.gwm-progres-55 { --gwm-progres: 55%; }
.gwm-progres-60 { --gwm-progres: 60%; }
.gwm-progres-65 { --gwm-progres: 65%; }
.gwm-progres-70 { --gwm-progres: 70%; }
.gwm-progres-75 { --gwm-progres: 75%; }
.gwm-progres-80 { --gwm-progres: 80%; }
.gwm-progres-85 { --gwm-progres: 85%; }
.gwm-progres-90 { --gwm-progres: 90%; }
.gwm-progres-95 { --gwm-progres: 95%; }
.gwm-progres-100 { --gwm-progres: 100%; }
@keyframes gwm-progres { from { scale: 0 1; } }
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.gwm-fx-sd .gwm-fx-stagger > :has(.gwm-progres) { view-timeline-name: --gwm-progres; }
		.gwm-fx-sd .gwm-progres::before {
			animation-name: gwm-progres;
			animation-timing-function: linear;
			animation-fill-mode: backwards;
			animation-timeline: --gwm-progres;
			animation-range:
				entry calc((var(--gwm-fx-d, 0) + var(--gwm-fx-i, 0)) * var(--wp--custom--motion--step))
				entry calc(var(--gwm-fx-end, 75%) + (var(--gwm-fx-d, 0) + var(--gwm-fx-i, 0)) * var(--wp--custom--motion--step));
		}
	}
	.gwm-fx-io .gwm-progres::before {
		transition-property: scale;
		transition-duration: var(--wp--custom--motion--duration-slow);
		transition-timing-function: var(--wp--custom--motion--ease);
		transition-delay: calc((var(--gwm-fx-d, 0) + var(--gwm-fx-i, 0)) * 90ms);
	}
	/* Buida només dins d'una entrada encara no revelada: sense entrada, plena.
	   :where perquè el primer mòdul i .gwm-fx-static hi guanyin. */
	.gwm-fx-io :where([class*="gwm-fx-in-"]:not(.is-in)) .gwm-progres::before { scale: 0 1; }
	/* Primer mòdul: s'omple en carregar. Ja a la vista quan arriba el JS: plena. */
	:is(.gwm-fx-sd, .gwm-fx-io) .gwm-fx-first .gwm-progres::before {
		scale: 1 1;
		animation-name: gwm-progres;
		animation-duration: var(--wp--custom--motion--duration-slow);
		animation-timing-function: var(--wp--custom--motion--ease);
		animation-delay: calc((var(--gwm-fx-d, 0) + var(--gwm-fx-i, 0)) * 90ms);
		animation-fill-mode: backwards;
		animation-timeline: auto;
		animation-range: normal;
	}
	:is(.gwm-fx-sd, .gwm-fx-io) .gwm-fx-static .gwm-progres::before { animation-name: none; scale: 1 1; }
}

/* Pestanyes, abans/després i compte enrere (gwm-interactius.js). Sense JS,
   el contingut es veu sencer: aquestes regles només actuen sobre el que crea
   el JS o sobre .is-ready. */
.gwm-pestanyes-llista {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	border-block-end: var(--wp--custom--border--width) solid var(--wp--preset--color--line);
}
.gwm-pestanyes-llista [role="tab"] {
	margin-block-end: calc(-1 * var(--wp--custom--border--width));
	padding: .6em 1em;
	font: inherit;
	color: inherit;
	background-color: transparent;
	border: 0;
	border-block-end: calc(var(--wp--custom--border--width) * 3) solid transparent;
	cursor: pointer;
}
.gwm-pestanyes-llista [aria-selected="true"] { border-block-end-color: var(--wp--preset--color--primary); }
.gwm-pestanyes [role="tabpanel"][hidden] { display: none; }

.gwm-abans-despres > figure { position: relative; margin: 0; }
.gwm-abans-despres > figure img { display: block; inline-size: 100%; }
.gwm-abans-despres.is-ready { grid-template-columns: minmax(0, 1fr); }
.gwm-abans-despres.is-ready > figure { grid-area: 1 / 1; }
.gwm-abans-despres.is-ready > figure + figure { clip-path: inset(0 calc(100% - var(--gwm-ad, 50%)) 0 0); }
.gwm-abans-despres.is-ready figcaption {
	position: absolute;
	inset-block-start: var(--wp--preset--spacing--30);
	margin: 0;
	padding: .25em .6em;
	color: var(--wp--preset--color--ink);
	background-color: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--small);
}
.gwm-abans-despres.is-ready > figure:first-child figcaption { inset-inline-end: var(--wp--preset--spacing--30); }
.gwm-abans-despres.is-ready > figure + figure figcaption { inset-inline-start: var(--wp--preset--spacing--30); }
/* El control, a sobre de la imatge: el range (invisible) la cobreix sencera i
   la línia i el botó rodó (sense clics) en marquen la posició. Mida, colors i
   gruix de la línia, de token (custom.comparador.*). Teclat: el del range. */
.gwm-abans-despres.is-ready { position: relative; }
.gwm-abans-despres.is-ready > input[type="range"] {
	grid-area: 1 / 1;
	align-self: stretch;
	z-index: 2;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
	touch-action: pan-y;
}
.gwm-abans-despres.is-ready::before,
.gwm-abans-despres.is-ready::after {
	position: absolute;
	z-index: 1;
	inset-inline-start: var(--gwm-ad, 50%);
	pointer-events: none;
}
.gwm-abans-despres.is-ready::before {
	content: "";
	inset-block: 0;
	inline-size: var(--wp--custom--comparador--line-width);
	translate: -50% 0;
	background-color: var(--wp--custom--comparador--line);
}
.gwm-abans-despres.is-ready::after {
	content: "\2194";
	inset-block-start: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	inline-size: var(--wp--custom--comparador--size);
	block-size: var(--wp--custom--comparador--size);
	translate: -50% -50%;
	font-size: calc(var(--wp--custom--comparador--size) / 3);
	font-weight: 800;
	color: var(--wp--custom--comparador--color);
	background-color: var(--wp--custom--comparador--background);
	border: var(--wp--custom--comparador--line-width) solid var(--wp--custom--comparador--line);
	border-radius: 50%;
}
.gwm-abans-despres.is-ready:has(> input[type="range"]:focus-visible)::after {
	outline: var(--wp--custom--comparador--line-width) solid var(--wp--custom--comparador--color);
	outline-offset: 2px;
}

.gwm-compte-enrere:not(.is-ready) .gwm-compte-enrere-caselles { display: none; }
.gwm-compte-enrere-caselles > * { min-inline-size: 8rem; }
.gwm-compte-enrere-caselles > * > :first-child { font-variant-numeric: tabular-nums; }

/* Entrada destacada: la imatge de l'entrada (no és un core/image) també es retalla. */
.gwm-fx-hover-img-zoom .wp-block-post-featured-image { overflow: clip; }
/* Entrada sense imatge destacada: la columna de la imatge queda buida i el text ocupa tot l'ample. */
.wp-block-post-template .wp-block-column:not(:has(> *)) { display: none; }

/* Separadors (estils de bloc del grup, inc/estils-de-bloc.php): el canvi de
   secció és el fons del grup retallat per una màscara SVG del tema. El color
   és el fons del bloc (el de la franja, per defecte) i enganxa amb el veí. */
.wp-block-group:is(.is-style-separador-onada, .is-style-separador-diagonal) {
	block-size: clamp(3rem, 8vw, 6rem);
	margin-block: 0;
	padding: 0;
	background-color: var(--wp--preset--color--surface-alt);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}
.wp-block-group.is-style-separador-onada { -webkit-mask-image: url(../img/separador-onada.svg); mask-image: url(../img/separador-onada.svg); }
.wp-block-group.is-style-separador-diagonal { -webkit-mask-image: url(../img/separador-diagonal.svg); mask-image: url(../img/separador-diagonal.svg); }
.wp-block-group:is(.is-style-separador-onada, .is-style-separador-diagonal) + * { margin-block-start: 0; }

/* Capçalera transparent d'abans de la 2.3.0 (classe gwm-header-transparent):
   damunt del primer mòdul, sense ocupar lloc. La part del tema ja fa servir
   l'estil is-style-capcalera-sobre-portada (gwm-estils.css); això queda per a
   les còpies de la part desades a la base de dades d'una web. */
.wp-site-blocks > :has(> .gwm-header-transparent) { position: relative; z-index: 20; block-size: 0; }
.wp-site-blocks > :has(> .gwm-header-transparent) + * { margin-block-start: 0; }
.gwm-header-transparent {
	position: absolute;
	inset-block-start: 0;
	inset-inline: 0;
	color: var(--wp--preset--color--white);
	background-color: transparent;
	/* Vel fosc a dalt: el text blanc es llegeix també sobre un primer mòdul clar. */
	background-image: linear-gradient(to bottom, color-mix(in srgb, var(--wp--preset--color--ink) 80%, transparent), color-mix(in srgb, var(--wp--preset--color--ink) 55%, transparent) 75%, transparent);
}
.gwm-header-transparent :is(a:where(:not(.wp-element-button)), .wp-block-site-title, .wp-block-navigation, .wp-block-navigation__responsive-container-open) { color: inherit; }
.gwm-header-transparent a:where(:not(.wp-element-button)):is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: .2em; }

/* Menys moviment: res es mou, tot es veu (xarxa per si una regla nova s'escapa del gate). */
@media (prefers-reduced-motion: reduce) {
	[class*="gwm-fx-"], [class*="gwm-fx-"] *, [class*="gwm-fx-"]::before, [class*="gwm-fx-"]::after {
		animation: none !important;
		transition: none !important;
	}
}
