/*
  Styles for the public docs page (templates/docs.html), served from
  /docs/assets/docs.css by docs_page.py.

  Styled after the TRISON Corporate Identity Manual: black and white as the
  main colours, greyscale for functional UI, Montserrat for headings, Source
  Sans for body text (the manual's typeface for documentation), thin
  horizontal rules and an asymmetric two-column layout.
*/
@font-face { font-family: "Montserrat"; font-weight: 100 900; font-display: swap;
  src: url("montserrat-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 200 900; font-display: swap;
  src: url("source-sans-3-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("source-sans-3-latin-wght-italic.woff2") format("woff2"); }
:root {
  /* Main colours: black and white. Greyscale is the manual's secondary palette. */
  --bg: #ffffff; --fg: #000000; --muted: #434343; --faint: #8c8c8c;
  --rule: #000000; --border: #d2d2d2; --surface: #f0f0f0; --surface-2: #fafafa;
  --heading: "Montserrat", system-ui, sans-serif;
  --body: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* #231f20 is the dark used on the manual's own dark pages. */
    --bg: #231f20; --fg: #ffffff; --muted: #d2d2d2; --faint: #8c8c8c;
    --rule: #ffffff; --border: #434343; --surface: #2d2d2d; --surface-2: #2a2627;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--body); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header and footer: logo / caption separated from the page by a thin rule. */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 24px 0; border-bottom: 1px solid var(--rule); }
.bar.foot { border-bottom: 0; border-top: 1px solid var(--rule); padding: 16px 0 32px; }
.bar small { font: 300 0.8rem var(--heading); color: var(--muted); }
/* 120px is the manual's minimum digital width for the mark. */
.logo { display: block; width: 132px; height: auto; color: var(--fg); }

.hero { padding: 72px 0 56px; }
.hero h1 { font: 600 clamp(2rem, 5vw, 3rem)/1.1 var(--heading); margin: 0 0 12px; }
.hero p { margin: 0; font: 400 0.95rem var(--heading); color: var(--muted); }

/* Asymmetric composition: a narrow caption column and a wide text column. */
.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 64px; padding-bottom: 80px; }
nav { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; gap: 6px;
  font: 400 0.9rem var(--heading); }
nav span { font-weight: 600; margin-bottom: 6px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }
.content { max-width: 760px; }

a { color: var(--fg); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.25; }
.content h1 { font-size: 1.6rem; font-weight: 600; }
.content h2 { font-size: 1.3rem; font-weight: 600; margin-top: 2.2em; }
.content h3 { font-size: 1.05rem; font-weight: 600; }
strong { font-weight: 600; }

section { padding-top: 48px; margin-top: 48px; border-top: 1px solid var(--rule); }
section:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
section > h2:first-child, section > h1:first-child { margin-top: 0; }

.note { margin: 0 0 48px; padding: 12px 16px; border-left: 3px solid var(--fg);
  background: var(--surface-2); font-size: 0.95rem; color: var(--muted); }

code { font-family: var(--mono); font-size: 0.86em; background: var(--surface);
  padding: 0.1em 0.35em; border-radius: 2px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 2px;
  padding: 12px 14px; overflow-x: auto; }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.95rem; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 12px 8px 0; text-align: left; vertical-align: top; }
th { font: 600 0.85rem var(--heading); border-bottom-color: var(--rule); }
/* claude.ai is the main way in, so its subsection opens with a heavier rule. */
#claude-ai-recommended { margin-top: 1.6em; padding-top: 16px; border-top: 2px solid var(--rule); }
.content ol { padding-left: 1.4em; }
.content ol li { margin-bottom: 6px; }
.content img { display: block; width: 100%; height: auto; margin: 24px 0 8px;
  border: 1px solid var(--border); border-radius: 4px; }
/* Caption: the italic line right after the illustration. */
.content p:has(> img) + p em { font-size: 0.85rem; color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--border); }

ul.tools { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--rule); }
ul.tools li { border-bottom: 1px solid var(--border); }
ul.tools summary { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 0; cursor: pointer; list-style: none; }
ul.tools summary::-webkit-details-marker { display: none; }
ul.tools summary code { font-size: 0.95rem; background: none; padding: 0; font-weight: 600; }
/* Plus / minus marker drawn with thin lines, in keeping with the manual's rules. */
ul.tools summary::after { content: "+"; font: 300 1.4rem/1 var(--heading); color: var(--muted); }
ul.tools details[open] summary::after { content: "\2212"; }
ul.tools summary:hover code { text-decoration: underline; text-underline-offset: 3px; }
ul.tools summary:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
ul.tools details > :not(summary) { margin-top: 0; }
ul.tools details[open] { padding-bottom: 12px; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 32px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 16px;
    padding-bottom: 16px; border-bottom: 1px solid var(--border); }
  nav span { display: none; }
}
