/* Data pack docs: the site's colours and type (styles.css), laid out for reading reference pages. */

:root {
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --read: #c9d0db;
  --code-bg: #0d1117;
}

.docs .nav-in nav a[aria-current] { color: var(--text); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dsearch { margin-left: auto; }
.dsearch input { width: 240px; height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--bg-1); color: var(--text); font: 400 14px var(--body); }
.dsearch input::placeholder { color: var(--text-faint); }
.dsearch input:focus { outline: none; border-color: var(--accent); }

.docs-in { display: grid; grid-template-columns: 240px minmax(0, 1fr) 210px; gap: 48px; align-items: start; padding-top: 40px; padding-bottom: 88px; max-width: 1400px; }
.docs-in.wide { grid-template-columns: 240px minmax(0, 1fr); }
.docs-in.wide .toc { display: none; }

/* Side navigation */
.dnav { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.dnav summary { display: none; }
.dn-h { margin: 22px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.dnav .dn-h:first-of-type { margin-top: 0; }
.dnav ul, .toc ul { margin: 0; padding: 0; list-style: none; }
.dnav a { display: block; padding: 5px 10px; border-left: 2px solid transparent; color: var(--text-dim); font-size: 14px; line-height: 1.35; text-decoration: none; }
.dnav a:hover { color: var(--text); }
.dnav a[aria-current] { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }

/* On this page */
.toc { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; }
.toc a { display: block; padding: 3px 0; color: var(--text-faint); font-size: 13px; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc .l3 a { padding-left: 12px; }

/* The page */
.doc { min-width: 0; }
.doc article { color: var(--read); font-size: 16px; line-height: 1.7; }
.doc h1 { margin: 0 0 18px; font: 700 clamp(34px, 4.6vw, 50px)/1.02 var(--head); text-transform: uppercase; letter-spacing: .01em; color: var(--text); }
.doc h2 { margin: 48px 0 14px; padding-top: 8px; font: 700 clamp(24px, 2.8vw, 30px)/1.1 var(--head); text-transform: uppercase; letter-spacing: .02em; color: var(--text); }
.doc h3 { margin: 32px 0 10px; font-size: 18px; font-weight: 700; color: var(--text); }
.doc h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 700; color: var(--text); }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.anchor { margin-left: 8px; color: var(--text-faint); font-weight: 400; text-decoration: none; opacity: 0; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; }
.doc .eyebrow { margin-bottom: 10px; }
.doc p, .doc li { max-width: 78ch; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 1em; }
.doc li { margin-bottom: 6px; }
.doc li > ul, .doc li > ol { margin: 6px 0 0; }
.doc strong { color: var(--text); font-weight: 600; }
.doc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(244, 193, 82, .35); }
.doc a:hover { border-bottom-color: var(--accent); }
.doc .anchor, .doc .btn { border-bottom: 0; }
.lede-doc, .doc .lede { font-size: 18px; color: var(--text); max-width: 72ch; }
.doc blockquote { margin: 0 0 1em; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-m) var(--radius-m) 0; }
.doc blockquote p { margin: 0; }
.doc-meta { margin: 56px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-faint); }

/* Notes and callouts */
.note { margin: 0 0 1.2em; padding: 14px 18px; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: var(--radius-m); background: var(--bg-1); }
.note p:last-child { margin-bottom: 0; }
.note.warn { border-left-color: #f08c4f; }
.note-h { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.note.warn .note-h { color: #f08c4f; }
.refs { margin: 0 0 22px; font-size: 14px; color: var(--text-dim); }
.refs p { margin: 0; }

/* Code */
.doc code { padding: .12em .38em; border-radius: 5px; background: var(--bg-2); color: #e9edf3; font: 400 .88em/1.4 var(--mono); overflow-wrap: anywhere; }
.code { position: relative; margin: 0 0 1.3em; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--code-bg); }
.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 9px; left: 14px; font: 600 11px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; scrollbar-width: thin; }
.code[data-lang] pre { padding-top: 32px; }
.code code { padding: 0; background: none; font-size: 13.5px; line-height: 1.6; color: #e6e9ee; overflow-wrap: normal; white-space: pre; }
.copy { position: absolute; top: 6px; right: 6px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg-2); color: var(--text-dim); font: 600 12px var(--body); cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus { opacity: 1; }
.copy.done { color: var(--success); }

/* Tables */
.table { margin: 0 0 1.4em; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-m); scrollbar-width: thin; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.doc th { position: sticky; top: 0; padding: 10px 12px; background: var(--bg-2); color: var(--text); font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-strong); }
.doc td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.doc tbody tr:first-child td { border-top: 0; }
.doc td code { font-size: 12.5px; }
.fields td:nth-child(2) { min-width: 130px; color: var(--text-dim); }
.fields td:nth-child(3) { color: var(--success); font-weight: 600; white-space: nowrap; }
.fields td:nth-child(4) { white-space: nowrap; }
.fields td:nth-child(5) { min-width: 260px; }
.fields td.f { padding-left: calc(12px + var(--d, 0) * 18px); white-space: nowrap; }
.fields td.f code { background: none; padding: 0; color: var(--accent); font-weight: 500; }
.fields tr.variant td { padding: 7px 12px 7px calc(12px + (var(--d, 1) - 1) * 18px); background: rgba(244, 193, 82, .06); color: var(--text-dim); font-size: 13px; font-style: italic; }
.fields tr:target td { background: var(--accent-soft); }
.types td:first-child a { font-weight: 600; }
.types td:nth-child(2) { white-space: nowrap; }

.facts-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 22px; margin: 0 0 1.4em; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--bg-1); font-size: 14px; }
.facts-dl dt { color: var(--text-faint); font-weight: 600; }
.facts-dl dd { margin: 0; color: var(--read); }

