/*
Theme Name: Sofás Editorial
Theme URI: https://www.thesofacompany.es
Author: The Sofa Company
Description: Tema editorial a medida para la red de medios de sofás. Blanco y negro con un acento en los enlaces, ancho de 1280 px, tipografía del sistema (sin fuentes externas: no se envía la IP del visitante a terceros) y tablas con estilo propio. Incluye title, meta description, Open Graph, JSON-LD y robots, porque la red no usa plugin de SEO.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: sofas
Tags: editorial, blog, accessibility-ready, custom-menu, featured-images
*/

/* ==========================================================================
   1. Variables
   ========================================================================== */
:root {
  --ancho: 1280px;          /* el ancho que se pidió */
  --ancho-texto: 44rem;     /* columna de lectura: ~72 caracteres */
  --tinta: #0a0a0a;         /* negro, no #000: menos fatiga en pantalla */
  --tinta-media: #4a4a4a;
  --tinta-suave: #767676;   /* cumple 4.5:1 sobre blanco */
  --papel: #ffffff;
  --papel-hueso: #f6f5f3;
  --linea: #e3e1dd;
  --linea-fuerte: #0a0a0a;
  --acento: #c1121f;        /* el color de los enlaces */
  --acento-oscuro: #8e0c17; /* para hover: mantiene el contraste en texto */
  --acento-papel: #fdf3f4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sombra: 0 1px 2px rgba(10,10,10,.04), 0 8px 24px -12px rgba(10,10,10,.18);
  --sombra-alta: 0 2px 4px rgba(10,10,10,.06), 0 20px 48px -20px rgba(10,10,10,.28);
  --radio: 2px;             /* esquinas casi rectas: más editorial que redondeado */
  --transicion: 180ms cubic-bezier(.2,.6,.3,1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--acento);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: color var(--transicion), text-decoration-thickness var(--transicion);
}
a:hover, a:focus {
  color: var(--acento-oscuro);
  text-decoration-thickness: 3px;
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 3px;
  border-radius: var(--radio);
}

::selection { background: var(--tinta); color: var(--papel); }

/* ==========================================================================
   3. Tipografía
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  color: var(--tinta);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
h3 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1.4em; }
strong, b { font-weight: 700; }
small { font-size: .875rem; color: var(--tinta-suave); }

code, kbd, pre, samp { font-family: var(--mono); font-size: .9em; }
code {
  background: var(--papel-hueso);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: .1em .35em;
}
pre {
  background: var(--tinta);
  color: #f2f2f2;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  border-radius: var(--radio);
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

hr {
  border: 0;
  height: 1px;
  background: var(--linea);
  margin: 3rem 0;
}

/* Rótulos: la pieza que da el aire profesional. Mayúsculas, muy espaciadas. */
.rotulo {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--acento);
  line-height: 1.4;
}
.rotulo--tinta { color: var(--tinta-suave); }

/* ==========================================================================
   4. Estructura
   ========================================================================== */
.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.contenedor--texto { max-width: calc(var(--ancho-texto) + 6rem); }

.saltar {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--tinta);
  color: var(--papel);
  padding: .75rem 1.25rem;
  z-index: 100;
}
.saltar:focus { left: 1rem; top: 1rem; }

/* ==========================================================================
   5. Cabecera
   ========================================================================== */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--linea);
  transition: box-shadow var(--transicion);
}
.cabecera.esta-fija { box-shadow: var(--sombra); }

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

.marca {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--tinta);
  text-decoration: none;
  white-space: nowrap;
}
.marca:hover { color: var(--tinta); text-decoration: none; }
.marca__punto { color: var(--acento); }
.marca__lema {
  display: block;
  font-family: var(--sans);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-top: .15rem;
}

