/* =========================================================================
   LATITUD CERO — base.css
   Reset, tokens de respaldo y tipografía base.
   Los valores de theme.json tienen prioridad; estas variables actúan como
   red de seguridad si alguien borra un preset desde Estilos globales.
   ========================================================================= */

:root {
	/* Superficies */
	--lat-parchment: #faf6ef;
	--lat-sand: #f1e9da;
	--lat-base: #ffffff;
	--lat-rule: #d9ccb4;

	/* Tinta */
	--lat-ink: #16233d;
	--lat-ink-soft: #3a4a6b;

	/* Acentos */
	--lat-clay: #a8482a;
	--lat-ochre: #e0a93b;
	--lat-moss: #2f4a3c;

	/*
	 * Bordes que delimitan un control interactivo (campos de formulario,
	 * botones fantasma). Un borde decorativo puede ser casi invisible; el de
	 * algo con el que hay que interactuar no. Este valor mide 3,7:1 sobre
	 * blanco y 3,4:1 sobre pergamino, por encima del 3:1 que pide WCAG 1.4.11.
	 */
	--lat-control-edge: #8a8577;

	/* Tipografía */
	--lat-font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
	--lat-font-text: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--lat-font-label: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	/* Medidas del motivo */
	--lat-line: 1px;
	--lat-tick-opacity: 0.42;
	--lat-card-radius: 4px;
	--lat-grain: 0.035;

	/* Curvas de movimiento */
	--lat-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--lat-ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
	--lat-dur-fast: 180ms;
	--lat-dur: 420ms;
	--lat-dur-slow: 820ms;

	/* Sombra: cálida, nunca grisneutra */
	--lat-shadow-sm: 0 1px 2px rgba(22, 35, 61, 0.05), 0 2px 6px rgba(22, 35, 61, 0.04);
	--lat-shadow-md: 0 2px 4px rgba(22, 35, 61, 0.05), 0 10px 26px rgba(22, 35, 61, 0.07);
	--lat-shadow-lg: 0 4px 10px rgba(22, 35, 61, 0.06), 0 26px 60px rgba(22, 35, 61, 0.12);

	--lat-gutter: clamp(1.25rem, 0.4rem + 3.4vw, 3.5rem);
	--lat-measure: 68ch;
}

/* --------------------------------------------------------------- Reset */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 6.5rem;
}

body {
	margin: 0;
	min-height: 100svh;
	font-family: var(--wp--preset--font-family--text, var(--lat-font-text));
	font-size: var(--wp--preset--font-size--medium, 1.0625rem);
	line-height: 1.68;
	letter-spacing: -0.003em;
	color: var(--wp--preset--color--ink, var(--lat-ink));
	background-color: var(--wp--preset--color--parchment, var(--lat-parchment));
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

/* Grano de papel: da textura sin coste de red. Se desactiva si el usuario
   no quiere texturas o si el navegador no soporta el filtro. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	opacity: var(--lat-grain);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

img {
	border-style: none;
}

svg {
	fill: currentColor;
}

/* --------------------------------------------------------- Tipografía */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--wp--preset--font-family--display, var(--lat-font-display));
	color: var(--wp--preset--color--ink, var(--lat-ink));
	text-wrap: balance;
}

p,
li,
dd {
	text-wrap: pretty;
}

/* Evita líneas huérfanas de una sola palabra al final de un párrafo */
p,
li {
	orphans: 2;
	widows: 2;
}

/* Enlaces */
a {
	color: var(--wp--preset--color--clay, var(--lat-clay));
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
	transition: color var(--lat-dur-fast) var(--lat-ease-out);
}

a:hover {
	color: var(--wp--preset--color--ink, var(--lat-ink));
}

