/*
 * The DigitPeak guide (/docs on the app's name, app.digitpeak.com/docs) — only what a document needs.
 *
 * Everything else is the app's own stylesheet, loaded first: the topbar,
 * the sidebar and its items, .widget cards, buttons, inputs, tabs, and both
 * themes' tokens (owner, 28 Sept 2026: "follow our style"). What is here is
 * what the app never had to draw — a three-column reading page and the type
 * of a long article — and it is written in the app's tokens so the
 * two can never drift apart. No colour in this file is a literal except the
 * two drop shadows, which are the same in both themes.
 */

.dc { min-height: 100vh; display: flex; flex-direction: column; }
.dc a { text-decoration: none; }
.dc-skip { position: absolute; left: -999px; top: 0; }
.dc-skip:focus { left: var(--s3); top: var(--s3); z-index: 50; background: var(--bg-panel); padding: var(--s2) var(--s3); border-radius: var(--radius-sm); }

/* ── Topbar ───────────────────────────────────────────────── */
.dc-topbar { gap: var(--s3); }
.dc-docs-label {
  font-weight: 620;
  color: var(--text-dim);
  padding-left: var(--s3);
  border-left: 1px solid var(--border);
  line-height: 20px;
}
.dc-tabs { display: flex; gap: 2px; align-self: stretch; align-items: stretch; margin-left: var(--s2); }
.dc-tabs .dc-tab { display: flex; align-items: center; margin-bottom: 0; }
.dc-tabs .dc-tab .kpi-sub { margin-left: var(--s1); font-weight: 400; }
.dc-search { flex: 0 1 320px; }
.dc-search input { height: 34px; padding-right: 34px; background: var(--bg-panel-2); }
.dc-kbd {
  position: absolute; right: 8px; top: 7px;
  font: inherit; font-size: 12px; line-height: 18px;
  min-width: 18px; text-align: center;
  color: var(--text-faint); border: 1px solid var(--border); border-radius: 4px;
  pointer-events: none;
}
.dc-search input:focus + .dc-kbd { display: none; }
.dc-open { white-space: nowrap; }
.dc-menu { display: none; }

.dc-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: min(480px, 92vw);
  max-height: 70vh; overflow: auto; z-index: 40;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); padding: var(--s1);
}
.dc-result { display: block; padding: var(--s2) var(--s3); border-radius: var(--radius-sm); color: var(--text); }
.dc-result:hover, .dc-result.on { background: var(--bg-hover); }
.dc-result-title { font-weight: 620; display: block; }
.dc-result-where { font-size: var(--fs-xs); color: var(--text-faint); display: block; }
.dc-result-snip { font-size: var(--fs-sm); color: var(--text-dim); display: block; margin-top: 2px; }
.dc-result mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 2px; }
.dc-results-empty { padding: var(--s3); color: var(--text-dim); }

/* ── Three columns ────────────────────────────────────────── */
.dc-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 220px;
  align-items: start;
}
.dc-body.dc-noside { grid-template-columns: minmax(0, 1fr); }
/* No "On this page" (a front page): the content takes the third column's room. */
.dc-body.dc-notoc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.dc-notoc .dc-main { max-width: 1040px; }
/* The page's own background, not the app menu's grey (owner, 29 Sept 2026:
   "a bit weird if its grey"); the border line still divides them. */
.dc-sidebar { top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); background: var(--bg); }
.dc-sidebar .sidebar-title { color: var(--text); }
.dc-sidebar .nav-item { text-decoration: none; }
/* A tool that opens and closes: the summary is a .nav-item, the chevron
   turns down when open, and its pages hang off a thin line, as on
   developers.cloudflare.com. */
/* "Filter sidebar": the topbar search's input, the width of the menu. */
.dc-filter { flex: none; max-width: none; margin: 0 0 var(--s2); }
.dc-filter input { padding-right: 12px; background: var(--bg-panel-2); }
.dc-filter-none { padding: var(--s2) 10px; }
/* .nav-item sets display:flex, which would beat [hidden] while filtering. */
.dc-sidebar [hidden] { display: none !important; }
.dc-acc > summary { list-style: none; }
.dc-acc > summary::-webkit-details-marker { display: none; }
.dc-acc-chev { display: flex; flex-shrink: 0; color: var(--text-faint); transition: transform 0.15s ease; }
.dc-acc[open] > summary .dc-acc-chev { transform: rotate(90deg); }
.dc-acc > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dc-acc-body {
  display: flex; flex-direction: column; gap: 1px;
  margin: 2px 0 var(--s2) 20px; padding-left: var(--s2);
  border-left: 1px solid var(--border);
}
.dc-main { min-width: 0; padding: var(--s8) 48px 64px; max-width: 820px; width: 100%; box-sizing: border-box; justify-self: center; }
.dc-noside .dc-main { max-width: 1040px; }
.dc-toc {
  position: sticky; top: calc(var(--topbar-h) + var(--s8));
  padding: 0 var(--s5) var(--s5) 0;
  max-height: calc(100vh - var(--topbar-h) - 64px); overflow: auto;
}
.dc-toc-title { font-size: var(--fs-xs); font-weight: 560; color: var(--text-faint); margin: 0 0 var(--s2); }
.dc-toc ul { list-style: none; margin: 0 0 var(--s6); padding: 0; border-left: 1px solid var(--border); }
.dc-toc li a { display: block; padding: 3px 0 3px var(--s3); color: var(--text-dim); margin-left: -1px; border-left: 2px solid transparent; font-size: var(--fs-sm); }
.dc-toc li.dc-toc-3 a { padding-left: 24px; }
.dc-toc li a:hover { color: var(--text); }
.dc-toc li a.on { color: var(--text); border-left-color: var(--brand); }
.dc-helpful-btns { display: flex; gap: var(--s2); }
.dc-helpful-thanks { margin: var(--s2) 0 0; }

