/* The documentation page (/documentacao). Everything else comes from ../v1/styles.css. */

/* PoM's diagram tokens (rgb triples, as PoM's index.css has them), mapped to the site's
   palette: iris is the logo's navy-blue, aqua its teal. The dark values follow the site's
   dark palette and are declared twice, like styles.css, so the theme toggle wins both ways. */
:root {
  --g-iris: 18 63 143;
  --g-aqua: 11 130 121;
  --g-amber: 186 116 12;
  --g-surface: 255 255 255;
  --g-raised: 250 249 250;
  --g-ink: 248 246 247;
  --g-line: 226 222 228;
  --g-line-strong: 200 194 204;
  --g-fg: 24 21 27;
  --g-muted: 74 69 81;
  --g-faint: 109 103 117;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-iris: 79 155 255;
    --g-aqua: 47 220 200;
    --g-amber: 255 180 84;
    --g-surface: 22 20 29;
    --g-raised: 30 27 38;
    --g-ink: 11 10 15;
    --g-line: 52 48 61;
    --g-line-strong: 74 69 86;
    --g-fg: 244 242 247;
    --g-muted: 182 177 191;
    --g-faint: 143 138 153;
  }
}
:root[data-theme="dark"] {
  --g-iris: 79 155 255;
  --g-aqua: 47 220 200;
  --g-amber: 255 180 84;
  --g-surface: 22 20 29;
  --g-raised: 30 27 38;
  --g-ink: 11 10 15;
  --g-line: 52 48 61;
  --g-line-strong: 74 69 86;
  --g-fg: 244 242 247;
  --g-muted: 182 177 191;
  --g-faint: 143 138 153;
}


/* The documentation uses the whole screen: wider than the site's shell, with the guide list on the
   left, the guide in the middle and its sections on the right. Prose keeps a readable measure;
   tables, diagrams and cards take the middle column's full width. */
.doc-main { padding-block: clamp(36px, 6vw, 72px); max-width: 1680px; }
/* The top bar spans the same width, so the logo lines up with the page under it. */
.doc-page .topbar-inner { max-width: 1680px; }
.doc-heading { max-width: 20ch; }
.doc-intro { max-width: 68ch; }
.js .doc-fallback { display: none; }
.doc-fallback { color: var(--ink-2); }

/* The guide list beside the text on wide screens; a select above it on narrow ones. */
.doc-layout { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 56px); align-items: start; margin-top: clamp(24px, 4vw, 40px); }
@media (min-width: 1360px) {
  .doc-layout:has(.doc-toc:not([hidden])) { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr) minmax(190px, 230px); }
}
.doc-layout[hidden] { display: none; }
.doc-nav { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; }
.doc-picker { display: none; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc-list a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--ink-2); }
.doc-list a:hover { background: var(--accent-soft); color: var(--ink); }
.doc-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.doc-list-label { font-weight: 700; font-size: 14.5px; }
.doc-list-summary { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

.doc-guide { min-width: 0; }
.doc-title { margin: 0; }
.doc-summary { margin: 10px 0 26px; color: var(--ink-3); font-size: 15px; }
.doc-lead { max-width: 78ch; font-size: 18px; line-height: 1.6; color: var(--ink); margin: 0 0 18px; }
.doc-p { max-width: 78ch; color: var(--ink-2); line-height: 1.75; margin: 14px 0; }
.doc-h { margin: 34px 0 12px; font-size: 19px; letter-spacing: -.02em; }

/* steps: one numbered rail, so the order reads before the words */
.doc-steps { list-style: none; counter-reset: step; margin: 20px 0; padding: 0; position: relative; display: grid; gap: 16px; max-width: 82ch; }
.doc-steps::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 1px; background: linear-gradient(var(--blue), var(--teal)); opacity: .45; }
.doc-steps li { counter-increment: step; position: relative; padding-left: 44px; }
.doc-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; font: 700 11px var(--mono); color: var(--accent);
  background: var(--card-solid); border: 1px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.doc-steps strong { display: block; color: var(--ink); }
.doc-steps p { margin: 4px 0 0; color: var(--ink-2); line-height: 1.6; }

.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 18px 0; }
.doc-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.doc-card strong { display: block; color: var(--ink); }
.doc-card p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

.doc-callout { margin: 20px 0; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--accent-soft); max-width: 82ch; }
.doc-warn { background: rgba(186, 116, 12, .09); border-color: rgba(186, 116, 12, .35); }
.doc-callout strong { display: block; color: var(--ink); }
.doc-callout p { margin: 4px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

/* Tables and code are scanned, not read: they may use the full width and scroll inside themselves. */
.doc-table { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th, .doc-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); background: var(--card); }
.doc-table tr:last-child td { border-bottom: 0; }
/* Code reads light on the dark panel, in both themes, like a terminal. */
.doc-code {
  margin: 18px 0; padding: 18px 22px; overflow-x: auto; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--panel-line); color: rgba(255, 255, 255, .86);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; -webkit-overflow-scrolling: touch;
}
.doc-code code { background: none; padding: 0; color: inherit; font-size: inherit; white-space: pre; }

