/* Estilos de las guías (scripts/paginas.mjs). Se carga solo en esas páginas, después de site.css. */
/* ============ GUÍAS (páginas de contenido, scripts/paginas.mjs) ============ */
.pg-body .nav { border-bottom-color: var(--line); }
.pg { display: block; }
.pg-hero { position: relative; overflow: clip; padding: clamp(28px, 4vw, 52px) 0 clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff 0%, #F6F6FC 100%); }
.pg-hero::before { content: ""; position: absolute; inset: -40% -12% auto auto; width: 62vw; height: 62vw; max-width: 880px; max-height: 880px; background: radial-gradient(closest-side, rgba(46,52,112,.11), transparent 70%); pointer-events: none; }
.pg-hero::after { content: ""; position: absolute; right: max(4vw, 24px); top: 50%; width: min(34vw, 420px); aspect-ratio: 1; transform: translateY(-50%); border-radius: 50%; border: 1px solid rgba(46,52,112,.16); box-shadow: 0 0 0 46px rgba(46,52,112,.035), 0 0 0 110px rgba(46,52,112,.022), inset 0 0 0 1px rgba(255,255,255,.6); background: radial-gradient(circle at 50% 50%, var(--accent-deep) 0 5px, transparent 6px), radial-gradient(circle at 78% 24%, var(--warm) 0 4px, transparent 5px), radial-gradient(circle at 22% 70%, var(--accent) 0 3.5px, transparent 4.5px), radial-gradient(circle at 64% 82%, var(--accent) 0 3px, transparent 4px), radial-gradient(circle at 30% 26%, var(--accent) 0 3px, transparent 4px); pointer-events: none; opacity: .9; }
.pg-hero > .wrap { position: relative; z-index: 1; }
.pg-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .04em; color: var(--muted); margin-bottom: clamp(24px, 3.4vw, 44px); }
.pg-crumbs a { color: var(--muted); text-decoration: none; }
.pg-crumbs a:hover { color: var(--accent); }
.pg-crumbs b { font-weight: 500; color: var(--ink); }
.pg-hero h1 { font-size: clamp(36px, 4.7vw, 66px); line-height: 1.02; letter-spacing: -.025em; max-width: 17ch; }
.pg-answer { margin-top: clamp(20px, 2.4vw, 30px); font-size: clamp(18px, 1.55vw, 21.5px); line-height: 1.55; color: var(--ink2); max-width: 62ch; }
.pg-answer strong { color: var(--ink); font-weight: 600; }
.pg-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; font-size: 12px; color: var(--muted); }
.pg-meta span + span::before { content: "·"; margin-right: 22px; color: var(--line2); }

.pg-grid { display: grid; grid-template-columns: 250px minmax(0, 740px); gap: clamp(36px, 6vw, 96px); justify-content: center; padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(56px, 7vw, 104px); }
.pg-toc { position: sticky; top: 96px; align-self: start; font-size: 14.5px; }
.pg-toc ol { list-style: none; margin: 10px 0 26px; padding: 0; border-left: 1px solid var(--line2); }
.pg-toc li a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink2); text-decoration: none; line-height: 1.35; transition: color .2s, border-color .2s; }
.pg-toc li a:hover { color: var(--accent); }
.pg-toc li a.on { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }

.pg-art { font-size: 18px; line-height: 1.7; color: var(--ink2); min-width: 0; }
.pg-art > p, .pg-art > ul, .pg-art > ol, .pg-art > .pg-note, .pg-art > .pg-table { margin: 0 0 22px; }
.pg-art h2 { font-size: clamp(27px, 2.7vw, 38px); line-height: 1.1; letter-spacing: -.022em; color: var(--ink); margin: clamp(48px, 5.4vw, 72px) 0 20px; padding-top: 26px; border-top: 1px solid var(--line); scroll-margin-top: 92px; }
.pg-art > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pg-art h3 { font-size: 20.5px; color: var(--ink); margin: 34px 0 10px; }
.pg-art strong { color: var(--ink); font-weight: 600; }
.pg-art a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(46,52,112,.35); transition: text-decoration-color .2s; }
.pg-art a:hover { text-decoration-color: currentColor; }
.pg-art code { font: 500 .86em var(--f-mono); background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink); }
.pg-art ul { list-style: none; padding: 0; }
.pg-art ul li { position: relative; padding-left: 26px; margin: 0 0 10px; }
.pg-art ul li::before { content: ""; position: absolute; left: 4px; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pg-steps { list-style: none; padding: 0; counter-reset: paso; display: grid; gap: 12px; }
.pg-steps li { counter-increment: paso; position: relative; padding: 18px 20px 18px 66px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(18,22,58,.03); }
.pg-steps li::before { content: counter(paso, decimal-leading-zero); position: absolute; left: 20px; top: 19px; font: 500 13px var(--f-mono); color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 3px 7px; }
.pg-note { position: relative; padding: 22px 24px 22px 28px; border-radius: 16px; background: linear-gradient(135deg, #F2F3FE 0%, #F8F8FD 100%); border: 1px solid #DCDEF7; color: var(--ink); font-size: 17.5px; }
.pg-note::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--accent); }
.pg-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.pg-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.pg-table thead th { text-align: left; font: 500 11.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 18px; background: var(--bg2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pg-table thead th:last-child { color: var(--accent); background: #F1F2F7; }
.pg-table tbody th { text-align: left; font-weight: 600; color: var(--ink); padding: 15px 18px; vertical-align: top; width: 24%; }
.pg-table tbody td { padding: 15px 18px; vertical-align: top; color: var(--ink2); }
.pg-table tbody td:last-child { color: var(--ink); background: rgba(46,52,112,.035); }
.pg-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.pg-faq { margin-top: clamp(48px, 5.4vw, 72px); }
.pg-faq h2 { margin-top: 0; }
.pg-faq details p { font-size: 17px; }

.pg-rel { background: var(--bg2); border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 84px) 0; }
.pg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.pg-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 54px; min-height: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink2); font-size: 15px; line-height: 1.5; transition: transform .25s ease, box-shadow .25s ease, border-color .25s; }
.pg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #C9CCF3; }
.pg-card-k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.pg-card strong { font: 600 21px/1.18 var(--f-head); letter-spacing: -.015em; color: var(--ink); }
.pg-card i { position: absolute; left: 24px; bottom: 20px; font-style: normal; font-size: 18px; color: var(--accent); transition: transform .25s; }
.pg-card:hover i { transform: translateX(5px); }
.pg-card-home { background: var(--ink); border-color: var(--ink); color: rgba(237,238,248,.78); }
.pg-card-home strong { color: #fff; }
.pg-card-home .pg-card-k, .pg-card-home i { color: #ABA6FF; }
.pg-idx { padding-top: clamp(36px, 5vw, 64px); padding-bottom: clamp(56px, 7vw, 96px); }
.pg-cards-idx { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.pg-cards-idx .pg-card { min-height: 230px; padding: 28px 28px 58px; }
.pg-cards-idx .pg-card strong { font-size: 25px; }
.pg-cards-idx .pg-card i { left: 28px; }

.pg-cta { position: relative; overflow: clip; background: radial-gradient(90% 140% at 10% 0%, #1D2366 0%, var(--ink) 60%); color: #EDEEF8; padding: clamp(64px, 8vw, 112px) 0; }
.pg-cta-in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px 64px; align-items: center; }
.pg-cta .eyebrow { color: #ABA6FF; }
.pg-cta h2 { color: #fff; font-size: clamp(32px, 3.8vw, 54px); line-height: 1.05; letter-spacing: -.022em; }
.pg-cta h2 em { color: #ABA6FF; }
.pg-cta .lede { color: rgba(237,238,248,.8); margin-top: 18px; }
.pg-cta-act { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.pg-cta-btn { background: #fff; color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.pg-cta-btn:hover { background: #EEF0F6; }
.pg-cta-alt { color: rgba(237,238,248,.72); font-size: 14.5px; text-underline-offset: 3px; }
.pg-cta-alt:hover { color: #fff; }

@media (max-width: 1020px) {
  .pg-hero::after { display: none; }
  .pg-grid { grid-template-columns: minmax(0, 740px); gap: 28px; }
  .pg-toc { position: static; padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); }
  .pg-toc ol { margin-bottom: 0; columns: 2; column-gap: 24px; }
  .pg-toc li { break-inside: avoid; }
  .pg-toc .btn { display: none; }
  .pg-cta-in { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .pg-art { font-size: 17px; }
  .pg-toc ol { columns: 1; }
  .pg-meta { flex-direction: column; gap: 3px; }
  .pg-meta span + span::before { content: none; }
  .pg-steps li { padding: 46px 18px 16px; }
  .pg-steps li::before { left: 18px; top: 16px; }
  .pg-note { padding: 18px 18px 18px 22px; font-size: 16.5px; }
  /* tablas: cada fila pasa a ser una ficha, sin scroll horizontal */
  .pg-table { overflow: visible; border: 0; box-shadow: none; background: none; border-radius: 0; }
  .pg-table table, .pg-table tbody, .pg-table tr, .pg-table th, .pg-table td { display: block; width: auto; }
  .pg-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pg-table tbody tr { border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 12px; overflow: hidden; }
  .pg-table tbody tr + tr > * { border-top: 0; }
  .pg-table tbody th { width: auto; padding: 14px 16px 10px; background: var(--bg2); border-bottom: 1px solid var(--line); }
  .pg-table tbody td { padding: 12px 16px; border-top: 1px solid var(--line) !important; }
  .pg-table tbody th + td { border-top: 0 !important; }
  .pg-table tbody td::before { content: attr(data-l); display: block; font: 500 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
  .pg-table tbody td:last-child::before { color: var(--accent); }
  .pg-card { min-height: 0; }
}


/* 19-nov · crítico: respuesta inicial a un ancho de lectura cómodo */
.pg-answer { max-width: 50ch; font-size: clamp(18px, 1.4vw, 20px); }
.pg-hero::after, .pg-hero::before { display: none; } /* el círculo decorativo no aportaba */
/* cabecera de la guía en una columna centrada, alineada con el índice y el artículo */
@media (min-width: 901px) { .pg-hero > .wrap { max-width: 1086px; } .pg-hero h1 { max-width: 22ch; } }
