/* ==========================================================================
   Pattern per articoli
   Stili dei blocchi inseribili dall'editor: note, numeri, procedura,
   servizi, risorse e richiamo finale.
   ========================================================================== */

/* I pattern a tutta pagina escono dalla colonna di lettura. */
.single-content > .afm-stats,
.single-content > .afm-services,
.single-content > .afm-resources,
.single-content > .afm-cta,
.single-content > .afm-steps {
	max-width: none;
	margin-top: 2.4em;
	margin-bottom: 2.4em;
}

.single-content > .afm-stats:first-child,
.single-content > .afm-services:first-child,
.single-content > .afm-resources:first-child,
.single-content > .afm-cta:first-child,
.single-content > .afm-steps:first-child {
	margin-top: 0;
}

/* --- Nota --------------------------------------------------------------- */

.afm-note {
	--afm-note-accent: var(--afm-amber);
	--afm-note-bg: var(--afm-amber-soft);
	position: relative;
	margin: 2.2em 0;
	padding: 26px 28px 26px 30px;
	background: var(--afm-note-bg);
	border-radius: var(--afm-r-lg);
	overflow: hidden;
}

.afm-note::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 5px;
	background: var(--afm-note-accent);
}

.afm-note--info {
	--afm-note-accent: var(--afm-amber);
	--afm-note-bg: var(--afm-amber-soft);
}

.afm-note--attenzione {
	--afm-note-accent: var(--afm-red);
	--afm-note-bg: var(--afm-red-soft);
}

.afm-note--successo {
	--afm-note-accent: var(--afm-char);
	--afm-note-bg: var(--afm-cream-2);
}

.afm-note__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.afm-note__icon {
	display: inline-flex;
	flex: none;
	width: 38px;
	height: 38px;
	align-items: center;
	justify-content: center;
	background: var(--afm-white);
	border-radius: 50%;
	color: var(--afm-note-accent);
	box-shadow: var(--afm-shadow-xs);
}

.afm-note__icon svg {
	width: 19px;
	height: 19px;
}

.afm-note__title {
	margin: 0;
	font-family: var(--afm-font-head);
	font-size: 1.02rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--afm-char);
}

.afm-note__body {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.68;
	color: var(--afm-char-2);
}

/* --- Numeri chiave ------------------------------------------------------ */

.afm-stats__grid {
	gap: 20px;
}

.afm-stat {
	padding: 30px 26px;
	background: var(--afm-char);
	border-radius: var(--afm-r-lg);
	text-align: center;
}

.afm-stat__value {
	margin: 0 0 8px;
	font-family: var(--afm-font-article);
	font-size: clamp(2rem, 3.4vw, 2.7rem);
	font-weight: 600;
	line-height: 1;
	color: var(--afm-amber);
}

.afm-stat__caption {
	margin: 0;
	font-family: var(--afm-font-head);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.82);
}

/* --- Procedura ---------------------------------------------------------- */

.afm-steps {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
	counter-reset: afm-step;
}

.afm-step {
	position: relative;
	padding: 28px 24px;
	background: var(--afm-cream);
	border: 1px solid var(--afm-cream-3);
	border-radius: var(--afm-r-lg);
}

.afm-step__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0 0 16px;
	background: var(--afm-white);
	border: 1px solid var(--afm-cream-3);
	border-radius: 50%;
	font-family: var(--afm-font-head);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--afm-red);
	box-shadow: var(--afm-shadow-xs);
}

.afm-step__title {
	margin: 0 0 8px;
	font-family: var(--afm-font-head);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--afm-char);
}

.afm-step__body {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.62;
	color: var(--afm-char-2);
}

/* --- Servizi ------------------------------------------------------------ */

.afm-services {
	gap: 22px;
}

.afm-service {
	padding: 30px 26px;
	background: var(--afm-white);
	border: 1px solid var(--afm-line);
	border-radius: var(--afm-r-lg);
	box-shadow: var(--afm-shadow-xs);
	transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.afm-service:hover {
	border-color: var(--afm-amber-tint);
	box-shadow: var(--afm-shadow);
	transform: translateY(-3px);
}

.afm-service__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	margin-bottom: 18px;
	background: var(--afm-amber-soft);
	border-radius: 16px;
	color: var(--afm-amber-deep);
}

.afm-service__icon svg {
	width: 25px;
	height: 25px;
}

.afm-service__title {
	margin: 0 0 10px;
	font-family: var(--afm-font-head);
	font-size: 1.12rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--afm-char);
}

.afm-service__body {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.65;
	color: var(--afm-char-2);
}

/* --- Risorse ------------------------------------------------------------ */

.afm-resources {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.afm-resource {
	display: grid;
	gap: 10px;
	align-content: start;
	padding: 26px 24px;
	background: var(--afm-cream);
	border-radius: var(--afm-r-lg);
}

.afm-resource__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: var(--afm-white);
	border-radius: 12px;
	color: var(--afm-red);
}

.afm-resource__icon svg {
	width: 21px;
	height: 21px;
}

.afm-resource__title {
	margin: 0;
	font-family: var(--afm-font-head);
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.32;
	color: var(--afm-char);
}

.afm-resource__text {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--afm-char-2);
}

.afm-resource__link {
	margin: 0;
	font-family: var(--afm-font-head);
	font-size: 0.9rem;
	font-weight: 600;
}

.afm-resource__link a {
	color: var(--afm-red);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- Richiamo finale ---------------------------------------------------- */

.afm-cta {
	position: relative;
	padding: clamp(32px, 5vw, 48px);
	background:
		radial-gradient(90% 130% at 100% 0%, rgba(225, 140, 28, 0.28) 0%, transparent 58%),
		radial-gradient(70% 120% at 0% 100%, rgba(229, 28, 34, 0.32) 0%, transparent 55%),
		var(--afm-char);
	border-radius: var(--afm-r-xl);
	overflow: hidden;
	text-align: center;
}

.afm-cta__title {
	margin: 0 0 12px;
	font-family: var(--afm-font-article);
	font-size: clamp(1.5rem, 3vw, 2.15rem);
	font-weight: 600;
	line-height: 1.18;
	color: var(--afm-white);
}

.afm-cta__text {
	max-width: 52ch;
	margin: 0 auto 26px;
	font-size: 1.02rem;
	line-height: 1.68;
	color: rgba(255, 255, 255, 0.85);
}

.afm-cta__actions {
	justify-content: center;
	gap: 12px;
}

.afm-cta__actions .wp-block-button__link {
	padding: 14px 28px;
	border-radius: var(--afm-r-pill);
	font-family: var(--afm-font-head);
	font-weight: 700;
	letter-spacing: 0.01em;
}

.afm-cta__actions .is-style-outline .wp-block-button__link {
	color: var(--afm-white);
	border: 1px solid rgba(255, 255, 255, 0.5);
	background: transparent;
}

.afm-cta__actions .is-style-outline .wp-block-button__link:hover {
	background: var(--afm-white);
	color: var(--afm-char);
}

/* --- Adattamenti -------------------------------------------------------- */

@media (max-width: 900px) {
	.afm-steps,
	.afm-resources {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.afm-note {
		padding: 22px 20px 22px 24px;
	}

	.afm-stats__grid,
	.afm-steps,
	.afm-resources,
	.afm-services {
		grid-template-columns: minmax(0, 1fr);
	}

	.afm-stat {
		padding: 24px 20px;
	}

	.afm-cta {
		padding: 30px 22px;
	}

	.afm-cta__actions .wp-block-button,
	.afm-cta__actions .wp-block-button__link {
		width: 100%;
	}
}
