/**
Theme Name: Astra child
Template: astra
Author: Actualidad Salamanca
Description: Tema hijo de Astra con el sistema visual de Actualidad Salamanca.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: astra-child
*/

/* =====================================================================
   Sistema visual — Actualidad Salamanca

   Criterio: es un medio de sucesos. La autoridad la dan la tipografia y
   el ritmo vertical, no los efectos. Serif con peso para los titulares,
   sans muy legible para el cuerpo, un unico acento cromatico usado con
   avaricia y filetes de un pixel.
   ===================================================================== */

:root {
	/* Tinta y papel. El blanco es calido a proposito: el blanco puro
	   bajo un texto largo cansa la vista. */
	--as-tinta: #14161a;
	--as-tinta-media: #4a5058;
	--as-tinta-suave: #767e88;
	--as-papel: #fffdfa;
	--as-papel-alt: #f6f3ee;
	--as-filete: #e2ddd4;

	/* Un solo acento. Rojo apagado, de tinta de imprenta, no de alarma. */
	--as-acento: #9b1c1c;
	--as-acento-claro: #c0392b;

	--as-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--as-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	/* Escala tipografica fluida entre movil y escritorio. */
	--as-t-xs: 0.75rem;
	--as-t-s: 0.875rem;
	--as-t-base: 1.0625rem;
	--as-t-m: clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
	--as-t-l: clamp(1.375rem, 1vw + 1.1rem, 1.75rem);
	--as-t-xl: clamp(1.75rem, 2vw + 1.2rem, 2.5rem);
	--as-t-xxl: clamp(2.25rem, 3.5vw + 1.2rem, 3.5rem);

	--as-medida: 34rem; /* ~68 caracteres: el ancho comodo de lectura */
	--as-radio: 2px;    /* casi recto; el redondeo generoso abarata */
}

/* --- Base ---------------------------------------------------------- */

body,
.ast-container {
	font-family: var(--as-sans);
	font-size: var(--as-t-base);
	line-height: 1.7;
	color: var(--as-tinta);
	background: var(--as-papel);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4,
.entry-title,
.ast-archive-title,
.site-title {
	font-family: var(--as-serif);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.015em;
	color: var(--as-tinta);
}

a { color: var(--as-acento); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--as-acento-claro); }

/* --- Cabecera ------------------------------------------------------ */

.site-header,
.ast-primary-header-bar {
	background: var(--as-papel);
	border-bottom: 1px solid var(--as-filete);
	box-shadow: none;
}

.site-title,
.site-title a {
	font-family: var(--as-serif);
	font-weight: 700;
	font-size: clamp(1.35rem, 2vw + 0.9rem, 1.9rem);
	letter-spacing: -0.03em;
	color: var(--as-tinta) !important;
}

.site-description {
	font-family: var(--as-sans);
	font-size: var(--as-t-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--as-tinta-suave) !important;
}

.main-header-menu a {
	font-family: var(--as-sans);
	font-size: var(--as-t-s);
	font-weight: 500;
	color: var(--as-tinta-media);
}
.main-header-menu a:hover,
.main-header-menu .current-menu-item > a { color: var(--as-acento); }

/* --- Titulares ----------------------------------------------------- */

.entry-title { font-size: var(--as-t-xl); }

.single .entry-title,
.page .entry-title {
	font-size: var(--as-t-xxl);
	font-weight: 700;
	letter-spacing: -0.025em;
	margin-bottom: 0.6rem;
	max-width: 22ch; /* un titular largo a todo lo ancho no se lee */
}

/* --- Metadatos: versalitas, que es lo que separa un medio de un blog */

.entry-meta,
.ast-blog-meta-container,
.post-meta {
	font-family: var(--as-sans);
	font-size: var(--as-t-xs);
	font-weight: 500;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--as-tinta-suave);
}
.entry-meta a { color: var(--as-tinta-media); text-decoration: none; }
.entry-meta a:hover { color: var(--as-acento); }

/* La categoria hace de banderin de seccion. */
.ast-terms-link a,
.cat-links a {
	color: var(--as-acento) !important;
	font-weight: 600;
	letter-spacing: 0.1em;
}

/* --- Cuerpo del articulo ------------------------------------------- */

.single .entry-content > *,
.page .entry-content > * {
	max-width: var(--as-medida);
	margin-left: auto;
	margin-right: auto;
}

.entry-content p {
	margin-bottom: 1.45em;
	font-size: var(--as-t-m);
	line-height: 1.75;
	color: #23262c;
}

/* Entradilla: el primer parrafo pesa mas, como en cualquier diario. */
.single .entry-content > p:first-of-type {
	font-size: calc(var(--as-t-m) * 1.14);
	line-height: 1.6;
	color: var(--as-tinta);
	font-weight: 450;
}

.entry-content h2 {
	font-size: var(--as-t-l);
	margin-top: 2.6em;
	margin-bottom: 0.7em;
	padding-top: 1.1em;
	border-top: 1px solid var(--as-filete);
}
.entry-content h3 { font-size: var(--as-t-m); margin-top: 2em; margin-bottom: 0.5em; }

.entry-content blockquote {
	border-left: 3px solid var(--as-acento);
	padding-left: 1.4rem;
	margin: 2rem auto;
	font-family: var(--as-serif);
	font-size: var(--as-t-l);
	line-height: 1.4;
	font-style: normal;
	color: var(--as-tinta);
}

