/* ==========================================================================
   Vilasecom — estilos generales del tema
   ========================================================================== */

/* ---------- Fuentes (alojadas en el tema, sin Google Fonts) ---------- */
@font-face {
	font-family: "Fraunces";
	src: url("../fonts/fraunces-var.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Manrope";
	src: url("../fonts/manrope-var.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}

/* ---------- Variables ---------- */
:root {
	--noche: #15100b;
	--nogal: #3b2618;
	--roble: #c8914f;
	--miel: #e6b56c;
	--crema: #f3e6d0;
	--papel: #faf5ec;
	--tinta: #2a1d13;
	--gris: #7a6a5b;

	--fuente-titulos: "Fraunces", Georgia, "Times New Roman", serif;
	--fuente-texto: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

	--ancho: 1200px;
	--ancho-estrecho: 760px;
	--margen: clamp(1rem, 4vw, 2.5rem);
	--radio: 14px;
	--sombra: 0 10px 30px rgb(42 29 19 / 0.12);
}

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

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

body {
	margin: 0;
	background: var(--papel);
	color: var(--tinta);
	font-family: var(--fuente-texto);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-color: var(--roble); text-underline-offset: 0.2em; }
a:hover { color: var(--nogal); }

h1, h2, h3, h4 {
	font-family: var(--fuente-titulos);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 0.6em;
}

:focus-visible { outline: 2px solid var(--roble); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.saltar-enlace {
	position: absolute;
	left: 1rem; top: -4rem;
	z-index: 1000;
	padding: 0.6rem 1rem;
	background: var(--noche);
	color: var(--crema);
	border-radius: 8px;
}
.saltar-enlace:focus { top: 1rem; }

/* ---------- Estructura ---------- */
.contenedor { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }
.contenedor--estrecho { width: min(100% - 2 * var(--margen), var(--ancho-estrecho)); }
.seccion { padding-block: clamp(2.5rem, 7vw, 5rem); }

/* ---------- Botones ---------- */
.boton {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.8em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--nogal);
	color: var(--crema);
	font: 600 0.95rem/1 var(--fuente-texto);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
}
.boton:hover { background: var(--tinta); color: #fff; transform: translateY(-1px); }

/* ---------- Cabecera ---------- */
.cabecera {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgb(250 245 236 / 0.92);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid rgb(42 29 19 / 0.08);
}
.admin-bar .cabecera { top: 32px; }
@media (max-width: 782px) { .admin-bar .cabecera { top: 46px; } }

.cabecera__fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }

.logo { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.logo__nombre { font: 600 1.5rem/1 var(--fuente-titulos); letter-spacing: 0.02em; }
.logo__lema { margin-top: 0.3em; font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--gris); }
.custom-logo { max-height: 56px; width: auto; }

.cabecera__nav .menu { display: flex; gap: 1.75rem; margin: 0; padding: 0; list-style: none; }
.cabecera__nav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.cabecera__nav .current-menu-item > a { color: var(--roble); }
.cabecera__nav .sub-menu { display: none; }

.cabecera__boton-menu { display: none; background: none; border: 0; padding: 0.5rem; color: inherit; cursor: pointer; }

@media (max-width: 820px) {
	.cabecera__boton-menu { display: inline-flex; }
	.cabecera__nav {
		position: absolute;
		inset: 100% 0 auto;
		display: none;
		background: var(--papel);
		border-bottom: 1px solid rgb(42 29 19 / 0.1);
		padding: 1rem var(--margen) 1.5rem;
	}
	.cabecera__nav.esta-abierto { display: block; }
	.cabecera__nav .menu { flex-direction: column; gap: 0.9rem; }
}

/* ---------- Cabecera de página ---------- */
.cabecera-pagina { margin-bottom: 2rem; }
.cabecera-pagina__titulo { font-size: clamp(2rem, 5vw, 3.4rem); }
.cabecera-pagina__intro { color: var(--gris); max-width: 60ch; }

/* ---------- Contenido del editor ---------- */
.contenido-editor > * + * { margin-top: 1.1em; }
.contenido-editor h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin-top: 1.8em; }
.contenido-editor h3 { font-size: 1.35rem; margin-top: 1.5em; }
.contenido-editor img { border-radius: var(--radio); }
.contenido-editor blockquote {
	margin-inline: 0;
	padding-left: 1.2rem;
	border-left: 3px solid var(--roble);
	font-family: var(--fuente-titulos);
	font-size: 1.25rem;
}
.contenido-editor .alignwide { width: min(100vw - 2 * var(--margen), var(--ancho)); margin-inline: 50%; transform: translateX(-50%); }
.contenido-editor .alignfull { width: 100vw; margin-inline: 50%; transform: translateX(-50%); }
.contenido-editor--ancho > * { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }
.contenido-editor--ancho > .alignfull { width: 100%; transform: none; margin-inline: 0; }

/* ---------- Tarjetas de entradas ---------- */
.rejilla-entradas { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tarjeta { background: #fff; border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); transition: transform 0.25s; }
.tarjeta:hover { transform: translateY(-3px); }
.tarjeta__enlace { display: block; text-decoration: none; height: 100%; }
.tarjeta__imagen { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.tarjeta__imagen img { width: 100%; height: 100%; object-fit: cover; }
.tarjeta__cuerpo { padding: 1.25rem 1.4rem 1.5rem; }
.tarjeta__titulo { font-size: 1.35rem; }
.tarjeta__extracto { color: var(--gris); font-size: 0.95rem; }
.entrada__meta { margin: 0 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--roble); }
.entrada__imagen { margin: 0 0 2rem; }
.entrada__imagen img { border-radius: var(--radio); width: 100%; }

.nav-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; }
.nav-entradas__etiqueta { display: block; font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gris); }
.pagination .nav-links { justify-content: center; }
.page-numbers { padding: 0.4em 0.8em; border-radius: 8px; text-decoration: none; }
.page-numbers.current { background: var(--nogal); color: var(--crema); }

/* ---------- Buscador ---------- */
.buscador { display: flex; gap: 0.5rem; max-width: 480px; }
.buscador__campo {
	flex: 1;
	padding: 0.75em 1em;
	border: 1px solid rgb(42 29 19 / 0.2);
	border-radius: 999px;
	font: inherit;
	background: #fff;
}

/* ---------- 404 ---------- */
.error-404 { text-align: center; }
.error-404__numero { margin: 0; font: 600 clamp(5rem, 18vw, 10rem)/1 var(--fuente-titulos); color: var(--roble); opacity: 0.35; }

/* ---------- Widgets / lateral ---------- */
.widget { margin-bottom: 2rem; }
.widget__titulo { font-size: 1.1rem; }

/* ---------- Contacto (botones) ---------- */
.contacto { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.contacto__enlace {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.55em 1em;
	border: 1px solid currentColor;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.92rem;
}
.aviso-admin {
	padding: 0.6em 1em;
	border: 1px dashed var(--roble);
	border-radius: 8px;
	font-size: 0.9rem;
}

/* ---------- Pie ---------- */
.pie { margin-top: 4rem; padding-top: 3rem; background: var(--noche); color: var(--crema); }
.pie a:hover { color: var(--miel); }
.pie .logo__lema { color: rgb(243 230 208 / 0.6); }
.pie__rejilla { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-bottom: 2rem; }
.pie__dato { display: flex; gap: 0.5rem; align-items: flex-start; margin: 1rem 0 0; font-size: 0.95rem; }
.pie__dato .icono { flex: none; margin-top: 0.2em; color: var(--miel); }
.menu-pie ul { margin: 0; padding: 0; list-style: none; }
.pie__legal { margin-block: 0; padding-block: 1.25rem; border-top: 1px solid rgb(243 230 208 / 0.12); font-size: 0.85rem; color: rgb(243 230 208 / 0.6); }

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