/* wireface.dev/docs: the documentation pages. Built on site.css (its colours, fonts, buttons, .code blocks and
   tables): a list of the pages on the left, the article, and "On this page" on the right on wide screens. */
.docs { --docs-text: #cdd5e6; --docs-link: #a5b4fc; padding: 36px 0 80px; }
@media (min-width: 821px) { html { scroll-padding-top: 88px; } }

.docs-grid { display: grid; grid-template-columns: 196px minmax(0, 1fr) 188px; gap: 44px; align-items: start; }

/* --- the list of pages ------------------------------------------------------------------------------------------ */
.docs-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding: 2px 4px 24px 0;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.docs-group + .docs-group { margin-top: 22px; }
.docs-group-name { font: 500 0.7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  margin: 0 0 10px; }
.docs-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.docs-group a { display: block; margin-left: -1px; padding: 6px 12px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; font-size: 0.92rem; line-height: 1.35; border-radius: 0 8px 8px 0; }
.docs-group a:hover { color: var(--text); border-left-color: var(--line-2); }
.docs-group a[aria-current="page"] { color: var(--text); font-weight: 600; border-left-color: var(--cyan);
  background: linear-gradient(90deg, rgba(34, 211, 238, .09), transparent 85%); }

/* the same list on a phone, folded into a bar above the article */
.docs-menu { display: none; }
.docs-menu summary, .toc-inline summary { list-style: none; cursor: pointer; }
.docs-menu summary::-webkit-details-marker, .toc-inline summary::-webkit-details-marker { display: none; }
.docs-menu summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(13, 22, 48, .7); }
.docs-menu summary::after, .toc-inline summary::after { content: ""; width: 8px; height: 8px; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg);
  transition: transform .15s ease; }
