/* Ópera Holgazana — tokens, night sky, header, footer, forms. */

/* Two palettes: night (navy) and day (eggshell, borderline white, the book pages' tint).
   The page follows the device unless the visitor picked a mode with the toggle (data-tema on <html>);
   the header and footer always wear the other palette. */
:root,
.oh-header,
.oh-pie {
	--oh-header-h: 64px;
	/* The header button: gold in both modes; on hover it takes the bar's ink. */
	--oh-boton: #cba25a;
	--oh-boton-texto: #000000;
}
:root,
:root[data-tema="claro"] .oh-header,
:root[data-tema="claro"] .oh-pie {
	--oh-bg: #050a12;
	--oh-ink: #f4eee5;
	--oh-accent: #cba25a;
	--oh-tan: #dad3c3;
	--oh-star: #ffffff;
	--oh-muted: rgba(244, 238, 229, .62);
	--oh-rule: rgba(244, 238, 229, .18);
	--oh-campo: rgba(244, 238, 229, .1);
	color-scheme: dark;
}
.oh-header,
.oh-pie,
:root[data-tema="claro"] {
	--oh-bg: #f9f7f1;
	--oh-ink: #1f1c18;
	--oh-accent: #8a6220;
	--oh-tan: #958c7e;
	--oh-star: #1f1c18;
	--oh-muted: rgba(31, 28, 24, .62);
	--oh-rule: rgba(31, 28, 24, .16);
	--oh-campo: rgba(31, 28, 24, .07);
	color-scheme: light;
}
@media (prefers-color-scheme: light) {
	:root:not([data-tema="oscuro"]) {
		--oh-bg: #f9f7f1;
		--oh-ink: #1f1c18;
		--oh-accent: #8a6220;
		--oh-tan: #958c7e;
		--oh-star: #1f1c18;
		--oh-muted: rgba(31, 28, 24, .62);
		--oh-rule: rgba(31, 28, 24, .16);
		--oh-campo: rgba(31, 28, 24, .07);
		color-scheme: light;
	}
	:root:not([data-tema="oscuro"]) .oh-header,
	:root:not([data-tema="oscuro"]) .oh-pie {
		--oh-bg: #050a12;
		--oh-ink: #f4eee5;
		--oh-accent: #cba25a;
		--oh-tan: #dad3c3;
		--oh-star: #ffffff;
		--oh-muted: rgba(244, 238, 229, .62);
		--oh-rule: rgba(244, 238, 229, .18);
		--oh-campo: rgba(244, 238, 229, .1);
		color-scheme: dark;
	}
}
/* Picked night with the toggle on a light device: the bars go back to day. */
:root[data-tema="oscuro"] .oh-header,
:root[data-tema="oscuro"] .oh-pie {
	--oh-bg: #f9f7f1;
	--oh-ink: #1f1c18;
	--oh-accent: #8a6220;
	--oh-tan: #958c7e;
	--oh-star: #1f1c18;
	--oh-muted: rgba(31, 28, 24, .62);
	--oh-rule: rgba(31, 28, 24, .16);
	--oh-campo: rgba(31, 28, 24, .07);
	color-scheme: light;
}

/* Mode toggle: a quiet round button in the header. */
.oh-tema {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--oh-rule);
	border-radius: 50%;
	background: transparent;
	color: var(--oh-ink);
	cursor: pointer;
}
.oh-tema:hover, .oh-tema:focus-visible { border-color: var(--oh-accent); color: var(--oh-accent); }
.oh-tema svg { width: 16px; height: 16px; }
.oh-tema__sol { display: none; }
@media (prefers-color-scheme: light) {
	:root:not([data-tema="oscuro"]) .oh-tema__sol { display: block; }
	:root:not([data-tema="oscuro"]) .oh-tema__luna { display: none; }
}
:root[data-tema="claro"] .oh-tema__sol { display: block; }
:root[data-tema="claro"] .oh-tema__luna { display: none; }

body {
	background: var(--oh-bg);
	color: var(--oh-ink);
}

/* Night sky (from lectura/css/style.css #starfield / .star). */
#cielo {
	position: fixed;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}
.estrella {
	position: absolute;
	width: 2px;
	height: 2px;
	background: var(--oh-star);
	border-radius: 50%;
	opacity: 0;
	animation: estrella-brillo 3s infinite ease-in-out;
}
@keyframes estrella-brillo {
	0%, 100% { opacity: 0; transform: scale(1); }
	50% { opacity: 1; transform: scale(1.6); }
}
@media (prefers-reduced-motion: reduce) {
	.estrella { animation: none; opacity: .5; }
}
.wp-site-blocks { position: relative; z-index: 1; }

