/* ================================================================
   EL CUADERNO DE MORATÍN
   CSS limpio · reinicio estable v1
   
   Sustituye por completo todo el CSS anterior.
   
   Objetivo:
   - Quitar acumulación de parches.
   - Corregir cabecera negra en home y entradas.
   - Mantener estética editorial sobria.
   - Tocar solo base visual, títulos, enlaces, menú y lectura.
   - NO tocar imágenes.
   - NO tocar extractos.
   - NO tocar cajas de portada.
   - NO tocar grids, columnas ni estructura de artículos.
   ================================================================ */


/* ----------------------------------------------------------------
   1. TIPOGRAFÍAS
   ---------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Caveat:wght@400;600&display=swap');


/* ----------------------------------------------------------------
   2. VARIABLES
   ---------------------------------------------------------------- */

:root {
  --mlm-paper: #f5f1e4;
  --mlm-paper-soft: #ede6d2;
  --mlm-ink: #26201a;
  --mlm-ink-soft: #3a3024;
  --mlm-ink-faded: #5a4a32;
  --mlm-moss: #4a5d3a;
  --mlm-moss-deep: #3a4a2d;
  --mlm-tile: #a84c2f;
  --mlm-tile-deep: #8a3e25;
  --mlm-handwritten: #6f5538;
  --mlm-border: #c4bba4;

  --mlm-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --mlm-script: 'Caveat', 'Segoe Script', cursive;

  --mlm-read-width: 700px;
}


/* ----------------------------------------------------------------
   3. BASE GENERAL
   ---------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--mlm-paper) !important;
  color: var(--mlm-ink);
  font-family: var(--mlm-serif);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ----------------------------------------------------------------
   4. CABECERA GLOBAL
   ---------------------------------------------------------------- */

/*
   Esta parte fuerza la cabecera clara del Cuaderno.
   Se limita a header, site-header, role banner y al primer template-part,
   que en temas de bloques suele ser la cabecera.
*/

header,
.site-header,
[role="banner"],
.wp-site-blocks > header,
.wp-site-blocks > .wp-block-template-part:first-child {
  background: var(--mlm-paper) !important;
  background-color: var(--mlm-paper) !important;
  color: var(--mlm-ink) !important;
  border-bottom: 1px solid var(--mlm-border) !important;
}

/* Fondos interiores heredados del tema oscuro */
header > *,
.site-header > *,
[role="banner"] > *,
.wp-site-blocks > header > *,
.wp-site-blocks > .wp-block-template-part:first-child > * {
  background-color: transparent !important;
}

/* Evita textos blancos heredados dentro de la cabecera */
header,
header *,
.site-header,
.site-header *,
[role="banner"],
[role="banner"] *,
.wp-site-blocks > header,
.wp-site-blocks > header *,
.wp-site-blocks > .wp-block-template-part:first-child,
.wp-site-blocks > .wp-block-template-part:first-child * {
  color: var(--mlm-ink);
}

/* Pseudoelementos oscuros del tema */
header::before,
header::after,
.site-header::before,
.site-header::after,
[role="banner"]::before,
[role="banner"]::after,
.wp-site-blocks > header::before,
.wp-site-blocks > header::after,
.wp-site-blocks > .wp-block-template-part:first-child::before,
.wp-site-blocks > .wp-block-template-part:first-child::after {
  background: transparent !important;
  border-color: var(--mlm-border) !important;
}


/* ----------------------------------------------------------------
   5. TÍTULO DEL SITIO
   ---------------------------------------------------------------- */

.wp-block-site-title,
.site-title {
  font-family: var(--mlm-serif) !important;
  font-size: clamp(1.8rem, 4vw, 3rem) !important;
  line-height: 1.05 !important;
  font-style: italic;
  font-weight: 500 !important;
  letter-spacing: -0.015em !important;
  text-transform: none !important;
  color: var(--mlm-ink) !important;
}

.wp-block-site-title a,
.site-title a {
  color: var(--mlm-ink) !important;
  text-decoration: none !important;
}

.wp-block-site-title a:hover,
.site-title a:hover {
  color: var(--mlm-moss) !important;
}


