/**
 * Base del tema: reset, tipografia, etichette, pulsanti, campi, utilità.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--gm-header-h) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--gm-white);
	color: var(--gm-ink);
	font-family: var(--gm-font-body);
	font-size: 16px;
	line-height: 1.7;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

a,
button,
input,
summary {
	-webkit-tap-highlight-color: transparent;
}

:focus-visible {
	outline: 3px solid var(--gm-brand);
	outline-offset: 4px;
}

/* Specificità zero: valgono i margini dei contenuti (content.css). */
:where(h1, h2, h3, h4, h5, h6, p, figure) {
	margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--gm-ink);
	font-family: var(--gm-font-heading);
	font-weight: 550;
	letter-spacing: -.045em;
	line-height: 1.16;
}

strong,
b {
	font-weight: 650;
}

.gm-icon {
	display: inline-block;
	flex: none;
	vertical-align: middle;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.gm-skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 200;
	padding: 10px 14px;
	border-radius: var(--gm-radius-button);
	background: var(--gm-ink);
	color: var(--gm-white);
	font-weight: 600;
}

.gm-skip:focus {
	position: fixed;
	top: 12px;
}

/* Etichetta: il punto del marchio e il nome della sezione, in maiuscole iniziali. */
.gm-eyebrow,
:where(.wp-block-paragraph, p).is-style-gm-eyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 22px;
	color: var(--gm-brand);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
}

.gm-eyebrow::before,
.is-style-gm-eyebrow::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

/* Pulsanti del tema e del blocco Pulsante. */
.gm-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 34px;
	min-height: 48px;
	padding: 14px 22px;
	border: 1px solid var(--gm-brand);
	border-radius: var(--gm-radius-button);
	background: var(--gm-brand);
	color: var(--gm-white);
	font-family: var(--gm-font-body);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}

.gm-button:hover,
.wp-block-button__link:hover {
	border-color: var(--gm-brand-hover);
	background: var(--gm-brand-hover);
	color: var(--gm-white);
	transform: translateY(-2px);
}

.wp-block-button:not(.is-style-gm-text) .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--gm-arrow) center / contain no-repeat;
	mask: var(--gm-arrow) center / contain no-repeat;
}

.is-style-gm-outline .wp-block-button__link {
	border-color: var(--gm-button-line);
	background: transparent;
	color: var(--gm-ink);
}

.is-style-gm-outline .wp-block-button__link:hover {
	border-color: var(--gm-button-line);
	background: var(--gm-brand-soft);
	color: var(--gm-ink);
}

.is-style-gm-text .wp-block-button__link {
	min-height: 0;
	padding: 0 0 5px;
	border: 0;
	border-bottom: 1px solid var(--gm-link-line);
	border-radius: 0;
	background: none;
	color: var(--gm-ink);
	white-space: nowrap;
}

.is-style-gm-text .wp-block-button__link:hover {
	border-bottom-color: currentColor;
	background: none;
	color: var(--gm-brand);
	transform: none;
}

/* Con il tocco: area alta 44 px intorno al link di testo, senza spostare la linea sotto. */
@media (max-width: 800px), (pointer: coarse) {
	.is-style-gm-text .wp-block-button__link {
		position: relative;
	}

	.is-style-gm-text .wp-block-button__link::before {
		content: "";
		position: absolute;
		top: 50%;
		right: 0;
		left: 0;
		height: 44px;
		transform: translateY(-50%);
	}
}

.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

/* Campi. */
input[type="search"],
input[type="text"],
input[type="email"] {
	min-height: 48px;
	padding: 12px 14px;
	border: 1px solid var(--gm-button-line);
	border-radius: var(--gm-radius-button);
	background: var(--gm-white);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}