/* Botón que abre el panel */
.abrir-panel {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  background: none;
  border: 0;
  padding: .45rem .55rem .45rem 0;
  font: inherit;
  cursor: pointer;
  color: var(--tinta);
  flex-shrink: 0;
}
.abrir-panel__rayas { display: block; width: 22px; }
.abrir-panel__rayas span {
  display: block;
  height: 2px;
  background: var(--tinta);
  margin: 4px 0;
  transition: background var(--transicion), width var(--transicion);
}
.abrir-panel__rayas span:nth-child(2) { width: 15px; }
.abrir-panel:hover .abrir-panel__rayas span { background: var(--acento); }
.abrir-panel:hover .abrir-panel__rayas span:nth-child(2) { width: 22px; }
.abrir-panel__texto {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
@media (max-width: 480px) { .abrir-panel__texto { display: none; } }

/* Secciones en línea: solo cuando hay sitio de verdad. En pantallas estrechas
   toda la navegación vive en el panel. */
.nav--linea { display: none; margin-left: auto; }
@media (min-width: 1080px) { .nav--linea { display: flex; } }
.nav ul { list-style: none; display: flex; align-items: center; gap: .15rem; margin: 0; padding: 0; }
.nav a {
  display: block;
  padding: .5rem .65rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--tinta);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}
.nav a::after {
  content: "";
  position: absolute;
  left: .65rem; right: .65rem; bottom: .2rem;
  height: 2px;
  background: var(--acento);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transicion);
}
.nav a:hover::after, .nav a:focus::after,
.nav .current-menu-item > a::after,
.nav .current-cat > a::after { transform: scaleX(1); }
.nav .current-menu-item > a, .nav .current-cat > a { color: var(--acento); }

/* Lupa */
.cabecera__buscar {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  color: var(--tinta);
  border: 1px solid var(--linea);
  border-radius: 50%;
  flex-shrink: 0;
}
.cabecera__buscar:hover { color: var(--papel); background: var(--tinta); border-color: var(--tinta); }
.nav--linea + .cabecera__buscar { margin-left: .5rem; }
.marca { margin-right: auto; }
@media (min-width: 1080px) { .marca { margin-right: 0; } }

/* ==========================================================================
   5b. Panel lateral
   ========================================================================== */
.panel-fondo {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,.55);
  backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0;
  transition: opacity 240ms ease;
}
.panel-fondo.esta-visible { opacity: 1; }

.panel {
  position: fixed;
  top: 0; left: 0;
  z-index: 70;
  width: min(26rem, 88vw);
  height: 100%;
  background: var(--tinta);
  color: #f2f0ed;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(.2,.7,.25,1);
  box-shadow: 30px 0 60px -30px rgba(10,10,10,.5);
  overscroll-behavior: contain;
}
.panel.esta-abierto { transform: none; }
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }

.panel__cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}
.panel .marca { color: var(--papel); margin: 0; font-size: 1.2rem; }
.panel .marca:hover { color: var(--papel); }

