/* =============================================================
   Home dashboard toast ticker — stacked items scrolling upward.
   6 toasts visible on desktop, 2 on narrow screens; every cycle
   the top toast fades out, the track scrolls up one slot and a
   new toast fades in at the bottom.
   Loaded after home.css: overrides the single-slot crossfade and
   neutralizes the legacy .active rotation left in home.js (the new
   toasts.js drives .is-in / .is-out instead).
   ============================================================= */

.vd-toasts {
	/* one slot = 40px toast + 6px gap */
	--vd-toast-slot: 46px;
	height: calc(6 * var(--vd-toast-slot));
	overflow: hidden;
}

.vd-toast-track {
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: transform .45s ease;
	will-change: transform;
}

.vd-toasts .vd-home-toast {
	position: relative;
	inset: auto;
	height: 40px;
	flex: none;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .45s ease, transform .45s ease;
}

/* Legacy rotation class from home.js — keep it visually inert. */
.vd-toasts .vd-home-toast.active {
	opacity: 0;
	transform: translateY(14px);
}

/* Leaving toast (top of the stack): fade out while sliding up. */
.vd-toasts .vd-home-toast.is-out {
	opacity: 0;
	transform: translateY(-14px);
}

/* Visible toast: slide up into place while fading in. */
.vd-toasts .vd-home-toast.is-in {
	opacity: 1;
	transform: translateY(0);
}

/* The dashboard card must grow to fit the taller toast stack, and is
   widened so the toast text has room to breathe. The .vd-hero prefix
   beats the plain .vd-showcase rules in home.css / mobile.css
   regardless of load order (incl. the 240px width at <=1400px). */
.vd-hero .vd-showcase {
	width: 330px;
	height: 450px;
}

/* The showcase is absolutely positioned and vertically centered, so the
   hero card must be at least as tall as it (450px + 36px padding x2),
   otherwise the card pokes out of the hero above and below. Only at the
   breakpoints where the showcase is absolute (<=1180px it is in flow). */
@media (min-width: 1181px) {
	.vd-hero {
		min-height: 522px;
	}

	/* Stretch the showcase to the hero's inner box (36px padding) so the
	   dashboard card always matches the copy column height, no matter how
	   long the (translated) copy is. */
	.vd-hero .vd-showcase {
		top: 36px;
		bottom: 36px;
		height: auto;
		transform: none;
	}
}

@media (max-width: 1180px) {
	/* Keep the full-width treatment from home.css at this breakpoint.
	   6 toast slots (276px) + content + paddings need the extra height. */
	.vd-hero .vd-showcase {
		width: 100%;
		max-width: 540px;
		height: 575px;
	}
}

@media (max-width: 920px) {
	.vd-toasts {
		height: calc(2 * var(--vd-toast-slot));
	}

	.vd-hero .vd-showcase {
		height: 400px;
	}
}

@media (max-width: 640px) {
	.vd-hero .vd-showcase {
		height: 420px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vd-toast-track {
		transition: none;
	}

	.vd-toasts .vd-home-toast,
	.vd-toasts .vd-home-toast.active,
	.vd-toasts .vd-home-toast.is-out,
	.vd-toasts .vd-home-toast.is-in {
		transform: none;
		transition: opacity .45s ease;
	}
}