/* ----------------------------------------------------------------
   6. DESCRIPCIÓN DEL SITIO / TAGLINE
   ---------------------------------------------------------------- */

.wp-block-site-tagline,
.site-description {
  font-family: var(--mlm-script) !important;
  font-size: clamp(1.15rem, 2vw, 1.45rem) !important;
  line-height: 1.25;
  color: var(--mlm-handwritten) !important;
  font-style: italic;
  font-weight: 400;
}


/* ----------------------------------------------------------------
   7. NAVEGACIÓN
   ---------------------------------------------------------------- */

.wp-block-navigation a,
.wp-block-navigation-item__content,
nav a,
.menu a {
  font-family: var(--mlm-serif) !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase !important;
  color: var(--mlm-ink-faded) !important;
  background: transparent !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.25rem;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.wp-block-navigation a:hover,
.wp-block-navigation-item__content:hover,
nav a:hover,
.menu a:hover,
.current-menu-item > a,
.wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
  color: var(--mlm-moss) !important;
  border-bottom-color: var(--mlm-moss);
}


/* ----------------------------------------------------------------
   8. ENLACES GENERALES
   ---------------------------------------------------------------- */

a {
  color: var(--mlm-tile);
  text-decoration-color: rgba(168, 76, 47, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--mlm-tile-deep);
  text-decoration-color: var(--mlm-tile-deep);
}


/* ----------------------------------------------------------------
   9. TÍTULOS GENERALES
   ---------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6,
.entry-title,
.page-title,
.wp-block-post-title,
.wp-block-heading {
  font-family: var(--mlm-serif) !important;
  color: var(--mlm-ink) !important;
  font-weight: 500 !important;
  line-height: 1.18;
  letter-spacing: -0.012em;
  text-transform: none !important;
}

h1,
.entry-title,
.page-title,
.wp-block-post-title {
  font-size: clamp(2rem, 4vw, 2.7rem);
}

h2,
h2.wp-block-heading {
  font-size: clamp(1.45rem, 2.8vw, 1.9rem);
}

h3,
h3.wp-block-heading {
  font-size: clamp(1.2rem, 2vw, 1.35rem);
  color: var(--mlm-ink-soft) !important;
}


/* ----------------------------------------------------------------
   10. TÍTULOS DE ARTÍCULOS EN LISTADOS
   ---------------------------------------------------------------- */

.wp-block-post-title,
.entry-title {
  text-transform: none !important;
  letter-spacing: -0.012em !important;
}

.wp-block-post-title a,
.entry-title a,
.wp-block-query .wp-block-post-title a,
article .wp-block-post-title a {
  color: var(--mlm-ink) !important;
  text-decoration: none !important;
  background-image: linear-gradient(
    transparent 68%,
    rgba(168, 76, 47, 0.16) 68%
  );
  background-repeat: no-repeat;
  background-size: 0% 100%;
  transition:
    color 0.25s ease,
    background-size 0.3s ease;
}

.wp-block-post-title a:hover,
.entry-title a:hover,
.wp-block-query .wp-block-post-title a:hover,
article .wp-block-post-title a:hover {
  color: var(--mlm-moss) !important;
  background-size: 100% 100%;
}


/* ----------------------------------------------------------------
   11. FECHAS
   ---------------------------------------------------------------- */

.wp-block-post-date,
.post-date,
time {
  font-family: var(--mlm-script);
  font-size: 1.08rem;
  color: var(--mlm-handwritten);
  text-transform: none;
  letter-spacing: 0.01em;
}


/* ----------------------------------------------------------------
   12. ENTRADAS INDIVIDUALES: LECTURA
   ---------------------------------------------------------------- */

/*
   Solo mejora la lectura de los posts.
   No toca imágenes ni estructura del encabezado del tema.
*/

.single-post .entry-content,
.single-post .wp-block-post-content {
  max-width: var(--mlm-read-width);
  margin-left: auto;
  margin-right: auto;
}

