/**
 * Contenuti delle pagine e stili dei blocchi standard: valgono sul sito
 * (.gm-entry) e nell'editor (.editor-styles-wrapper).
 */

/* Testo. */

:where(.gm-entry, .editor-styles-wrapper) :where(p) {
	margin: 0 0 22px;
}

:where(.gm-entry, .editor-styles-wrapper) :where(h2) {
	margin: 0 0 28px;
	font-size: var(--gm-h2);
}

:where(.gm-entry, .editor-styles-wrapper) :where(h3) {
	margin: 0 0 16px;
	font-size: 25px;
	letter-spacing: -.025em;
	line-height: 1.3;
}

:where(.gm-entry, .editor-styles-wrapper) :where(h4) {
	margin: 0 0 12px;
	font-size: 20px;
	letter-spacing: -.02em;
	line-height: 1.35;
}

:where(.gm-entry, .editor-styles-wrapper) :where(ul, ol) {
	margin: 0 0 22px;
	padding-left: 1.3em;
}

:where(.gm-entry, .editor-styles-wrapper) :where(li + li) {
	margin-top: 6px;
}

:where(.gm-entry, .editor-styles-wrapper) :where(p, li, td) a {
	color: var(--gm-ink);
	text-decoration: underline;
	text-decoration-color: var(--gm-link-line);
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	transition: color .2s, text-decoration-color .2s;
}

:where(.gm-entry, .editor-styles-wrapper) :where(p, li, td) a:hover {
	color: var(--gm-brand);
	text-decoration-color: currentColor;
}

:where(.gm-entry, .editor-styles-wrapper) :where(p, ul, ol, h2, h3, h4, .wp-block-buttons, figure):last-child {
	margin-bottom: 0;
}

:where(.gm-entry, .editor-styles-wrapper) :where(blockquote) {
	margin: 0 0 22px;
	padding: 4px 0 4px 24px;
	border-left: 3px solid var(--gm-brand);
	font-size: 19px;
}

:where(.gm-entry, .editor-styles-wrapper) :where(hr) {
	margin: 40px 0;
	border: 0;
	border-top: 1px solid var(--gm-line);
}

:where(.gm-entry, .editor-styles-wrapper) :where(table) {
	width: auto;
	border-collapse: collapse;
	font-size: 15px;
}

/* WordPress dà il 100 % al blocco Tabella; le celle a larghezza fissa ne hanno bisogno. */
:is(.gm-entry, .editor-styles-wrapper) .wp-block-table table:not(.has-fixed-layout) {
	width: auto;
}

:where(.gm-entry, .editor-styles-wrapper) :where(th, td) {
	padding: 10px 12px;
	border-bottom: 1px solid var(--gm-line);
	text-align: left;
	vertical-align: top;
}

/* Blocco Tabella: le linee sottili del tema al posto della griglia di WordPress. */
:is(.gm-entry, .editor-styles-wrapper) .wp-block-table :is(th, td) {
	padding: 10px 12px;
	border: 0;
	border-bottom: 1px solid var(--gm-line);
	text-align: left;
	vertical-align: top;
}

:is(.gm-entry, .editor-styles-wrapper) .wp-block-table th {
	border-bottom-color: var(--gm-line-strong);
	font-weight: 600;
}

:is(.gm-entry, .editor-styles-wrapper) .wp-block-table thead {
	border-bottom: 0;
}

:where(.gm-entry, .editor-styles-wrapper) :where(figure) {
	margin: 0 0 22px;
}

:where(.gm-entry, .editor-styles-wrapper) :where(figcaption) {
	margin-top: 8px;
	color: var(--gm-muted);
	font-size: 14px;
}

.wp-block-image img {
	display: block;
	height: auto;
}

/* Paragrafi: Testo d'apertura, Ambito, Etichetta (in base.css). */

.is-style-gm-lead {
	color: var(--gm-muted);
	font-size: 21px;
	line-height: 1.65;
}

.is-style-gm-tag {
	margin: 0 0 12px;
	color: var(--gm-brand);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .01em;
	line-height: 1.4;
}

.gm-text-brand {
	color: var(--gm-brand);
}

/* Elenchi: Vantaggi numerati e Elenco con punti. */

.wp-block-list.is-style-gm-benefits {
	margin: 40px 0;
	padding: 0;
	list-style: none;
	counter-reset: gm-benefit;
}

.is-style-gm-benefits > li {
	display: grid;
	grid-template-columns: 50px 1fr;
	gap: 30px;
	margin: 0;
	padding: 23px 0;
	border-top: 1px solid var(--gm-line);
	counter-increment: gm-benefit;
}

.is-style-gm-benefits > li:last-child {
	border-bottom: 1px solid var(--gm-line);
}

