/*
Theme Name: Logópolis
Theme URI: https://logopolis.es
Author: Logópolis
Description: Theme hijo de M2Media para Logópolis (logopolis.es): lenguaje, pensamiento, aprendizaje, cultura en los medios, libros y mercado editorial. Papel, tinta y terracota; Newsreader para titulares y texto e IBM Plex Sans para los detalles, servidas desde tu propio servidor; un color por sección que tiñe las imágenes tramadas por el plugin Logópolis Tramado. Cabecera centrada y recuadros destacados en portada. Necesita el theme padre M2Media (1.16 o posterior) y el plugin M2Media Core (1.34 o posterior).
Template: m2media
Version: 2.2.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: logopolis
Tags: news, blog, two-columns, right-sidebar, custom-colors, featured-images, translation-ready, accessibility-ready
*/

/* Newsreader e IBM Plex Sans (SIL Open Font License 1.1), autoalojadas: sin peticiones a terceros. */
@font-face {
	font-family: "Newsreader";
	src: url("fonts/newsreader.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Newsreader";
	src: url("fonts/newsreader-italic.woff2") format("woff2");
	font-weight: 200 800;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "IBM Plex Sans";
	src: url("fonts/ibm-plex-sans.woff2") format("woff2");
	font-weight: 100 700;
	font-stretch: 85% 100%;
	font-style: normal;
	font-display: swap;
}
/* Respaldo con métricas parecidas a Newsreader, para que el texto no salte al cargar la fuente. */
@font-face {
	font-family: "Newsreader Fallback";
	src: local("Georgia");
	size-adjust: 96%;
	ascent-override: 98%;
	descent-override: 26%;
}

/* ---------- Identidad: papel, tinta y terracota (contraste AA comprobado) ---------- */
:root {
	--mm-bg: #f4efe6;
	--mm-surface: #fbf8f2;
	--mm-soft: #eadfcf;
	--mm-ink: #1e1b18;
	--mm-text: #2f2a25;
	--mm-muted: #5e564d;
	--mm-line: #dcd3c5;
	--mm-line-strong: #1e1b18;
	--mm-accent: #a1432c;
	--mm-on-accent: #ffffff;
	--mm-hot: #a1432c;
	--mm-on-hot: #ffffff;
	--mm-focus: #2b4778;
	--mm-header-bg: rgba(244, 239, 230, .94);
	--mm-font-serif: "Newsreader", "Newsreader Fallback", Georgia, serif;
	--mm-font-display: "Newsreader", "Newsreader Fallback", Georgia, serif;
	--mm-font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mm-font-mono: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif; /* Antetítulos y datos: en Logópolis, la sans. */
	--mm-heading-weight: 500;
	--mm-radius: 3px;
	--mm-radius-sm: 2px;
}
:root[data-theme="dark"] {
	--mm-bg: #1b1917;
	--mm-surface: #24211e;
	--mm-soft: #2e2a25;
	--mm-ink: #ede6da;
	--mm-text: #d8d0c3;
	--mm-muted: #b5ab9c;
	--mm-line: #3a352f;
	--mm-line-strong: #ede6da;
	--mm-accent: #e0876c;
	--mm-on-accent: #1b1917;
	--mm-hot: #e0876c;
	--mm-on-hot: #1b1917;
	--mm-focus: #a9bce0;
	--mm-header-bg: rgba(27, 25, 23, .94);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--mm-bg: #1b1917;
		--mm-surface: #24211e;
		--mm-soft: #2e2a25;
		--mm-ink: #ede6da;
		--mm-text: #d8d0c3;
		--mm-muted: #b5ab9c;
		--mm-line: #3a352f;
		--mm-line-strong: #ede6da;
		--mm-accent: #e0876c;
		--mm-on-accent: #1b1917;
		--mm-hot: #e0876c;
		--mm-on-hot: #1b1917;
		--mm-focus: #a9bce0;
		--mm-header-bg: rgba(27, 25, 23, .94);
	}
}

