/* StepPDF 3D — Resources / Recursos section.
   Loaded after styles.css on Resources pages only. Every colour, font and radius comes
   from the tokens in styles.css, so light/dark mode and branding stay identical. */

/* ------------------------------------------------------------ header state */
.nav a.is-active { color: var(--ink); background: var(--surface-2); }

/* ------------------------------------------------------------ article shell
   < 1024px   : one column (article only; in-article ads)
   ≥ 1024px   : article | right rail (table of contents + sticky ad)
   ≥ 1260px   : left rail (sticky ad) | article | right rail                 */
.res-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 20px; }
@media (max-width: 480px) { .res-shell { padding-inline: 16px; } }
.res-main { min-width: 0; }
.res-rail { display: none; min-width: 0; }
.res-article { max-width: 720px; margin: 0 auto; padding-block: 28px 8px; }
@media (min-width: 1024px) {
  .res-shell { grid-template-columns: minmax(0, 720px) 200px; justify-content: center; }
  .res-rail--right { display: block; padding-top: 34px; }
  .res-article { margin: 0; }
  .res-toc--inline { display: none; }
}
@media (min-width: 1260px) {
  .res-shell { grid-template-columns: 160px minmax(0, 720px) 200px; }
  .res-rail--left { display: block; padding-top: 34px; }
}
/* Side ads stick while reading, below the sticky header — only when the screen is tall enough
   for the whole 600px unit, so they never cover anything. */
@media (min-width: 1024px) and (min-height: 760px) {
  .res-rail .ad-slot { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); }
}

/* ------------------------------------------------------------ article header */
.res-article h1 { margin-bottom: 12px; }
.res-lead { font-size: 17.5px; line-height: 1.55; color: var(--ink); margin: 0 0 14px; max-width: 68ch; }
.res-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 22px; padding-block: 12px; border-block: 1px solid var(--line); font: 500 12.5px/1.5 var(--f-mono); color: var(--ink-3); }
.res-byline b { color: var(--ink); font-weight: 600; }
.res-byline a { color: inherit; }
.res-byline .sep { color: var(--line-strong); }

/* ------------------------------------------------------------ table of contents */
.res-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.res-toc li { counter-increment: toc; }
.res-toc a { display: grid; grid-template-columns: 2.1em minmax(0, 1fr); color: var(--ink-2); text-decoration: none; font-size: 13.5px; line-height: 1.4; padding: 6px 8px; border-radius: var(--radius-s); }
.res-toc a::before { content: counter(toc, decimal-leading-zero); font: 600 11px/1.6 var(--f-mono); color: var(--ink-3); }
.res-toc a:hover { background: var(--surface-2); color: var(--ink); }
.res-toc a.is-current { color: var(--accent-ink); }
.res-toc a.is-current::before { color: var(--accent-ink); }
.res-toc-h, .res-toc summary { font: 600 11.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; padding-inline: 8px; }
.res-toc--side { margin-bottom: 24px; }
.res-toc--inline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 8px; margin: 0 0 24px; }
.res-toc--inline summary { cursor: pointer; list-style: none; margin: 0; padding-block: 4px; display: flex; justify-content: space-between; }
.res-toc--inline summary::-webkit-details-marker { display: none; }
.res-toc--inline summary::after { content: "+"; font-size: 16px; line-height: .8; }
.res-toc--inline[open] summary::after { content: "−"; }
.res-toc--inline[open] summary { margin-bottom: 8px; }

