/**
 * Aura Prima & Dopo — stile frontend
 * Palette Aura Dimore: ottanio #1B3B36 · terracotta #C87D65 · sabbia #F3EDE2
 */

.aura-ba {
	--aura-ba-ottanio: #1B3B36;
	--aura-ba-ottanio-light: #2C5650;
	--aura-ba-terracotta: #C87D65;
	--aura-ba-sabbia-light: #FBF9F5;
	--aura-ba-sabbia-dark: #E7DEC8;
	--aura-ba-h: 480px;
	--aura-ba-h-mob: 320px;
	--aura-ba-pos: 50%;

	box-sizing: border-box;
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 0 1.5rem;
	font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--aura-ba-ottanio);
}

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

/* --- Cornice bianca (come il blocco hero) --- */
.aura-ba--framed {
	background: #ffffff;
	padding: 12px;
	border-radius: 16px;
	border: 1px solid rgba(231, 222, 200, 0.6);
	box-shadow: 0 10px 30px rgba(15, 40, 36, 0.05);
}

/* --- Intestazione --- */
.aura-ba__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 12px;
	margin-bottom: 8px;
}

.aura-ba__head-title {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--aura-ba-ottanio);
	line-height: 1.3;
}

.aura-ba__icon {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	color: var(--aura-ba-terracotta);
}

.aura-ba__head-hint {
	font-size: 12px;
	color: rgba(27, 59, 54, 0.6);
	white-space: nowrap;
}

/* --- Palcoscenico --- */
.aura-ba__stage {
	position: relative;
	width: 100%;
	height: var(--aura-ba-h);
	overflow: hidden;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	-webkit-user-select: none;
	user-select: none;
	touch-action: pan-y;
	background: #e9e9e9;
}

.aura-ba--vertical .aura-ba__stage {
	touch-action: pan-x;
}

.aura-ba__layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.aura-ba__layer img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	margin: 0;
	max-width: none;
	pointer-events: none;
	-webkit-user-drag: none;
	user-select: none;
}

.aura-ba__layer--after {
	z-index: 10;
	clip-path: inset(0 calc(100% - var(--aura-ba-pos)) 0 0);
}

.aura-ba--vertical .aura-ba__layer--after {
	clip-path: inset(0 0 calc(100% - var(--aura-ba-pos)) 0);
}

/* --- Etichette --- */
.aura-ba__label {
	position: absolute;
	bottom: 16px;
	z-index: 2;
	display: inline-block;
	padding: 4px 12px;
	border-radius: 9999px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: #ffffff;
	white-space: nowrap;
	max-width: calc(100% - 32px);
	overflow: hidden;
	text-overflow: ellipsis;
}

.aura-ba__label--before {
	right: 16px;
	background: rgba(27, 59, 54, 0.8);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.aura-ba__label--after {
	left: 16px;
	background: var(--aura-ba-terracotta);
	box-shadow: 0 2px 8px rgba(15, 40, 36, 0.15);
}

.aura-ba--vertical .aura-ba__label--before {
	bottom: 16px;
	right: 16px;
}

.aura-ba--vertical .aura-ba__label--after {
	bottom: auto;
	top: 16px;
	left: 16px;
}

/* --- Maniglia --- */
.aura-ba__handle {
	position: absolute;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	padding: 0;
	top: 0;
	bottom: 0;
	left: var(--aura-ba-pos);
	width: 44px;
	margin-left: -22px;
	cursor: ew-resize;
}

.aura-ba--vertical .aura-ba__handle {
	left: 0;
	right: 0;
	top: var(--aura-ba-pos);
	bottom: auto;
	width: auto;
	height: 44px;
	margin-left: 0;
	margin-top: -22px;
	cursor: ns-resize;
}

.aura-ba__handle:focus {
	outline: none;
}

.aura-ba__handle:focus-visible .aura-ba__circle {
	box-shadow: 0 0 0 3px rgba(200, 125, 101, 0.7), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aura-ba__line {
	position: absolute;
	background: #ffffff;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
}

.aura-ba--vertical .aura-ba__line {
	top: 50%;
	bottom: auto;
	left: 0;
	right: 0;
	width: auto;
	height: 2px;
	margin-left: 0;
	margin-top: -1px;
}

.aura-ba__circle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid var(--aura-ba-ottanio);
	color: var(--aura-ba-ottanio);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease;
}

.aura-ba__circle svg {
	width: 16px;
	height: 16px;
}

.aura-ba--vertical .aura-ba__circle svg {
	transform: rotate(90deg);
}

.aura-ba__handle:hover .aura-ba__circle,
.aura-ba__handle:focus-visible .aura-ba__circle {
	transform: scale(1.1);
}

.aura-ba.is-dragging .aura-ba__circle {
	transform: scale(1.06);
}

.aura-ba.is-dragging {
	cursor: ew-resize;
}

/* --- Piede --- */
.aura-ba__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 12px;
	padding: 12px;
	border-radius: 12px;
	background: var(--aura-ba-sabbia-light);
	font-size: 12px;
	line-height: 1.5;
	color: rgba(27, 59, 54, 0.8);
}

.aura-ba__caption strong {
	color: var(--aura-ba-ottanio);
	font-weight: 700;
}

.aura-ba__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--aura-ba-terracotta);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.aura-ba__link:hover {
	text-decoration: underline;
}

.aura-ba__link svg {
	width: 14px;
	height: 14px;
}

.aura-ba-error {
	padding: 12px 16px;
	border-left: 4px solid #C87D65;
	background: #FBF9F5;
	color: #1B3B36;
	font-size: 13px;
}

/* --- Mobile --- */
@media (max-width: 640px) {
	.aura-ba__stage {
		height: var(--aura-ba-h-mob);
	}

	.aura-ba__head {
		padding: 6px 4px;
		flex-wrap: wrap;
		gap: 4px;
	}

	.aura-ba__head-hint {
		font-size: 11px;
	}

	.aura-ba__label {
		font-size: 10px;
		padding: 3px 10px;
		bottom: 12px;
	}

	.aura-ba__label--before {
		right: 12px;
	}

	.aura-ba__label--after {
		left: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aura-ba__circle {
		transition: none;
	}
}
