/* =====================================================================
   Indus River Basin · artículos (tema 1.10)
   Páginas y entradas: columna de lectura + columna lateral, tipografía de
   archivo, tablas legibles en claro y oscuro, citas documentales, figuras
   numeradas, notas, impresión, y una capa que neutraliza los colores en
   línea del contenido antiguo (pegado de Word / editor clásico) que dejaba
   texto claro sobre fondo blanco.
   ===================================================================== */

/* ── Héroe: datos de lectura ─────────────────────────────────────── */
.page-hero .post-meta { gap: 8px 22px; }
.page-hero .post-meta .post-meta-item { display: inline-flex; align-items: baseline; gap: 6px; }
.page-hero .post-meta .post-meta-item + .post-meta-item::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--brick); align-self: center; margin-right: 16px; opacity: .8; }
.page-hero .post-meta .k { color: var(--brick); text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }

/* ── Retícula del artículo ───────────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: clamp(40px, 5vw, 76px); align-items: start; }
.article-grid > .entry { min-width: 0; }
.page-body.article-body { padding-top: clamp(32px, 4.5vw, 56px); }
@media (max-width: 1020px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .article-grid > .article-aside { display: contents; }
  .article-aside .toc { order: -1; }
  .article-aside .section-box, .article-aside .tools { order: 2; }
}

/* Columna lateral */
.article-aside { position: sticky; top: 92px; display: grid; gap: 14px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 6px; }
body.admin-bar .article-aside { top: 124px; max-height: calc(100vh - 148px); }
@media (max-width: 1020px) { .article-aside { position: static; max-height: none; overflow: visible; } }
.aside-box { border: 1px solid var(--line); background: color-mix(in srgb, var(--d1) 40%, transparent); padding: 14px 16px; min-width: 0; }
.aside-box[hidden] { display: none; }
.aside-box > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.aside-box > summary::-webkit-details-marker { display: none; }
.aside-box .chev { width: 8px; height: 8px; border-right: 1.5px solid var(--fg-2); border-bottom: 1.5px solid var(--fg-2); transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.aside-box[open] .chev { transform: rotate(-135deg) translate(-2px, 0); }
@media (min-width: 1021px) { .aside-box > summary { cursor: default; pointer-events: none; } .aside-box .chev { display: none; } }

/* Índice "En esta página" */
.toc-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); counter-reset: toc; }
.toc-list li { margin: 0; }
.toc-list a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--fg-2); text-decoration: none; font-size: .87rem; line-height: 1.35; transition: color .15s, border-color .15s; }
.toc-list a:hover { color: var(--fg); }
.toc-list a[aria-current="true"] { color: var(--fg); border-left-color: var(--brick); }
.toc-list .lvl-3 a { padding-left: 28px; font-size: .82rem; }

/* "En esta sección" */
.section-box .rail-parent { display: block; margin-top: 12px; font: 500 1.22rem/1.2 var(--display); text-decoration: none; }
.section-box .rail-parent:hover { color: var(--brick); }
.section-box ol.tindex { margin-top: 10px; }
.section-box ol.tindex a { font-size: .86rem; color: var(--fg-2); padding: 9px 0; grid-template-columns: 30px minmax(0, 1fr) auto; }
.section-box ol.tindex a:hover, .section-box ol.tindex a[aria-current="page"] { color: var(--fg); }
.section-box ol.tindex a[aria-current="page"]::before { color: var(--fg); }

/* Herramientas */
.tools { display: grid; gap: 2px; padding: 8px; }
.tools .tool { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: var(--fg-2); font: 500 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; text-align: left; }
.tools .tool:hover { color: var(--fg); background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.tools .tool svg { width: 16px; height: 16px; fill: none; stroke: var(--brick); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tools .tool.is-done { color: var(--brick); }
@media (max-width: 1020px) { .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tools .tool { justify-content: center; } }
@media (max-width: 480px) { .tools .tool span { font-size: .64rem; } }

/* Barra de progreso de lectura */
.read-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 100001; pointer-events: none; background: transparent; }
.read-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--glacier), var(--brick)); transform-origin: 0 50%; transform: scaleX(0); }