.doc-diagram { margin: 22px 0; padding: clamp(14px, 2vw, 22px); border: 1px solid var(--line); border-radius: 20px; background: rgb(var(--g-surface)); }
/* A diagram reads best at about the size PoM draws it; past that its lettering only grows. */
.doc-diagram-art svg { display: block; width: 100%; max-width: 980px; height: auto; margin-inline: auto; }
.doc-diagram figcaption { margin-top: 12px; color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }

.doc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 18px 0; }
.doc-stats div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; }
.doc-stats dt { font-size: 26px; font-weight: 900; letter-spacing: -.04em; background: linear-gradient(90deg, var(--blue), var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-stats dd { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }

.doc-checklist { margin: 18px 0; }
.doc-checklist strong { color: var(--ink); }
.doc-checklist ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.doc-checklist li { position: relative; padding-left: 28px; color: var(--ink-2); line-height: 1.55; }
.doc-checklist li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 14px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }

.doc-faq { margin: 18px 0; display: grid; gap: 8px; max-width: 82ch; }
.doc-faq details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.doc-faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.doc-faq p { margin: 8px 0 0; color: var(--ink-2); line-height: 1.6; }

/* The plugin repositories (guias-site.js), live from the store. */
.doc-repos { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.doc-repos a { display: grid; gap: 4px; align-content: start; height: 100%; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); text-decoration: none; color: var(--ink-2); transition: border-color .15s ease; }
.doc-repos a:hover { border-color: var(--accent); }
.doc-repos strong { color: var(--ink); }
.doc-repos-url { font-family: var(--mono); font-size: 12px; color: var(--accent); overflow-wrap: anywhere; }
.doc-repos-desc { font-size: 14px; line-height: 1.55; }
.doc-repos-note { color: var(--ink-3); }

.doc-deeper { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc-deeper ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc-deeper li { display: grid; gap: 2px; }
.doc-deeper code { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

/* Search: above the guide list; results replace the guide in the middle column. */
.doc-search { display: grid; gap: 6px; margin-bottom: 14px; }
.doc-search-label { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.doc-search input { width: 100%; }
.doc-results-head { margin: 0 0 18px; color: var(--ink-3); font-size: 15px; }
.doc-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc-results a { display: grid; gap: 4px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink-2); background: var(--card); }
.doc-results a:hover, .doc-results a:focus-visible { border-color: var(--accent); }
.doc-result-guide { font: 700 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.doc-result-text { line-height: 1.55; overflow-wrap: anywhere; }
.doc-results mark, .doc-guide mark { background: rgba(53, 201, 240, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
/* The block a search result opens on is lit for a moment. */
.doc-hit { animation: doc-hit 2.2s ease-out; border-radius: 12px; }
@keyframes doc-hit { from { box-shadow: 0 0 0 6px rgba(53, 201, 240, .35); background: rgba(53, 201, 240, .10); } to { box-shadow: 0 0 0 6px transparent; background: transparent; } }

/* On this page: the guide's sections, beside it on wide screens. */
.doc-toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 13px; }
.doc-toc[hidden] { display: none; }
.doc-toc p { margin: 0 0 10px; font: 700 10px var(--mono); letter-spacing: .14em; color: var(--ink-3); }
.doc-toc ol { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); display: grid; gap: 8px; }
.doc-toc a { color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.doc-toc a:hover { color: var(--accent); }
@media (max-width: 1359px) { .doc-toc { display: none; } }

/* PoM's diagram motion (its index.css guide-* rules), unchanged. */
.guide-dash { stroke-dasharray: 5 5; animation: guide-dash 1.1s linear infinite; }
@keyframes guide-dash { to { stroke-dashoffset: -20; } }
.guide-packet { animation: guide-packet var(--dur, 2.6s) ease-in-out var(--delay, 0s) infinite; }
@keyframes guide-packet {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translate(var(--dx, 0px), var(--dy, 0px)); opacity: 0; }
}
.guide-pulse { transform-box: fill-box; transform-origin: center; animation: guide-pulse 2.4s ease-in-out var(--delay, 0s) infinite; }
@keyframes guide-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.guide-ring { transform-box: fill-box; transform-origin: center; animation: guide-ring 2.8s ease-out var(--delay, 0s) infinite; }
@keyframes guide-ring { 0% { transform: scale(.4); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .guide-dash, .guide-packet, .guide-pulse, .guide-ring, .doc-hit { animation: none; }
}

@media (max-width: 860px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-nav { position: static; max-height: none; overflow: visible; }
  .doc-list { display: none; }
  .doc-picker { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
}