/* ------------------------------------------------------------ article body */
.res-body { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); }
.res-body > * { max-width: 68ch; }
.res-body > .res-table-wrap, .res-body > .ad-slot, .res-body > .res-cta, .res-body > .res-flow, .res-body > .res-faq, .res-body > .res-keypoints { max-width: none; }
.res-body p { margin: 0 0 16px; }
.res-body h2 { font: 700 clamp(21px, 2.3vw, 25px)/1.25 var(--f-display); letter-spacing: -.012em; color: var(--ink); margin: 42px 0 12px; text-wrap: balance; scroll-margin-top: 84px; }
.res-body h3 { font: 700 18px/1.3 var(--f-display); color: var(--ink); margin: 28px 0 8px; scroll-margin-top: 84px; }
.res-body ul, .res-body ol { padding-left: 1.3em; margin: 0 0 18px; }
.res-body li { margin-bottom: 7px; }
.res-body li::marker { color: var(--accent); }
.res-body strong, .res-body b { color: var(--ink); font-weight: 600; }
.res-body a { color: var(--accent-ink); }
.res-body code { font: 500 .88em/1 var(--f-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--ink); overflow-wrap: anywhere; }
.res-body pre { font: 500 13px/1.6 var(--f-mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; overflow-x: auto; color: var(--ink); max-width: 100%; }
.res-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.res-body blockquote { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--line-strong); background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* Key points box (quick answer near the top) */
.res-keypoints { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 24px; }
.res-keypoints p:first-child { margin-top: 0; }
.res-keypoints-h { font: 600 11.5px/1 var(--f-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3) !important; margin: 0 0 10px !important; }
.res-keypoints ul { margin: 0; }
.res-keypoints li:last-child { margin-bottom: 0; }

/* Tables: scroll inside their own box on small screens, never the page */
.res-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 8px 0 22px; -webkit-overflow-scrolling: touch; }
.res-table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; min-width: 560px; }
.res-table-wrap th, .res-table-wrap td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.res-table-wrap thead th { font: 600 11.5px/1.3 var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); }
.res-table-wrap tbody th { color: var(--ink); font-weight: 600; }
.res-table-wrap tr:last-child td, .res-table-wrap tr:last-child th { border-bottom: 0; }
.res-table-wrap caption { caption-side: bottom; text-align: left; font-size: 12.5px; color: var(--ink-3); padding: 8px 14px; }

/* Process diagram built in HTML (wraps on small screens instead of shrinking text) */
.res-flow { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; padding: 0 !important; margin: 10px 0 24px !important; counter-reset: flow; }
.res-flow li { counter-increment: flow; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; margin: 0; font-size: 14px; line-height: 1.45; }
.res-flow li::before { content: counter(flow, decimal-leading-zero); display: block; font: 700 11px/1 var(--f-mono); color: var(--accent-ink); letter-spacing: .06em; margin-bottom: 6px; }
.res-flow li b { display: block; color: var(--ink); font: 700 14.5px/1.3 var(--f-display); margin-bottom: 3px; }
.res-flow + .res-figcap, .res-figcap { font-size: 13px; color: var(--ink-3); margin-top: -14px; }

/* FAQ reuses .faq from styles.css */
.res-faq h2 { margin-bottom: 14px; }
.res-faq .faq { max-width: none; }
.res-faq .faq details > div { font-size: 15px; line-height: 1.65; }

/* ------------------------------------------------------------ CTAs to the site's own tools
   Solid surfaces, accent colour and real buttons — clearly different from the dashed,
   label-only advertising placeholders. */
.res-btn { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 11px 18px; border-radius: var(--radius-s); background: var(--accent); border: 1px solid var(--accent); color: var(--on-accent) !important; font: 600 15px/1.2 var(--f-body); text-decoration: none; }
.res-btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.res-btn--ghost { background: transparent; color: var(--ink) !important; border-color: var(--line-strong); }
.res-btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.res-ico { width: 19px; height: 19px; flex: none; }
.res-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 30px 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.res-cta-copy { flex: 1 1 280px; min-width: 0; }
.res-cta-title { margin: 0 0 4px !important; font: 700 17.5px/1.3 var(--f-display); color: var(--ink); max-width: none; }
.res-cta-text { margin: 0 !important; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.res-cta-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.res-cta--top { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); border-left-color: var(--accent); box-shadow: none; padding: 14px 18px; margin: 0 0 26px; }
.res-cta--top .res-cta-title { font-size: 16px; }
.res-cta--final { background: var(--ink); border-color: var(--ink); border-left-color: var(--accent); margin: 40px 0 8px; padding: 24px; }
.res-cta--final .res-cta-title { color: var(--surface); font-size: clamp(19px, 2.2vw, 23px); letter-spacing: -.01em; }
.res-cta--final .res-cta-text { color: color-mix(in srgb, var(--surface) 78%, var(--ink)); }
.res-cta--final .res-btn--ghost { color: var(--surface) !important; border-color: color-mix(in srgb, var(--surface) 40%, var(--ink)); }
.res-cta--final .res-btn--ghost:hover { background: color-mix(in srgb, var(--surface) 12%, var(--ink)); }
@media (max-width: 560px) {
  .res-cta-btns, .res-cta-btns .res-btn { width: 100%; }
  .res-cta-btns .res-btn { justify-content: center; }
}

