.aw-guide-step {
	display: grid;
	box-sizing: border-box;
	grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr);
	grid-template-areas:
		"media content"
		"media legend";
	gap: 1rem 2rem;
	padding: 1.5rem;
}

.aw-guide-step[hidden] {
	display: none;
}

.aw-guide-step__media {
	grid-area: media;
	min-width: 0;
}

.aw-guide-step__image-stage {
	position: relative;
	display: flex;
	width: 100%;
	aspect-ratio: 16 / 10;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--primary-soft-3, #bfd4ed);
	background: var(--wp--preset--color--primary-soft-1, #eef5fc);
}

.aw-guide-step__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.aw-guide-step__hotspot,
.aw-guide-step__legend-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--wp--preset--color--primary-main, #356fba);
	color: var(--wp--preset--color--white, #fff);
	font-weight: 700;
}

.aw-guide-step__hotspot {
	position: absolute;
	width: 2.125rem;
	height: 2.125rem;
	box-sizing: border-box;
	transform: translate(-50%, -50%);
	border: 3px solid var(--wp--preset--color--white, #fff);
	box-shadow: 0 0 0 2px var(--wp--preset--color--primary-main, #356fba);
	font-size: .9375rem;
}

.aw-guide-step__content {
	display: flex;
	grid-area: content;
	min-width: 0;
	align-self: start;
	flex-direction: column;
	gap: .875rem;
}

.aw-guide-step__number {
	color: var(--wp--preset--color--primary-main, #356fba);
	font-size: 2.75rem;
	font-weight: 300;
	line-height: 1;
}

.aw-guide-step__title {
	font-size: 1.625rem;
	font-weight: 700;
	line-height: 1.2;
}

.aw-guide-step__text {
	color: var(--wp--preset--color--dark-1, #1f1a16);
	font-size: 1.0625rem;
	line-height: 1.55;
}

.aw-guide-step__legend {
	display: flex;
	grid-area: legend;
	margin: 0;
	padding: 0;
	align-self: start;
	flex-direction: column;
	gap: .625rem;
	list-style: none;
}

.aw-guide-step__legend-item {
	display: flex;
	min-width: 0;
	align-items: flex-start;
	gap: .75rem;
	font-size: .9375rem;
	line-height: 1.45;
}

.aw-guide-step__legend-number {
	width: 1.5rem;
	height: 1.5rem;
	flex: 0 0 1.5rem;
	font-size: .8125rem;
}

.aw-guide-step__legend-label {
	min-width: 0;
	flex: 1 1 auto;
}

.aw-step-guide--interface .aw-guide-step {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"content"
		"media"
		"legend";
	gap: 1.25rem;
	padding: 1.5rem 1.75rem;
}

.aw-step-guide--interface .aw-guide-step__content {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-areas:
		"number title"
		"number text";
	column-gap: 1.5rem;
	row-gap: .375rem;
}

.aw-step-guide--interface .aw-guide-step__number {
	grid-area: number;
}

.aw-step-guide--interface .aw-guide-step__title {
	grid-area: title;
}

.aw-step-guide--interface .aw-guide-step__text {
	grid-area: text;
}

.aw-step-guide--interface .aw-guide-step__image-stage {
	aspect-ratio: 16 / 7;
}

.aw-step-guide--interface .aw-guide-step__legend {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.aw-step-guide--interface .aw-guide-step__legend-item {
	box-sizing: border-box;
	padding: 1rem 1.125rem;
	border: 1px solid var(--wp--preset--color--light-2, #d9d9d9);
	background: var(--wp--preset--color--primary-soft-1, #eef5fc);
}

@media (max-width: 781px) {
	.aw-guide-step,
	.aw-step-guide--interface .aw-guide-step {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"media"
			"content"
			"legend";
		gap: 1rem;
		padding: 1rem;
	}

	.aw-step-guide--interface .aw-guide-step__content {
		display: flex;
	}

	.aw-guide-step__image-stage,
	.aw-step-guide--interface .aw-guide-step__image-stage {
		aspect-ratio: 3 / 2;
	}

	.aw-guide-step__number {
		font-size: 2.125rem;
	}

	.aw-guide-step__title {
		font-size: 1.375rem;
	}

	.aw-guide-step__text {
		font-size: 1rem;
	}

	.aw-step-guide--interface .aw-guide-step__legend {
		display: flex;
		flex-direction: column;
		gap: .5rem;
	}

	.aw-step-guide--interface .aw-guide-step__legend-item {
		padding: .75rem;
	}

	.aw-guide-step__hotspot {
		width: 1.875rem;
		height: 1.875rem;
		font-size: .875rem;
	}
}

/* Immagine apribile nell'overlay del tema. */
.aw-guide-step__zoom {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

.aw-guide-step__zoom:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary-dark-2, #173b66);
	outline-offset: -3px;
}

.aw-guide-step__zoom-icon {
	position: absolute;
	right: .75rem;
	bottom: .75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primary-main, #356fba);
	color: var(--wp--preset--color--white, #fff);
	font-size: 1rem;
	transition: transform 160ms ease;
}

.aw-guide-step__zoom:hover .aw-guide-step__zoom-icon,
.aw-guide-step__zoom:focus-visible .aw-guide-step__zoom-icon {
	transform: scale(1.1);
}

/* I punti numerati non intercettano il click sull'immagine. */
.aw-guide-step__hotspot {
	pointer-events: none;
}

/* Passo senza immagine: messaggio bianco su sfondo primario. */
.aw-guide-step__image-stage.is-empty {
	border-color: var(--wp--preset--color--primary-main, #356fba);
	background: var(--wp--preset--color--primary-main, #356fba);
}

.aw-guide-step__placeholder {
	max-width: 28rem;
	margin: 0;
	padding: 1.5rem;
	color: var(--wp--preset--color--white, #fff);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.45;
	text-align: center;
}

/* Schermate (sottopassaggi) del passo. */
.aw-guide-step__frames {
	grid-column: 1 / -1;
	min-width: 0;
}

.aw-guide-step__frame[hidden],
.aw-guide-step__frame-text[hidden],
.aw-guide-step__legend[hidden] {
	display: none !important;
}

.aw-guide-step__frame-tabs {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: .625rem;
}

.aw-guide-step__frame-tab {
	display: flex;
	min-height: 4.25rem;
	box-sizing: border-box;
	align-items: center;
	gap: .625rem;
	padding: .375rem .625rem .375rem .375rem;
	border: 2px solid var(--wp--preset--color--light-2, #d9d9d9);
	background: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--dark-1, #1f1a16);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.aw-guide-step__frame-tab.is-active,
.aw-guide-step__frame-tab[aria-selected="true"] {
	border-color: var(--wp--preset--color--primary-main, #356fba);
	background: color-mix(in srgb, var(--wp--preset--color--primary-main, #356fba) 6%, #fff);
}

.aw-guide-step__frame-tab:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary-dark-2, #173b66);
	outline-offset: 2px;
}

.aw-guide-step__frame-thumb {
	display: block;
	width: 4rem;
	height: 3.5rem;
	flex: 0 0 4rem;
	object-fit: cover;
	object-position: top center;
	border: 1px solid var(--wp--preset--color--light-2, #d9d9d9);
}

.aw-guide-step__frame-thumb.is-empty {
	box-sizing: border-box;
	background: var(--wp--preset--color--primary-main, #356fba);
}

.aw-guide-step__frame-tab-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: .125rem;
}

.aw-guide-step__frame-code {
	color: var(--wp--preset--color--primary-dark-1, #24548c);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
}

.aw-guide-step__frame-label {
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.25;
}

/* Intestazione del contenuto: numero e link diretto al passo. */
.aw-guide-step__content-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
}

.aw-guide-step__permalink {
	display: inline-flex;
	min-height: 2rem;
	align-items: center;
	gap: .375rem;
	color: var(--wp--preset--color--primary-main, #356fba);
	font-size: .875rem;
	font-weight: 600;
	text-decoration: none;
}

.aw-guide-step__permalink:hover,
.aw-guide-step__permalink:focus-visible {
	text-decoration: underline;
	text-underline-offset: .2em;
}

/* Bivio: scelte sotto la descrizione del passo. */
.aw-guide-step__choices {
	display: flex;
	flex-direction: column;
	gap: .625rem;
	margin-top: .25rem;
}

.aw-guide-step__choice {
	display: flex;
	min-height: 3.5rem;
	box-sizing: border-box;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .625rem 1rem;
	border: 1px solid var(--wp--preset--color--primary-main, #356fba);
	background: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--dark-1, #1f1a16);
	text-decoration: none;
	transition: background-color 160ms ease;
}

.aw-guide-step__choice:hover,
.aw-guide-step__choice:focus-visible {
	background: color-mix(in srgb, var(--wp--preset--color--primary-main, #356fba) 8%, #fff);
}

.aw-guide-step__choice:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary-dark-2, #173b66);
	outline-offset: 2px;
}

.aw-guide-step__choice-text {
	display: flex;
	flex-direction: column;
	gap: .125rem;
}

.aw-guide-step__choice-label {
	color: var(--wp--preset--color--primary-main, #356fba);
	font-size: 1rem;
	font-weight: 700;
}

.aw-guide-step__choice-hint {
	font-size: .875rem;
	line-height: 1.4;
}

.aw-guide-step__choice svg {
	width: 1.125rem;
	height: 1.125rem;
	flex: 0 0 auto;
	fill: none;
	stroke: var(--wp--preset--color--primary-main, #356fba);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.4;
}

/* Sottopassaggio corrente: contatore, frecce e istruzione. */
.aw-guide-step__frame-info {
	display: flex;
	flex-direction: column;
	gap: .625rem;
	margin-top: .5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--light-2, #d9d9d9);
}

.aw-guide-step__frame-status {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}

.aw-guide-step__frame-counter {
	color: var(--wp--preset--color--primary-dark-1, #24548c);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .12em;
}

.aw-guide-step__frame-arrows {
	display: flex;
	gap: .375rem;
}

.aw-guide-step__frame-arrow {
	display: inline-flex;
	width: 2.25rem;
	height: 2.25rem;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--wp--preset--color--primary-soft-3, #bfd4ed);
	background: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--primary-dark-2, #173b66);
	cursor: pointer;
}

.aw-guide-step__frame-arrow svg {
	width: .875rem;
	height: .875rem;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.6;
}

.aw-guide-step__frame-arrow:disabled {
	cursor: not-allowed;
	opacity: .45;
}

.aw-guide-step__frame-arrow:focus-visible {
	outline: 3px solid var(--wp--preset--color--primary-dark-2, #173b66);
	outline-offset: 2px;
}

.aw-guide-step__frame-text {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.5;
}

/* Senza JavaScript le schermate restano tutte visibili, una sotto l'altra. */
.aw-step-guide:not(.is-interactive):not(.is-editor) .aw-guide-step__frame + .aw-guide-step__frame {
	margin-top: 1rem;
}

.aw-step-guide:not(.is-interactive):not(.is-editor) .aw-guide-step__frame-tabs,
.aw-step-guide:not(.is-interactive):not(.is-editor) .aw-guide-step__frame-arrows {
	display: none;
}

@media (max-width: 781px) {
	.aw-guide-step__frame-tabs {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
	}

	.aw-guide-step__frame-tab {
		flex: 0 0 min(15rem, 75%);
		scroll-snap-align: start;
	}

	.aw-guide-step__content-head {
		flex-wrap: wrap;
		align-items: center;
	}
}