/* Fichas de subpáginas y anterior/siguiente dentro del artículo */
.child-section { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); }
.child-section > .eyebrow { display: block; font: 500 .74rem/1.2 var(--mono); }
.child-section .child-grid { margin-top: 18px; }

/* ── Contenido: base (todas las .entry-content) ──────────────────── */
.entry-content { font-size: 1.065rem; line-height: 1.78; color: var(--fg); counter-reset: fig tab; overflow-wrap: break-word; }
.entry-content :where(p) { margin: 0; text-wrap: pretty; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h1, .entry-content h2, .entry-content h3 { color: var(--fg); scroll-margin-top: 96px; }
.entry-content h1 { font-size: clamp(2rem, 3.6vw, 2.7rem); margin-top: 1.6em; }
.entry-content h2 { font-size: clamp(1.75rem, 3vw, 2.3rem); margin-top: 2em; padding-top: .55em; border-top: 1px solid var(--line); }
.entry-content h3 { font-size: clamp(1.38rem, 2.1vw, 1.7rem); margin-top: 1.7em; }
.entry-content h4, .entry-content h5, .entry-content h6 { font: 500 .78rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brick); margin-top: 2em; scroll-margin-top: 96px; }
.entry-content :is(h1, h2, h3, h4, h5, h6) + * { margin-top: .7em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > h2:first-child { border-top: 0; padding-top: 0; }
.entry-content a { color: var(--glacier); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--glacier) 45%, transparent); transition: color .15s, text-decoration-color .15s; }
.entry-content a:hover { color: var(--brick); text-decoration-color: var(--brick); }
.entry-content strong, .entry-content b { color: var(--fg); font-weight: 600; }
.entry-content em, .entry-content i { font-style: italic; }
.entry-content small { font-size: .85em; }
.entry-content mark { background: color-mix(in srgb, var(--sand) 30%, transparent); color: var(--fg); padding: 0 .2em; }
.entry-content abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.entry-content sup, .entry-content sub { font-size: .7em; line-height: 0; }
.entry-content sup a { text-decoration: none; font-family: var(--mono); padding: 0 2px; }
.entry-content ul, .entry-content ol { padding-left: 1.35em; }
.entry-content li + li { margin-top: .4em; }
.entry-content li > ul, .entry-content li > ol { margin-top: .4em; }
.entry-content li::marker { color: var(--brick); }
.entry-content ol > li::marker { font: .85em var(--mono); }
.entry-content dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; }
.entry-content dt { font: 500 .74rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brick); }
.entry-content dd { margin: 0; }
@media (max-width: 600px) { .entry-content dl { grid-template-columns: 1fr; gap: 2px; } .entry-content dd + dt { margin-top: 10px; } }
.entry-content img { max-width: 100%; height: auto; }
.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object { max-width: 100%; }
.entry-content code, .entry-content kbd { font: .88em var(--mono); background: var(--bg-2); padding: 2px 6px; border-radius: 2px; }
.entry-content pre { font: .88rem/1.6 var(--mono); background: var(--d5); border: 1px solid var(--line); padding: 16px 18px; overflow-x: auto; }
.entry-content pre code { background: none; padding: 0; }

/* Enlaces a documentos */
.entry-content a:is([href$=".pdf" i], [href*=".pdf?" i])::after { content: "PDF"; display: inline-block; margin-left: 6px; padding: 1px 5px 0; border: 1px solid currentColor; border-radius: 2px; font: 500 .58rem/1.4 var(--mono); letter-spacing: .1em; vertical-align: 2px; opacity: .8; }
.entry-content .wp-block-file a:is([href$=".pdf" i])::after { display: none; }

/* Subtítulos falsos del contenido antiguo (párrafo en negrita), marcados por el JS. */
.entry-content p.is-subhead { font: 500 clamp(1.32rem, 2vw, 1.6rem)/1.25 var(--display); color: var(--fg); margin-top: 1.9em; padding-left: 14px; border-left: 2px solid var(--brick); scroll-margin-top: 96px; text-wrap: balance; }
.entry-content p.is-subhead :is(strong, b) { font-weight: 500; }
.entry-content p.is-subhead + * { margin-top: .7em; }
/* Título repetido dentro del contenido (ya está en el héroe). */
.entry-content .is-dup-title { display: none; }