/* --- Imagen destacada: el mapa merece ir a sangre ------------------- */

.single .post-thumb img,
.wp-post-image {
	width: 100%;
	height: auto;
	border-radius: var(--as-radio);
	border: 1px solid var(--as-filete);
}

/* --- Bloque de fuentes: es la prueba del trabajo, no una nota al pie */

.entry-content ul li a[rel~="nofollow"] {
	font-family: var(--as-sans);
	font-size: var(--as-t-s);
	color: var(--as-tinta-media);
	text-decoration: none;
	border-bottom: 1px solid var(--as-filete);
}
.entry-content ul li a[rel~="nofollow"]:hover {
	color: var(--as-acento);
	border-bottom-color: var(--as-acento);
}

/* --- Portada y archivo: rejilla editorial --------------------------- */

.blog .site-main .ast-row,
.archive .site-main .ast-row {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
	gap: 2.5rem 2rem;
}

.ast-article-post {
	border: 0;
	border-bottom: 1px solid var(--as-filete);
	padding-bottom: 1.6rem;
	background: transparent;
	box-shadow: none !important;
	transition: transform 0.18s ease;
}
.ast-article-post:hover { transform: translateY(-2px); }

.ast-article-post .post-thumb img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
	width: 100%;
}

.ast-article-post .entry-title {
	font-size: var(--as-t-l);
	line-height: 1.2;
	margin: 0.75rem 0 0.4rem;
}
.ast-article-post .entry-title a { color: var(--as-tinta); text-decoration: none; }
.ast-article-post .entry-title a:hover { color: var(--as-acento); }

.ast-excerpt-container p {
	font-size: var(--as-t-s);
	line-height: 1.6;
	color: var(--as-tinta-media);
}

/* --- Pie ------------------------------------------------------------ */

.site-footer,
.ast-small-footer {
	background: var(--as-papel-alt);
	border-top: 1px solid var(--as-filete);
	color: var(--as-tinta-media);
	font-size: var(--as-t-s);
}
.site-footer a { color: var(--as-tinta-media); }
.site-footer a:hover { color: var(--as-acento); }

/* --- Foco visible: accesibilidad, no adorno ------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--as-acento);
	outline-offset: 2px;
	border-radius: var(--as-radio);
}

/* --- Modo oscuro por preferencia del sistema ------------------------ */

@media (prefers-color-scheme: dark) {
	:root {
		--as-tinta: #eceef1;
		--as-tinta-media: #a9b0b9;
		--as-tinta-suave: #7e8792;
		--as-papel: #131519;
		--as-papel-alt: #1a1d22;
		--as-filete: #2b2f36;
		--as-acento: #f08a80;
		--as-acento-claro: #f5a9a1;
	}
	.entry-content p { color: #d6dae0; }
	.wp-post-image { border-color: var(--as-filete); }
}

/* --- Impresion: que una pieza se pueda archivar en papel ------------ */

@media print {
	.site-header, .site-footer, .ast-sidebar, nav { display: none !important; }
	.entry-content > * { max-width: none; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.75em; }
}

/* =====================================================================
   Ajustes sobre los valores por defecto de Astra.
   Revisado a ojo sobre el sitio ya desplegado.
   ===================================================================== */

/* Astra pinta un gris azulado fuera del contenido; el papel debe llegar
   hasta los bordes o la pieza parece flotar sobre otra web. */
html,
body,
#page,
.site,
#content,
.site-content,
.ast-separate-container {
	background-color: var(--as-papel) !important;
}
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post {
	background-color: transparent;
	padding-left: 0;
	padding-right: 0;
}

/* El contenedor por defecto deja la columna demasiado estrecha: el titular
   partia en cuatro lineas. */
.ast-container {
	max-width: 1180px;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.single .entry-title,
.page .entry-title {
	max-width: 26ch;
}

/* Astra pone sus enlaces en azul; los metadatos deben ir en la paleta. */
.entry-meta,
.entry-meta *,
.ast-blog-meta-container,
.ast-blog-meta-container a {
	color: var(--as-tinta-suave) !important;
}
.entry-meta a:hover,
.ast-blog-meta-container a:hover { color: var(--as-acento) !important; }

/* Imagen destacada del articulo: es el mapa del suceso y merece aire. */
.as-destacada {
	max-width: 52rem;
	margin: 0 auto 2.75rem;
}
.as-destacada img {
	width: 100%;
	height: auto;
	display: block;
	border: 1px solid var(--as-filete);
	border-radius: var(--as-radio);
}
.as-destacada figcaption {
	font-family: var(--as-sans);
	font-size: var(--as-t-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--as-tinta-suave);
	margin-top: 0.6rem;
}

/* Nota de correccion al pie de la pieza. */
.as-correccion {
	max-width: var(--as-medida);
	margin: 2.5rem auto 0;
	padding: 0.9rem 1.1rem;
	border-left: 3px solid var(--as-acento);
	background: var(--as-papel-alt);
	font-size: var(--as-t-s) !important;
	line-height: 1.55;
	color: var(--as-tinta-media) !important;
}

@media (max-width: 48rem) {
	.ast-container { padding-left: 1.15rem; padding-right: 1.15rem; }
	.single .entry-title, .page .entry-title { max-width: none; }
}