.single-post .entry-title,
.single-post .wp-block-post-title {
  font-size: clamp(2.15rem, 4vw, 3rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.018em !important;
  margin-bottom: 1rem;
}

.single-post .entry-content p,
.single-post .wp-block-post-content p {
  font-size: 1.08rem;
  line-height: 1.86;
}

.single-post .entry-content > p:first-of-type,
.single-post .wp-block-post-content > p:first-of-type {
  font-size: 1.12rem;
  line-height: 1.84;
}


/* ----------------------------------------------------------------
   13. CITAS
   ---------------------------------------------------------------- */

blockquote,
.wp-block-quote {
  border-left: 3px solid var(--mlm-moss);
  padding-left: 1.25rem;
  color: var(--mlm-ink-soft);
  font-style: italic;
}


/* ----------------------------------------------------------------
   14. NEGRITAS Y CURSIVAS
   ---------------------------------------------------------------- */

strong,
b {
  font-weight: 600;
  color: var(--mlm-ink);
}

em,
i {
  font-style: italic;
}


/* ----------------------------------------------------------------
   15. BOTONES BÁSICOS
   ---------------------------------------------------------------- */

button,
input[type="submit"],
.wp-element-button,
.wp-block-button__link {
  font-family: var(--mlm-serif) !important;
  background: var(--mlm-ink) !important;
  color: var(--mlm-paper) !important;
  border: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

button:hover,
input[type="submit"]:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
  background: var(--mlm-moss) !important;
}


/* ----------------------------------------------------------------
   16. FORMULARIOS BÁSICOS
   ---------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="search"],
textarea {
  font-family: var(--mlm-serif);
  color: var(--mlm-ink);
  border-color: var(--mlm-border);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: 2px solid var(--mlm-moss);
  outline-offset: 2px;
}


/* ----------------------------------------------------------------
   17. ACCESIBILIDAD
   ---------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--mlm-moss);
  outline-offset: 2px;
}


/* ----------------------------------------------------------------
   18. MÓVIL
   ---------------------------------------------------------------- */

@media (max-width: 768px) {

  body {
    font-size: 16px;
  }

  .wp-block-site-title,
  .site-title {
    font-size: 1.6rem !important;
  }

  .wp-block-site-tagline,
  .site-description {
    font-size: 1.15rem !important;
  }

  h1,
  .entry-title,
  .page-title,
  .wp-block-post-title {
    font-size: 1.9rem;
  }

  .single-post .entry-title,
  .single-post .wp-block-post-title {
    font-size: 2rem !important;
  }

  .single-post .entry-content p,
  .single-post .wp-block-post-content p {
    font-size: 1.03rem;
    line-height: 1.78;
  }

  .single-post .entry-content > p:first-of-type,
  .single-post .wp-block-post-content > p:first-of-type {
    font-size: 1.06rem;
  }

  .wp-block-navigation a,
  .wp-block-navigation-item__content,
  nav a,
  .menu a {
    font-size: 0.74rem !important;
    letter-spacing: 0.08em !important;
  }
}
/* ================================================================
   HOME · AJUSTE FINO DE PORTADA
   Solo corrige aire, línea, apertura e imagen.
   No toca estructura global.
   ================================================================ */


/* Reducir el vacío entre presentación y primer artículo */
.home main,
.home .wp-site-blocks main {
  padding-top: 0 !important;
}

/* Presentación inicial: algo más recogida */
.home main > p:first-of-type,
.home .entry-content > p:first-of-type {
  margin-bottom: 3rem !important;
}

/* Línea separadora más editorial y menos dura */
.home hr,
.home .wp-block-separator {
  max-width: 860px !important;
  width: 76% !important;
  margin: 2.6rem auto 2.8rem !important;
  border: 0 !important;
  border-top: 2px solid rgba(38, 32, 26, 0.78) !important;
}

/* Primer artículo: un poco más de equilibrio */
.home .wp-block-post-template > li:first-child {
  column-gap: 2.2rem !important;
  row-gap: 1rem !important;
}

/* Título de apertura: sigue grande, pero algo menos desbordante */
.home .wp-block-post-template > li:first-child .wp-block-post-title,
.home .wp-block-post-template > li:first-child .wp-block-post-title a {
  font-size: clamp(2.6rem, 5vw, 4.1rem) !important;
  line-height: 1.06 !important;
  letter-spacing: -0.025em !important;
}

/* Extracto: un poco más cómodo */
.home .wp-block-post-template > li:first-child .wp-block-post-excerpt,
.home .wp-block-post-template > li:first-child .wp-block-post-excerpt p {
  font-size: 1.05rem !important;
  line-height: 1.55 !important;
}

/* Imagen de apertura: algo más presente */
.home .wp-block-post-template > li:first-child .wp-block-post-featured-image img {
  width: 100% !important;
  max-width: 290px !important;
  height: auto !important;
  object-fit: cover !important;
}

/* Móvil: no tocar demasiado */
@media (max-width: 768px) {
  .home hr,
  .home .wp-block-separator {
    width: 86% !important;
    margin: 2rem auto !important;
  }

  .home .wp-block-post-template > li:first-child .wp-block-post-title,
  .home .wp-block-post-template > li:first-child .wp-block-post-title a {
    font-size: 2rem !important;
    line-height: 1.12 !important;
  }

  .home .wp-block-post-template > li:first-child .wp-block-post-featured-image img {
    max-width: 100% !important;
  }
}
/* ================================================================
   CABECERA · FORZAR ESTÉTICA CLARA EN TODO EL SITIO
   Corrige el fondo negro heredado del tema en entradas individuales
   ================================================================ */

/* El template part superior completo */
.wp-site-blocks > .wp-block-template-part:first-child,
.wp-site-blocks > .wp-block-template-part:first-child > *,
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-group,
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-group__inner-container,
.wp-site-blocks > .wp-block-template-part:first-child .has-background,
.wp-site-blocks > .wp-block-template-part:first-child .alignwide,
.wp-site-blocks > .wp-block-template-part:first-child .alignfull {
  background: var(--mlm-paper) !important;
  background-color: var(--mlm-paper) !important;
  color: var(--mlm-ink) !important;
}

/* Cabecera semántica, por si el tema usa header real */
header,
.site-header,
[role="banner"],
.wp-site-blocks > header,
.wp-site-blocks > header > *,
.wp-site-blocks > header .wp-block-group,
.wp-site-blocks > header .has-background,
.wp-site-blocks > header .alignwide,
.wp-site-blocks > header .alignfull {
  background: var(--mlm-paper) !important;
  background-color: var(--mlm-paper) !important;
  color: var(--mlm-ink) !important;
}

/* Línea inferior de cabecera */
.wp-site-blocks > .wp-block-template-part:first-child,
header,
.site-header,
[role="banner"],
.wp-site-blocks > header {
  border-bottom: 1px solid var(--mlm-border) !important;
}

/* Título del sitio dentro de la cabecera */
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-site-title,
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-site-title a,
header .wp-block-site-title,
header .wp-block-site-title a,
.site-title,
.site-title a {
  color: var(--mlm-ink) !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* Navegación dentro de la cabecera */
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-navigation a,
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-navigation-item__content,
header .wp-block-navigation a,
header .wp-block-navigation-item__content,
header nav a {
  color: var(--mlm-ink-faded) !important;
  background: transparent !important;
  text-decoration: none !important;
}

.wp-site-blocks > .wp-block-template-part:first-child .wp-block-navigation a:hover,
.wp-site-blocks > .wp-block-template-part:first-child .wp-block-navigation-item__content:hover,
header .wp-block-navigation a:hover,
header .wp-block-navigation-item__content:hover,
header nav a:hover {
  color: var(--mlm-moss) !important;
}

/* Evita pseudoelementos oscuros del tema */
.wp-site-blocks > .wp-block-template-part:first-child::before,
.wp-site-blocks > .wp-block-template-part:first-child::after,
.wp-site-blocks > .wp-block-template-part:first-child *::before,
.wp-site-blocks > .wp-block-template-part:first-child *::after,
header::before,
header::after,
header *::before,
header *::after {
  background-color: transparent !important;
  border-color: var(--mlm-border) !important;
}