/* Separador con marca */
.entry-content hr, .entry-content .wp-block-separator { border: 0; height: 1px; background: var(--line); margin: 2.8em auto; position: relative; overflow: visible; opacity: 1; }
.entry-content hr::after, .entry-content .wp-block-separator::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: 1px solid var(--brick); background: var(--bg); transform: translate(-50%, -50%) rotate(45deg); }
.entry-content .wp-block-separator.is-style-dots { background: none; height: auto; }
.entry-content .wp-block-separator.is-style-dots::after { display: none; }

/* ── Citas: documentales por defecto, grandes solo si se piden ───── */
.entry-content blockquote, .entry-content .wp-block-quote { margin: 1.8em 0; padding: 18px 22px 18px 26px; border: 0; border-left: 2px solid var(--brick); background: color-mix(in srgb, var(--bg-2) 55%, transparent); font: 400 1rem/1.72 var(--body); color: var(--fg); position: relative; }
.entry-content blockquote > * + * { margin-top: .8em; }
.entry-content blockquote p { margin: 0; }
.entry-content blockquote cite, .entry-content .wp-block-quote cite, .entry-content blockquote footer { display: block; margin-top: 12px; font: normal .74rem/1.5 var(--mono); letter-spacing: .08em; color: var(--fg-2); }
.entry-content blockquote cite::before { content: "— "; color: var(--brick); }
.entry-content .wp-block-quote.is-style-large, .entry-content .wp-block-quote.is-large { background: none; padding: 4px 0 4px 26px; font: italic 500 clamp(1.4rem, 2.4vw, 1.75rem)/1.4 var(--display); }
.entry-content .wp-block-pullquote { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; margin: 2.4em 0; text-align: left; }
.entry-content .wp-block-pullquote blockquote { border: 0; background: none; padding: 0; margin: 0; font: italic 500 clamp(1.6rem, 2.8vw, 2.15rem)/1.3 var(--display); }
.entry-content .wp-block-pullquote blockquote::before { content: "“"; display: block; font: 500 3.6rem/0.6 var(--display); color: var(--brick); margin-bottom: 10px; }

/* ── Figuras e imágenes ──────────────────────────────────────────── */
.entry-content figure { margin: 1.8em 0; }
.entry-content .wp-block-image img, .entry-content figure > img, .entry-content .wp-caption img { display: block; border: 1px solid var(--line); background: var(--bg-2); }
.entry-content figcaption, .entry-content .wp-element-caption, .entry-content .wp-caption-text, .entry-content .gallery-caption { font: .74rem/1.55 var(--mono); color: var(--fg-2); letter-spacing: .03em; margin-top: 10px; text-align: left; }
.entry-content :is(.wp-block-image, .wp-block-embed, .wp-block-video, .wp-caption):has(> :is(figcaption, .wp-caption-text)) { counter-increment: fig; }
.entry-content :is(.wp-block-image, .wp-block-embed, .wp-block-video) > figcaption::before, .entry-content .wp-caption .wp-caption-text::before { content: "Fig. " counter(fig) "  ·  "; color: var(--brick); white-space: pre; }
.entry-content .wp-caption { max-width: 100% !important; }
.entry-content .wp-block-image.aligncenter, .entry-content .wp-caption.aligncenter, .entry-content img.aligncenter { margin-inline: auto; display: block; }
.entry-content .wp-block-image.aligncenter figcaption { text-align: center; }
.entry-content .alignleft { float: left; margin: .35em 1.8em 1em 0; max-width: 46%; }
.entry-content .alignright { float: right; margin: .35em 0 1em 1.8em; max-width: 46%; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content::after { content: ""; display: table; clear: both; }
@media (max-width: 600px) { .entry-content .alignleft, .entry-content .alignright { float: none; margin: 1.4em 0; max-width: 100%; } }
.entry-content .wp-block-gallery, .entry-content .gallery { gap: 12px; }
.entry-content .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.entry-content .gallery-item { margin: 0; width: auto !important; }
.entry-content .gallery br { display: none; }
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper iframe { border: 1px solid var(--line); }
.entry-content .wp-block-video video { width: 100%; border: 1px solid var(--line); }

/* Botones, archivos, grupos */
.entry-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.entry-content .wp-block-button__link, .entry-content .wp-element-button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border: 1px solid var(--brick); border-radius: 2px; background: var(--brick); color: var(--on-brick); font: 500 .9rem/1 var(--body); text-decoration: none; }
.entry-content .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--fg); }
.entry-content .wp-block-button__link:hover { background: transparent; color: var(--fg); }
.entry-content .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--d1) 40%, transparent); }
.entry-content .wp-block-file a:not(.wp-block-file__button) { color: var(--fg); font-weight: 500; }
.entry-content .wp-block-file__button { margin-left: auto; background: var(--brick); color: var(--on-brick); border-radius: 2px; padding: 8px 14px; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; }
.entry-content .wp-block-file__embed { width: 100%; border: 1px solid var(--line); }
.entry-content .wp-block-cover, .entry-content .wp-block-group.has-background, .entry-content .wp-block-columns.has-background { padding: 28px; }
.entry-content .wp-block-columns { gap: 28px; }
.entry-content .wp-block-details { border: 1px solid var(--line); padding: 12px 16px; }
.entry-content .wp-block-details summary { cursor: pointer; font-weight: 600; }
.entry-content .alignwide { max-width: min(1100px, 92vw); }
.entry-content .alignfull { max-width: none; }

