/* ============================================================
   ASHEN THRONE - DOCS SHELL
   Layout only. theme.css owns every token, the site header and
   the site footer; nothing here may redeclare a brand token.
   Guard: scripts/verify-hub-shell.js
   ============================================================ */

/* ── layout ────────────────────────────────────────────────── */

.docs {
  --docs-nav-w: 264px;
  --docs-rail-w: 228px;
  --docs-gutter: 40px;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-nav-w) minmax(0, 1fr) var(--docs-rail-w);
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

/* ── sidebar ───────────────────────────────────────────────── */

.docs-nav {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px 48px;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-darker);
}

.docs-search {
  position: relative;
  margin-bottom: 22px;
}

.docs-search input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  background: var(--bg-input);
  border: 1px solid var(--border-steel);
  border-radius: 2px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.docs-search input::placeholder { color: #5d6675; }

.docs-search input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.docs-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  stroke: #5d6675;
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.docs-group + .docs-group { margin-top: 2px; }

.docs-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  border-radius: 2px;
}

.docs-group > summary::-webkit-details-marker { display: none; }
.docs-group > summary:hover { background: var(--bg-panel); color: var(--text-primary); }
.docs-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.docs-group > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.18s ease;
  flex: none;
}

.docs-group[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.docs-group[open] > summary { color: var(--text-primary); }

.docs-group ul {
  list-style: none;
  margin: 2px 0 10px;
  padding: 0;
}

.docs-group a {
  display: block;
  padding: 7px 10px 7px 20px;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}

.docs-group a:hover {
  color: var(--text-primary);
  background: var(--bg-panel);
}

.docs-group a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.docs-group a[aria-current="page"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--bg-slot);
}

/* ── article ───────────────────────────────────────────────── */

.docs-article {
  padding: 44px var(--docs-gutter) 120px;
  min-width: 0;
}

.docs-article > * { max-width: 68ch; }

.docs-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #7d8796;
  margin: 0 0 14px;
}

.docs-article h1 {
  font-family: var(--font-display);
  font-size: clamp(42px, 5.4vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--gold);
  margin: 0 0 20px;
}

.docs-lead {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
  color: var(--text-secondary);
  margin: 0 0 36px;
}

.docs-article h2 {
  font-family: var(--font-chrome);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--text-primary);
  margin: 52px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--border-subtle);
}

.docs-article h3 {
  font-family: var(--font-chrome);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 10px;
}

.docs-article p,
.docs-article li {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.74;
  color: var(--text-secondary);
}

.docs-article p { margin: 0 0 18px; }
.docs-article ul { margin: 0 0 18px; padding-left: 20px; }
.docs-article li { margin-bottom: 7px; }

.docs-article a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(79, 195, 247, 0.35);
}

.docs-article a:hover { border-bottom-color: var(--accent); }
.docs-article a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.docs-article code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-primary);
  background: var(--bg-slot);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 1px 5px;
}

/* ── the allocation block: one whole, two parts ────────────── */

.docs-alloc {
  max-width: 68ch;
  margin: 0 0 40px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
}