.cerrar-panel {
  background: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  width: 2.4rem; height: 2.4rem;
  display: grid;
  place-items: center;
  color: #f2f0ed;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transicion);
}
.cerrar-panel:hover { background: var(--acento); border-color: var(--acento); color: #fff; transform: rotate(90deg); }

.panel__cuerpo { padding: 1.5rem 1.75rem 2.5rem; overflow-y: auto; flex: 1; }
.panel__buscador .buscador { max-width: none; margin-bottom: 2rem; }
.panel__buscador input { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #fff; }
.panel__buscador input::placeholder { color: #8f8c87; }
.panel__buscador .boton { background: var(--acento); border-color: var(--acento); }
.panel__buscador .boton:hover { background: #fff; color: var(--tinta); border-color: #fff; }

.panel__titulo {
  font-family: var(--sans);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #8f8c87;
  margin: 0 0 .75rem;
}
.panel__titulo + * { margin-bottom: 2.25rem; }

.panel__nav ul, .panel__legal ul { list-style: none; margin: 0; padding: 0; }
.panel__nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .95rem 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #f2f0ed;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  transition: color var(--transicion), padding-left var(--transicion);
}
.panel__nav a:hover, .panel__nav a:focus-visible { color: #fff; padding-left: .4rem; }
.panel__nav a[aria-current] { color: var(--acento); }
.panel__num {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--acento);
  flex-shrink: 0;
  padding-top: .35rem;
}
.panel__nombre { flex: 1; }
.panel__flecha { opacity: 0; transform: translateX(-6px); transition: all var(--transicion); flex-shrink: 0; }
.panel__nav a:hover .panel__flecha, .panel__nav a:focus-visible .panel__flecha { opacity: 1; transform: none; }

.panel__legal a { color: #bdbab5; text-decoration: none; font-size: .9375rem; display: inline-block; padding: .35rem 0; }
.panel__legal a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; }
.panel__nota { font-size: .8125rem; color: #74716c; margin: 1.5rem 0 0; line-height: 1.6; }

/* Mientras el panel está abierto, la página no se desplaza por detrás. */
body.panel-abierto { overflow: hidden; }

/* ==========================================================================
   6. Portada y archivos
   ========================================================================== */
.titulo-seccion {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 3px solid var(--linea-fuerte);
  padding-bottom: .75rem;
  margin: 3.5rem 0 2.5rem;
}
.titulo-seccion h1, .titulo-seccion h2 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
.titulo-seccion__cuenta { margin-left: auto; font-size: .8125rem; color: var(--tinta-suave); white-space: nowrap; }
.seccion-intro { max-width: var(--ancho-texto); color: var(--tinta-media); font-size: 1.125rem; margin: -1.5rem 0 2.5rem; }

/* Destacado de portada: una pieza grande que entra por los ojos */
.destacada {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 3vw, 3rem) 0 clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--linea);
}
.destacada__media { position: relative; overflow: hidden; border-radius: var(--radio); background: var(--papel-hueso); }
.destacada__media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(.2,.6,.3,1);
}
.destacada:hover .destacada__media img { transform: scale(1.03); }
.destacada h2 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3.1rem); margin-bottom: .6rem; }
.destacada h2 a { color: var(--tinta); text-decoration: none; }
.destacada h2 a:hover { color: var(--tinta); text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 3px; }
.destacada__entradilla { font-size: 1.1875rem; color: var(--tinta-media); margin-bottom: 1rem; }

@media (max-width: 820px) {
  .destacada { grid-template-columns: 1fr; }
  .destacada__media { order: -1; }
}

/* Rejilla de fichas */
.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1.75rem, 3vw, 2.75rem);
}

.ficha { display: flex; flex-direction: column; }
.ficha__media {
  overflow: hidden;
  border-radius: var(--radio);
  background: var(--papel-hueso);
  margin-bottom: 1rem;
}
.ficha__media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(.2,.6,.3,1);
}
.ficha:hover .ficha__media img { transform: scale(1.04); }
.ficha h3 { font-size: 1.3rem; margin-bottom: .45rem; }
.ficha h3 a { color: var(--tinta); text-decoration: none; }
.ficha:hover h3 a { text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; }
.ficha__entradilla { color: var(--tinta-media); font-size: .9688rem; margin-bottom: .85rem; }
.ficha__pie { margin-top: auto; }

/* Línea de datos (firma, fecha, lectura) */
.datos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  font-size: .8125rem;
  color: var(--tinta-suave);
  font-family: var(--sans);
}
.datos > * + *::before {
  content: "·";
  margin-right: .9rem;
  color: var(--linea);
}
.datos a { color: var(--tinta-media); text-decoration: none; font-weight: 600; }
.datos a:hover { color: var(--acento); text-decoration: underline; }

/* Etiqueta de categoría */
.etiqueta-cat {
  display: inline-block;
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--acento);
  text-decoration: none;
  margin-bottom: .55rem;
}
.etiqueta-cat:hover { color: var(--acento-oscuro); text-decoration: underline; }

/* ==========================================================================
   7. Entrada
   ========================================================================== */
