/* SPDX-License-Identifier: GPL-3.0-only */
/* The pages besides home (US-092): the docs, the docs index, the Wispr
   Flow comparison, and the 404. Quiet reading pages on the night studio
   ground: no paint, brand gold for labels and link underlines only, and
   the display face for the page title alone. */

.page-main {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 36px var(--gutter) 80px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
}

/* -------------------------------------------------------- docs list --- */

.doc-nav {
  position: sticky;
  top: 92px;
  align-self: start;
}

.doc-nav .label a {
  color: inherit;
  text-decoration: none;
}

.doc-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}

.doc-nav li a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dim);
  text-decoration: none;
}

.doc-nav li a:hover {
  color: var(--text);
  background: var(--cream-06);
}

.doc-nav li a[aria-current='page'] {
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--brand);
}

/* ------------------------------------------------------------- doc --- */

.doc {
  min-width: 0;
  max-width: 720px;
}

.doc-wide {
  max-width: 880px;
  margin: 0 auto;
}

.crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.crumbs a {
  color: inherit;
  text-underline-offset: 3px;
}

.doc h1 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 80%;
  font-size: clamp(34px, 5.2vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 10px 0 18px;
}

.doc h2 {
  font-size: 1.4rem;
  font-weight: 650;
  line-height: 1.3;
  margin: 48px 0 12px;
}

.doc h3 {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 30px 0 8px;
}

.doc p,
.doc li {
  color: var(--text-dim);
  line-height: 1.7;
}

.doc p + p {
  margin-top: 14px;
}

.doc .lede {
  max-width: 64ch;
  font-size: 1.12rem;
  color: var(--text);
  line-height: 1.6;
}

.doc ul,
.doc ol {
  display: grid;
  gap: 6px;
  margin: 12px 0 16px 22px;
}

.doc li::marker {
  color: var(--brand);
}

.doc a {
  color: var(--text);
  text-decoration-color: var(--brand-edge);
  text-underline-offset: 3px;
}

.doc a:hover {
  text-decoration-color: var(--brand);
}

.doc strong {
  color: var(--text);
  font-weight: 600;
}

.doc code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

.doc pre {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  overflow-x: auto;
}

.doc pre code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
}

.table-wrap {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc th,
.doc td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  border-bottom: 1px solid var(--panel-edge);
}

.doc thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--brand);
}

.doc td {
  color: var(--text-dim);
}

.doc tbody tr:last-child th,
.doc tbody tr:last-child td {
  border-bottom: 0;
}

.doc-meta {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--cream-06);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.doc-next {
  font-size: 15px;
}

/* ------------------------------------------------------- docs index --- */

.doc-card {
  padding: 26px 0;
  border-bottom: 1px solid var(--cream-06);
}

.doc-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.doc-card h2 a {
  text-decoration: none;
}

.doc-card h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--brand);
}

.doc .doc-questions {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.doc .doc-questions li {
  font-size: 14px;
}

.doc .doc-questions a {
  color: var(--text-dim);
}

.doc .doc-questions a:hover {
  color: var(--text);
}

/* ---------------------------------------------------------- compare --- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.doc .cta-row .btn {
  color: var(--ink);
  text-decoration: none;
}

.compare th[scope='row'] {
  width: 22%;
  color: var(--text);
  font-weight: 600;
}

.compare td {
  width: 39%;
}

.doc .points {
  list-style: none;
  margin-left: 0;
  gap: 10px;
}

.faq-block .qa:last-child {
  border-bottom: 0;
}

.sources {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--cream-06);
  font-size: 13px;
}

/* ----------------------------------------------------------- narrow --- */

@media (max-width: 860px) {
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .doc-nav {
    position: static;
  }

  .doc-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .doc-nav li a {
    padding: 5px 11px;
    font-size: 13px;
    border: 1px solid var(--panel-edge);
    border-radius: 999px;
  }

  .doc-nav li a[aria-current='page'] {
    box-shadow: none;
    border-color: var(--brand-edge);
  }

  .compare th[scope='row'] {
    width: auto;
  }
}

/* On a phone each comparison row stacks: the question, then each app's
   answer under its own label, so nothing is squeezed into a third. */
@media (max-width: 560px) {
  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .compare,
  .compare tbody,
  .compare tr,
  .compare th,
  .compare td {
    display: block;
    width: auto;
  }

  .compare tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--panel-edge);
  }

  .compare tbody tr:last-child {
    border-bottom: 0;
  }

  .compare th[scope='row'],
  .compare td {
    padding: 0;
    border-bottom: 0;
  }

  .compare td {
    margin-top: 8px;
  }

  .compare td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--brand);
  }
}
