/* Estilos de páginas secundarias (documentos, ficha de documento, 404) */
body.subpage main { min-height: 60vh; }
.subpage .section-pad { padding: 72px 0 96px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 26px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.crumbs a { border-bottom: 1px solid transparent; }
.crumbs a:hover { border-color: var(--yellow); }
.crumbs strong { color: var(--ink); font-weight: 800; }

.doc-title { margin: 0; max-width: 900px; font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.02; letter-spacing: -.05em; }

.doc-group { margin-top: 56px; }
.doc-group-title { margin: 0 0 22px; font-size: .78rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; color: var(--blue-dark); }
.doc-group .docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.doc-group .doc-card h3 { margin: 8px 0 10px; font-size: 1.06rem; line-height: 1.25; letter-spacing: -.02em; }
.doc-group .doc-card h3 a:hover { color: var(--blue-dark); }

.doc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 34px 0 0; }
.doc-facts .fact { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.doc-facts .fact small { display: block; margin-bottom: 6px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.doc-facts .fact strong { font-size: 1rem; letter-spacing: -.02em; }

.doc-page-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 0; }

.pdf-shell { margin-top: 34px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.pdf-shell object, .pdf-shell iframe { display: block; width: 100%; height: min(80vh, 900px); border: 0; }
.pdf-facade { display: grid; gap: 8px; place-content: center; width: 100%; min-height: 340px; padding: 40px 24px; border: 0; background: var(--paper); cursor: pointer; text-align: center; font: inherit; color: inherit; transition: background .2s; }
.pdf-facade:hover { background: #eef1f3; }
.pdf-facade strong { font-size: 1.15rem; letter-spacing: -.02em; }
.pdf-facade span { color: var(--muted); font-size: .85rem; }
.pdf-fallback { padding: 40px 24px; text-align: center; color: var(--muted); }
.pdf-fallback a { font-weight: 800; border-bottom: 2px solid var(--yellow); }

.doc-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 46px; }
.doc-nav-link { padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; transition: .22s; }
.doc-nav-link:hover { border-color: var(--ink); transform: translateY(-2px); }
.doc-nav-link small { display: block; margin-bottom: 6px; color: var(--muted); font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.doc-nav-link strong { display: block; font-size: 1rem; line-height: 1.25; letter-spacing: -.02em; }
.doc-nav-link.right { text-align: right; }

@media (max-width: 760px) {
  .doc-nav { grid-template-columns: 1fr; }
  .doc-nav-link.right { text-align: left; }
  .pdf-shell object, .pdf-shell iframe { height: 70vh; }
  .pdf-facade { min-height: 250px; }
  .subpage .nav-links { display: none; }
}

/* ---------- artículos ---------- */
.article-body { max-width: 68ch; margin-top: 34px; }
.article-body p { margin: 0 0 22px; font-size: 1.06rem; line-height: 1.75; }
.article-body p:first-child { font-size: 1.16rem; }
.doc-origin { max-width: 68ch; margin-top: 26px; padding: 16px 20px; border-left: 3px solid var(--yellow); background: var(--paper); font-size: .92rem; color: var(--muted); }
.doc-origin a { font-weight: 800; border-bottom: 2px solid var(--yellow); }
.doc-origin code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.doc-tags span { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- sala de prensa ---------- */
.press-bio { max-width: 70ch; margin-top: 14px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.press-bio p { margin: 0 0 16px; line-height: 1.7; }
.press-bio p:last-child { margin-bottom: 0; }
.press-list { display: grid; gap: 12px; margin-top: 20px; }
.press-item { padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: .2s; }
.press-item:hover { border-color: var(--ink); transform: translateY(-2px); }
.press-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .72rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.press-kind { color: var(--blue-dark); }
.press-item h3 { margin: 8px 0 0; font-size: 1.05rem; line-height: 1.35; letter-spacing: -.015em; }
.doc-page .doc-group-title { margin-top: 54px; }
.doc-page .doc-group-title + .section-lead { margin-top: 10px; }

/* ---------- glosario ---------- */
.glosario { display: grid; gap: 2px; margin-top: 30px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--line); }
.glosario-item { padding: 22px 26px; background: #fff; scroll-margin-top: 100px; }
.glosario-item h2 { margin: 0 0 8px; font-size: 1.08rem; letter-spacing: -.02em; }
.glosario-item p { margin: 0; max-width: 72ch; color: var(--muted); line-height: 1.65; }

/* ---------- cifras ---------- */
.cifras-group { margin-top: 62px; scroll-margin-top: 100px; }
.cifras-group > p.section-lead { margin: 10px 0 0; max-width: 74ch; }
.cifras-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; margin-top: 26px; }
.cifra { display: flex; flex-direction: column; padding: 24px 24px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.cifra b { display: block; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.02; letter-spacing: -.045em; }
.cifra .cifra-label { margin: 10px 0 0; color: var(--ink); font-size: .95rem; line-height: 1.45; }
.cifra .cifra-note { margin: 10px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.cifra .cifra-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; font-size: .72rem; font-weight: 800; color: var(--muted); }
.cifra .cifra-src a { color: var(--blue-dark); border-bottom: 1px solid var(--line); }
.cifra .cifra-src a:hover { border-color: var(--yellow); }
.cifra-period { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--paper); font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cifras-tabla-wrap { margin-top: 26px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.cifras-tabla { width: 100%; min-width: 480px; border-collapse: collapse; }
.cifras-tabla th, .cifras-tabla td { padding: 14px 20px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.cifras-tabla th:first-child, .cifras-tabla td:first-child { text-align: left; }
.cifras-tabla thead th { font-size: .68rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.cifras-tabla tbody tr:last-child td { border-bottom: 0; }
.cifras-tabla tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 900; }
.cifras-aviso { margin-top: 30px; max-width: 74ch; padding: 20px 24px; border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 16px; background: var(--paper); color: var(--muted); font-size: .9rem; line-height: 1.7; }
.cifras-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.cifras-toc a { padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px; font-size: .76rem; font-weight: 800; color: var(--muted); }
.cifras-toc a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- ficha: resumen y contenido ---------- */
.doc-resumen { margin: 34px 0 0; max-width: 74ch; padding: 24px 28px; border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 18px; background: var(--paper); }
.doc-resumen p { margin: 0; font-size: 1.05rem; line-height: 1.7; }
.doc-contiene { margin-top: 40px; max-width: 76ch; }
.doc-contiene h2 { margin: 0 0 18px; font-size: .78rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; color: var(--blue-dark); }
.doc-contiene ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--line); }
.doc-contiene li { position: relative; padding: 16px 24px 16px 46px; background: #fff; line-height: 1.6; }
.doc-contiene li::before { content: ""; position: absolute; left: 24px; top: 25px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }

/* ---------- Las respuestas son los hechos ---------- */
.resp-tabs { margin-top: 40px; }
.resp-tablist { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.resp-tab { padding: 12px 20px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted);
  font: inherit; font-size: .82rem; font-weight: 800; letter-spacing: -.01em; cursor: pointer; transition: .18s; }
.resp-tab:hover { border-color: var(--ink); color: var(--ink); }
.resp-tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.resp-tab:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.resp-panel { padding-top: 38px; }
.resp-panel[hidden] { display: none; }
.resp-panel > h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.06; letter-spacing: -.04em; }
.resp-intro { margin: 0; max-width: 74ch; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.resp-grupo { margin-top: 46px; }
.resp-grupo > h3 { margin: 0 0 6px; font-size: .78rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; color: var(--blue-dark); }
.resp-nota { margin: 0 0 4px; max-width: 72ch; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.resp-lista { display: grid; gap: 14px; margin-top: 20px; }
.resp-item { padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: .2s; }
.resp-item:hover { border-color: var(--ink); }
.resp-kind { font-size: .66rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-dark); }
.resp-item h4 { margin: 10px 0 10px; font-size: 1.14rem; line-height: 1.3; letter-spacing: -.025em; }
.resp-item p { margin: 0; max-width: 78ch; color: #3d464c; line-height: 1.68; }
.resp-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 20px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.resp-src { color: var(--muted); font-size: .78rem; font-weight: 700; }
.resp-links { display: flex; flex-wrap: wrap; gap: 16px; }
.resp-links a { font-size: .78rem; font-weight: 900; color: var(--ink); border-bottom: 2px solid var(--yellow); }
.resp-links a:hover { color: var(--blue-dark); }
@media (max-width: 620px) {
  .resp-item { padding: 20px 20px; }
  .resp-foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- propuesta: el precedente documentado ---------- */
.prop-precedente { margin-top: 52px; padding: 30px 34px; border: 1px solid var(--line); border-left: 3px solid var(--yellow); border-radius: 20px; background: var(--paper); }
.prop-precedente > h2 { margin: 0 0 14px; font-size: .78rem; font-weight: 900; letter-spacing: .17em; text-transform: uppercase; color: var(--blue-dark); }
.prop-precedente-lead { margin: 0 0 20px; max-width: 74ch; font-size: 1.04rem; line-height: 1.72; }
.prop-precedente ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.prop-precedente li { position: relative; padding-left: 26px; max-width: 76ch; line-height: 1.65; color: #3d464c; }
.prop-precedente li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.prop-precedente .doc-page-actions { margin-top: 24px; }
@media (max-width: 620px) { .prop-precedente { padding: 24px 22px; } }
.prop-fuentes { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.prop-fuentes h3 { margin: 0 0 14px; font-size: .7rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.prop-fuentes ul { display: grid; gap: 12px; }
.prop-fuentes li { padding-left: 0; }
.prop-fuentes li::before { display: none; }
.prop-fuentes li a { display: block; font-weight: 800; line-height: 1.4; color: var(--ink); border-bottom: 2px solid var(--yellow); }
.prop-fuentes li a:hover { color: var(--blue-dark); }
.prop-fuentes li span { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }

/* ---------- ENIA ---------- */
.enia-cita { margin: 38px 0 0; padding: 30px 34px; border-left: 4px solid var(--yellow); background: var(--paper); border-radius: 0 18px 18px 0; }
.enia-cita blockquote { margin: 0; max-width: 68ch; font-size: clamp(1.1rem, 1.9vw, 1.42rem); line-height: 1.55; letter-spacing: -.02em; }
.enia-cita figcaption { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.enia-cita figcaption strong { font-size: .88rem; }
.enia-cita figcaption span { color: var(--muted); font-size: .8rem; }
.enia-pilares { display: grid; gap: 16px; margin-top: 26px; }
.enia-pilar { padding: 28px 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.enia-pilar-num { font-size: .68rem; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; color: var(--blue-dark); }
.enia-pilar h3 { margin: 10px 0 12px; font-size: 1.3rem; letter-spacing: -.03em; line-height: 1.2; }
.enia-pilar > p { margin: 0 0 20px; max-width: 78ch; color: var(--muted); line-height: 1.66; }
.enia-pilar ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.enia-pilar li { max-width: 80ch; padding-left: 4px; line-height: 1.6; color: #3d464c; }
.enia-pilar li b { display: inline-block; min-width: 2.6em; margin-right: 8px; color: var(--blue-dark); font-variant-numeric: tabular-nums; }
.cifra .cifra-label strong { font-weight: 800; }
@media (max-width: 620px) { .enia-pilar { padding: 22px 20px; } .enia-cita { padding: 24px 22px; } }

/* ---------- fuentes de prensa ---------- */
.fuentes { margin-top: 52px; }
.fuentes-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; }
.fuentes-cab .doc-group-title { margin: 0; }
.fuentes-n { font-size: .74rem; font-weight: 800; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; }
.fuentes-lista { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: f;
  display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.fuentes-lista li { counter-increment: f; position: relative; padding: 15px 22px 15px 60px; background: #fff; }
.fuentes-lista li::before { content: counter(f, decimal-leading-zero); position: absolute; left: 22px; top: 16px;
  font-size: .72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.fuentes-lista a { display: block; font-weight: 700; font-size: .96rem; line-height: 1.4; letter-spacing: -.012em;
  border-bottom: 2px solid transparent; }
.fuentes-lista a:hover { border-bottom-color: var(--yellow); }
.fuentes-meta { display: block; margin-top: 5px; font-size: .76rem; font-weight: 700; color: var(--blue-dark); }
.fuentes-nota { display: block; margin-top: 5px; max-width: 80ch; font-size: .85rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 620px) { .fuentes-lista li { padding: 14px 18px 14px 18px; } .fuentes-lista li::before { position: static; display: block; margin-bottom: 6px; } }

/* ---------- índice de iniciativas ---------- */
.ini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 34px; }
.ini-card { display: flex; flex-direction: column; padding: 28px 30px 26px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; transition: .2s; }
.ini-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: 0 18px 44px rgba(9,13,16,.09); }
.ini-n { font-size: .7rem; font-weight: 900; letter-spacing: .16em; color: var(--muted); font-variant-numeric: tabular-nums; }
.ini-card h2 { margin: 12px 0 10px; font-size: 1.24rem; line-height: 1.22; letter-spacing: -.03em; }
.ini-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.ini-dato { margin-top: auto; padding-top: 20px; font-size: .76rem; font-weight: 900; letter-spacing: .03em; color: var(--blue-dark); }

/* ---------- acordeón de preguntas ---------- */
.faq-bloque { margin-top: 62px; padding-top: 44px; border-top: 1px solid var(--line); }
.faq-lista { display: grid; gap: 10px; margin-top: 26px; }
.faq-item { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.faq-item[open] { border-color: var(--line-2, #c9c5bc); box-shadow: 0 10px 30px rgba(9,13,16,.06); }
.faq-item summary { display: flex; gap: 14px; align-items: baseline; padding: 20px 26px; cursor: pointer; list-style: none;
  font-weight: 800; font-size: 1.02rem; line-height: 1.38; letter-spacing: -.015em; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; flex: none; font-size: 1.15rem; font-weight: 700; color: var(--yellow); line-height: 1; }
.faq-item[open] summary::before { content: "–"; }
.faq-item summary:hover { background: var(--paper); }
.faq-item summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.faq-cont { padding: 0 26px 24px 54px; }
.faq-cont p { margin: 0; max-width: 82ch; line-height: 1.72; color: #3d464c; }
.faq-fuente { margin-top: 16px !important; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.faq-fuente a { font-size: .8rem; font-weight: 900; color: var(--ink); border-bottom: 2px solid var(--yellow); }
.faq-fuente a:hover { color: var(--blue-dark); }
@media (max-width: 620px) { .faq-item summary { padding: 17px 20px; font-size: .95rem; } .faq-cont { padding: 0 20px 20px 20px; } }

/* ---------- acciones con su referencia documental ---------- */
.acciones-ref { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 2px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); }
.acciones-ref li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 6px 24px; padding: 17px 24px; background: #fff; }
.acciones-ref strong { font-size: 1rem; font-weight: 700; letter-spacing: -.015em; }
.acciones-ref a { flex: none; font-size: .79rem; font-weight: 800; color: var(--blue-dark);
  border-bottom: 2px solid var(--yellow); }
.acciones-ref a:hover { color: var(--ink); }
@media (max-width: 620px) { .acciones-ref li { flex-direction: column; gap: 7px; } .acciones-ref a { flex: 1 1 auto; } }

/* ---------- objetivos táctiles: WCAG 2.5.5 en móvil ---------- */
@media (max-width: 760px) {
  .btn, .nav-link, .nav-cta, .resp-links a, .faq-fuente a,
  .doc-actions a, .doc-page-actions a, .press-item a, .chips button {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  .resp-links, .faq-fuente, .cifra-src { gap: 4px 18px; }
  .resp-links a, .faq-fuente a { padding: 6px 0; }
  .fuentes-lista a { padding: 4px 0; }
  .crumbs { gap: 10px 12px; }
  .crumbs a { padding: 4px 0; min-height: 32px; display: inline-flex; align-items: center; }
}

/* ---------- aparición al desplazar ---------- */
/* Sin librerías: IntersectionObserver + una transición. Si el sistema pide
   menos movimiento, todo aparece de golpe y ya está. */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .62s cubic-bezier(.22,.61,.36,1), transform .62s cubic-bezier(.22,.61,.36,1); }
.rv.on { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .07s } .rv-d2 { transition-delay: .14s } .rv-d3 { transition-delay: .21s }
.rv-d4 { transition-delay: .28s } .rv-d5 { transition-delay: .35s }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* ---------- realce de tarjetas ---------- */
.cifra, .resp-item, .enia-pilar, .doc-card { transition: border-color .2s, transform .2s, box-shadow .2s; }
.cifra:hover, .enia-pilar:hover { border-color: var(--line-2, #c9c5bc); transform: translateY(-2px); box-shadow: 0 14px 36px rgba(9,13,16,.07); }
.metric { transition: transform .2s, box-shadow .2s; }
.metric:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(9,13,16,.08); }

/* Objetivo táctil mínimo 44×44 (WCAG 2.5.5 / regla 2 de la guía UI-UX).
   Especificidad suficiente para ganarle a .doc-actions .btn{min-height:38px}. */
@media (max-width: 760px) {
  .doc-actions .btn, .case-actions .btn, .doc-page-actions .btn,
  .hero-actions .btn, .vision-cta .btn, .closing-actions .btn,
  .doc-actions a.btn, .chips .chip {
    min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .doc-actions { gap: 10px; }
  .chips { gap: 10px; }
}
