/* The documentation (src/web/docs.js). Colours, fonts, buttons and the footer come from app.css. */
.docs { --nav-w: 280px; }
.docs-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--border); }
.docs-top .brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 700 1.15rem var(--display); letter-spacing: .06em; text-transform: uppercase; }
.docs-top .brand:hover { text-decoration: none; }
.docs-top .brand img { width: 28px; height: 28px; }
.docs-top .brand em { font: 700 .68rem var(--display); letter-spacing: .16em; color: var(--accent); border: 1px solid var(--accent-dim); border-radius: 3px; padding: 2px 6px; font-style: normal; }
.docs-links { margin-left: auto; display: flex; gap: 20px; font-size: .92rem; }
.docs-links a { color: var(--muted); } .docs-links a:hover { color: var(--text); text-decoration: none; }
.docs-burger { display: none; background: none; border: 1px solid var(--border); border-radius: var(--r); color: var(--text); padding: 6px 8px; cursor: pointer; font-size: 1.1rem; line-height: 1; }

.docs-layout { flex: 1 0 auto; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); width: 100%; max-width: 1320px; margin: 0 auto; }
.docs-nav { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto; padding: 18px 12px 40px 16px; border-right: 1px solid var(--border); scrollbar-width: thin; }
.docs-search { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); color: var(--faint); }
.docs-search:focus-within { border-color: var(--accent); }
.docs-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.docs-nav ul { list-style: none; margin: 0 0 6px; padding: 0; }
.docs-nav .nav-title { margin: 18px 8px 6px; font: 700 .7rem var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.docs-nav a { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: var(--r); color: var(--muted); font-size: .93rem; line-height: 1.3; }
.docs-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.docs-nav a[aria-current="page"] { color: var(--accent); background: var(--panel-2); font-weight: 600; }
.docs-nav a .ic { color: var(--gold); font-size: .78rem; margin-left: auto; }
.docs-nav .sub { margin: 2px 0 8px 12px; border-left: 1px solid var(--border); }
.docs-nav .sub a { padding: 5px 12px; font-size: .86rem; font-weight: 400; color: var(--muted); background: none; }
.docs-nav .sub a:hover { color: var(--text); }

.docs-main { min-width: 0; padding: 36px 48px 56px; }
.docs-main article { max-width: 860px; }
.docs-main h1 { font-size: 2.1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.docs-main h1 > .ic { color: var(--accent); font-size: 1.7rem; }
.docs-main h2 { margin-top: 2.2em; padding-top: .2em; scroll-margin-top: 76px; }
.docs-main h3 { margin-top: 1.6em; scroll-margin-top: 76px; }
.docs-main .lead { color: var(--muted); font-size: 1.06rem; max-width: 70ch; }
.docs-main p, .docs-main li { max-width: 78ch; }
.docs-main ul, .docs-main ol { padding-left: 1.3em; margin: 0 0 1em; }
.docs-main li { margin: .3em 0; }
.docs-main li::marker { color: var(--faint); }
.doc-head { margin-bottom: 22px; }
.doc-head .eyebrow { display: block; margin-bottom: 8px; }

.hero { display: flex; align-items: center; gap: 22px; padding: 30px 28px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(135deg, var(--panel-2), var(--bg) 70%); }
.hero h1 { margin: 0 0 8px; }
.hero .lead { margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 26px; }

.tier { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font: 700 .72rem var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; }
.tier.free { color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.tier.premium { color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.tier.premium .ic { color: var(--gold); font-size: .8rem; }
.tier.off { color: var(--faint); border: 1px solid var(--border-strong); }

.callout { display: flex; gap: 12px; padding: 13px 16px; margin: 0 0 1.2em; border: 1px solid var(--border); border-left: 3px solid var(--info); border-radius: var(--r); background: var(--panel); max-width: 860px; }
.callout > .ic { color: var(--info); margin-top: .15em; }
.callout.warn { border-left-color: var(--danger); } .callout.warn > .ic { color: var(--danger); }
.callout.gold { border-left-color: var(--gold); } .callout.gold > .ic { color: var(--gold); }

.shot { margin: 1.4em 0 1.8em; }
.shot a { display: block; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--panel); }
.shot img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; object-position: top; }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: .88rem; }

.cmd { margin: 0 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); scroll-margin-top: 76px; }
.cmd > header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.cmd > header h3 { margin: 0; font: 700 1.05rem ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: 0; }
.cmd > p { margin: 0; padding: 12px 16px; }
.who { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; }
.who .ic { font-size: .9rem; }
.use { padding: 12px 16px; } .use + .use { border-top: 1px dashed var(--border); }
.use p { margin: 6px 0 0; color: var(--muted); }
code.usage { display: inline-block; padding: 4px 9px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-size: .88rem; overflow-wrap: anywhere; }
.docs-main .opts { list-style: none; padding: 0; margin: 8px 0 0; font-size: .9rem; }
.opts li { margin: .25em 0; }

