/* Velora Motion: features (PROPOSED). Colour switch, inline SVG logo, colour-mode transitions. CSS only, tokens with fallbacks. */

/* Colour-mode switch block (velora/appearance): a form of buttons, server-side cookie, no script. */
.vl-theme-switch { display: inline-flex; gap: 2px; padding: 2px; margin: 0; border: 1px solid var(--vl-border-subtle, currentColor); border-radius: 999px; font-size: var(--wp--preset--font-size--small, .875rem); }
.vl-theme-switch button { all: unset; box-sizing: border-box; cursor: pointer; padding: .25rem .75rem; border-radius: 999px; }
.vl-theme-switch button[aria-pressed="true"] { background: var(--wp--preset--color--text); color: var(--wp--preset--color--bg); }
.vl-theme-switch button:focus-visible { outline: 2px solid var(--wp--preset--color--primary); outline-offset: 2px; }
.vl-theme-switch.is-compact { border: 0; padding: 0; }
.vl-theme-switch.is-compact button { padding: .25rem .5rem; }


/* Inline SVG logo (inc/media.php): parts animated by Velora attributes need a local origin. */
.vl-logo-svg { height: auto; max-width: 100%; }
.vl-logo-svg [vl-enter], .vl-logo-svg [vl-loop-effect], .vl-logo-svg [vl-hover] { transform-box: fill-box; transform-origin: center; }
.wp-block-site-logo[style*="--vl-logo-h"] img { height: var(--vl-logo-h); width: auto; max-width: 100%; }


/* ---- Colour mode transitions (PROPOSED, theme-local) -------------------------------------------
   Used by assets/js/appearance.js through document.startViewTransition(); data-vl-vt is set only
   while a transition runs. Names follow the Velora page-transition presets (velora, wipe, glide,
   iris, cinema, snap) but these rules are NOT the core 05-transitions.css: replace them with the
   core file when it is vendored. No effect without the View Transitions API or with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	html[data-vl-vt]::view-transition-old(root),
	html[data-vl-vt]::view-transition-new(root) {
		animation-duration: var(--vl-vt-dur, 600ms);
		animation-timing-function: cubic-bezier(.65, 0, .35, 1);
		animation-fill-mode: both;
		mix-blend-mode: normal;
	}
	html[data-vl-vt]::view-transition-old(root) { z-index: 1; }
	html[data-vl-vt]::view-transition-new(root) { z-index: 2; }

	html[data-vl-vt="fade"]::view-transition-old(root) { animation-name: vl-vt-out; }
	html[data-vl-vt="fade"]::view-transition-new(root) { animation-name: vl-vt-in; }

	html[data-vl-vt="velora"]::view-transition-old(root) { animation-name: vl-vt-out-soft; }
	html[data-vl-vt="velora"]::view-transition-new(root) { animation-name: vl-vt-in-soft; }

	html[data-vl-vt="wipe"]::view-transition-old(root) { animation: none; }
	html[data-vl-vt="wipe"]::view-transition-new(root) { animation-name: vl-vt-wipe; }

	html[data-vl-vt="iris"]::view-transition-old(root) { animation: none; }
	html[data-vl-vt="iris"]::view-transition-new(root) { animation-name: vl-vt-iris; }

	html[data-vl-vt="glide"]::view-transition-old(root) { animation-name: vl-vt-glide-out; }
	html[data-vl-vt="glide"]::view-transition-new(root) { animation-name: vl-vt-glide-in; }

	html[data-vl-vt="cinema"]::view-transition-old(root) { animation-name: vl-vt-out; }
	html[data-vl-vt="cinema"]::view-transition-new(root) { animation-name: vl-vt-cinema; }

	html[data-vl-vt="snap"]::view-transition-old(root) { animation-name: vl-vt-out; }
	html[data-vl-vt="snap"]::view-transition-new(root) { animation-name: vl-vt-snap; }
}
@keyframes vl-vt-out { to { opacity: 0; } }
@keyframes vl-vt-in { from { opacity: 0; } }
@keyframes vl-vt-out-soft { to { opacity: 0; filter: blur(6px); scale: .985; } }
@keyframes vl-vt-in-soft { from { opacity: 0; filter: blur(6px); scale: 1.015; } }
@keyframes vl-vt-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes vl-vt-iris { from { clip-path: circle(0 at var(--vl-vt-x, 50%) var(--vl-vt-y, 50%)); } to { clip-path: circle(150vmax at var(--vl-vt-x, 50%) var(--vl-vt-y, 50%)); } }
@keyframes vl-vt-glide-out { to { opacity: 0; translate: -6% 0; } }
@keyframes vl-vt-glide-in { from { opacity: 0; translate: 6% 0; } }
@keyframes vl-vt-cinema { from { opacity: 0; filter: blur(10px); scale: 1.04; clip-path: inset(6% 0); } to { clip-path: inset(0); } }
@keyframes vl-vt-snap { from { opacity: 0; translate: 0 1.5%; rotate: .5deg; } }


/* ---- SVG logo colour roles (inc/svg.php rewrites hard-coded colours to these hooks) ------------
   ink = the surrounding text colour, paper = the surrounding background, muted = secondary text.
   Parts with no colour at all inherit the ink, so they never vanish on dark pages. Brand colours
   keep their original value unless --vl-logo-cN is set (Appearance > Velora Settings). */
.vl-logo-svg {
	--vl-logo-ink: currentColor;
	--vl-logo-paper: var(--wp--preset--color--bg);
	--vl-logo-muted: var(--wp--preset--color--muted);
	fill: var(--vl-logo-ink);
	color: inherit;
}
