/* ===========================================================================
   terminal.css — complemento di theme.json (stile "Command Prompt")
   ---------------------------------------------------------------------------
   theme.json non può contenere @keyframes né @media: il suo parser CSS
   spezza le regole sul carattere "&" e le at-rules verrebbero corrotte.
   Tutto ciò che è animazione o media query vive quindi qui.

   Caricalo dal tema (vedi README) o incollalo in
   Aspetto > Personalizza > CSS aggiuntivo.
   =========================================================================== */

/* ---------- animazioni usate da theme.json ---------- */

@keyframes term-blink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0;
	}
}

@keyframes term-type {
	from {
		width: 0;
	}
	to {
		width: 100%;
	}
}

/* Il caret del typing lampeggia sul bordo, non sull'opacità:
   animare l'opacità farebbe sparire anche il testo. */
@keyframes term-caret {
	0%,
	49% {
		border-right-color: var(--wp--preset--color--phosphor, #00ff41);
	}
	50%,
	100% {
		border-right-color: transparent;
	}
}

@keyframes term-flicker {
	0%,
	92%,
	100% {
		opacity: 1;
	}
	93% {
		opacity: 0.82;
	}
	94% {
		opacity: 1;
	}
	96% {
		opacity: 0.9;
	}
	97% {
		opacity: 1;
	}
}

@keyframes term-boot {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- effetto "boot" all'ingresso in pagina ---------- */

.term-boot > * {
	animation: term-boot 0.5s ease-out both;
}
.term-boot > *:nth-child(2) {
	animation-delay: 0.12s;
}
.term-boot > *:nth-child(3) {
	animation-delay: 0.24s;
}
.term-boot > *:nth-child(4) {
	animation-delay: 0.36s;
}
.term-boot > *:nth-child(5) {
	animation-delay: 0.48s;
}

/* ---------- scrollbar in stile terminale (WebKit) ---------- */

::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}
::-webkit-scrollbar-track {
	background: var(--wp--preset--color--base, #0a0e0a);
}
::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--phosphor-dim, #00a82d);
	border: 3px solid var(--wp--preset--color--base, #0a0e0a);
}
::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--phosphor, #00ff41);
}

/* ---------- caret di input verde ---------- */

input,
textarea,
select {
	caret-color: var(--wp--preset--color--phosphor, #00ff41);
}

/* ---------- schermi piccoli: scanline meno invasive ---------- */

@media (max-width: 600px) {
	body::before {
		opacity: 0.35;
	}
	body::after {
		background: radial-gradient(
			ellipse at center,
			rgba(0, 0, 0, 0) 60%,
			rgba(0, 0, 0, 0.45) 100%
		);
	}
}

/* ---------- accessibilità: nessun movimento ---------- */

@media (prefers-reduced-motion: reduce) {
	h1::after,
	.wp-block-post-title::after,
	.term-cursor::after,
	.term-typing,
	.term-flicker,
	.term-boot > * {
		animation: none !important;
	}
	.term-typing {
		width: auto;
		border-right: 0;
	}
}

/* ---------- stampa: torna leggibile su carta ---------- */

@media print {
	body::before,
	body::after {
		display: none !important;
	}
	body {
		background: #fff !important;
		color: #000 !important;
		text-shadow: none !important;
	}
	h1::after,
	.wp-block-post-title::after {
		display: none !important;
	}
}
