/*
 Theme Name:   Twenty Twenty-Five Child — sietepeines
 Template:     twentytwentyfive
 Version:      3.0.0
 Description:  Tema hijo de Twenty Twenty-Five. Rediseño "índice mono":
               IBM Plex Mono para la estructura, Newsreader para la lectura,
               papel #FCFCFA, acento verde botella, numeración con huecos.
 Text Domain:  twentytwentyfive-child
*/

/* =========================================================
   0) TIPOGRAFÍAS
   Por defecto se cargan desde Google Fonts (functions.php,
   constante SP_GOOGLE_FONTS). Para autoalojarlas (RGPD + velocidad):
     1. Descarga los .woff2 en https://gwfh.mranftl.com
     2. Súbelos a /wp-content/themes/twentytwentyfive-child/fonts/
     3. Descomenta los @font-face de abajo
     4. Pon SP_GOOGLE_FONTS en false en functions.php
   ========================================================= */

/*
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/ibm-plex-mono-v19-latin-regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/ibm-plex-mono-v19-latin-500.woff2") format("woff2"); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:"IBM Plex Mono"; src:url("fonts/ibm-plex-mono-v19-latin-italic.woff2") format("woff2"); font-weight:400; font-style:italic; font-display:swap; }
@font-face { font-family:"Newsreader"; src:url("fonts/newsreader-v20-latin-regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Newsreader"; src:url("fonts/newsreader-v20-latin-500.woff2") format("woff2"); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:"Newsreader"; src:url("fonts/newsreader-v20-latin-italic.woff2") format("woff2"); font-weight:400; font-style:italic; font-display:swap; }
*/

/* =========================================================
   1) VARIABLES (claro y oscuro)
   Las usan los componentes propios; theme.json define la paleta
   equivalente para el editor.
   ========================================================= */

:root {
  --sp-papel:        #FCFCFA;
  --sp-papel-fila:   #F3F3EE;
  --sp-papel-sub:    #F8F8F4;
  --sp-tinta:        #141412;
  --sp-tinta-suave:  #6E6E66;
  --sp-acento:       #1D6E56;
  --sp-filete:       #E3E3DE;
  --sp-mono:  "IBM Plex Mono", "Courier New", Courier, monospace;
  --sp-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sp-papel:       #1C1C1A;
    --sp-papel-fila:  #26261F;
    --sp-papel-sub:   #222220;
    --sp-tinta:       #E8E6DF;
    --sp-tinta-suave: #9A9A90;
    --sp-acento:      #5FBF9D;
    --sp-filete:      #36362F;
  }
}

/* =========================================================
   2) BASE
   ========================================================= */

body.wp-site-blocks,
body {
  background: var(--sp-papel);
  color: var(--sp-tinta);
  font-family: var(--sp-mono);
}

a { color: var(--sp-tinta); transition: color 0.15s ease; }
a:hover, a:focus { color: var(--sp-acento); }

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

:focus-visible { outline: 2px solid var(--sp-acento); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* =========================================================
   3) CABECERA Y MENÚS
   La disposición (Inicio + buscador a la izquierda, menú a la
   derecha) se monta en el Editor del sitio; esto da estilo.
   ========================================================= */

header.wp-block-template-part { border-bottom: 0; }

.wp-block-site-title,
.wp-block-site-title a {
  font-family: var(--sp-mono);
  font-weight: 500;
  color: var(--sp-tinta);
  text-decoration: none;
}

.wp-block-navigation { font-family: var(--sp-mono); font-size: 14px; }
.wp-block-navigation a { color: var(--sp-tinta); text-decoration: none; }
.wp-block-navigation a:hover, .wp-block-navigation a:focus { color: var(--sp-acento); }

/* Cabecera a ancho casi completo, tres zonas (título · buscador · menú) */
header.wp-block-template-part > .wp-block-group { max-width: none; }

header .wp-block-site-title { flex: 0 0 auto; }
header .wp-block-navigation { flex: 0 0 auto; }

/* El buscador ocupa el centro y queda centrado entre título y menú */
/* Buscador (bloque core/search) — caja pequeña (≈92px), centrada en la cabecera */
.wp-block-search { max-width: 200px; }

header .wp-block-search {
  flex: 0 0 auto !important;
  width: 200px !important;
  max-width: 200px !important;
  margin-left: auto;
  margin-right: auto;
}

.wp-block-search__inside-wrapper {
  border: 1px solid var(--sp-filete);
  border-radius: 2px;
  background: var(--sp-papel);
  overflow: hidden;
  width: 200px !important;
  max-width: 200px !important;
}

.wp-block-search__input { width: 100% !important; min-width: 0 !important; }

.wp-block-search__input {
  border: 0 !important;
  background: transparent;
  color: var(--sp-tinta);
  font-family: var(--sp-mono);
  font-size: 14px;
  height: 38px;
  padding: 0 10px;
}

.wp-block-search__input:focus { outline: none; box-shadow: none; }

.wp-block-search .wp-block-search__button {
  margin: 0;
  background: transparent;
  color: var(--sp-tinta-suave);
  border: 0;
  font-family: var(--sp-mono);
  font-size: 13px;
  padding: 0 12px;
}