.is-style-gm-benefits > li::before {
	content: counter(gm-benefit, decimal-leading-zero);
	padding-top: 3px;
	color: var(--gm-brand);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
}

.wp-block-list.is-style-gm-checks {
	padding: 0;
	list-style: none;
}

.is-style-gm-checks > li {
	position: relative;
	padding-left: 22px;
}

.is-style-gm-checks > li::before {
	content: "";
	position: absolute;
	top: .72em;
	left: 2px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--gm-brand);
}

/* Elenco con icone: l'icona (immagine in linea all'inizio della voce) va nel margine. */
.wp-block-list.is-style-gm-icons {
	padding: 0;
	list-style: none;
}

.is-style-gm-icons > li {
	position: relative;
	min-height: 40px;
	padding-left: 54px;
}

.is-style-gm-icons > li + li {
	margin-top: 14px;
}

.is-style-gm-icons > li > img:first-child {
	position: absolute;
	top: -2px;
	left: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
}

/* Immagini: Marchio, In un riquadro, Foto. */

.wp-block-image.is-style-gm-mark img {
	width: auto;
	max-width: min(100%, 200px);
	max-height: 230px;
	object-fit: contain;
}

.wp-block-image.is-style-gm-framed {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	padding: 40px;
	border-radius: var(--gm-radius-panel);
	background: var(--gm-mist);
}

.wp-block-image.is-style-gm-framed img {
	width: 100%;
	max-height: 240px;
	object-fit: contain;
}

.wp-block-image.is-style-gm-photo img {
	width: 100%;
	border-radius: var(--gm-radius-card);
	aspect-ratio: 1.76;
	object-fit: cover;
}

/* Gruppi: Sezione azzurrata, Riquadro, Card, Avviso. */

.wp-block-group.is-style-gm-section-mist {
	padding: 70px var(--gm-gutter);
	background: var(--gm-mist);
}

.wp-block-group.is-style-gm-panel {
	padding: 40px;
	border-radius: var(--gm-radius-card);
	background: var(--gm-sky);
}

.wp-block-group.is-style-gm-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-height: 300px;
	padding: 26px 24px 88px;
	border: 1px solid var(--gm-card-border);
	border-radius: var(--gm-radius-card);
	background: var(--gm-mist);
}

.is-style-gm-card h3 {
	margin: 18px 0 12px;
	font-size: 30px;
	letter-spacing: -.045em;
}

.is-style-gm-card p:not(.is-style-gm-tag) {
	margin: 0;
	color: var(--gm-muted);
	font-size: 15px;
}

.wp-block-group.is-style-gm-notice {
	padding: 30px 35px;
	border-radius: var(--gm-radius-card);
	background: var(--gm-mist);
	color: var(--gm-muted);
	font-size: 14px;
}

.is-style-gm-notice h3 {
	margin: 0 0 12px;
	color: var(--gm-ink);
	font-family: var(--gm-font-body);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0;
}

.is-style-gm-notice p {
	margin-bottom: 12px;
}

/* Freccia in un cerchio, in fondo a card e servizi: il cerchio è ::before, la freccia ::after. */
.is-style-gm-card::before,
.gm-teaser::before {
	content: "";
	position: absolute;
	left: 24px;
	bottom: 26px;
	width: 40px;
	height: 40px;
	border: 1px solid var(--gm-button-line);
	border-radius: 50%;
	transition: background-color .2s, border-color .2s, transform .2s;
}

.is-style-gm-card::after,
.gm-teaser::after {
	content: "";
	position: absolute;
	left: 35px;
	bottom: 37px;
	width: 18px;
	height: 18px;
	background: var(--gm-ink);
	-webkit-mask: var(--gm-arrow) center / contain no-repeat;
	mask: var(--gm-arrow) center / contain no-repeat;
	transition: background-color .2s, transform .2s;
}

.is-style-gm-card:hover::before,
.gm-teaser:hover::before {
	border-color: var(--gm-brand);
	background: var(--gm-brand);
	transform: rotate(8deg);
}

.is-style-gm-card:hover::after,
.gm-teaser:hover::after {
	background: var(--gm-white);
	transform: rotate(8deg);
}

/* Il link del titolo rende cliccabile tutta la card, ma non nell'editor. */
.gm-entry .is-style-gm-card h3 a::after,
.gm-entry .gm-teaser h3 a::after,
.gm-entry .is-style-gm-document h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.is-style-gm-card h3 a,
.gm-teaser h3 a,
.is-style-gm-document h3 a {
	text-decoration: none;
}

/* Riga documento: titolo e testo a sinistra, tipo di file a destra. */

.wp-block-group.is-style-gm-document {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 8px 40px;
	padding: 27px 0;
	border-top: 1px solid var(--gm-line);
}

.wp-block-group.is-style-gm-document:last-child {
	border-bottom: 1px solid var(--gm-line);
}