/* ------------------------------------------------------------ advertising placeholders
   Neutral, dashed, label only, no buttons: can never be mistaken for a tool.
   Fixed sizes reserve the space real ads will use (no layout shift later). */
.ad-slot { display: grid; place-items: center; background: var(--ad); border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--ad-ink); font: 600 10.5px/1 var(--f-mono); letter-spacing: .2em; text-align: center; user-select: none; pointer-events: none; }
.ad-slot--sidebar-left, .ad-slot--sidebar-right { width: 160px; height: 600px; }
.ad-slot--sidebar-right { margin-inline: auto; }
.ad-slot--in-article { width: 100%; height: 250px; margin: 34px 0; }
.ad-slot--article-bottom { width: 100%; height: 90px; margin: 34px 0 8px; }
@media (max-width: 640px) {
  .ad-slot--in-article { height: 250px; margin: 30px 0; }
  .ad-slot--article-bottom { height: 100px; }
}
/* Live AdSense units (rendered only when site.json has a real client + slot id).
   Same reserved box as the placeholder, a small "Advertisement" label above,
   and the whole slot collapses if Google returns no ad (data-ad-status="unfilled"). */
.ad-slot--live { display: block; place-items: normal; height: auto; background: none; border: 0; border-radius: 0; pointer-events: auto; user-select: auto; text-align: left; }
.ad-slot--live > ins { display: block; width: 100%; }
.ad-slot--live .ad-slot__label { display: block; font: 500 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ad-ink); margin: 0 0 6px; }
.ad-slot--live.ad-slot--in-article .adsbygoogle { min-height: 250px; }
.ad-slot--live.ad-slot--article-bottom .adsbygoogle { min-height: 90px; }
.ad-slot--live.ad-slot--sidebar-left ins, .ad-slot--live.ad-slot--sidebar-right ins { width: 160px; min-height: 600px; }
.ad-slot--live .adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-slot--live:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* ------------------------------------------------------------ figures */
.res-body > .res-figure { max-width: none; }
.res-figure { margin: 28px 0 30px; }
.res-figure img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--stage); }
.res-figure figcaption { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); margin-top: 10px; }

/* Share workflow diagram (HTML + inline SVG icons, themed by tokens) */
.res-diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px 14px; }
.res-diagram__flow { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; }
.res-diagram .d-node { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.res-diagram .d-node svg { width: 44px; height: 44px; margin-bottom: 4px; }
.res-diagram .d-node b { font: 700 14px/1.25 var(--f-display); color: var(--ink); }
.res-diagram .d-node:not(:last-child)::after { content: ""; position: absolute; top: 20px; right: -17px; width: 12px; height: 12px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); transform: rotate(45deg); }
.res-diagram .d-node--hl b { color: var(--accent-ink); }
.res-diagram .d-line { fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.res-diagram .d-acc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.res-diagram .d-tag { font: 700 7.5px/1 var(--f-mono); fill: var(--accent-ink); text-anchor: middle; letter-spacing: .04em; }
.res-diagram__note { margin: 16px 0 0 !important; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: none !important; }
.res-diagram figcaption:empty { display: none; }
@media (max-width: 700px) {
  .res-diagram__flow { grid-template-columns: 1fr; gap: 18px; }
  .res-diagram .d-node { flex-direction: row; text-align: left; flex-wrap: wrap; gap: 2px 12px; padding-left: 0; }
  .res-diagram .d-node svg { width: 36px; height: 36px; margin: 0; flex: none; }
  .res-diagram .d-node b { flex: 1 1 60%; align-self: center; }
  .res-diagram .d-node span { flex-basis: 100%; padding-left: 48px; margin-top: -6px; }
  .res-diagram .d-node:not(:last-child)::after { top: auto; bottom: -15px; right: auto; left: 13px; transform: rotate(135deg); width: 9px; height: 9px; }
}

/* ------------------------------------------------------------ related articles */
.res-related { margin-top: 44px; }
.res-related h2 { font: 700 20px/1.3 var(--f-display); margin: 0 0 14px; }
.res-rel-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.res-rel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.res-rel h3 { margin: 0; font: 700 15.5px/1.35 var(--f-display); }
.res-rel h3 a { color: var(--ink); text-decoration: none; }
.res-rel h3 a:hover { color: var(--accent-ink); text-decoration: underline; }
.res-rel-desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); flex: 1; }