/* Notas al pie (bloque de WP y notas clásicas) */
.entry-content .wp-block-footnotes, .entry-content .footnotes { margin-top: 3em; padding-top: 18px; border-top: 1px solid var(--line); font-size: .88rem; line-height: 1.6; color: var(--fg-2); }
.entry-content .wp-block-footnotes li::marker, .entry-content .footnotes li::marker { font: .8em var(--mono); }
.entry-content .wp-block-footnotes a, .entry-content .footnotes a { word-break: break-word; }

/* ── Tablas ──────────────────────────────────────────────────────── */
/* Contenedor: borde, fondo de agua quieta y desplazamiento horizontal. */
.entry-content .wp-block-table, .entry-content .table-wrap { margin: 2em 0; padding: 0; border: 1px solid var(--line) !important; background: color-mix(in srgb, var(--d1) 45%, transparent); overflow-x: auto; position: relative; counter-increment: tab; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.entry-content .wp-block-table > table, .entry-content .table-wrap > table { margin: 0; border: 0 !important; }
.entry-content .wp-block-table figcaption, .entry-content .table-wrap > figcaption { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); }
.entry-content .wp-block-table figcaption::before { content: "Table " counter(tab) "  ·  "; color: var(--brick); white-space: pre; }
.entry-content table caption { caption-side: top; padding: 12px 16px; text-align: left; font: .74rem/1.5 var(--mono); color: var(--fg-2); letter-spacing: .04em; border-bottom: 1px solid var(--line); }

/* La tabla: transparente siempre. Neutraliza #f0f0f0 de las rayas de WP,
   fondos blancos y colores en línea del contenido antiguo. */
.entry-content table { width: 100% !important; max-width: none; height: auto !important; border-collapse: collapse; border-spacing: 0; border: 0; font-size: .94rem; line-height: 1.5; font-variant-numeric: tabular-nums; margin: 1.6em 0; }
.entry-content :is(table, thead, tbody, tfoot, tr, th, td, caption, colgroup, col) { background-color: transparent !important; background-image: none !important; color: inherit !important; }
.entry-content :is(th, td) :not(a) { color: inherit !important; background-color: transparent !important; }
.entry-content :is(th, td) :is(p, div, span, font) { font-family: inherit !important; font-size: inherit !important; }
.entry-content :is(th, td) p { margin: 0; }
.entry-content :is(th, td) p + p { margin-top: .4em; }
.entry-content table { color: var(--fg) !important; }
.entry-content :is(th, td) { padding: 13px 16px !important; text-align: left; vertical-align: top; border: 0 !important; border-bottom: 1px solid var(--line) !important; height: auto !important; }
.entry-content tbody tr:last-child > :is(td, th) { border-bottom: 0 !important; }

