/* TuneHaven — docs, guides and FAQ.
   Loaded alongside /assets/site.css, which owns the tokens, header, ruler and footer.
   Everything here is additive: nothing in this file may restyle the shared shell, because the
   hand-written static pages under public/ do NOT load it and the two halves must match.
   No JavaScript on this host (CSP script-src 'none') — layout is CSS Grid only. */

/* ---------- shared page furniture ---------- */
.hub, .docs-shell {
  max-width: var(--w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.hub-head { max-width: var(--w-text); margin-bottom: 2.75rem; }
.hub-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.75rem); margin-bottom: 0.4em; }
.hub-lede { color: var(--muted); font-size: 1.125rem; margin: 0; }
.hub-foot { color: var(--muted); margin-top: 3rem; }

.hub-section { margin-bottom: 3rem; }
.hub-section h2 {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}

.hub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); }
@media (min-width: 46rem) { .hub-list { grid-template-columns: repeat(2, 1fr); } }
.hub-list li { background: var(--bg); }
.hub-list a {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1.1rem 1.15rem; height: 100%;
  text-decoration: none; color: inherit;
  transition: background 140ms ease;
}
.hub-list a:hover { background: var(--surface); }
.hub-title { font-weight: 600; color: var(--text); }
.hub-list a:hover .hub-title { color: var(--green); }
.hub-desc { color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.hub-date {
  margin-top: auto; padding-top: 0.4rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--muted);
}

/* ---------- docs shell: sidebar + article ---------- */
.docs-shell { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 60rem) {
  .docs-shell { grid-template-columns: 15.5rem minmax(0, 1fr); gap: 3.5rem; }
  .docs-nav { position: sticky; top: 2rem; max-height: calc(100vh - 4rem); overflow-y: auto; }
}
.docs-nav-group { margin-bottom: 1.6rem; }
.docs-nav-label {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 0.6rem;
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-nav li a {
  display: block; padding: 0.32rem 0 0.32rem 0.85rem; margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--muted); text-decoration: none; font-size: 0.9375rem; line-height: 1.45;
}
.docs-nav li a:hover { color: var(--text); }
.docs-nav li a[aria-current="page"] {
  color: var(--green); border-left-color: var(--green); font-weight: 500;
}

.docs-main { min-width: 0; }
.crumbs {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 1.5rem;
  display: flex; gap: 0.55rem; flex-wrap: wrap;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green); }

/* ---------- long-form article ---------- */
.prose { max-width: var(--w-text); }
.prose h1 { font-size: clamp(1.8rem, 1.25rem + 2.2vw, 2.5rem); }
.doc-lede { color: var(--muted); font-size: 1.125rem; margin-bottom: 0.8em; }
.prose h2 {
  font-size: 1.3rem; margin-top: 2.4em;
  padding-top: 1.2rem; border-top: 1px solid var(--line);
}
.prose h3 { font-size: 1.0625rem; margin-top: 1.9em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--muted); }
.prose code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--surface); padding: 0.12em 0.38em; border-radius: 4px;
}
.prose blockquote {
  margin: 1.4em 0; padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 2px solid var(--amber); color: var(--muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

/* Tuning tables. These are the substance of the instrument guides, so they get real styling and
   they must scroll on their own rather than forcing the page sideways on a phone. */
.prose .table-wrap, .prose table { display: block; }
.prose table {
  width: 100%; overflow-x: auto; white-space: nowrap;
  border-collapse: collapse; margin: 0 0 1.5em; font-size: 0.9375rem;
}
.prose thead th {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 0 0.9rem 0.55rem 0; border-bottom: 1px solid var(--line);
}
.prose tbody td {
  padding: 0.5rem 0.9rem 0.5rem 0; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody td:first-child { font-weight: 600; color: var(--text); }

/* ---------- related + pager ---------- */
.related { max-width: var(--w-text); margin-top: 3.5rem; }
.related h2 {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 1rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.related a { font-weight: 600; text-decoration: none; }
.related a:hover { text-decoration: underline; }
.rel-desc { display: block; color: var(--muted); font-size: 0.9375rem; margin-top: 0.15rem; }

.pager {
  max-width: var(--w-text); margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.pager a {
  display: flex; flex-direction: column; gap: 0.15rem;
  text-decoration: none; color: var(--text); font-weight: 600; max-width: 20rem;
}
.pager a:hover { color: var(--green); }
.pager-next { text-align: right; margin-left: auto; }
.pager-dir {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- FAQ ---------- */
.faq { max-width: var(--w-text); display: grid; gap: 0; }
.faq-item { padding: 1.6rem 0; border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h2 { font-size: 1.125rem; margin-bottom: 0.5em; }
.faq-item p { color: var(--muted); margin: 0; }