body { font-optical-sizing: auto; }
::selection { background: var(--mm-accent); color: var(--mm-on-accent); }

/* ---------- Titulares en Newsreader, sin negritas gruesas ---------- */
h1, h2, h3, h4, .card__title, .article-header__title, .page-header__title { letter-spacing: -.01em; }
.article-header__title, .card--lead .card__title { font-weight: 450; line-height: 1.08; }
.card__title { font-weight: 500; line-height: 1.2; }
.card__excerpt, .article-header__dek { font-family: var(--mm-font-serif); }

/* ---------- Cabecera: logotipo de comillas y nombre en Newsreader ---------- */
.site-header { border-bottom-color: var(--mm-line); }
.brand-mark { width: auto; height: 22px; }
.wordmark { font-family: var(--mm-font-display); letter-spacing: -.01em; }
.wordmark__a { font-weight: 500; }
.wordmark__o { color: var(--mm-accent); }
.header-centered .wordmark { font-size: 2.25rem; }
.header-centered .brand-mark { width: auto; height: 27px; }
.main-nav a { font-family: var(--mm-font-sans); font-weight: 500; }

/* ---------- Antetítulos: sans en versalitas, con el color de cada sección ---------- */
.kicker, .section-head__title, .badge, .home-box__label, .claim-box__label, .mm-box__label, .mm-etym__label {
	font-family: var(--mm-font-sans); letter-spacing: .08em;
}
.kicker__cat { color: var(--lp-text, var(--mm-accent)); }
.badge { font-weight: 600; }

/* ---------- Imágenes tramadas: duotono con el color de la sección ---------- */
img.is-dithered {
	filter: var(--lp-duo);
	image-rendering: pixelated;
	background: var(--lp-bg);
}
.card__media, .article-media img { border-radius: var(--mm-radius); }

/* ---------- Recuadros destacados de portada ---------- */
.home-box { border-radius: var(--mm-radius); }
.home-box--1 { background: #24211e; border-color: #24211e; color: #ede6da; }
.home-box--1 .home-box__title { font-style: italic; font-weight: 400; }
.home-box__title { font-weight: 450; }
.home-box--2 .home-box__title { font-size: clamp(1.5rem, 2.8vw, 2rem); line-height: 1.12; }
.home-box--2 .home-box__more a { color: var(--mm-accent); text-decoration: none; }
.home-box--2 .home-box__more a:hover { text-decoration: underline; }
:root[data-theme="dark"] .home-box--1 { background: #2e2a25; border-color: #3a352f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-box--1 { background: #2e2a25; border-color: #3a352f; } }

/* ---------- ¿Quién dijo esto?: la frase y su sello ---------- */
.claim-box { border-left-width: 1px; border-radius: var(--mm-radius); background: var(--mm-surface); }
.claim-box__claim { font-weight: 400; }
.claim-seal { border-radius: 2px; font-family: var(--mm-font-sans); }

/* ---------- Elementos del texto ---------- */
.entry-content .mm-etym { background: var(--mm-soft); border-radius: var(--mm-radius); }
.entry-content .mm-etym__step { border-top-color: var(--lp-text, var(--mm-accent)); }
.entry-content .mm-etym__word { font-weight: 500; }
.entry-content .mm-box { border-color: var(--mm-line-strong); }
.entry-content .wp-block-pullquote { border: 0; padding: 1.25em 0; text-align: center; }
.entry-content .wp-block-pullquote blockquote { font-style: italic; font-weight: 400; font-size: 1.6em; line-height: 1.25; color: var(--lp-text, var(--mm-accent)); }
.entry-content blockquote { border-left-color: var(--mm-accent); }

@media (forced-colors: active) {
	img.is-dithered { filter: none; }
	.home-box--1 { forced-color-adjust: auto; }
}
@media print {
	img.is-dithered { filter: none; }
}
