/* TM Transitions */

:root {
	--tmt-color: #111;
	--tmt-text: #fff;
}

/* Overlay sopra tutto (anche barra admin e header fissi) */
.tmt-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	visibility: hidden;
	overflow: hidden;
}
html.tmt-busy .tmt-overlay {
	visibility: visible;
	pointer-events: auto;
}
.tmt-panel {
	position: absolute;
	inset: 0;
	background: var(--tmt-color);
	will-change: transform, opacity;
}
.tmt-curtain {
	position: absolute;
	inset: 0;
	visibility: hidden;
	will-change: transform;
}
.tmt-cols {
	position: absolute;
	inset: 0;
	display: flex;
	visibility: hidden;
}
.tmt-cols > span {
	flex: 1 1 0;
	height: 100%;
	transform: scaleY(0);
	/* evita le righe sottili tra una colonna e l'altra */
	margin-right: -1px;
	will-change: transform;
}
.tmt-liquid {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	visibility: hidden;
}
.tmt-content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	color: var(--tmt-text);
	text-align: center;
	pointer-events: none;
}
.tmt-logo {
	display: block;
	max-width: min(40vw, 260px);
	max-height: 30vh;
	opacity: 0;
	will-change: transform, opacity;
}
.tmt-logo[hidden] {
	display: none;
}
.tmt-label {
	display: block;
	font-size: clamp(2rem, 6vw, 5.5rem);
	line-height: 1;
	font-weight: 500;
	letter-spacing: -0.02em;
	opacity: 0;
	padding: 0 1rem;
	will-change: transform, opacity;
}
.tmt-label:empty {
	display: none;
}

/* Durante il cambio pagina niente clic sulla pagina e niente scroll */
html.tmt-busy:not(.tmt-has-loader),
html.tmt-busy:not(.tmt-has-loader) body {
	cursor: progress;
}
/* con il "Caricamento vicino al mouse" attivo resta la freccia normale del
   mouse (niente rotellina di attesa) e accanto gira l'icona scelta */
html.tmt-busy.tmt-has-loader,
html.tmt-busy.tmt-has-loader * {
	cursor: default !important;
}
html.tmt-busy .tmt-container {
	pointer-events: none;
}

/* Il wrapper di barba non deve cambiare il layout del tema */
.tmt-wrapper,
.tmt-container {
	display: contents;
}
/* …ma il contenitore va misurato e animato: lo rendiamo un blocco solo quando serve */
.tmt-container.tmt-box {
	display: block;
}

/* Entrata automatica dei contenuti */
.tmt-in-line {
	display: block;
}
.tmt-in-mask {
	overflow: clip;
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.tmt-logo,
	.tmt-label {
		transition: none;
	}
}

/* Caricamento vicino al mouse */
.tmt-loader {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 2147483001;
	width: var(--tmt-loader-size, 36px);
	height: var(--tmt-loader-size, 36px);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
	will-change: transform;
}
.tmt-loader.is-on {
	opacity: 1;
}
.tmt-loader__img {
	display: block;
	width: 100%;
	height: 100%;
	background: center / contain no-repeat;
	animation: tmt-spin var(--tmt-loader-speed, 1s) linear infinite;
}
.tmt-loader:not(.has-image) .tmt-loader__img {
	border-radius: 50%;
	border: 3px solid currentColor;
	border-right-color: transparent;
	color: #fff;
}
/* cerchio bianco in "differenza": si vede sia su sfondi chiari sia scuri */
.tmt-loader:not(.has-image) {
	mix-blend-mode: difference;
}
.tmt-loader.no-spin .tmt-loader__img {
	animation: none;
}
@keyframes tmt-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (hover: none) {
	.tmt-loader {
		display: none;
	}
}

/* Menu "prova le transizioni" */
.tmt-switcher[hidden] {
	display: none !important;
}
.tmt-switcher {
	font: 500 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #111;
}
.tmt-switcher__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.tmt-switcher__item,
.tmt-switcher__toggle {
	appearance: none;
	border: 1px solid rgba(0, 0, 0, 0.15);
	background: #fff;
	color: #111;
	border-radius: 999px;
	padding: 7px 14px;
	font: inherit;
	cursor: pointer;
	line-height: 1.2;
	transition: background 0.15s, color 0.15s;
}
.tmt-switcher__item:hover {
	background: #f1f1f1;
}
.tmt-switcher__item.is-active {
	background: #111;
	color: #fff;
	border-color: #111;
}
.tmt-switcher--float {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 2147482000;
	max-width: min(360px, calc(100vw - 32px));
}
.tmt-switcher--float .tmt-switcher__toggle {
	background: #111;
	color: #fff;
	border-color: #111;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.tmt-switcher--float .tmt-switcher__list {
	display: none;
	position: absolute;
	left: 0;
	bottom: calc(100% + 8px);
	width: max-content;
	max-width: min(360px, calc(100vw - 32px));
	flex-direction: column;
	align-items: stretch;
	padding: 8px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.tmt-switcher--float.is-open .tmt-switcher__list {
	display: flex;
}
.tmt-switcher--float .tmt-switcher__item {
	border-radius: 8px;
	border-color: transparent;
	text-align: left;
}

/* Header fisso tra le pagine: sopra la transizione */
html.tmt-header-above .tmt-header-kept {
	z-index: 2147483100 !important;
}