/* Encabezado: thead, celdas th o primera fila en negrita (marcada por el JS). */
.entry-content thead :is(th, td), .entry-content tr.is-head > :is(th, td) { font: 500 .7rem/1.35 var(--mono) !important; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2) !important; padding-top: 14px !important; padding-bottom: 12px !important; border-bottom: 1px solid color-mix(in srgb, var(--brick) 70%, var(--line)) !important; background-color: color-mix(in srgb, var(--d1) 80%, transparent) !important; white-space: nowrap; vertical-align: bottom; }
.entry-content thead :is(th, td) :is(strong, b), .entry-content tr.is-head :is(strong, b) { font-weight: 500; }
.entry-content tbody th { font-weight: 600; }

/* Filas alternas y realce al pasar: con tokens, así se leen en claro y en oscuro. */
.entry-content tbody tr:nth-child(even):not(.is-head):not(.is-total) > :is(td, th) { background-color: color-mix(in srgb, var(--bg-2) 60%, transparent) !important; }
.entry-content tbody tr:not(.is-head):hover > :is(td, th) { background-color: color-mix(in srgb, var(--brick) 9%, transparent) !important; }
.entry-content .wp-block-table.is-style-stripes { border-bottom: 1px solid var(--line) !important; }
.entry-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background-color: transparent !important; }

/* Pie y fila de total */
.entry-content tfoot :is(td, th), .entry-content tr.is-total > :is(td, th) { font-weight: 600; color: var(--fg) !important; border-top: 1px solid var(--brick) !important; border-bottom: 0 !important; background-color: color-mix(in srgb, var(--brick) 10%, transparent) !important; }
.entry-content tr.is-total > :first-child, .entry-content tr.is-total > .is-label { font: 600 .74rem/1.5 var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; }

/* Columnas numéricas (marcadas por el JS): alineadas a la derecha. */
.entry-content :is(td, th).is-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.entry-content :is(td, th).is-index { width: 1%; white-space: nowrap; color: var(--fg-2) !important; font: .8rem/1.5 var(--mono) !important; text-align: right !important; padding-right: 6px !important; }
.entry-content :is(td, th):empty { padding: 0 !important; }
.entry-content thead :is(th, td):empty, .entry-content tr.is-head > :is(th, td):empty { padding: 0 !important; }

/* Tablas con columna fija de etiquetas en WP */
.entry-content .wp-block-table .has-fixed-layout { table-layout: fixed; }
.entry-content .wp-block-table .has-fixed-layout :is(td, th) { word-break: break-word; }

/* Aviso de desplazamiento cuando la tabla no cabe. */
.entry-content .is-scrollable { box-shadow: inset -24px 0 18px -18px rgb(0 0 0 / .45); }
.entry-content .scroll-hint { position: sticky; left: 0; display: flex; justify-content: flex-end; padding: 6px 12px; border-bottom: 1px solid var(--line); font: .64rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brick); }
.entry-content .table-wrap > table, .entry-content .wp-block-table > table { min-width: 100%; }
@media (max-width: 640px) { .entry-content table { font-size: .88rem; } .entry-content :is(th, td) { padding: 10px 12px !important; } }

/* ── Contenido antiguo: colores y tipos en línea ─────────────────── */
/* Texto negro o de color pegado desde Word/Docs: hereda el del tema. */
.entry-content :is(p, span, div, font, strong, b, em, i, u, li, ol, ul, h1, h2, h3, h4, h5, h6, blockquote, section, article, center, small, big, sup, sub, dd, dt, pre)[style*="color"]:not([class*="has-"]):not(.irb-keep) { color: inherit !important; }
.entry-content :is(p, span, div, font, strong, b, em, i, u, li, h1, h2, h3, h4, h5, h6, blockquote, section, center, small, sup, sub)[style*="background"]:not([class*="has-"]):not(.irb-keep) { background: transparent !important; }
.entry-content a[style*="color"]:not([class*="has-"]) { color: var(--glacier) !important; }
.entry-content font[color] { color: inherit; }
.entry-content [style*="font-family"]:not(code):not(pre):not(kbd) { font-family: inherit !important; }
.entry-content :is(p, span, font, li, div)[style*="font-size"]:not([class*="has-"]) { font-size: inherit !important; }
.entry-content :is(p, span, div, li)[style*="line-height"] { line-height: inherit !important; }
.entry-content font[face] { font-family: inherit; }
.entry-content font[size] { font-size: inherit; }
.entry-content p[style*="justify"], .entry-content div[style*="justify"] { text-align: left !important; }
.entry-content p:empty, .entry-content p.is-blank { display: none; }
.entry-content [style*="margin-left"]:not(.wp-block-columns):not(figure) { margin-left: 0 !important; }