.docs-main .settings { list-style: none; padding: 0; }
.settings > li { padding: 7px 0; border-bottom: 1px solid var(--border); max-width: none; }
.settings > li.group { margin-top: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border-strong); color: var(--text); }
.settings .label { color: var(--text); font-weight: 600; }
.settings ul { list-style: disc; margin: 6px 0 2px; padding-left: 1.4em; font-size: .93rem; }
.settings ul .label { font-weight: 500; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: 8px; }
.docs-main table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.docs-main th, .docs-main td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.docs-main th { background: var(--panel); font: 700 .72rem var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.docs-main tr:last-child td { border-bottom: 0; }
.docs-main td.num, .docs-main th.num { text-align: right; white-space: nowrap; }
.docs-main td code { white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 0 0 1.4em; }
.card-link { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); font-size: .9rem; }
.card-link:hover { border-color: var(--accent-dim); text-decoration: none; background: var(--panel-2); }
.card-title { font: 700 1rem var(--display); letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.card-title .ic { color: var(--accent); }
.docs-main .cols { columns: 2 320px; column-gap: 32px; }
.cols li { break-inside: avoid; }

.pager { display: flex; justify-content: space-between; gap: 14px; max-width: 860px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 11px 16px; min-width: 0; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.pager a:hover { border-color: var(--accent-dim); text-decoration: none; }
.pager a.next { margin-left: auto; text-align: right; }

@media (max-width: 900px) {
  .docs-burger { display: inline-flex; }
  .docs-links a:not(:nth-child(2)) { display: none; }
  .docs-layout { display: block; }
  .docs-nav { display: none; position: fixed; inset: 56px 0 0 0; z-index: 25; height: auto; background: var(--bg); border-right: 0; padding: 16px; }
  .docs.nav-open .docs-nav { display: block; }
  .docs.nav-open { overflow: hidden; }
  .docs-main { padding: 24px 16px 40px; }
  .docs-main h1 { font-size: 1.65rem; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px 18px; }
  .who { margin-left: 0; }
}

/* pictures open in a viewer on the page (docs.js) */
.shot a { cursor: zoom-in; }
.viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(8 7 6 / .94); color: var(--text); }
.viewer::backdrop { background: rgb(0 0 0 / .6); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg); }
.viewer-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.viewer-level { min-width: 3.5em; text-align: right; color: var(--faint); font-size: .85rem; font-variant-numeric: tabular-nums; }
.viewer-bar .btn { min-width: 36px; justify-content: center; }
.viewer-stage { flex: 1; min-height: 0; overflow: auto; display: flex; cursor: zoom-in; touch-action: none; user-select: none; scrollbar-width: thin; }
.viewer-stage.zoomed { cursor: grab; } .viewer-stage.zoomed:active { cursor: grabbing; }
.viewer-stage img { -webkit-user-drag: none; user-select: none; display: block; flex: none; margin: auto; max-width: none; height: auto; border-radius: 4px; } /* (flex: none - a flex item would be squeezed back to the window's width) */
@media (max-width: 900px) { .viewer-caption { display: none; } .viewer-level { margin-left: auto; } }

/* the bar that follows the reader through the sections of the page (docs.js) */
.docs-nav .sub { position: relative; }
.sub-marker { position: absolute; top: 0; left: -1px; width: 2px; height: 0; border-radius: 2px; background: var(--accent); opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.3, .7, .2, 1), height .28s cubic-bezier(.3, .7, .2, 1), opacity .2s; }
.sub-marker.on { opacity: 1; }
.docs-nav .sub a { transition: color .2s; }
.docs-nav .sub a.reading { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .sub-marker, .docs-nav .sub a { transition: none; } }

/* Icons next to text in the display font: that font's capitals sit above the middle of the line, so an icon
   centred on the LINE looks too low. Lifted to the middle of the letters (measured: 0.075 of the text size). */
.docs-main h1 > .ic { position: relative; top: -.092em; }
.card-title .ic, .tier .ic, .docs-top .brand img { position: relative; top: -.08em; }
