.amo-org,
.amo-org * {
	box-sizing: border-box;
}

.amo-org {
	--amo-accent: #d6202f;
	--amo-ink: #17202a;
	--amo-muted: #647182;
	--amo-line: #dfe4ea;
	--amo-soft: #f6f7f8;
	--amo-white: #fff;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	color: var(--amo-ink);
	font-family: inherit;
	line-height: 1.55;
}

.amo-org__header {
	position: relative;
	overflow: hidden;
	padding: clamp(28px, 5vw, 62px);
	border-radius: 24px;
	background:
		radial-gradient(circle at 88% 18%, rgb(255 255 255 / 20%) 0 7%, transparent 7.5%),
		linear-gradient(135deg, #a31322, var(--amo-accent));
	color: var(--amo-white);
	box-shadow: 0 18px 48px rgb(42 20 24 / 16%);
}

.amo-org__header::after {
	content: "";
	position: absolute;
	right: -70px;
	bottom: -140px;
	width: 300px;
	height: 300px;
	border: 46px solid rgb(255 255 255 / 9%);
	border-radius: 50%;
}

.amo-org__header h2 {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 0;
	color: inherit;
	font-size: clamp(2rem, 5vw, 4.5rem);
	font-weight: 800;
	letter-spacing: -0.045em;
	line-height: 0.98;
}

.amo-org__eyebrow,
.amo-org__kicker {
	margin: 0 0 8px;
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.13em;
	line-height: 1.25;
	text-transform: uppercase;
}

.amo-org__eyebrow {
	position: relative;
	z-index: 1;
	color: rgb(255 255 255 / 78%);
}

.amo-org__intro {
	position: relative;
	z-index: 1;
	max-width: 680px;
	margin: 20px 0 0;
	color: rgb(255 255 255 / 88%);
	font-size: clamp(1rem, 2vw, 1.17rem);
}

.amo-org__nav {
	position: sticky;
	z-index: 20;
	top: var(--wp-admin--admin-bar--height, 0);
	display: flex;
	gap: 8px;
	overflow-x: auto;
	margin: 18px 0 30px;
	padding: 10px;
	border: 1px solid var(--amo-line);
	border-radius: 16px;
	background: rgb(255 255 255 / 94%);
	box-shadow: 0 8px 24px rgb(23 32 42 / 7%);
	backdrop-filter: blur(12px);
	scrollbar-width: thin;
}

.amo-org__nav a {
	flex: 0 0 auto;
	padding: 9px 13px;
	border-radius: 9px;
	color: var(--amo-ink);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease;
}

.amo-org__nav a:hover,
.amo-org__nav a:focus-visible,
.amo-org__nav a[aria-current="true"] {
	background: var(--amo-accent);
	color: var(--amo-white);
	outline: none;
}

.amo-org__map-wrap {
	margin: 0 0 30px;
	padding: clamp(20px, 3vw, 34px);
	border: 1px solid var(--amo-line);
	border-radius: 22px;
	background: var(--amo-soft);
}

.amo-org__map-heading,
.amo-org__area-header,
.amo-org__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.amo-org__map-heading {
	margin-bottom: 28px;
}

.amo-org__map-heading h3,
.amo-org__area-header h3 {
	margin: 0;
	color: var(--amo-ink);
	font-size: clamp(1.45rem, 3vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.12;
}

.amo-org__map-heading > p {
	max-width: 340px;
	margin: 0;
	color: var(--amo-muted);
	font-size: 0.92rem;
	text-align: right;
}

.amo-org__kicker {
	color: var(--amo-area-color, var(--amo-accent));
}

.amo-org__map {
	position: relative;
	isolation: isolate;
}

.amo-org__map-desktop {
	position: relative;
}

.amo-org__map-mobile {
	display: none;
}

.amo-org__connectors {
	position: absolute;
	z-index: -1;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.amo-org__connectors path {
	fill: none;
	stroke: #aab3bf;
	stroke-linecap: round;
	stroke-width: 2;
}

.amo-org__level {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin-top: 36px;
}

.amo-org__level:first-of-type {
	margin-top: 0;
}

.amo-org__node {
	position: relative;
	display: flex;
	flex: 0 1 260px;
	flex-direction: column;
	min-width: min(220px, 100%);
	padding: 18px 18px 16px;
	border: 1px solid var(--amo-line);
	border-top: 4px solid var(--amo-area-color, var(--amo-accent));
	border-radius: 14px;
	background: var(--amo-white);
	box-shadow: 0 7px 18px rgb(23 32 42 / 7%);
	color: var(--amo-ink);
	text-decoration: none;
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.amo-org__node:hover,
.amo-org__node:focus-visible {
	transform: translateY(-3px);
	border-color: var(--amo-area-color, var(--amo-accent));
	box-shadow: 0 12px 25px rgb(23 32 42 / 12%);
	outline: none;
}

.amo-org__node-label {
	margin-bottom: 7px;
	color: var(--amo-area-color, var(--amo-accent));
	font-size: 0.67rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1.2;
	text-transform: uppercase;
}

.amo-org__node strong {
	font-size: 1rem;
	line-height: 1.25;
}

.amo-org__node > span:last-child:not(.amo-org__node-label) {
	margin-top: 8px;
	color: var(--amo-muted);
	font-size: 0.78rem;
	line-height: 1.3;
}

.amo-org__toolbar {
	margin: 34px 0 16px;
	padding: 0 4px;
}

.amo-org__toolbar > span {
	font-size: 0.86rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.amo-org__toolbar > div {
	display: flex;
	gap: 8px;
}

.amo-org__toolbar button {
	padding: 8px 12px;
	border: 1px solid var(--amo-line);
	border-radius: 9px;
	background: var(--amo-white);
	color: var(--amo-ink);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

.amo-org__toolbar button:hover,
.amo-org__toolbar button:focus-visible {
	border-color: var(--amo-accent);
	color: var(--amo-accent);
	outline: none;
}

.amo-org__sections {
	display: grid;
	gap: 26px;
}

.amo-org__area {
	scroll-margin-top: 100px;
	padding: clamp(20px, 4vw, 40px);
	border: 1px solid var(--amo-line);
	border-top: 5px solid var(--amo-area-color, var(--amo-accent));
	border-radius: 20px;
	background: var(--amo-white);
	box-shadow: 0 12px 38px rgb(23 32 42 / 7%);
}

.amo-org__area:focus {
	outline: 3px solid color-mix(in srgb, var(--amo-area-color, var(--amo-accent)) 30%, transparent);
	outline-offset: 3px;
}

.amo-org__count {
	flex: 0 0 auto;
	padding: 7px 11px;
	border-radius: 999px;
	background: var(--amo-soft);
	color: var(--amo-muted);
	font-size: 0.78rem;
	font-weight: 700;
}

.amo-org__area-description {
	max-width: 850px;
	margin: 18px 0 26px;
	color: var(--amo-muted);
	font-size: 0.98rem;
}

.amo-org__area-description > :first-child,
.amo-org__role-content > :first-child,
.amo-org__bio > :first-child {
	margin-top: 0;
}

.amo-org__area-description > :last-child,
.amo-org__role-content > :last-child,
.amo-org__bio > :last-child {
	margin-bottom: 0;
}

.amo-org__role-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.amo-org__role-list .amo-org__role-list {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin: 12px 0 0 28px;
	padding-left: 20px;
}

.amo-org__role-list .amo-org__role-list--single {
	grid-template-columns: minmax(0, 1fr);
}

.amo-org__role-list .amo-org__role-list::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 12px;
	left: 2px;
	width: 2px;
	border-radius: 2px;
	background: color-mix(in srgb, var(--amo-area-color, var(--amo-accent)) 24%, var(--amo-line));
}

.amo-org__role-item {
	min-width: 0;
	margin: 0 0 12px;
}

.amo-org__role-list .amo-org__role-list > .amo-org__role-item {
	margin: 0;
}

.amo-org__role {
	overflow: hidden;
	border: 1px solid var(--amo-line);
	border-radius: 14px;
	background: var(--amo-white);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.amo-org__role[open] {
	border-color: color-mix(in srgb, var(--amo-area-color, var(--amo-accent)) 40%, var(--amo-line));
	box-shadow: 0 8px 24px rgb(23 32 42 / 6%);
}

.amo-org__role summary {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr) 20px;
	align-items: center;
	gap: 13px;
	min-height: 74px;
	padding: 13px 16px;
	list-style: none;
	cursor: pointer;
}

.amo-org__role summary::-webkit-details-marker {
	display: none;
}

.amo-org__role summary:hover,
.amo-org__role summary:focus-visible {
	background: color-mix(in srgb, var(--amo-area-color, var(--amo-accent)) 5%, white);
	outline: none;
}

.amo-org__avatar {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

.amo-org__avatar--initials {
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--amo-area-color, var(--amo-accent)) 12%, white);
	color: var(--amo-area-color, var(--amo-accent));
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.amo-org__role-heading {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.amo-org__role-heading strong {
	font-size: 1rem;
	line-height: 1.25;
}

.amo-org__role-title {
	color: var(--amo-muted);
	font-size: 0.84rem;
	font-weight: 600;
	line-height: 1.35;
}

.amo-org__chevron {
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--amo-muted);
	border-bottom: 2px solid var(--amo-muted);
	transform: rotate(45deg) translateY(-2px);
	transition: transform 160ms ease;
}

.amo-org__role[open] .amo-org__chevron {
	transform: rotate(225deg) translate(-2px, -2px);
}

.amo-org__role-content {
	padding: 2px 20px 20px 74px;
	color: var(--amo-ink);
	font-size: 0.93rem;
}

.amo-org__summary {
	margin: 0 0 16px;
	color: var(--amo-muted);
	font-weight: 600;
}

.amo-org__role-content h4 {
	margin: 0 0 8px;
	color: var(--amo-area-color, var(--amo-accent));
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.amo-org__functions {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.amo-org__functions li {
	position: relative;
	padding-left: 18px;
}

.amo-org__functions li::before {
	content: "";
	position: absolute;
	top: 0.66em;
	left: 1px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--amo-area-color, var(--amo-accent));
}

.amo-org__bio {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--amo-line);
	color: var(--amo-muted);
}

.amo-org__empty {
	margin: 20px 0 0;
	padding: 16px;
	border-radius: 12px;
	background: var(--amo-soft);
	color: var(--amo-muted);
}

@media (max-width: 760px) {
	.amo-org__header {
		border-radius: 18px;
	}

	.amo-org__nav {
		top: 0;
		margin-bottom: 22px;
		border-radius: 12px;
	}

	.admin-bar .amo-org__nav {
		top: 46px;
	}

	.amo-org__map-heading,
	.amo-org__area-header,
	.amo-org__toolbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.amo-org__map-heading > p {
		text-align: left;
	}

	.amo-org__map-desktop {
		display: none;
	}

	.amo-org__map-mobile {
		display: block;
	}

	.amo-org__mobile-tree,
	.amo-org__mobile-children {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.amo-org__mobile-item {
		position: relative;
		margin: 0 0 14px;
	}

	.amo-org__mobile-node {
		z-index: 2;
		width: 100%;
		min-width: 0;
		max-width: none;
	}

	/* Tratto verticale in uscita dalla card che possiede dei figli. */
	.amo-org__mobile-item--has-children > .amo-org__mobile-node::after {
		content: "";
		position: absolute;
		z-index: 1;
		bottom: -17px;
		left: 13px;
		height: 17px;
		border-left: 3px solid var(--amo-node-color);
	}

	/* Il rientro crea una corsia dedicata ai collegamenti, esterna alle card. */
	.amo-org__mobile-children {
		position: relative;
		margin: 14px 0 0 13px;
		padding-left: 17px;
		border-left: 3px solid var(--amo-node-color);
	}

	/* Ramo orizzontale dal tronco alla singola area figlia. */
	.amo-org__mobile-children > .amo-org__mobile-item::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 35px;
		left: -17px;
		width: 17px;
		border-top: 3px solid var(--amo-parent-color);
	}

	/* Punto di innesto: rende inequivocabile la card raggiunta dal ramo. */
	.amo-org__mobile-children > .amo-org__mobile-item > .amo-org__mobile-node::before {
		content: "";
		position: absolute;
		z-index: 3;
		top: 31px;
		left: -5px;
		width: 9px;
		height: 9px;
		border: 2px solid var(--amo-white);
		border-radius: 50%;
		background: var(--amo-parent-color);
		box-shadow: 0 0 0 1px var(--amo-parent-color);
	}

	/* Il tronco termina esattamente in corrispondenza dell’ultimo figlio. */
	.amo-org__mobile-children > .amo-org__mobile-item:last-child::after {
		content: "";
		position: absolute;
		z-index: 0;
		top: 38px;
		bottom: -15px;
		left: -20px;
		width: 6px;
		background: var(--amo-soft);
	}

	.amo-org__toolbar > div {
		width: 100%;
	}

	.amo-org__toolbar button {
		flex: 1;
	}

	.amo-org__role-list .amo-org__role-list {
		grid-template-columns: 1fr;
		margin-left: 10px;
		padding-left: 13px;
	}

	.amo-org__role summary {
		grid-template-columns: 40px minmax(0, 1fr) 18px;
		gap: 10px;
		padding: 12px;
	}

	.amo-org__avatar {
		width: 38px;
		height: 38px;
	}

	.amo-org__role-content {
		padding: 4px 14px 17px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amo-org *,
	.amo-org *::before,
	.amo-org *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

@media print {
	.amo-org__nav,
	.amo-org__toolbar,
	.amo-org__connectors {
		display: none !important;
	}

	.amo-org__header,
	.amo-org__map-wrap,
	.amo-org__area {
		box-shadow: none;
	}

	.amo-org__area {
		break-inside: avoid;
	}
}
