/*
 * Editor de VisuBloq: estilos fuera del Shadow DOM.
 * - Tipografía Bricolage Grotesque (alojada aquí; las @font-face no funcionan dentro del Shadow DOM).
 * - Posición del editor (#vbe): a pantalla completa en cuanto llega una foto. El recortador antiguo
 *   (Croppie de index.js) queda debajo, sin usar: el encuadre se hace en el editor.
 * Va después de los estilos de index.html y gana con más especificidad o !important donde ellos lo usan.
 */

@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("fuentes/bricolage-grotesque-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Bricolage Grotesque";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("fuentes/bricolage-grotesque-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	/* Solo diseño claro, también con el móvil en modo oscuro. */
	color-scheme: only light;
	--vbe-barra: 64px;
	--vbe-fuente: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (max-width: 600px) {
	:root {
		--vbe-barra: 56px;
	}
}

/* ---------- El editor ---------- */

/* Un deslizamiento lateral dentro del editor no debe tomarse como "atrás" del navegador. */
html:has(body.vbe-activo),
body.vbe-activo {
	overscroll-behavior: none;
}

#vbe {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 100000;
	height: var(--vbe-barra);
}

#vbe[data-paso="0"] {
	display: none;
}

#vbe[data-paso="2"] {
	bottom: 0;
	height: auto;
}

/* La barra antigua ("NEXT") la sustituye la del editor: no se enseña nunca, tampoco mientras carga. */
#crop-topbar {
	display: none !important;
}

/* ---------- Debajo del editor ---------- */

html body.vbe-activo {
	background-color: #f2f1ed !important;
	background-image: radial-gradient(rgba(0, 0, 0, 0.07) 1.2px, transparent 1.3px) !important;
	background-size: 16px 16px !important;
}

/* Pantalla de "creando el mosaico" (index.js la enseña al aplicar). */
body.vbe-activo #lego-preview-loading-overlay {
	gap: 16px;
	background: #fff !important;
}

body.vbe-activo #lego-preview-loading-overlay::after {
	content: "Creando tu mosaico…";
	color: #000;
	font-family: var(--vbe-fuente) !important;
	font-size: 1.125rem;
	font-weight: 700;
}

body.vbe-activo .lego-preview-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid #e4e2da;
	border-top-color: #cd2928;
}
