/* Force docs: the landing page's tokens, top bar and footer (style.css), laid out for reading. A contents list on the
   left that marks where you are, one column of text, and code and tables drawn like Force's own windows. */

.docs { width: var(--width); margin-inline: auto; display: grid; grid-template-columns: 200px minmax(0, 1fr);
        gap: clamp(32px, 6vw, 96px); padding: calc(clamp(40px, 6vw, 72px) + 72px) 0 120px; }

/* contents */
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 112px); overflow-y: auto;
       scrollbar-width: none; display: flex; flex-direction: column; }
.toc-h { margin: 0 0 12px; font-size: .8rem; font-weight: 500; color: var(--muted); }
.toc a { padding: 5px 0 5px 14px; border-left: 1px solid #2a2a2a; color: #8a8a8a; font-size: .9rem; line-height: 1.4;
         text-decoration: none; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); }
.toc a[aria-current] { color: var(--text); border-left-color: var(--coral); }

/* the text column */
.doc { min-width: 0; max-width: 760px; }
.doc-head { padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.doc h1 { margin: 0; font: 700 clamp(1.9rem, 3.4vw, 2.6rem)/1.1 var(--display); letter-spacing: -.03em; }
.doc .lead { margin: 18px 0 0; max-width: 58ch; font-size: 1.12rem; line-height: 1.6; color: #a6a6a6; }
.doc section { width: auto; margin: 0; padding-top: 56px; }
.doc h2 { margin: 0 0 14px; font: 600 1.6rem/1.2 var(--sans); letter-spacing: -.025em; }
.doc h3 { margin: 34px 0 10px; font: 600 1.05rem/1.3 var(--sans); letter-spacing: -.01em; color: var(--text); }
.doc p { margin: 0 0 16px; color: #b0b0b0; line-height: 1.7; max-width: 56ch; }
.doc strong { color: var(--soft); font-weight: 500; }
.doc p code, .doc td code { color: var(--soft); font-size: .86em; padding: 1px 5px; border-radius: 5px; background: #222; }
.doc a { color: var(--soft); }
.doc .install { margin: 8px 0 20px; }

/* code: Force's ground, its prompt in the mark's coral, comments in the sidebar's grey, strings in its green */
.code { margin: 6px 0 20px; padding: 15px 18px; border-radius: 12px; overflow-x: auto; scrollbar-width: thin;
        background: linear-gradient(180deg, #232323, #1d1d1d); color: #d6d6d6; font: .82rem/1.65 var(--mono);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(255, 255, 255, .07); }
.code .p { color: var(--coral); }
.code .c { color: #8c8c8c; }
.code .s { color: #a7d4ad; }
.ref-block { font-size: .78rem; }

/* tables: the help window's rows */
.ref { width: 100%; margin: 6px 0 22px; border-collapse: collapse; font-size: .92rem; line-height: 1.55; }
.ref th, .ref td { text-align: left; vertical-align: baseline; padding: 10px 0; border-top: 1px solid #262626; }
.ref tr:last-child th, .ref tr:last-child td { border-bottom: 1px solid #262626; }
.ref tbody th { font-weight: 400; white-space: nowrap; padding-right: 28px; width: 1%; color: var(--text); }
.ref tbody th code { font-size: .86em; color: var(--text); }
.ref td { color: #9a9a9a; padding-right: 12px; }
.ref thead th { font-size: .8rem; font-weight: 500; color: var(--muted); padding-top: 0; border-top: 0; }
.ref td:nth-child(2):not(:last-child) { white-space: nowrap; padding-right: 24px; }
.ref.keys kbd { margin-right: 2px; }
/* states: the sidebar's bar in each state's colour */
.states tbody th { position: relative; padding-left: 16px; }
.states tbody th::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--s); }

.floating .top nav a[aria-current] { color: var(--text); }
.docs-page .foot { border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  html { scroll-padding-top: 130px; }
  .docs { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  /* the contents: one row under the floating top bar; its background runs up behind the bar so no text shows between */
  .toc { position: sticky; top: 0; z-index: 30; max-height: none; flex-direction: row; gap: 6px; overflow-x: auto;
         margin: 0 calc(-1 * var(--gutter)) 28px; padding: 80px var(--gutter) 10px; background: rgba(20, 20, 20, .92);
         border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .toc-h { display: none; }
  .toc a { flex: none; }
  .toc a { border: 0; padding: 5px 10px; border-radius: 7px; background: #1e1e1e; font-size: .84rem; }
  .toc a[aria-current] { background: #262626; }
  .ref { font-size: .86rem; }
  .ref tbody tr { display: grid; padding: 10px 0; border-top: 1px solid #262626; }
  .ref tbody th, .ref tbody td { border: 0; padding: 0; width: auto; white-space: normal; }
  .ref tbody td { margin-top: 2px; }
  .ref td:nth-child(2):not(:last-child) { white-space: normal; padding-right: 0; color: #7a7a7a; }
  .ref thead { display: none; }
  .states tbody th::before { top: 3px; bottom: 3px; }
}
