/* lua.email — página /docs (manual do webmail). Usa os tokens de style.css. */

.docs-hero {
  padding: calc(var(--header-h) + 2rem) 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
}
.docs-hero__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  margin: .75rem 0 1rem;
}
.docs-hero__title em { color: var(--color-accent); font-style: italic; }
.docs-hero__sub { max-width: 46rem; color: var(--color-text-muted); font-size: 1.05rem; line-height: 1.6; }
.docs-hero__meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.25rem; color: var(--color-text-subtle); font-size: .9rem; }
.docs-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 0 5rem;
}

/* ---- Índice lateral ---- */
.docs-toc {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.docs-toc > summary {
  cursor: pointer;
  list-style: none;
  padding: .85rem 1rem;
  font-weight: 600;
}
.docs-toc > summary::-webkit-details-marker { display: none; }
.docs-toc > summary::after { content: '▾'; float: right; color: var(--color-text-subtle); }
.docs-toc[open] > summary::after { content: '▴'; }
.docs-toc ol { list-style: none; margin: 0; padding: 0 .5rem .75rem; counter-reset: toc; }
.docs-toc li { counter-increment: toc; }
.docs-toc a {
  display: block;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: .92rem;
  line-height: 1.35;
}
.docs-toc a::before { content: counter(toc) '. '; color: var(--color-text-subtle); }
.docs-toc a:hover { background: var(--color-surface-hover); color: var(--color-text); }
.docs-toc a.is-active { background: var(--color-accent-dim); color: var(--color-accent); }
.docs-toc a.is-active::before { color: var(--color-accent); }
.docs-toc__extra { border-top: 1px solid var(--color-border); margin: 0 .5rem; padding: .5rem 0 0; }
.docs-toc__extra a::before { content: none; }

/* ---- Conteúdo ---- */
.docs-content { min-width: 0; max-width: 52rem; }
.docs-chapter { scroll-margin-top: calc(var(--header-h) + 1rem); padding-bottom: 2.5rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--color-border); }
.docs-chapter:last-of-type { border-bottom: 0; }
.docs-chapter > h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  display: flex;
  gap: .75rem;
  align-items: baseline;
}
.docs-chapter > h2 .num { color: var(--color-accent); font-size: .6em; font-family: var(--font-sans); font-weight: 700; letter-spacing: .04em; }
.docs-content h3 { font-size: 1.15rem; margin: 2rem 0 .6rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.docs-content p, .docs-content li { line-height: 1.65; color: var(--color-text); }
.docs-content p { margin: 0 0 1rem; }
.docs-content .lead { color: var(--color-text-muted); font-size: 1.05rem; }
.docs-content ul { list-style: disc; padding-left: 1.25rem; margin: 0 0 1rem; }
.docs-content ul li::marker { color: var(--color-accent); }
.docs-content ul li { margin-bottom: .35rem; }
.docs-content a { color: var(--color-secondary-text); }
.docs-content strong { color: #fff; font-weight: 600; }
.docs-content code, .docs-content kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: .1em .4em;
  word-break: break-word;
}

/* passos numerados */
.docs-steps { list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: step; }
.docs-steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: .75rem; }
.docs-steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: .05rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-dim); color: var(--color-accent);
  font-weight: 700; font-size: .85rem;
}

/* avisos */
.callout {
  border-left: 4px solid var(--color-secondary);
  background: var(--color-secondary-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .9rem 1.1rem;
  margin: 1.25rem 0;
}
.callout p { margin: 0; }
.callout--warn { border-color: var(--color-warm); background: rgba(var(--color-warm-rgb), .12); }
.callout--danger { border-color: var(--color-danger); background: rgba(var(--color-danger-rgb), .12); }

/* tabelas */
.docs-table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.docs-table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 30rem; }
.docs-table th { text-align: left; background: var(--color-surface); color: var(--color-accent); padding: .7rem .9rem; font-weight: 600; white-space: nowrap; }
.docs-table td { padding: .65rem .9rem; border-top: 1px solid var(--color-border); vertical-align: top; line-height: 1.5; }
.docs-table tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.docs-table td:first-child { font-weight: 600; color: #fff; }

/* figuras */
.docs-figure { margin: 1.5rem 0; }
.docs-figure img {
  display: block; width: 100%; height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
}
.docs-figure figcaption { margin-top: .5rem; text-align: center; color: var(--color-text-subtle); font-size: .85rem; }
.docs-figure--narrow img { max-width: 40rem; margin-inline: auto; }

/* bloco de exemplo */
.docs-example {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 1rem 1.15rem;
  margin: 1rem 0 1.25rem;
}
.docs-example h4 { margin: 0 0 .5rem; font-size: 1rem; }
.docs-example p { margin: 0 0 .25rem; font-size: .93rem; color: var(--color-text-muted); }
.docs-example p:last-child { margin: 0; }

.docs-note { color: var(--color-text-subtle); font-size: .88rem; text-align: center; margin-top: 2rem; }

@media (min-width: 960px) {
  .docs-layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
  .docs-toc { position: sticky; top: calc(var(--header-h) + 1rem); align-self: start; max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; }
  .docs-toc > summary { pointer-events: none; }
  .docs-toc > summary::after { content: none; }
}