/* ── Article type ─────────────────────────────────────────── */
.dc-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s4); }
.dc-crumbs a { color: var(--text-dim); }
.dc-crumbs a:hover { color: var(--text); }
.dc-sep { color: var(--text-faint); }
.dc-main h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 var(--s3); color: var(--text); }
.dc-lead { font-size: var(--fs-xl); line-height: 1.55; color: var(--text-dim); margin: 0 0 var(--s8); }
.dc-article { font-size: var(--fs-md); line-height: 1.7; color: var(--text); }
.dc-article h2, .dc-main > h2 { font-size: var(--fs-2xl); font-weight: 700; margin: 44px 0 var(--s3); scroll-margin-top: calc(var(--topbar-h) + var(--s4)); position: relative; }
.dc-article h3 { font-size: var(--fs-xl); font-weight: 620; margin: var(--s8) 0 var(--s2); scroll-margin-top: calc(var(--topbar-h) + var(--s4)); position: relative; }
.dc-anchor { position: absolute; left: -22px; color: var(--text-faint); opacity: 0; font-weight: 400; }
.dc-article h2:hover .dc-anchor, .dc-article h3:hover .dc-anchor { opacity: 1; }
.dc-article p { margin: 0 0 var(--s4); }
.dc-article ul, .dc-article ol { margin: 0 0 var(--s4); padding-left: 24px; }
.dc-article li { margin: 0 0 6px; }
.dc-article li > ul, .dc-article li > ol { margin: 6px 0 0; }
.dc-article strong { font-weight: 620; color: var(--text); }
.dc-article a { color: var(--info); }
.dc-article a:hover { text-decoration: underline; }
.dc-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em;
  background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.dc-code { background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); overflow: auto; margin: 0 0 var(--s4); }
.dc-code code { background: none; border: 0; padding: 0; }
.dc-table { overflow-x: auto; margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); }
.dc-table table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.dc-table th { text-align: left; font-weight: 620; color: var(--text); background: var(--bg-panel-2); }
.dc-table th, .dc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dc-table tr:last-child td { border-bottom: 0; }
.dc-updated { margin-top: 48px; }

/* No callout boxes (owner, 5 Oct 2026): a warning is a plain paragraph that
   opens with a bold "Costs credits:" or "Cannot be undone:" (lib/docsSite.js). */

/* ── Cards (the app's .widget, as links) ──────────────────── */
.dc-hero { padding: var(--s6) 0 var(--s2); }
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s4); margin: 0 0 var(--s8); }
.dc-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: border-color 0.15s ease; }
.dc-card:hover { border-color: var(--brand); }
.dc-card-title { font-size: var(--fs-lg); font-weight: 620; }
.dc-card-text { color: var(--text-dim); line-height: 1.55; flex: 1; }
.dc-card-go { color: var(--info); font-weight: 560; margin-top: var(--s2); }
.dc-card-muted { opacity: 0.75; }
.dc-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.dc-all-group ul { list-style: none; margin: var(--s3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.dc-all-group li { display: flex; flex-direction: column; gap: 2px; }
.dc-all-group li a { color: var(--text); font-weight: 560; }
.dc-all-group li a:hover { color: var(--info); }

.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); margin-top: var(--s8); }
.dc-pager a { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.dc-pager a:hover { border-color: var(--brand); }
.dc-next { text-align: right; }
.dc-pager-title { font-weight: 620; }

.dc-foot { display: flex; gap: var(--s5); justify-content: center; padding: var(--s6) var(--s4); border-top: 1px solid var(--border); }
.dc-foot a { color: var(--text-dim); }
.dc-foot a:hover { color: var(--text); }

/* ── Narrower screens ─────────────────────────────────────── */
@media (max-width: 1200px) {
  .dc-body { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .dc-toc { display: none; }
}
@media (max-width: 900px) {
  .dc-body { grid-template-columns: minmax(0, 1fr); }
  .dc-menu { display: inline-flex; }
  .dc-sidebar {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 30;
    transform: translateX(-100%); transition: transform 0.2s ease, visibility 0.2s;
    visibility: hidden;
  }
  /* The shadow only while open: closed, it showed as a grey strip down the left edge. */
  .dc-sidebar.open { transform: none; visibility: visible; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3); }
  .dc-body.dc-notoc { grid-template-columns: minmax(0, 1fr); }
  .dc-tabs, .dc-docs-label, .dc-open { display: none; }
  .dc-search { flex: 1 1 auto; }
  .dc-main { padding: var(--s6) var(--s4) 48px; }
  .dc-main h1 { font-size: 26px; }
  .dc-anchor { display: none; }
}
@media (max-width: 520px) {
  .dc-topbar { padding: 0 var(--s3); gap: var(--s2); }
  .topbar-wordmark { height: 18px; }
  .dc-pager { grid-template-columns: 1fr; }
  .dc-foot { flex-wrap: wrap; gap: var(--s3); }
}
