/* 3D model viewer (templates/parts/model-viewer.php).
   Loaded only on pages that render a model — see
   alliance_child_enqueue_model_viewer() in functions.php.

   Background matches the studio poster renders so there's no visible
   change when the model replaces the poster. */

.au-model-viewer {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	background: radial-gradient(ellipse at 50% 60%, #fafaf9 0%, #e2e2e1 45%, #a9a8a6 100%);
	--poster-color: transparent;
	--progress-bar-color: var(--au-gold);
	outline: none;
}

/* Poster: also what shows if the script never loads (the element is
   then just an unknown inline element, so the <img> renders as-is). */
.au-model-viewer .au-model-viewer-poster {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Failed load: model-viewer keeps the poster up on its own; just hide the
   loading bar so it doesn't sit there half-full. */
.au-model-viewer.is-error::part(default-progress-bar) {
	display: none;
}

/* Before the custom element upgrades, keep the 4:3 box so the layout
   doesn't jump. */
model-viewer:not(:defined) {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
}
