/*
 * Typography for pages rendered by @stackship/docs (`.stackship-doc`).
 *
 * Plain CSS, no framework: every colour and radius is a custom property that falls back
 * to the shadcn-style token of the same role (--foreground, --border, --muted, …) and then
 * to a literal, so the portal needs no mapping and another host (docs.stackship.se) can
 * set --doc-* to restyle it.
 */
.stackship-doc {
  --doc-fg: var(--foreground, #1f2328);
  --doc-muted-fg: var(--muted-foreground, #59636e);
  --doc-border: var(--border, #d1d9e0);
  --doc-code-bg: var(--muted, #f6f8fa);
  --doc-link: var(--primary, #0969da);
  --doc-radius: var(--radius-sm, 12px);
  color: var(--doc-fg);
  font-size: 0.875rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.stackship-doc > * + * { margin-top: 0.875rem; }
.stackship-doc h2, .stackship-doc h3, .stackship-doc h4, .stackship-doc h5, .stackship-doc h6 {
  font-weight: 600;
  line-height: 1.3;
  scroll-margin-top: 1rem;
}
.stackship-doc h2 { font-size: 1.125rem; margin-top: 1.75rem; }
.stackship-doc h3 { font-size: 1rem; margin-top: 1.5rem; }
.stackship-doc h4, .stackship-doc h5, .stackship-doc h6 { font-size: 0.875rem; margin-top: 1.25rem; }
.stackship-doc :target, .stackship-doc .doc-target { outline: 2px solid var(--doc-link); outline-offset: 4px; border-radius: 4px; }

.stackship-doc a { color: var(--doc-link); text-decoration: underline; text-underline-offset: 2px; }
.stackship-doc a:focus-visible, .stackship-doc button:focus-visible { outline: 2px solid var(--ring, var(--doc-link)); outline-offset: 2px; }
.stackship-doc .doc-note { color: var(--doc-muted-fg); font-size: 0.8125rem; }

.stackship-doc ul, .stackship-doc ol { padding-left: 1.25rem; }
.stackship-doc ul { list-style: disc; }
.stackship-doc ol { list-style: decimal; }
.stackship-doc li + li { margin-top: 0.25rem; }

.stackship-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  background: var(--doc-code-bg);
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
}
.stackship-doc .doc-code { border: 1px solid var(--doc-border); border-radius: var(--doc-radius); overflow: hidden; }
.stackship-doc .doc-code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  border-bottom: 1px solid var(--doc-border);
  color: var(--doc-muted-fg); font-size: 0.75rem;
}
.stackship-doc .doc-code-copy {
  border: 1px solid var(--doc-border); border-radius: 8px;
  padding: 0.125rem 0.5rem; font-size: 0.75rem; background: transparent; color: inherit; cursor: pointer;
}
.stackship-doc pre { margin: 0; padding: 0.75rem; overflow-x: auto; background: var(--doc-code-bg); }
.stackship-doc pre code { background: none; padding: 0; white-space: pre; }

.stackship-doc blockquote { border-left: 3px solid var(--doc-border); padding-left: 0.875rem; color: var(--doc-muted-fg); }
.stackship-doc .doc-alert { border-left-width: 3px; border-radius: 0 var(--doc-radius) var(--doc-radius) 0; padding: 0.5rem 0.875rem; color: var(--doc-fg); }
.stackship-doc .doc-alert-title { font-weight: 600; }
.stackship-doc .doc-alert-note { border-color: var(--info, #0969da); background: var(--info-tint, transparent); }
.stackship-doc .doc-alert-tip { border-color: var(--success, #1a7f37); background: var(--success-tint, transparent); }
.stackship-doc .doc-alert-important { border-color: var(--primary, #8250df); background: var(--info-tint, transparent); }
.stackship-doc .doc-alert-warning { border-color: var(--warning, #9a6700); background: var(--warning-tint, transparent); }
.stackship-doc .doc-alert-caution { border-color: var(--destructive, #d1242f); background: var(--destructive-tint, transparent); }

.stackship-doc table { display: block; overflow-x: auto; border-collapse: collapse; }
/*
 * `anywhere` counts every character as a break point when a table sizes its columns, so a
 * narrow column shrinks to one letter per line. `break-word` keeps whole words in the
 * column widths; a table wider than the page scrolls instead.
 */
.stackship-doc th, .stackship-doc td { border: 1px solid var(--doc-border); padding: 0.375rem 0.625rem; text-align: left; overflow-wrap: break-word; }
.stackship-doc th { font-weight: 600; }

.stackship-doc img { max-width: 100%; height: auto; border-radius: 6px; }
/* A screenshot is a picture of a page: an edge keeps it apart from the page it sits on. */
.stackship-doc .doc-screenshot-picture { display: block; }
.stackship-doc img.doc-screenshot { display: block; border: 1px solid var(--doc-border); }
.stackship-doc .doc-image-missing {
  display: inline-block; padding: 0.5rem 0.75rem;
  border: 1px dashed var(--doc-border); border-radius: var(--doc-radius);
  color: var(--doc-muted-fg); font-size: 0.8125rem;
}
.stackship-doc hr { border: 0; border-top: 1px solid var(--doc-border); }