:where(a) :is(:focus-visible, :focus) {
	outline: 2px solid var(--lat-clay, #a8482a);
	outline-offset: 3px;
	border-radius: 1px;
}

::selection {
	background-color: rgba(224, 169, 59, 0.32);
	color: var(--lat-ink, #16233d);
}

/* ---------------------------------------------------------- Foco/Accesibilidad */

/*
  .screen-reader-text se define aquí y no se delega en los estilos del core,
  para que el theme sea autónomo: si un plugin o el propio WordPress cambian
  el orden de carga de las hojas, el enlace de salto y las etiquetas del
  menú siguen ocultas hasta recibir el foco.
*/
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip-path: none;
	clip: auto !important;
	color: var(--lat-ink, #16233d);
	display: block;
	font-size: 0.9375rem;
	font-weight: 600;
	height: auto;
	line-height: normal;
	padding: 0.85rem 1.35rem;
	text-decoration: none;
	width: auto;
	z-index: 100000;
}

.skip-link.screen-reader-text {
	background: var(--lat-ink, #16233d);
	color: var(--lat-parchment, #faf6ef);
	border-radius: 2px;
}

.skip-link.screen-reader-text:focus {
	color: var(--lat-parchment, #faf6ef);
}

.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --------------------------------------------------- Formularios nativos */

input,
select,
textarea,
button {
	font: inherit;
	color: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
select,
textarea {
	width: 100%;
	background-color: var(--lat-base, #fff);
	border: var(--lat-line) solid var(--lat-control-edge, #8a8577);
	border-radius: 2px;
	padding: 0.85rem 0.95rem;
	line-height: 1.45;
	transition: border-color var(--lat-dur-fast) var(--lat-ease-out), box-shadow var(--lat-dur-fast) var(--lat-ease-out);
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

input::placeholder,
textarea::placeholder {
	color: rgba(58, 74, 107, 0.55);
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--lat-clay, #a8482a);
	box-shadow: 0 0 0 3px rgba(168, 72, 42, 0.15);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--lat-clay, #a8482a);
	outline-offset: 1px;
}

select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%233a4a6b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.6rem;
}

/* ---------------------------------------------- Contenido de flowed blocks */

.entry-content > *,
.wp-block-post-content > * {
	margin-block-start: 0;
	margin-block-end: 1.4em;
}

.entry-content > :first-child,
.wp-block-post-content > :first-child {
	margin-block-start: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-block-start: 2.2em;
	margin-block-end: 0.5em;
}

.entry-content h2:first-child,
.entry-content h3:first-child {
	margin-block-start: 0;
}

.entry-content ul,
.entry-content ol {
	padding-inline-start: 1.35em;
}

.entry-content li + li {
	margin-block-start: 0.4em;
}

/* Viñeta de lista: marca fina de terracota, coherente con el motivo */
.entry-content ul > li::marker {
	color: var(--lat-clay, #a8482a);
}

/* Tablas */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.entry-content th,
.entry-content td {
	text-align: left;
	padding: 0.75rem 0.9rem;
	border-bottom: var(--lat-line) solid var(--lat-rule, #e2d8c6);
	vertical-align: top;
}

.entry-content thead th {
	font-family: var(--lat-font-label, sans-serif);
	font-size: 0.6875rem;
	font-weight: 680;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--lat-ink-soft, #3a4a6b);
	border-bottom-color: rgba(22, 35, 61, 0.28);
}

/* Código */
code,
kbd,
samp {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.9em;
	background: rgba(22, 35, 61, 0.06);
	padding: 0.12em 0.4em;
	border-radius: 2px;
}

/* ------------------------------------------------------ Imágenes de contenido */

.wp-block-image img {
	border-radius: 2px;
}

.wp-block-image figcaption,
.wp-block-embed figcaption {
	font-size: 0.875rem;
	color: var(--lat-ink-soft, #3a4a6b);
	margin-top: 0.7rem;
}

/* ------------------------------------------------------- Elementos de WordPress */

.alignwide {
	max-width: var(--wp--style--global--wide-size, 72rem);
}

.alignfull {
	max-width: none;
}

.alignleft {
	float: left;
	margin: 0.4rem 1.6rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.4rem 0 1rem 1.6rem;
}

.aligncenter {
	margin-inline: auto;
}

.wp-caption-text,
.blocks-gallery-caption {
	font-size: 0.875rem;
	color: var(--lat-ink-soft, #3a4a6b);
}

.sticky .wp-block-post-title::after {
	content: "";
}