.wp-block-search .wp-block-search__button:hover { color: var(--sp-acento); }

/* =========================================================
   4) ENTRADA Y PÁGINA — columna de lectura
   El ancho lo fija theme.json (contentSize 740px). Aquí van
   ritmo y estilo del contenido.
   ========================================================= */

.wp-block-post-title { margin: 0 0 1.8rem; color: var(--sp-tinta); }

/* Entrada individual: columna de texto a 1021px (≈ +20% sobre los 851 previos).
   El resto del sitio (listas, índice) usa 1110px. */
.single-post .wp-block-post-title,
.single-post .entry-content,
.single-post .sp-post-meta,
.single-post .sp-post-nav {
  max-width: 1021px;
  margin-left: auto;
  margin-right: auto;
}

/* El bloque de contenido lleva la clase .entry-content */
.entry-content { color: var(--sp-tinta); }

.entry-content p { margin: 0 0 1.15em; }

.entry-content a {
  color: var(--sp-tinta);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--sp-tinta-suave);
}

.entry-content a:hover, .entry-content a:focus {
  color: var(--sp-acento);
  text-decoration-color: var(--sp-acento);
}

.entry-content h2, .entry-content h3 {
  font-family: var(--sp-mono);
  font-weight: 500;
  line-height: 1.35;
  margin: 2.2em 0 0.8em;
}

.entry-content h2 { font-size: 21px; }
.entry-content h3 { font-size: 17px; }

/* Citas — la voz ajena, distinguida */
.entry-content blockquote {
  margin: 2.2rem 0;
  padding: 0.2rem 0 0.2rem 1.5rem;
  border-left: 2px solid var(--sp-acento);
  font-family: var(--sp-serif);
  font-style: italic;
  font-size: 1.12em;
  line-height: 1.65;
  color: var(--sp-tinta);
  background: transparent;
}

.entry-content blockquote p { margin-bottom: 0.6em; }

.entry-content blockquote cite,
.entry-content blockquote footer {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--sp-mono);
  font-style: normal;
  font-size: 13px;
  color: var(--sp-tinta-suave);
}

.entry-content blockquote cite::before,
.entry-content blockquote footer::before { content: "— "; }

.entry-content figure { margin: 2rem auto; text-align: center; }

.entry-content figcaption {
  font-family: var(--sp-mono);
  font-size: 12.5px;
  color: var(--sp-tinta-suave);
  margin-top: 0.6rem;
}

.entry-content hr,
.wp-block-separator {
  width: 56px; max-width: 56px; height: 1px; border: 0;
  background: var(--sp-tinta); opacity: 1; margin: 2.5rem auto;
}

/* Metadatos de la casa (shortcode [sp_meta]) */
.sp-post-meta {
  font-family: var(--sp-mono);
  font-size: 13px;
  color: var(--sp-acento);
  margin: 1.5rem 0 0.4rem;
}

.sp-post-meta .sp-post-ciclo {
  display: block;
  color: var(--sp-tinta-suave);
  margin-top: 0.2rem;
}

.sp-post-meta a { color: inherit; text-decoration: none; }
.sp-post-meta a:hover { text-decoration: underline; }

/* Navegación anterior / siguiente (shortcode [sp_nav]) */
.sp-post-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin: 3.5rem 0 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sp-filete);
  font-family: var(--sp-mono);
  font-size: 13px;
}

.sp-post-nav a { color: var(--sp-tinta-suave); text-decoration: none; }
.sp-post-nav a:hover, .sp-post-nav a:focus { color: var(--sp-acento); }
.sp-post-nav .sp-nav-centro { color: var(--sp-tinta-suave); }
.sp-post-nav .sp-nav-sig { text-align: right; }

/* =========================================================
   5) LISTAS DE LA CASA — portada, índice, archivo
   (shortcodes [sp_recientes] [sp_indice] [sp_del_archivo])
   ========================================================= */

.sp-lista, .sp-indice {
  max-width: 1110px;
  margin: 0 auto;
  font-family: var(--sp-mono);
}

.sp-fila {
  display: flex;
  gap: 18px;
  align-items: baseline;
  padding: 11px 0;
  font-size: 15px;
}

.sp-num { color: var(--sp-acento); flex: 0 0 auto; min-width: 3.2ch; }
.sp-titulo { flex: 1 1 auto; min-width: 0; }
.sp-titulo a { color: var(--sp-tinta); text-decoration: none; }
.sp-titulo a:hover, .sp-titulo a:focus { color: var(--sp-acento); }

.sp-fila-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--sp-tinta-suave);
  white-space: nowrap;
}

.sp-anio {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.8rem 0 0.4rem;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--sp-tinta-suave);
}

.sp-anio::after {
  content: "";
  flex: 1;
  border-bottom: 1px dotted var(--sp-tinta-suave);
  opacity: 0.5;
}