/* Colores de la paleta de WP pensados para fondo blanco. */
.entry-content :is(.has-black-color, .has-very-dark-gray-color, .has-contrast-color, .has-foreground-color) { color: var(--fg) !important; }
.entry-content :is(.has-white-background-color, .has-very-light-gray-background-color, .has-cyan-bluish-gray-background-color, .has-pale-cyan-blue-background-color, .has-pale-pink-background-color, .has-light-green-cyan-background-color, .has-luminous-vivid-amber-background-color, .has-base-background-color, .has-background-background-color, .has-base-2-background-color) { background-color: var(--bg-2) !important; color: var(--fg) !important; }
/* El JS añade esta clase a lo que sigue con poco contraste tras todo lo anterior. */
.entry-content .irb-fix-contrast { background-color: var(--bg-2) !important; color: var(--fg) !important; }
.entry-content .irb-fix-contrast * { color: inherit !important; }
.entry-content .irb-fix-text { color: var(--fg) !important; }

/* ── Columna de lectura (solo artículos) ─────────────────────────── */
.article-body .entry-content > :is(p, ul, ol, dl, h1, h2, h3, h4, h5, h6, blockquote, .wp-block-quote, .wp-block-footnotes, .footnotes, .wp-block-file, .wp-block-buttons, details, .wp-block-details, address) { max-width: 70ch; }
.article-body .entry-content { max-width: none; }

/* ── Modo claro: ajustes finos ───────────────────────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .entry-content .is-scrollable { box-shadow: inset -24px 0 18px -18px rgb(10 34 49 / .18); }
}
:root[data-theme="light"] .entry-content .is-scrollable { box-shadow: inset -24px 0 18px -18px rgb(10 34 49 / .18); }

@media (prefers-reduced-motion: reduce) { .read-progress { display: none; } .aside-box .chev { transition: none; } }

/* ── Impresión: documento limpio en blanco y negro ───────────────── */
@media print {
  :root, :root[data-theme] { --bg: #fff; --bg-2: #f3f3f3; --d1: #fff; --d5: #f6f6f6; --line: #bbb; --fg: #000; --fg-2: #444; --brick: #000; --glacier: #000; color-scheme: light; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  header.top, footer, .article-aside, .read-progress, .prev-next, .child-section, .crumbs, .skip, .wave, #searchDialog, .comments, .page-links, .scroll-hint, [class*="trustedsite"] { display: none !important; }
  .page-hero { background: none !important; padding: 0 0 12pt !important; border-bottom: 1px solid #000; }
  .page-hero .sec-head { display: block; }
  .page-hero .idx { border: 0; padding: 0; margin-bottom: 6pt; }
  .page-hero h1 { font-size: 26pt; }
  .page-body { padding: 12pt 0 0 !important; border: 0; }
  .article-grid { display: block; }
  .wrap { max-width: none; padding: 0; }
  .entry-content { font-size: 11pt; line-height: 1.55; }
  .article-body .entry-content > * { max-width: none; }
  .entry-content a { color: #000; text-decoration: underline; }
  .entry-content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; word-break: break-all; }
  .entry-content :is(h2, h3, p.is-subhead) { break-after: avoid; }
  .entry-content :is(figure, table, tr, blockquote, img) { break-inside: avoid; }
  .entry-content .wp-block-table, .entry-content .table-wrap { overflow: visible; background: none; border-color: #000 !important; box-shadow: none !important; }
  .entry-content :is(th, td) { border-bottom: 1px solid #999 !important; }
  .entry-content tbody tr:nth-child(even) > :is(td, th) { background-color: #f2f2f2 !important; }
  .entry-content tr.is-total > :is(td, th), .entry-content tfoot :is(td, th) { border-top: 1.5px solid #000 !important; background: none !important; }
}