.entrada__cabecera {
  max-width: calc(var(--ancho-texto) + 6rem);
  margin: clamp(2rem, 4vw, 3.5rem) auto clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
}
.entrada__cabecera h1 { margin-bottom: 1rem; }
.entrada__dek {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1rem + .5vw, 1.375rem);
  line-height: 1.5;
  color: var(--tinta-media);
  margin: 0 auto 1.5rem;
  max-width: 38rem;
}
.entrada__cabecera .datos { justify-content: center; }

.entrada__portada {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  background: var(--papel-hueso);
  border-radius: var(--radio);
  overflow: hidden;
}
.entrada__portada img { width: 100%; max-height: 34rem; object-fit: cover; }
.entrada__portada figcaption {
  font-size: .8125rem;
  color: var(--tinta-suave);
  padding: .7rem 1rem;
  text-align: center;
  background: var(--papel);
}

.contenido { max-width: var(--ancho-texto); margin-inline: auto; font-size: 1.125rem; }
.contenido > * { margin-inline: auto; }

/* La entradilla del artículo, más grande */
.contenido > p:first-of-type { font-size: 1.25rem; line-height: 1.6; color: var(--tinta); }

.contenido h2 {
  margin-top: 2.75em;
  padding-top: .6em;
  border-top: 3px solid var(--linea-fuerte);
}
.contenido h3 { margin-top: 2em; }
.contenido h2 + p, .contenido h3 + p { margin-top: 0; }

.contenido ul, .contenido ol { margin: 0 0 1.5em; padding-left: 1.4em; }
.contenido li { margin-bottom: .55em; }
.contenido ul { list-style: none; padding-left: 1.3em; }
.contenido ul > li { position: relative; }
.contenido ul > li::before {
  content: "";
  position: absolute;
  left: -1.3em; top: .62em;
  width: .45em; height: .45em;
  background: var(--acento);
  border-radius: 50%;
}
.contenido ol { counter-reset: paso; list-style: none; padding-left: 0; }
.contenido ol > li {
  counter-increment: paso;
  position: relative;
  padding-left: 2.6em;
  margin-bottom: .9em;
}
.contenido ol > li::before {
  content: counter(paso);
  position: absolute;
  left: 0; top: .05em;
  width: 1.85em; height: 1.85em;
  display: grid;
  place-items: center;
  background: var(--tinta);
  color: var(--papel);
  font-family: var(--sans);
  font-size: .8em;
  font-weight: 700;
  border-radius: 50%;
}

.contenido blockquote {
  margin: 2.5em 0;
  padding: 0 0 0 1.5rem;
  border-left: 4px solid var(--acento);
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--tinta);
}
.contenido blockquote p:last-child { margin-bottom: 0; }
.contenido blockquote cite {
  display: block;
  margin-top: .8rem;
  font-family: var(--sans);
  font-size: .8125rem;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.contenido figure { margin: 2.5em auto; }
.contenido figcaption {
  font-size: .8438rem;
  color: var(--tinta-suave);
  padding-top: .6rem;
  border-top: 1px solid var(--linea);
  margin-top: .7rem;
}

/* Imágenes anchas: se salen de la columna de texto hasta el ancho del contenedor */
.contenido .alignwide, .contenido .wp-block-image.alignwide,
.contenido .wp-block-table.alignwide {
  max-width: min(var(--ancho), 100%);
  width: min(var(--ancho), 100vw - 2.5rem);
}

/* ==========================================================================
   8. TABLAS — se pidieron con estilo propio
   ========================================================================== */
/* Contenedor con scroll: una comparativa de tiendas no cabe en un móvil, y es mejor
   que se desplace dentro de su caja que romper el ancho de la página. */
.tabla-scroll {
  overflow-x: auto;
  margin: 2.5em 0;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  -webkit-overflow-scrolling: touch;
  /* Sombra que aparece solo cuando queda tabla por ver, a derecha o izquierda */
  background:
    linear-gradient(to right, var(--papel) 30%, rgba(255,255,255,0)) left center,
    linear-gradient(to left,  var(--papel) 30%, rgba(255,255,255,0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(10,10,10,.14), rgba(0,0,0,0)) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(10,10,10,.14), rgba(0,0,0,0)) right center;
  background-repeat: no-repeat;
  background-size: 48px 100%, 48px 100%, 16px 100%, 16px 100%;
  background-attachment: local, local, scroll, scroll;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.5;
  background: var(--papel);
}
table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--papel);
  background: var(--tinta);
  padding: .8rem 1rem;
}
thead th {
  background: var(--tinta);
  color: var(--papel);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: left;
  padding: .9rem 1rem;
  vertical-align: bottom;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
tbody th { text-align: left; font-weight: 700; font-family: var(--sans); font-size: .9375rem; }
th, td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--linea);
  vertical-align: top;
}
/* Primera columna fija en el scroll: en una comparativa es el nombre de la tienda,
   y sin esto te pierdes al desplazarte. */