.docs-alloc-total {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-alloc-total b {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.docs-alloc-total span,
.docs-alloc-part span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #7d8796;
}

.docs-alloc-total span { margin-top: 7px; display: block; }

.docs-bar {
  display: flex;
  height: 10px;
  background: var(--bg-slot);
}

.docs-bar i { display: block; height: 100%; }
.docs-bar .is-liquidity { background: var(--accent); }
.docs-bar .is-team { background: #4a5364; }

.docs-alloc-parts {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.docs-alloc-part { padding: 16px 24px 20px; }
.docs-alloc-part + .docs-alloc-part { border-left: 1px solid var(--border-subtle); }

.docs-alloc-part b {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.docs-alloc-part b::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
}

.docs-alloc-part.is-liquidity b::before { background: var(--accent); }
.docs-alloc-part.is-team b::before { background: #4a5364; }

.docs-alloc-part span { display: block; padding-left: 17px; }

/* ── table ─────────────────────────────────────────────────── */

.docs-table {
  width: 100%;
  max-width: 68ch;
  border-collapse: collapse;
  margin: 0 0 24px;
  border: 1px solid var(--border-subtle);
}

.docs-table th {
  text-align: left;
  padding: 11px 16px;
  background: var(--bg-slot);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #7d8796;
}

.docs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  vertical-align: top;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table td:last-child {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ── status note: what is policy vs what is on chain ───────── */

.docs-note {
  max-width: 68ch;
  margin: 0 0 32px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent-orange);
  background: var(--bg-panel);
}

.docs-note p { margin: 0; font-size: 15px; color: var(--text-secondary); }
.docs-note b { color: var(--text-primary); font-weight: 600; }

/* ── on this page ──────────────────────────────────────────── */

.docs-rail {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 48px 24px 48px 0;
}

.docs-rail h2 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7d8796;
  margin: 0 0 12px;
}

.docs-rail ul { list-style: none; margin: 0; padding: 0; }

.docs-rail a {
  display: block;
  padding: 6px 0 6px 13px;
  border-left: 2px solid var(--border-steel);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.42;
}

.docs-rail a:hover { color: var(--text-primary); border-left-color: #5d6675; }
.docs-rail a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.docs-rail a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); }

/* ── footer link row ───────────────────────────────────────── */

.docs-next {
  display: flex;
  gap: 12px;
  max-width: 68ch;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.docs-next a {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-next a:hover { border-color: var(--border-steel); background: var(--bg-panel-hover); }

.docs-next span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #7d8796;
  margin-bottom: 5px;
}

.docs-next b {
  font-family: var(--font-chrome);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── responsive ────────────────────────────────────────────── */

.docs-menu {
  display: none;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 11px 16px;
  background: var(--bg-panel);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .docs-layout { grid-template-columns: var(--docs-nav-w) minmax(0, 1fr); }
  .docs-rail { display: none; }
}

@media (max-width: 900px) {
  .docs { --docs-gutter: 20px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-menu { display: flex; }

  .docs-nav {
    position: static;
    height: auto;
    max-height: 62vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 12px 24px;
  }

  /* The nav ships collapsed so a phone opens on the article. */
  .docs-nav.is-collapsed { display: none; }
  .docs-article { padding-top: 28px; }
  .docs-article h1 { font-size: clamp(34px, 11vw, 48px); }
  .docs-alloc-parts { grid-template-columns: 1fr; }
  .docs-alloc-part + .docs-alloc-part {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
  .docs-next { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-group > summary::after { transition: none; }
}

/* ── search results ────────────────────────────────────────── */

.docs-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-steel);
  border-radius: 2px;
}

.docs-results a {
  display: block;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
}

.docs-results a:last-child { border-bottom: none; }
.docs-results a:hover,
.docs-results a:focus-visible { background: var(--bg-panel-hover); outline: none; }

.docs-results b {
  display: block;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
}

.docs-results span,
.docs-noresult {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7d8796;
}

.docs-noresult { display: block; margin: 0; padding: 12px; text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ── lore pull quote on a commander page ───────────────────── */

.docs-lore {
  max-width: 68ch;
  margin: 0 0 32px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--border-steel);
}

.docs-lore p {
  margin: 0;
  font-style: italic;
  color: #9aa3b2;
}

/* ── wide tables scroll rather than squash ─────────────────── */

.docs-scroll {
  max-width: 68ch;
  margin: 0 0 24px;
  overflow-x: auto;
}

.docs-scroll .docs-table { margin: 0; min-width: 100%; }
.docs-table-wide { min-width: 640px; }
.docs-table-wide td:last-child {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  white-space: normal;
}

.docs-good { color: var(--accent-green); }
.docs-bad { color: var(--accent-red); }
.docs-dash { color: #5d6675; }

/* A blockquote in the corpus is a standing caveat, not decoration. */
.docs-article blockquote:not(.docs-lore) {
  max-width: 68ch;
  margin: 0 0 32px;
  padding: 14px 18px;
  border-left: 2px solid var(--accent-orange);
  background: var(--bg-panel);
}

.docs-article blockquote:not(.docs-lore) p { margin: 0; }
.docs-article blockquote p:last-child { margin-bottom: 0; }

.docs-table-bare td:first-child { width: 42%; }

/* ── authored prose tables ─────────────────────────────────── */
/* A markdown pipe table is label-plus-prose, not a data grid: the last column
   holds a sentence, so it must wrap in the body face instead of taking the
   mono nowrap treatment a projected value column gets, and it needs no
   min-width forcing a scroll on a phone. */

.docs-table-prose { min-width: 0; }

.docs-table-prose td:last-child {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  white-space: normal;
}

/* No fixed column width: these tables are authored, and which side carries the
   sentence varies (a long lever with a short rate, or a short policy name with a
   paragraph). Auto layout gives the space to whichever column needs it. */
.docs-table-prose td:first-child {
  color: var(--text-primary);
  min-width: 8em;
}

.docs-table-prose td:first-child strong { font-weight: 600; }

@media (max-width: 720px) {
  .docs-table-prose td,
  .docs-table-prose th { padding-left: 12px; padding-right: 12px; }
}