/* ------------------------------------------------------------ hub (Resources / Recursos) */
.res-hub { padding-block: 28px 8px; }
.res-hub h1 { margin-bottom: 12px; }
.res-hub .res-lead { margin-bottom: 22px; }
.res-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.res-chip { appearance: none; cursor: pointer; min-height: 36px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font: 500 13.5px/1 var(--f-body); }
.res-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.res-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.res-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.res-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.res-card-media { display: block; aspect-ratio: 2 / 1; border-bottom: 1px solid var(--line); }
.res-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.res-cat { margin: 0; font: 600 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.res-card-title { margin: 0; font: 700 18px/1.3 var(--f-display); letter-spacing: -.005em; text-wrap: balance; }
.res-card-title a { color: var(--ink); text-decoration: none; }
.res-card-title a:hover { color: var(--accent-ink); }
.res-card-desc { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; flex: 1; }
.res-card-meta { margin: 0; font: 500 12px/1.4 var(--f-mono); color: var(--ink-3); }
.res-card-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 40px; margin-top: 2px; font-weight: 600; font-size: 14.5px; color: var(--accent-ink); text-decoration: none; }
.res-card-link:hover { text-decoration: underline; }
.res-card-link .res-ico { width: 16px; height: 16px; }
.res-tools { margin-top: 48px; }
.res-tools h2 { font: 800 clamp(21px, 2.4vw, 26px)/1.2 var(--f-display); letter-spacing: -.015em; margin: 0 0 6px; }
.res-tools-lead { color: var(--ink-2); margin: 0 0 16px; }
.res-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.res-tool { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.res-tool > .res-ico { width: 26px; height: 26px; color: var(--accent); }
.res-tool h3 { margin: 0; font: 700 18px/1.3 var(--f-display); }
.res-tool p { margin: 0 0 6px; color: var(--ink-2); font-size: 14.5px; flex: 1; }

/* Card illustrations (decorative inline SVG) */
.res-ill { display: block; width: 100%; height: 100%; }
.res-ill .i-bg { fill: var(--stage); }
.res-ill .i-grid { stroke: color-mix(in srgb, var(--line-strong) 55%, transparent); stroke-width: 1; fill: none; }
.res-ill .i-face { fill: var(--surface); }
.res-ill .i-edge { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linejoin: round; }
.res-ill .i-hole { fill: var(--stage); stroke: var(--ink-2); stroke-width: 1.4; }
.res-ill .i-dim { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.res-ill .i-win { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.4; }
.res-ill .i-dot { fill: var(--line-strong); }
.res-ill .i-acc { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.res-ill .i-acc-f { fill: var(--accent); }
.res-ill .i-link { stroke: var(--line-strong); stroke-width: 1.6; stroke-dasharray: 4 4; fill: none; }
.res-ill .i-node circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.res-ill .i-tag { font: 600 11px var(--f-mono); fill: var(--ink-3); letter-spacing: .04em; }
.res-ill .i-pdf { font: 700 8px var(--f-mono); fill: var(--on-accent); letter-spacing: .06em; }

@media (max-width: 640px) {
  .res-article, .res-hub { padding-top: 18px; }
  .res-lead { font-size: 16.5px; }
  .res-body { font-size: 16.5px; }
  .res-body h2 { margin-top: 36px; }
}
@media (prefers-reduced-motion: reduce) { .res-card { transition: none; } }
.res-table-note { margin: 0 !important; padding: 8px 14px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line); position: sticky; left: 0; }

/* ------------------------------------------------------------ author page */
.res-author-bio { max-width: 68ch; font-size: 16.5px; line-height: 1.72; color: var(--ink-2); margin: 8px 0 34px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.res-author-bio p { margin: 0 0 14px; }
.res-author-bio p:last-child { margin-bottom: 0; }
.res-author-h { font: 700 clamp(19px, 2vw, 22px)/1.3 var(--f-display); color: var(--ink); margin: 0 0 14px; }

/* Fase 4.1 (P2): same rule as styles.css — collapse live ad containers until AdSense reports data-ad-status="filled". */
.ad-slot--live:has(.adsbygoogle):not(:has(.adsbygoogle[data-ad-status="filled"])) { max-height: 0; overflow: hidden; margin-block: 0; }