tbody tr > :first-child {
  font-weight: 600;
  color: var(--tinta);
  background: inherit;
}
tbody tr:nth-child(even) { background: var(--papel-hueso); }
tbody tr:hover { background: var(--acento-papel); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td:empty::after { content: "—"; color: var(--tinta-suave); }

/* Celdas numéricas alineadas a la derecha con cifras tabulares */
td[data-num], td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  table { font-size: .875rem; }
  th, td { padding: .7rem .8rem; }
}

/* Tabla de bloque de WordPress: hereda todo lo de arriba */
.wp-block-table { margin: 2.5em 0; }
.wp-block-table > table { margin: 0; }
.wp-block-table figcaption { margin-top: .7rem; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--papel-hueso); }
.wp-block-table.is-style-stripes tbody tr:nth-child(even) { background: var(--papel); }

/* ==========================================================================
   9. Avisos y cajas destacadas
   ========================================================================== */
.caja {
  margin: 2.5em 0;
  padding: 1.5rem 1.75rem;
  background: var(--papel-hueso);
  border-left: 4px solid var(--tinta);
  border-radius: var(--radio);
}
.caja > :last-child { margin-bottom: 0; }
.caja__titulo {
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .6rem;
}
.caja--aviso { background: var(--acento-papel); border-left-color: var(--acento); }
.caja--aviso .caja__titulo { color: var(--acento-oscuro); }

/* ==========================================================================
   10. Pie de entrada: firma, categorías, siguiente
   ========================================================================== */
.firma {
  max-width: var(--ancho-texto);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  padding: 1.75rem;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.firma img { width: 4rem; height: 4rem; border-radius: 50%; flex-shrink: 0; background: var(--papel-hueso); }
.firma__nombre { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; margin: 0 0 .3rem; }
.firma__nombre a { color: var(--tinta); text-decoration: none; }
.firma__nombre a:hover { color: var(--acento); }
.firma p { font-size: .9375rem; color: var(--tinta-media); margin: 0; }

.terminos { max-width: var(--ancho-texto); margin: 2.5rem auto 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.terminos__et {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--tinta-media);
  text-decoration: none;
  border: 1px solid var(--linea);
  border-radius: 100px;
  padding: .35rem .85rem;
  transition: all var(--transicion);
}
.terminos__et:hover { border-color: var(--tinta); color: var(--tinta); background: var(--papel-hueso); text-decoration: none; }

.relacionadas { margin-top: clamp(3rem, 6vw, 5rem); padding-top: 0; }

/* Paginación */
.paginacion { margin: 4rem 0 0; }
.paginacion .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.paginacion .page-numbers {
  min-width: 2.75rem;
  padding: .6rem .85rem;
  text-align: center;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  color: var(--tinta);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 600;
}
.paginacion .page-numbers:hover { border-color: var(--tinta); background: var(--papel-hueso); }
.paginacion .page-numbers.current { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

/* Scroll infinito. La paginación se oculta por JS, no por CSS: si el script
   falla, vuelve a aparecer. */
.infinito {
  margin: 3.5rem 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  min-height: 2rem;
}
.infinito__estado {
  margin: 0;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}
.infinito__estado.esta-cargando {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--tinta);
}
.infinito__estado.esta-cargando::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--linea);
  border-top-color: var(--acento);
  border-radius: 50%;
  animation: girar 700ms linear infinite;
}
.infinito__fin { color: var(--tinta-suave); }
@keyframes girar { to { transform: rotate(360deg); } }