.docs-menu[open] summary::after, .toc-inline[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.docs-menu-label { font: 500 0.72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.docs-menu-current { font-weight: 600; }
.docs-menu nav { margin-top: 8px; padding: 18px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--night-2); display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.docs-menu .docs-group + .docs-group { margin-top: 0; }

/* --- the article ------------------------------------------------------------------------------------------------- */
.docs-article { min-width: 0; color: var(--docs-text); }
.docs-head { margin-bottom: 8px; }
.docs-head .eyebrow { margin-bottom: .8rem; }
.docs-head h1 { font-size: clamp(2.1rem, 4.2vw, 3rem); color: var(--text); }
.docs-head .lede { margin-top: 1rem; max-width: 62ch; }
.docs-article h2 { font-size: 1.55rem; max-width: none; color: var(--text); margin: 3rem 0 1rem; padding-top: 2.2rem;
  border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.docs-article h3 { font-size: 1.14rem; color: var(--text); margin: 2.1rem 0 .7rem; }
.docs-article h4 { font: 600 0.98rem var(--display); color: var(--text); margin: 1.6rem 0 .5rem; }
.docs-article p, .docs-article ul, .docs-article ol, .docs-article dl, .docs-article .code, .docs-article .table-wrap,
.docs-article .note, .docs-article figure { margin: 0 0 1.05rem; }
.docs-article ul, .docs-article ol { padding-left: 1.35em; }
.docs-article li + li { margin-top: .4rem; }
.docs-article li > ul, .docs-article li > ol { margin: .4rem 0 0; }
.docs-article li::marker { color: var(--dim); }
.docs-article a { color: var(--docs-link); text-decoration: underline; text-decoration-color: rgba(165, 180, 252, .35);
  text-underline-offset: 3px; }
.docs-article a:hover { color: #c7d2fe; text-decoration-color: currentColor; }
.docs-article strong, .docs-article b, .docs-article dt { color: var(--text); font-weight: 600; }
.docs-article em { color: var(--text); }
.docs-article :not(pre) > code { padding: .1em .38em; border-radius: 6px; background: rgba(99, 102, 241, .13);
  border: 1px solid rgba(99, 102, 241, .18); font-size: .86em; overflow-wrap: anywhere; }
.docs-article kbd { font: 500 .82em var(--mono); padding: .12em .45em; border-radius: 6px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line-2); border-bottom-width: 2px; white-space: nowrap; }
.docs-article .lede a { color: inherit; }

/* a link to each heading, shown when you point at it */
.anchor { margin-left: .45em; color: var(--dim); text-decoration: none !important; font-weight: 400; opacity: 0;
  transition: opacity .15s ease; }
.docs-article h2:hover .anchor, .docs-article h3:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--cyan) !important; }

/* code: site.css's .code, a little smaller, with a Copy button (docs.js) that shows on hover */
.docs-article .code pre { font-size: .85rem; line-height: 1.65; padding: 16px 18px; }
.docs-article .code .copy { opacity: 0; transition: opacity .15s ease; }
.docs-article .code:hover .copy, .docs-article .code .copy:focus-visible { opacity: 1; }
@media (hover: none) { .docs-article .code .copy { opacity: 1; } }

/* tables of settings */
.docs-article .table-wrap { margin-top: 0; }
.docs-article table { min-width: 560px; font-size: .9rem; }
.docs-article th, .docs-article td { padding: 10px 14px; }
.docs-article thead th { font-size: .9rem; color: var(--text); white-space: nowrap; }
.docs-article tbody th { width: auto; }
.docs-article td { color: var(--docs-text); }
.docs-article td:first-child { white-space: nowrap; }
.docs-article td:first-child code, .docs-article td.k code { color: #c7d2fe; }
.docs-article table.wrap { min-width: 0; }
.docs-article table.wrap td:first-child { white-space: normal; }
.docs-article td code { overflow-wrap: normal; }
.docs-article td:first-child code { white-space: nowrap; }
.docs-article td p { margin: 0; }
.docs-article td p + p { margin-top: .4rem; }
.docs-article tbody tr:hover { background: rgba(99, 102, 241, .04); }

/* notes */
.note { padding: 14px 18px; border-radius: 12px; border: 1px solid rgba(34, 211, 238, .28);
  background: linear-gradient(180deg, rgba(34, 211, 238, .06), rgba(34, 211, 238, .02)); }
.note.warn { border-color: rgba(251, 191, 36, .35); background: linear-gradient(180deg, rgba(251, 191, 36, .07), rgba(251, 191, 36, .02)); }
.note > :last-child { margin-bottom: 0; }
.note-label { display: block; font: 500 0.7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 8px; }
.note.warn .note-label { color: #fbbf24; }

/* pictures and screenshots */
.docs-fig { margin: 1.4rem 0 1.6rem; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #060b18; }
.docs-fig img { display: block; width: 100%; height: auto; }
.docs-fig figcaption { padding: 10px 14px; color: var(--dim); font-size: .85rem; border-top: 1px solid var(--line); }
.docs-fig.narrow { max-width: 440px; }

/* a few short steps */
.docs-steps { list-style: none; padding: 0 !important; counter-reset: step; display: grid; gap: 10px; }
.docs-steps > li { position: relative; margin: 0 !important; padding: 12px 16px 12px 52px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(13, 22, 48, .55); counter-increment: step; }
.docs-steps > li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 8px; font: 600 .8rem var(--mono); color: #050914; background: var(--grad); }

/* cards: the docs index and "start here" */
.docs-cards { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.docs-cards li { margin: 0 !important; }
.docs-cards a { display: grid; gap: 6px; height: 100%; padding: 18px 20px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(13, 22, 48, .9), rgba(10, 16, 36, .9));
  transition: border-color .2s ease, transform .2s ease; }
.docs-cards a:hover { border-color: rgba(34, 211, 238, .45); transform: translateY(-2px); }
.docs-cards b { font: 600 1.05rem var(--display); color: var(--text); letter-spacing: -0.01em; }
.docs-cards span { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.docs-cards small { font: 500 .78rem var(--mono); color: var(--cyan); }

/* questions and answers */
.docs-qa dt { font: 600 1.02rem/1.35 var(--display); margin-top: 1.5rem; }
.docs-qa dt:first-child { margin-top: 0; }
.docs-qa dd { margin: .45rem 0 0; }
.docs-qa dd p:last-child { margin-bottom: 0; }

/* the download box on the install page (site.css's .download) */
.docs-article .download { margin-bottom: 1.2rem; }
.docs-article .btn { text-decoration: none; }
.docs-article .btn.primary:hover { color: #050914; }

/* a live embed */
.docs-live { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 1.2rem 0 1.6rem; }
.docs-live iframe { color-scheme: normal; display: block; border: 0; width: 360px; max-width: 100%; height: 400px; border-radius: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(34, 211, 238, .08), transparent 70%), #060b18;
  outline: 1px solid var(--line-2); }
.docs-live p { flex: 1; min-width: 220px; margin: 0; }

/* previous and next */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 3.5rem; padding-top: 2rem;
  border-top: 1px solid var(--line); }
.docs-pager a { display: grid; gap: 4px; padding: 14px 18px; border-radius: 12px; border: 1px solid var(--line);
  text-decoration: none; color: var(--text); font: 600 1rem var(--display); background: rgba(13, 22, 48, .5); }
.docs-pager a:hover { border-color: rgba(34, 211, 238, .45); color: var(--text); }
.docs-pager span { font: 500 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.docs-pager .next { grid-column: 2; text-align: right; }

/* --- on this page -------------------------------------------------------------------------------------------------- */
.docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; font-size: .85rem;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.docs-toc-title { font: 500 0.7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  margin: 0 0 10px; }
.docs-toc ol, .toc-inline ol { list-style: none; margin: 0; padding: 0; }
.docs-toc ol { border-left: 1px solid var(--line); }
.docs-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 12px; border-left: 2px solid transparent;
  color: var(--dim); text-decoration: none; line-height: 1.4; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.on { color: var(--cyan); border-left-color: var(--cyan); }

.toc-inline { display: none; margin: 1.4rem 0 1.6rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(13, 22, 48, .5); }
.toc-inline summary { display: flex; align-items: center; padding: 11px 16px; font: 500 0.74rem/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toc-inline ol { padding: 0 16px 12px; columns: 2; column-gap: 24px; }
.toc-inline li { break-inside: avoid; }
.toc-inline a { display: block; padding: 4px 0; color: var(--docs-link); text-decoration: none; font-size: .92rem; }
.toc-inline a:hover { color: var(--text); }

/* --- narrower screens ------------------------------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .docs-grid { grid-template-columns: 196px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 900px) {
  .docs { padding-top: 20px; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-side { display: none; }
  .docs-menu { display: block; margin-bottom: 26px; }
}
@media (max-width: 560px) {
  .docs-cards, .docs-menu nav { grid-template-columns: 1fr; }
  .toc-inline ol { columns: 1; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .next { grid-column: auto; }
  .docs-article h2 { font-size: 1.38rem; }
  .docs-steps > li { padding-left: 48px; }
}