.is-style-gm-document > * {
	grid-column: 1;
	margin: 0;
}

.is-style-gm-document h3 {
	margin: 0;
	font-size: 21px;
	transition: color .2s;
}

.is-style-gm-document:hover h3 {
	color: var(--gm-brand);
}

.is-style-gm-document p {
	color: var(--gm-muted);
}

.is-style-gm-document .gm-document__type {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--gm-brand);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.is-style-gm-document .gm-document__type::after {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--gm-arrow) center / contain no-repeat;
	mask: var(--gm-arrow) center / contain no-repeat;
}

/* Riga servizio: numero automatico, titolo, testo. */

.wp-block-group.is-style-gm-service {
	display: grid;
	grid-template-columns: 40px 1fr 1.6fr;
	gap: 40px;
	padding: 42px 0;
	border-bottom: 1px solid var(--gm-line);
	counter-increment: gm-service;
	scroll-margin-top: calc(var(--gm-header-h) + 10px);
}

.is-style-gm-service::before {
	content: counter(gm-service, decimal-leading-zero);
	padding-top: 6px;
	color: var(--gm-brand);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
}

.is-style-gm-service h2 {
	margin: 0;
	font-size: 25px;
	letter-spacing: -.025em;
	line-height: 1.35;
}

.is-style-gm-service p {
	color: var(--gm-muted);
}

/* Riga con immagine: certificazioni (marchio), prodotti e progetti (riquadro). */

.wp-block-group.is-style-gm-media-row {
	display: grid;
	grid-template-columns: 230px 1fr;
	align-items: start;
	gap: 75px;
	padding: 50px 0;
	border-bottom: 1px solid var(--gm-line);
	scroll-margin-top: calc(var(--gm-header-h) + 10px);
}

.wp-block-group.is-style-gm-media-row:has(> .is-style-gm-framed) {
	grid-template-columns: .8fr 1.2fr;
	gap: 70px;
	padding: 65px 0;
}

.is-style-gm-media-row > .wp-block-image {
	margin: 0;
}

.is-style-gm-media-row > .is-style-gm-mark {
	display: flex;
	justify-content: center;
	padding: 20px;
}

.is-style-gm-media-row h2 {
	margin: 0 0 25px;
	font-size: 32px;
}

.is-style-gm-media-row:has(> .is-style-gm-framed) h2 {
	margin: 0 0 22px;
	font-size: var(--gm-h2);
}

.is-style-gm-media-row p:not(.is-style-gm-tag),
.is-style-gm-media-row li {
	color: var(--gm-muted);
}

.is-style-gm-media-row .wp-block-buttons {
	margin-top: 30px;
}

@media (max-width: 1100px) {
	.wp-block-group.is-style-gm-service {
		grid-template-columns: 30px 1fr 1.4fr;
		gap: 25px;
	}
}

@media (max-width: 800px) {
	/* Tabelle senza il contenitore del blocco Tabella (come nelle informative di produzione):
	   scorrono nel loro spazio invece di allargare la pagina. */
	.gm-entry > table,
	.gm-entry :not(.wp-block-table) > table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
	}

	/* Il blocco Tabella scorre già nel suo contenitore: sotto questa larghezza le colonne
	   spezzerebbero le parole. */
	.gm-entry .wp-block-table table {
		min-width: 720px;
	}

	.is-style-gm-lead {
		font-size: 18px;
	}

	.is-style-gm-benefits > li {
		grid-template-columns: 25px 1fr;
		gap: 15px;
	}

	.wp-block-group.is-style-gm-service {
		grid-template-columns: 30px 1fr;
		gap: 12px 18px;
		padding: 30px 0;
	}

	.is-style-gm-service > .gm-service__body {
		grid-column: 2;
	}

	.is-style-gm-service h2 {
		font-size: 23px;
	}

	.wp-block-group.is-style-gm-media-row,
	.wp-block-group.is-style-gm-media-row:has(> .is-style-gm-framed) {
		grid-template-columns: 1fr;
		gap: 28px;
		padding: 40px 0;
	}

	.is-style-gm-media-row > .is-style-gm-mark {
		justify-content: flex-start;
		padding: 0;
	}

	.wp-block-image.is-style-gm-mark img {
		max-width: min(100%, 170px);
		max-height: 130px;
	}

	.wp-block-image.is-style-gm-framed {
		min-height: 230px;
	}

	.wp-block-image.is-style-gm-framed img {
		max-height: 180px;
	}

	.is-style-gm-media-row h2 {
		font-size: 28px;
	}

	.wp-block-group.is-style-gm-document {
		gap: 8px 20px;
	}

	.wp-block-group.is-style-gm-panel {
		padding: 30px;
	}

	.wp-block-group.is-style-gm-notice {
		padding: 25px;
	}
}