.sp-filtros {
  margin: 0 0 1.6rem;
  font-size: 13px;
  color: var(--sp-tinta-suave);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sp-chip {
  display: inline-block;
  font-family: var(--sp-mono);
  font-size: 12.5px;
  color: var(--sp-acento);
  background: transparent;
  border: 1px solid var(--sp-filete);
  border-radius: 2px;
  padding: 3px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sp-chip:hover { border-color: var(--sp-acento); color: var(--sp-acento); }

.sp-chip.activo {
  background: var(--sp-acento);
  border-color: var(--sp-acento);
  color: var(--sp-papel);
}

.sp-ciclo-cab { cursor: pointer; }
.sp-ciclo-cab:hover { background: var(--sp-papel-fila); }

.sp-ciclo-cab .sp-num { transition: transform 0.15s ease; transform-origin: 40% 55%; }
.sp-ciclo.abierto > .sp-ciclo-cab { background: var(--sp-papel-fila); }
.sp-ciclo.abierto > .sp-ciclo-cab .sp-num { transform: rotate(90deg); }

.sp-ciclo-cuerpo { display: none; }
.sp-ciclo.abierto > .sp-ciclo-cuerpo { display: block; }

.sp-ciclo-cuerpo .sp-fila {
  padding-left: 34px;
  background: var(--sp-papel-sub);
  font-size: 14px;
}

.sp-indice-pie { margin: 1.6rem 0 0; font-size: 12px; color: var(--sp-tinta-suave); }

.sp-archivo-titulo {
  max-width: 1110px;
  margin: 1.5rem auto 0.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sp-filete);
  font-family: var(--sp-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--sp-tinta-suave);
}

.sp-archivo-completo {
  max-width: 1110px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--sp-filete);
  font-family: var(--sp-mono);
  font-size: 14px;
}

.sp-archivo-completo a { color: var(--sp-acento); text-decoration: none; }
.sp-archivo-completo a:hover { text-decoration: underline; }

/* Paginación del índice (paginate_links) */
.sp-indice-paginacion { max-width: 1110px; margin: 2.5rem auto 1rem; }

.sp-indice-paginacion ul.page-numbers {
  list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0;
}

.sp-indice-paginacion li { margin: 0; }

.sp-indice-paginacion .page-numbers {
  font-family: var(--sp-mono);
  font-size: 14px;
  color: var(--sp-tinta);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 2px;
}

.sp-indice-paginacion a.page-numbers:hover { color: var(--sp-acento); }
.sp-indice-paginacion .page-numbers.current { background: var(--sp-acento); color: var(--sp-papel); }
.sp-indice-paginacion .page-numbers.dots { color: var(--sp-tinta-suave); }

.sp-oculto { display: none !important; }

/* =========================================================
   6) ARCHIVOS DE CATEGORÍA Y BÚSQUEDA — query loop minimalista
   ========================================================= */

.wp-block-query-title {
  font-family: var(--sp-mono);
  font-size: 18px;
  font-weight: 500;
  margin: 0 auto 1.2rem;
  max-width: 1110px;
}

.wp-block-query .wp-block-post-template {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1110px;
  gap: 0 !important;
}

.wp-block-query .wp-block-post-template > li {
  margin: 0;
  padding: 11px 0;
}

.wp-block-query .wp-block-post-title {
  font-family: var(--sp-mono);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

.wp-block-query .wp-block-post-title a { color: var(--sp-tinta); text-decoration: none; }
.wp-block-query .wp-block-post-title a:hover { color: var(--sp-acento); }

.wp-block-query-pagination {
  max-width: 1110px;
  margin: 2.5rem auto 0;
  font-family: var(--sp-mono);
  font-size: 14px;
  gap: 4px;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .wp-block-query-pagination-numbers a { color: var(--sp-tinta); text-decoration: none; }
.wp-block-query-pagination a:hover { color: var(--sp-acento); }

.wp-block-query-pagination .page-numbers.current {
  background: var(--sp-acento);
  color: var(--sp-papel);
  padding: 2px 8px;
  border-radius: 2px;
}

/* =========================================================
   7) PIE EDITORIAL
   Se oculta el pie del tema (parte de plantilla) y se inyecta
   el pie editorial vía wp_footer (functions.php).
   ========================================================= */

footer.wp-block-template-part { display: none !important; }

.pie-editorial {
  margin-top: 4rem;
  padding: 1.6rem 20px 1.4rem;
  border-top: 1px solid var(--sp-filete);
  text-align: center;
  font-family: var(--sp-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--sp-tinta-suave);
  background: var(--sp-papel);
}

.pie-editorial a { color: var(--sp-acento); text-decoration: none; }
.pie-editorial a:hover, .pie-editorial a:focus { text-decoration: underline; }

/* =========================================================
   8) RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {
  .wp-block-post-title { font-size: 23px; }
  .entry-content { font-size: 17.5px; line-height: 1.68; }

  .sp-fila { gap: 12px; }
  .sp-fila-meta { font-size: 11px; }
  .sp-ciclo-cuerpo .sp-fila { padding-left: 22px; }

  .sp-post-nav { flex-direction: column; gap: 8px; }
  .sp-post-nav .sp-nav-sig { text-align: left; }
}