/* Las fichas que llegan por scroll entran con un fundido corto: se nota que ha
   pasado algo sin que dé saltos. */
.rejilla > article { animation: aparecer 320ms cubic-bezier(.2,.6,.3,1) both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rejilla > article { animation: none; }
  .infinito__estado.esta-cargando::before { animation-duration: 2s; }
}

/* ==========================================================================
   11. Pie
   ========================================================================== */
.pie {
  margin-top: clamp(4rem, 8vw, 7rem);
  background: var(--tinta);
  color: #d8d6d2;
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
}
.pie__rejilla {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
@media (max-width: 780px) { .pie__rejilla { grid-template-columns: 1fr; gap: 2rem; } }

.pie .marca, .pie__titulo { color: var(--papel); }
.pie__titulo {
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.pie p { color: #a9a6a1; font-size: .9375rem; max-width: 34rem; }
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin-bottom: .55rem; }
.pie a { color: #d8d6d2; text-decoration: none; font-size: .9375rem; }
.pie a:hover { color: var(--papel); text-decoration: underline; text-decoration-color: var(--acento); text-decoration-thickness: 2px; }
.pie__legal {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-size: .8125rem;
  color: #8a8782;
}
.pie__legal ul { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.pie__legal li { margin: 0; }

/* ==========================================================================
   12. Formularios y buscador
   ========================================================================== */
input[type="text"], input[type="search"], input[type="email"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: var(--papel);
  color: var(--tinta);
}
input:focus, textarea:focus, select:focus { border-color: var(--tinta); }

.buscador { display: flex; gap: .5rem; max-width: 30rem; }
.boton {
  display: inline-block;
  font-family: var(--sans);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  padding: .8rem 1.4rem;
  background: var(--tinta);
  color: var(--papel);
  border: 1px solid var(--tinta);
  border-radius: var(--radio);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transicion), color var(--transicion);
}
.boton:hover { background: var(--acento); border-color: var(--acento); color: var(--papel); text-decoration: none; }
.boton--linea { background: none; color: var(--tinta); }
.boton--linea:hover { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

/* ==========================================================================
   13. Migas, vacíos, utilidades
   ========================================================================== */
.migas { font-size: .8125rem; color: var(--tinta-suave); padding: 1.25rem 0 0; }
.migas ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.migas li + li::before { content: "/"; margin-right: .4rem; color: var(--linea); }
.migas a { color: var(--tinta-media); text-decoration: none; }
.migas a:hover { color: var(--acento); text-decoration: underline; }

.vacio { max-width: var(--ancho-texto); margin: 4rem auto; text-align: center; }
.vacio h1 { margin-bottom: 1rem; }

.visualmente-oculto {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.alignleft { float: left; margin: .4em 2rem 1.5rem 0; }
.alignright { float: right; margin: .4em 0 1.5rem 2rem; }
.aligncenter { margin-inline: auto; }
.wp-caption { max-width: 100%; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 600px) {
  .alignleft, .alignright { float: none; margin: 1.5rem auto; }
}

/* ==========================================================================
   14. Impresión
   ========================================================================== */
@media print {
  .cabecera, .pie, .relacionadas, .paginacion, .buscador { display: none !important; }
  body { font-size: 11pt; color: #000; }
  .contenido, .entrada__cabecera { max-width: none; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  .tabla-scroll { overflow: visible; box-shadow: none; }
  thead th { background: #000 !important; color: #fff !important; }
}