.filter { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-dim); }
.filter input { width: min(380px, 70vw); height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--bg-1); color: var(--text); font: 400 14px var(--body); }
.filter input:focus { outline: none; border-color: var(--accent); }

/* Cards on the overview */
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 8px 0 2em; }
.doc .dcard { display: block; padding: 18px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius-l); background: var(--bg-1); color: var(--read); text-decoration: none; transition: border-color .15s, transform .15s; }
.doc .dcard:hover { border-color: rgba(244, 193, 82, .55); transform: translateY(-2px); }
.dcard strong { display: block; margin-bottom: 4px; font: 700 21px/1.1 var(--head); text-transform: uppercase; letter-spacing: .02em; color: var(--text); }
.dcard span { display: block; font-size: 14px; line-height: 1.5; color: var(--text-dim); }

/* Steps */
.doc ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.doc ol.steps > li { position: relative; padding-left: 44px; margin-bottom: 14px; counter-increment: step; }
.doc ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 14px/28px var(--body); text-align: center; }

/* Example packs */
.ex { margin: 0 0 18px; padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: var(--radius-l); background: var(--bg-1); }
.ex h3 { margin-top: 0; }
.ex-meta { font-size: 14px; color: var(--text-dim); }
.btn-dl { background: var(--accent); color: var(--accent-ink); }
.doc .btn-dl { color: var(--accent-ink); }
.ex details { margin-top: 10px; font-size: 14px; }
.ex summary, .readme summary { cursor: pointer; color: var(--text); font-weight: 600; }
.ex details ul { margin: 8px 0 0; columns: 2; column-gap: 28px; }
.ex details li { margin: 0 0 2px; break-inside: avoid; }
.readme { margin-top: 10px; }
.readme[open] { padding-bottom: 4px; }

/* Folder trees */
.tree { margin: 0 0 1.3em; padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--code-bg); font: 13.5px/1.7 var(--mono); color: #e6e9ee; white-space: pre; overflow-x: auto; }
.tree i { color: var(--text-faint); font-style: normal; }

/* Search results */
.dresults { margin: 0 0 32px; padding: 16px 20px; border: 1px solid var(--accent); border-radius: var(--radius-l); background: var(--bg-1); }
.dresults h2 { margin: 0 0 10px; font: 700 20px/1 var(--head); text-transform: uppercase; color: var(--text); }
.dresults ul { margin: 0; padding: 0; list-style: none; }
.dresults li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dresults li:first-child { border-top: 0; }
.dresults a { color: var(--accent); font-weight: 600; text-decoration: none; }
.dresults small { margin-left: 8px; color: var(--text-faint); }
.dresults .hit { display: block; color: var(--text-dim); font-size: 13px; }
.dresults .hit code { font: 12.5px var(--mono); }

@media (max-width: 1200px) {
  .docs-in { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .docs-in, .docs-in.wide { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .dnav { position: static; max-height: none; padding: 0; }
  .dnav details { border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--bg-1); padding: 0 14px; }
  .dnav summary { display: block; padding: 12px 0; font-weight: 600; color: var(--text); cursor: pointer; }
  .dnav details[open] { padding-bottom: 12px; }
  .dsearch { order: 3; flex-basis: 100%; margin: 4px 0 0; }
  .dsearch input { width: 100%; }
  .nav-in { flex-wrap: wrap; }
  .docs .nav-in nav { display: flex; gap: 18px; margin-left: 4px; }
  .docs .nav-in nav a:not([aria-current]):first-child { display: none; }
}
@media (max-width: 560px) {
  .docs .nav { position: relative; }
  .doc article { font-size: 15.5px; }
  /* The field table as a card per field: the path, then its type, whether it is required, its default and notes. */
  .fields { border: 0; overflow: visible; }
  .fields table, .fields tbody, .fields tr, .fields td { display: block; width: auto; }
  .fields thead { display: none; }
  .fields tr { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); background: var(--bg-1); }
  .doc .fields td { padding: 2px 0; border: 0; min-width: 0; white-space: normal; }
  .doc .fields td.f { padding: 0 0 4px; white-space: normal; overflow-wrap: anywhere; }
  .fields td[data-label]:empty { display: none; }
  .fields td[data-label]::before { content: attr(data-label) ': '; color: var(--text-faint); font-size: 12px; font-weight: 600; font-style: normal; }
  .fields td[data-label="Notes"]::before { content: none; }
  .fields td[data-label="Required"] { display: inline-block; margin-right: 12px; }
  .fields tr.variant { padding: 6px 12px; border-style: dashed; background: rgba(244, 193, 82, .06); }
  .doc .fields tr.variant td { padding: 0; background: none; }
  .ex details ul { columns: 1; }
  .facts-dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts-dl dd { margin-bottom: 8px; }
}
