/* public/report.css: the "report" look for Hogmatix's public pages (the MCP
   documentation at /docs/mcp and the landing page). A long-form research
   report: one reading column, warm ink on paper, thin rules, one oxblood
   accent, a contents rail, tabular figures, and a clean print. Light only,
   on purpose: it reads like a document. */

:root {
  color-scheme: light;
  --ink: #20201e;
  --ink-soft: #3a3a36;
  --muted: #666661;
  --faint: #8a8a83;
  --line: #deded8;
  --rule: #98988f;
  --accent: #963c36;
  --accent-soft: rgba(150, 60, 54, 0.08);
  --paper: #ffffff;
  --paper-2: #f7f7f3;
  --code-bg: #f4f4ef;
  --ok: #2f6b3a;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --column: 736px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 18px;
  scroll-padding-top: 32px;
  background: var(--paper);
}

body {
  margin: 0;
  padding: 32px 32px 100px;
  font-family: var(--sans);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--column); margin: 0 auto; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #aaa;
  text-underline-offset: 4px;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
/* A long address (a plugin link, a full URL) wraps instead of widening the page. */
main a, main p, main li { overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }

b, strong, th, h1, h2, h3, h4 { font-weight: 500; }

.skip { position: absolute; top: -100px; left: 8px; }
.skip:focus { top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* ── The site bar ─────────────────────────────────────────────────────── */
.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin: 0 auto 48px;
  max-width: var(--column);
}
.site a { text-decoration: none; }
.site .brand { color: var(--ink); font-weight: 500; }
.site nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site nav a { color: var(--muted); }
.site nav a:hover, .site nav a[aria-current] { color: var(--ink); }

