/* Styles for the /docs/ content pages. Loaded after styles.css and only adds
 * what the documentation layout needs; header, footer, buttons, and cards all
 * come from the shared stylesheet. The layout is a docs-site shell: sticky
 * sidebar outline on the left, article content on the right, collapsible
 * table of contents on small screens. */

html { scroll-behavior: smooth; }

/* Docs pages use a wider container than the dashboard so the sidebar and
 * article fit side by side. Applies to header and footer too. */
.docs-page .wrap { max-width: 1140px; }

.docs-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Shell: sidebar + article */
.docs-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-top: 36px;
  padding-bottom: 64px;
}

.docs section,
.docs .step,
.docs .measure-category { scroll-margin-top: 24px; }

/* Sidebar table of contents */
.docs-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.toc-label {
  margin: 0 0 10px;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.docs-toc summary { display: none; }
.toc-root,
.toc-root ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-root ul {
  margin: 2px 0 4px 10px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.toc-root a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text-soft);
  text-decoration: none;
}
.toc-root > li > a { font-weight: 600; color: var(--text); }
.toc-root a:hover { background: var(--surface-2); color: var(--blue-dark); }
.toc-root a.is-active {
  background: var(--lavender-soft);
  color: var(--blue-deep);
  font-weight: 600;
}

/* Hero */
.docs-hero { margin-bottom: 40px; }
.docs-hero h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: 0.2px;
  color: var(--blue-deep);
}
.docs-hero .lede {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 46em;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}
.hero-ctas .btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Section headings */
.docs h2 {
  margin: 56px 0 16px;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 0.2px;
  color: var(--blue-deep);
  padding-bottom: 10px;
  border-bottom: 4px solid var(--yellow);
}
.docs h3 {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.1px;
}
.docs p { max-width: 46em; }
.docs ul { max-width: 46em; padding-left: 24px; }
.docs li { margin: 6px 0; }
.docs a { color: var(--blue); }
.docs a:hover { color: var(--blue-dark); }

/* Fit / not-fit columns */
.fit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.fit-card { padding: 20px 22px; }
.fit-card h3 { margin-top: 0; font-size: 16px; }
.fit-card ul { margin: 0; padding-left: 20px; }
.fit-card.is-fit { border-left: 4px solid var(--teal); }
.fit-card.is-fit h3 { color: var(--teal-deep); }
.fit-card.is-not-fit { border-left: 4px solid var(--coral); }
.fit-card.is-not-fit h3 { color: var(--danger-text); }

/* Numbered how-to steps */
.step { margin-top: 36px; }
.step-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.step-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  transform: translateY(6px);
}
.step h3 { margin: 0; font-size: 21px; }
.step > p, .step > ul, .step > .design-grid { margin-left: 46px; }
@media (max-width: 560px) {
  .step > p, .step > ul, .step > .design-grid { margin-left: 0; }
}

/* Study design cards inside Step 2 */
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.design-card { padding: 18px 20px; border-top: 4px solid var(--teal); }
.design-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
}
.design-card p { margin: 0 0 10px; font-size: 14px; color: var(--text-soft); }
.design-card p:last-child { margin-bottom: 0; }
.design-card .consider { font-size: 13px; }
.design-card .consider strong { color: var(--teal-deep); }

/* Mid-page and closing CTA bands */
.cta-band {
  margin-top: 48px;
  padding: 28px;
  text-align: center;
  background: var(--blue);
  border-radius: var(--radius);
  color: #fff;
}
.cta-band h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  color: #fff;
  font-size: 24px;
}
.cta-band p { margin: 0 auto 18px; color: rgba(255, 255, 255, 0.85); max-width: 40em; }
.cta-band .hero-ctas { justify-content: center; margin: 0 0 8px; }
.cta-band .btn-outline { border-color: #fff; color: #fff; }
.cta-band .btn-outline:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.cta-band .text-link { color: #fff; font-size: 14px; }

/* Measure library */
.measure-category { margin-top: 40px; }
.measure-category > h3 {
  font-size: 21px;
  color: var(--blue-deep);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--lavender);
}
.measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.measure-card {
  padding: 18px 20px;
  border-left: 4px solid var(--teal);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.measure-card h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.1px;
}
.measure-card p { margin: 0; font-size: 14px; color: var(--text-soft); }
.measure-question {
  font-size: 14px;
  color: var(--teal-deep);
  font-style: italic;
}
.measure-meta {
  margin: 2px 0 0;
  font-size: 13px;
}
.measure-meta div { margin: 3px 0; }
.measure-meta dt {
  display: inline;
  font-weight: 700;
  color: var(--text);
}
.measure-meta dd { display: inline; margin: 0; color: var(--text-soft); }
.measure-link { margin-top: auto; font-size: 14px; font-weight: 600; }

/* Unfinished copy from the source doc, kept visible so editors can spot it */
.placeholder {
  color: var(--text-faint);
  font-style: italic;
}

/* FAQ accordion */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 10px;
  padding: 0;
}
.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  list-style-position: inside;
}
.faq summary:hover { color: var(--blue-dark); }
.faq summary:focus-visible { outline: 3px solid rgba(0, 48, 204, 0.4); outline-offset: 2px; border-radius: var(--radius); }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { margin: 12px 18px 16px; color: var(--text-soft); }

/* Small screens: single column, sidebar becomes a collapsible TOC card */
@media (max-width: 960px) {
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 24px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .toc-label { display: none; }
  .docs-toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 4px 10px;
  }
  .docs-toc summary {
    display: list-item;
    cursor: pointer;
    padding: 10px 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
  }
  .docs-toc[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 6px; }
  .docs-toc .toc-root { padding: 4px 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
