/* Documentation-site styling.
 *
 * base.html (shared with the generated reports) supplies the palette, the measure and
 * the dark-mode block. Everything here is site chrome and prose styling that must NOT
 * leak into a user's generated report, which is why it lives in its own stylesheet.
 */

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: .5rem .8rem; border-radius: 0 0 6px 0;
}
.skip:focus { left: 0; top: 0; z-index: 10; }

/* --- navigation --- */
nav.site {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1.4rem;
  padding-bottom: .9rem; margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
nav.site .brand {
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  font-size: .95rem; text-decoration: none;
}
nav.site ul { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; list-style: none; margin: 0; padding: 0; }
nav.site a { text-decoration: none; font-size: .93rem; }
nav.site a:hover { text-decoration: underline; }
nav.site a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* --- prose --- */
main h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 1rem; text-wrap: balance; }
main h2 { font-size: 1.25rem; margin: 2.2rem 0 .6rem; }
main h3 { font-size: 1.05rem; margin: 1.6rem 0 .4rem; }
main p, main li { line-height: 1.65; }
main ul, main ol { padding-left: 1.3rem; }
main li { margin: .3rem 0; }
main blockquote {
  margin: 1.2rem 0; padding: .3rem 0 .3rem 1rem;
  border-left: 3px solid var(--accent); color: inherit; opacity: .85;
}
main pre {
  overflow-x: auto; padding: .8rem 1rem; border: 1px solid var(--rule);
  border-radius: 6px; font-size: .87rem; line-height: 1.5;
  background: rgba(108, 46, 185, .04);
}
main :not(pre) > code {
  font-size: .88em; padding: .1rem .3rem; border-radius: 4px;
  background: rgba(108, 46, 185, .09);
}
main img { max-width: 100%; height: auto; }
.crumb { font-size: .9rem; margin-bottom: .5rem; }
.meta { color: inherit; opacity: .75; font-size: .93rem; }

/* --- home --- */
.hero { margin-bottom: 2.5rem; }
.hero h1 { font-size: 2.2rem; }
.lede { font-size: 1.1rem; max-width: 42rem; }
.promise {
  display: inline-block; font-weight: 700;
  border-left: 4px solid var(--accent); padding: .35rem 0 .35rem .8rem; margin: 1.2rem 0;
}
.cta code { font-size: 1rem; }
.panels { list-style: none; padding: 0; display: grid; gap: 1.2rem; }
.panels > li {
  border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem;
  min-width: 0;  /* let the code panel scroll rather than widen its grid column */
}
.panels h3 { margin-top: 0; font-size: .95rem; letter-spacing: .02em; }
.panels pre { margin: .6rem 0; font-size: .78rem; }
/* minmax(0, 1fr) rather than 1fr: a grid item's default min-width is its content, so a
   wide <pre> would otherwise blow the column out and squeeze its neighbours. */
@media (min-width: 52rem) { .panels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- card grids --- */
.cards { list-style: none; padding: 0; display: grid; gap: 1rem; }
.cards > li > a {
  display: flex; flex-direction: column; gap: .3rem; height: 100%;
  border: 1px solid var(--rule); border-radius: 8px; padding: .9rem 1rem;
  text-decoration: none; color: inherit;
}
.cards > li > a:hover { border-color: var(--accent); }
.cards strong { font-size: 1.02rem; color: var(--accent); }
.cards span { font-size: .9rem; }
.cards .publisher { opacity: .7; font-size: .82rem; }
.cards .tag {
  align-self: flex-start; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; opacity: .75;
}
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .cards.gallery { grid-template-columns: repeat(3, 1fr); } }

/* --- embedded reports --- */
.report-embed { margin: 1.2rem 0; }
.report-embed iframe {
  width: 100%; height: 34rem; border: 1px solid var(--rule);
  border-radius: 6px; background: #fff;
}
.report-embed figcaption { font-size: .87rem; opacity: .8; margin-top: .5rem; }

/* --- diagrams ---
 * The SVGs paint a white canvas with near-black text, so they sit on a deliberate
 * "paper" panel in both colour schemes rather than being inverted, which would wreck
 * the C4 colour conventions.
 */
figure.diagram {
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: .75rem; margin: 1.2rem 0;
}
figure.diagram svg { width: 100%; height: auto; display: block; }
figure.diagram figcaption {
  font-size: .85rem; color: #444; margin-top: .6rem; padding: 0 .25rem;
}

/* --- reference --- */
dl.functions dt { margin-top: 1rem; font-weight: 700; }
dl.functions dd { margin: .2rem 0 0 1.2rem; }
pre.signature { background: rgba(108, 46, 185, .09); font-weight: 700; }
pre.docstring, pre.help { white-space: pre-wrap; font-size: .85rem; }

/* The introducer, above the three panels it is a moving version of.  width/height on the
   element reserve the aspect ratio before the poster loads, so the page does not jump. */
.film { margin: 2.5rem 0 3rem; }
.film video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
}
.film-caption {
  max-width: 900px;
  margin: .9rem auto 0;
  text-align: center;
  font-size: .95rem;
  opacity: .78;
}

/* Extracted JSON runs to a thousand lines for the larger examples, which is worth showing
   in full -- the page's point is that nothing is abridged -- but not worth scrolling the
   whole document past. */
pre.json {
  max-height: 32rem;
  overflow: auto;
}
