/**
 * Biblioteca UV — base.
 * Colores, tipografía y espaciados vienen de theme.json (variables --wp--preset--*).
 * Aquí solo lo que theme.json no cubre. También se carga en el editor (add_editor_style).
 */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

img,
svg,
video { max-width: 100%; height: auto; }

:where(p, ul, ol) { margin-block: 0 1em; }

/* Accesibilidad */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: absolute;
	left: 1rem; top: -100px;
	z-index: 100000;
	padding: .75rem 1rem;
	background: var(--wp--preset--color--amarillo, #ffbc00);
	color: #000;
	font-weight: 700;
	text-decoration: none;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
	outline: 3px solid var(--wp--preset--color--azul, #5058ff);
	outline-offset: 2px;
}

/* Contenedor para plantillas PHP (listados, entradas, 404). Las páginas usan el layout de bloques. */
.bib-container {
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1140px);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left, 1rem);
}

/* Contenido de bloques en entradas (single.php, layout constrained): ancho completo sin franjas laterales */
.entry-content:not(.entry-content--full) > .alignfull { margin-inline: calc(var(--wp--style--root--padding-left) * -1); max-width: none; width: auto; }
.site-main { display: block; min-height: 50vh; }

/*
 * Páginas (page.php): a todo el ancho. Solo los bloques de texto sueltos en la raíz
 * (fuera de una sección) se limitan al ancho de contenido para que no vayan de borde a borde.
 */
.entry-content--full > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, .wp-block-heading, .wp-block-list, .wp-block-quote, .wp-block-details, .wp-block-table, .wp-block-buttons):not(.alignfull):not(.alignwide) {
	max-width: var(--wp--style--global--content-size, 1140px);
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left, 1rem);
}
.entry-content--full > .alignwide {
	max-width: var(--wp--style--global--wide-size, 1440px);
	margin-inline: auto;
}

/* Listados */
.bib-listing { padding-block: clamp(2rem, 5vw, 4rem); }
.bib-listing__title { margin: 0 0 2rem; }
.bib-listing__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 2rem;
}
.bib-card { display: flex; flex-direction: column; background: var(--wp--preset--color--gris-claro, #f4f4f4); }
.bib-card__image img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.bib-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.bib-card__date { font-size: .875rem; color: var(--wp--preset--color--gris, #808080); }
.bib-card__title { margin: 0; font-size: 1.25rem; }
.bib-card__title a { color: inherit; text-decoration: none; }
.bib-card__title a:hover { color: var(--wp--preset--color--azul, #5058ff); }
.bib-card__excerpt p { margin: 0; }

.navigation.pagination { margin-top: 2.5rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-numbers { padding: .5rem .9rem; border: 2px solid #000; color: #000; text-decoration: none; font-weight: 700; }
.page-numbers.current,
.page-numbers:hover { background: #000; color: #fff; }

/* Entradas */
.bib-single__header { padding-top: clamp(2rem, 5vw, 4rem); }
.bib-single__title { margin: .5rem 0 2rem; }
.bib-single__image img { display: block; width: 100%; }

/* 404 */
.bib-404 { padding-block: clamp(3rem, 8vw, 6rem); }
.bib-404__code { margin: 0; font-size: clamp(4rem, 12vw, 8rem); font-weight: 700; line-height: 1; color: var(--wp--preset--color--amarillo, #ffbc00); }

/* Formulario de búsqueda nativo */
.search-form { display: flex; gap: .5rem; max-width: 560px; margin-block: 1.5rem; }
.search-form label { flex: 1; }
.search-field { width: 100%; padding: .75rem 1rem; border: 2px solid #000; font: inherit; }
.search-submit { padding: .75rem 1.25rem; border: 2px solid #000; background: #000; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.search-submit:hover { background: var(--wp--preset--color--amarillo, #ffbc00); color: #000; border-color: var(--wp--preset--color--amarillo, #ffbc00); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