/* Labels: small uppercase letter-spaced. */
.is-style-label {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .18em;
	color: var(--oh-accent);
}

/* Fixed header. */
.oh-header {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 50;
	box-sizing: border-box;
	gap: 16px 24px;
	padding: 14px clamp(16px, 3vw, 40px);
	color: var(--oh-ink); /* its own palette: the nav links inherit from here */
	background: color-mix(in srgb, var(--oh-bg) 97%, transparent); /* nearly solid: over the opposite palette, see-through reads grey */
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--oh-rule);
}
.oh-logo { display: block; line-height: 0; flex: 0 0 auto; }
.oh-logo svg { display: block; width: clamp(150px, 16vw, 210px); height: auto; color: var(--oh-ink); overflow: visible; }
/* The letters ink in one after another, left to right (~0.6 s in all). */
.oh-logo-espera .oh-logo path { opacity: 0; }
.oh-logo-espera.oh-logo-escrito .oh-logo path { animation: oh-tinta .26s cubic-bezier(.3, .6, .4, 1) calc(var(--i) * 24ms) both; }
@keyframes oh-tinta {
	from { opacity: 0; filter: blur(14px); }
	to { opacity: 1; filter: blur(0); }
}
.oh-header__der .oh-tema { order: 9; }
.oh-header__der { gap: 12px 28px; }
.oh-header .oh-nav { gap: 22px; }
.oh-header .oh-nav a { color: var(--oh-ink); text-decoration: none; }
.oh-header .oh-nav a:hover, .oh-header .oh-nav a:focus-visible { color: var(--oh-accent); }
.oh-header .wp-block-button__link {
	font-size: 14px;
	letter-spacing: .14em;
	text-transform: uppercase;
	padding: 9px 18px;
	white-space: nowrap;
}
/* Preordenar / Preventa: filled gold in both modes; on hover, the bar's ink. */
.oh-header .wp-block-button__link,
.oh-header .is-style-outline > .wp-block-button__link {
	background: var(--oh-boton);
	color: var(--oh-boton-texto);
	border: 1px solid var(--oh-boton);
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.oh-header .wp-block-button__link:hover,
.oh-header .wp-block-button__link:focus-visible {
	background: var(--oh-ink);
	border-color: var(--oh-ink);
	color: var(--oh-bg);
}
@media (max-width: 600px) {
	/* Logo and Preordenar share the first line; the three links take a second. */
	.oh-header { flex-wrap: wrap !important; row-gap: 6px; padding: 10px 14px 8px; }
	.oh-header__der { display: contents !important; }
	.oh-logo { order: 1; }
	.oh-header .oh-header__botones { order: 2; margin-left: auto; }
	.oh-header .oh-tema { order: 2; width: 30px; height: 30px; }
	.oh-header .oh-nav { order: 3; flex: 1 0 100%; justify-content: center; gap: 22px; font-size: 15px; letter-spacing: .02em; }
	.oh-header .oh-nav .wp-block-navigation__container { justify-content: center; gap: 22px; }
	.oh-logo svg { width: 128px; }
	.oh-header .wp-block-button__link { font-size: 13px; letter-spacing: .1em; padding: 7px 12px; }
}

/* Inner pages sit below the fixed header. */
.oh-main--pagina { padding-top: calc(var(--oh-header-h) + 48px); padding-bottom: 72px; }

/* Footer. */
.oh-pie { font-size: 15px; color: var(--oh-muted); background: var(--oh-bg); border-top: 1px solid var(--oh-rule); }
.oh-pie a { color: var(--oh-muted); text-decoration: none; }
.oh-pie a:hover { color: var(--oh-accent); }
.oh-pie .oh-patrocinadores img { opacity: .9; }
.oh-ficha { padding-bottom: 32px; border-bottom: 1px solid var(--oh-rule); line-height: 1.55; }
.oh-ficha .wp-block-column > * { margin-block: 0; }
.oh-ficha .is-style-label { margin-bottom: .7em; }
.oh-ficha ul { margin: 0; padding-left: 1.1em; }
.oh-ficha li + li { margin-top: .3em; }
.oh-ficha a { color: var(--oh-accent); }
.oh-ficha a:hover { text-decoration: underline; }
.oh-ficha__nota { margin-top: 1.6em; font-size: 14px; font-style: italic; }

/* Forms on the navy (checkout, cart, waitlist). */
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-blocks-components-select .wc-blocks-components-select__container,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.oh-lista-espera input[type=email],
.oh-lista-espera input[type=text] {
	background: transparent !important;
	color: var(--oh-ink) !important;
	border: 1px solid var(--oh-tan) !important;
	border-radius: 0 !important;
}
.wc-blocks-components-select .wc-blocks-components-select__select { color: var(--oh-ink); background: transparent; }
.wc-blocks-components-select .wc-blocks-components-select__select option { color: #201c28; background: #fff; }
.wc-block-components-text-input label,
.wc-blocks-components-select .wc-blocks-components-select__label,
.wc-block-components-checkout-step__description { color: var(--oh-muted) !important; }
.wc-block-components-radio-control--highlight-checked,
.wc-block-components-radio-control-accordion-option,
.wc-block-components-radio-control__option,
.wc-block-components-totals-wrapper,
.wc-block-components-sidebar-layout .wc-block-components-panel,
.wp-block-woocommerce-checkout-order-summary-block { border-color: var(--oh-rule) !important; box-shadow: none !important; }
.wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted,
.wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted { box-shadow: inset 0 0 0 1px var(--oh-tan) !important; }
.wc-block-components-checkbox .wc-block-components-checkbox__input[type=checkbox],
.wc-block-components-radio-control__input { background: transparent !important; border-color: var(--oh-tan) !important; }
.wc-block-components-checkbox .wc-block-components-checkbox__mark { fill: var(--oh-ink); }
.wc-block-components-radio-control__input:checked::before { background: var(--oh-ink) !important; }
.wc-block-components-button:not(.is-link) { border-radius: 0; background: var(--oh-accent); color: var(--oh-bg); }
.wc-block-components-button:not(.is-link):hover { background: transparent; color: var(--oh-accent); box-shadow: inset 0 0 0 1px var(--oh-accent); }

/* Waitlist form. */
.oh-lista-espera__campos { display: grid; gap: 6px; max-width: 26em; }
.oh-lista-espera [hidden] { display: none !important; }
.oh-lista-espera input[type=email], .oh-lista-espera input[type=text] { font: inherit; padding: 14px 16px; }
/* Filled field with the label inside (as its placeholder); the real label stays for screen readers. */
.oh-lista-espera input[type=email] { background: var(--oh-campo) !important; border-color: transparent !important; }
.oh-lista-espera input[type=email]::placeholder { color: var(--oh-muted); opacity: 1; }
.oh-lista-espera input[type=email]:focus { outline: 1px solid var(--oh-accent); outline-offset: 0; }
.oh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.oh-lista-espera__consentimiento { font-size: 15px; color: var(--oh-muted); }
.oh-preordenar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.oh-preordenar__cantidad { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--oh-muted); }
.oh-preordenar select { font: inherit; color: var(--oh-ink); background: transparent; border: 1px solid var(--oh-tan); border-radius: 0; padding: 8px 10px; }
.oh-preordenar select option { color: #201c28; background: #fff; }

/* The privacy notice, in a modal over the page. */
.oh-modal {
	width: min(40em, calc(100vw - 32px));
	max-height: min(80svh, 900px);
	padding: 0;
	border: 1px solid var(--oh-rule);
	background: var(--oh-bg);
	color: var(--oh-ink);
	box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
	overflow: hidden;
}
.oh-modal[open] { display: flex; flex-direction: column; }
.oh-modal::backdrop { background: rgba(5, 10, 18, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.oh-modal__cuerpo { overflow-y: auto; padding: clamp(28px, 5vw, 48px); line-height: 1.6; }
.oh-modal__cuerpo h2 { margin-top: 0; padding-right: 40px; font-weight: 400; }
.oh-modal__cerrar {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--oh-rule);
	border-radius: 50%;
	background: var(--oh-bg);
	color: var(--oh-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.oh-modal__cerrar:hover, .oh-modal__cerrar:focus-visible { border-color: var(--oh-accent); color: var(--oh-accent); }
.oh-modal__cerrar:focus-visible { outline: 2px solid var(--oh-accent); outline-offset: 2px; }
.oh-modal__cuerpo:focus { outline: none; }