/* ── Title block ──────────────────────────────────────────────────────── */
.kicker {
  font-size: 12px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
h1 {
  font-size: clamp(2rem, 3.4vw, 2.55rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.13;
  text-wrap: balance;
  margin: 0 0 26px;
}
.lede { font-size: 1.15rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 26px; }
.byline {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.tools { display: flex; gap: 24px; flex-wrap: wrap; font-size: 12px; margin: 0 0 48px; }
.tools button, .tools a {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #aaa;
  text-underline-offset: 4px;
  cursor: pointer;
}
.tools button:hover, .tools a:hover { color: var(--accent); }

/* ── Sections ─────────────────────────────────────────────────────────── */
h2 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.25;
  text-wrap: balance;
  margin: 60px 0 24px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}
main > h2:first-of-type, .first-section > h2 { margin-top: 0; }
h3 { font-size: 1.1rem; letter-spacing: -.01em; margin: 36px 0 12px; line-height: 1.35; }
h4 { font-size: .95rem; margin: 26px 0 8px; }
p { margin: 0 0 1.3em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1.3em; }
li { padding-left: .3em; margin-bottom: .7em; }
ol > li::marker { font-size: .75em; color: var(--muted); }
.permalink { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 10px; white-space: nowrap; text-decoration: none; opacity: 0; }
h2:hover .permalink, h3:hover .permalink, .permalink:focus { opacity: 1; }

.note, figcaption {
  font-size: 12px;
  line-height: 1.65;
  color: #5a5a55;
  margin-top: 14px;
}
.callout {
  margin: 28px 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  font-size: .95rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout b { color: var(--accent); }

figure { margin: 40px 0; padding-top: 20px; border-top: 1px solid var(--line); }

/* Numbered findings: a large muted index beside each claim. */
.findings { list-style: none; padding: 0; counter-reset: finding; }
.findings > li { counter-increment: finding; position: relative; padding-left: 2.4em; margin-bottom: 1.5em; }
.findings > li::before {
  content: counter(finding, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .2em;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--accent);
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.tablecap { font-size: 13px; line-height: 1.55; margin: 36px 0 14px; }
.tablecap b { font-weight: 500; }
.tablewrap { overflow-x: auto; margin: 0 0 22px; scrollbar-width: thin; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  line-height: 1.5;
}
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid #e4e4df; }
th { font-size: 12px; color: var(--ink); font-weight: 500; border-bottom: 2px solid var(--ink); white-space: nowrap; }
tr.group td { padding-top: 24px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #65655d; }
td code { white-space: nowrap; }
/* Figures line up only where they are numbers: the face's tabular forms set
   commas and full stops wide, which reads badly in running text. */
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.flag { color: var(--accent); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }

/* ── Code ─────────────────────────────────────────────────────────────── */
code, kbd, samp { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: var(--code-bg); padding: .08em .35em; border-radius: 3px; overflow-wrap: anywhere; }
pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--code-bg);
  border-left: 2px solid var(--line);
  padding: 14px 16px;
  margin: 0 0 1.4em;
  overflow-x: auto;
  white-space: pre;
}
pre code { font-size: inherit; background: none; padding: 0; }
.code-tools { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.copy-code {
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .04em;
  cursor: pointer;
}
.copy-code:hover { color: var(--accent); border-color: var(--accent); }
.codecap { font-size: 12px; color: var(--muted); margin: 0 0 6px; letter-spacing: .02em; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 .35em; }

/* ── Collapsible reference entries ────────────────────────────────────── */
.entry { border-top: 1px solid var(--line); scroll-margin-top: 32px; }
.entry:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.entry summary { position: relative; cursor: pointer; list-style: none; padding: 20px 36px 20px 0; }
.entry summary::-webkit-details-marker { display: none; }
.entry summary::after { content: "+" / ""; position: absolute; right: 4px; top: 20px; font-size: 22px; line-height: 1; color: var(--muted); font-weight: 400; }
.entry[open] summary::after { content: "\2212" / ""; }
.entry-heading { display: block; font-size: 1.05rem; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }
.entry-heading code { font-size: .92em; background: none; padding: 0; }
.entry-description { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.entry summary:hover .entry-heading { color: var(--accent); }
.entry-body { padding: 4px 0 28px; }
.tags { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: 8px; vertical-align: 2px; }
.tag { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px; font-weight: 400; }
.tag.write { color: var(--accent); border-color: rgba(150, 60, 54, .35); }

/* ── Contents rail ────────────────────────────────────────────────────── */
.contents {
  position: fixed;
  top: 170px;
  left: max(24px, calc(50% - 590px));
  width: 175px;
  font-size: 12px;
  line-height: 1.5;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: none;
}
.contents summary {
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  list-style: none;
}
.contents a { display: block; text-decoration: none; color: #74746d; border-left: 1px solid var(--line); padding: 7px 0 7px 15px; }
.contents a:hover { color: var(--ink); }
.contents a:focus-visible, .tablewrap a:focus-visible { outline-offset: -2px; }
.contents a[aria-current] { color: var(--ink); border-left: 2px solid var(--accent); padding-left: 14px; font-weight: 500; }

/* ── Actions (landing) ────────────────────────────────────────────────── */
.actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 0 0 40px; }
.button {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: .01em;
  cursor: pointer;
}
.button:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.button.secondary { background: none; color: var(--ink); }
.button.secondary:hover { background: none; color: var(--accent); border-color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.grid-2 > div { border-top: 1px solid var(--line); padding-top: 16px; }
.grid-2 h3 { margin-top: 0; }

.plan { border-top: 2px solid var(--ink); padding-top: 14px; }
.plan .price { font-size: 1.6rem; letter-spacing: -.02em; font-weight: 500; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  max-width: var(--column);
  margin: 80px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

dialog { border: 1px solid var(--line); padding: 20px 22px; max-width: min(560px, calc(100% - 32px)); font-size: 14px; }
dialog .tools { margin-bottom: 0; }
dialog::backdrop { background: rgba(32, 32, 30, .25); }

@media (max-width: 1199px) {
  .contents { position: static; width: auto; max-height: none; margin: 0 auto 32px; max-width: var(--column); padding: 15px 0; border-block: 1px solid var(--line); }
  .contents summary { cursor: pointer; margin: 0; list-style: revert; }
  .contents[open] summary { margin-bottom: 12px; }
  .contents nav { display: grid; grid-template-columns: 1fr 1fr; }
}
/* Wide screens: the rail is always open (report.js keeps it so). */
@media (min-width: 1200px) { .contents summary { pointer-events: none; } .contents:not([open]) nav { display: block; } }
@media (max-width: 600px) {
  html { font-size: 17px; }
  body { padding: 24px 22px 64px; }
  .site { margin-bottom: 32px; }
  h1 { font-size: 2rem; line-height: 1.16; }
  h2 { margin-top: 44px; font-size: 1.4rem; }
  .tools { gap: 20px; margin-bottom: 28px; }
  .contents nav { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  table { min-width: 560px; }
}
@media print {
  html { font-size: 11pt; }
  body { padding: 0; color: black; }
  main { max-width: none; }
  .contents, .tools, .skip, .permalink, .actions, dialog, .site nav, .code-tools, .copy-code { display: none !important; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; }
  td code { white-space: normal; }
  h1 { font-size: 25pt; }
  h2 { break-after: avoid; margin-top: 25pt; }
  figure, tr, pre { break-inside: avoid; }
  thead { display: table-header-group; }
  .tablewrap { overflow: visible; }
  table { min-width: 0; font-size: 8pt; }
  .entry summary::after { display: none; }
  .entry-body { display: block !important; }
  a { text-decoration: none; }
  @page { margin: 18mm; }
}
