/* adoctra.org: site chrome on top of the bundled adoctra.css. The page
   content keeps adoctra's default look on purpose: it is the output of the
   processor itself. */
:root {
  --site-accent: #ba3925;
  --site-accent-dark: #7a2518;
  --site-ink: #1d1d1f;
  --site-muted: #5f6368;
  --site-line: #e7e7e9;
  --site-soft: #faf7f5;
  --site-bar-h: 3.5rem;
  --site-sub-h: 2.6rem;
  --site-sans: "Open Sans", "DejaVu Sans", system-ui, sans-serif;
}

html { scroll-padding-top: calc(var(--site-bar-h) + var(--site-sub-h) + 1rem); }
body { min-height: 100vh; display: flex; flex-direction: column; }
#content { flex: 1 0 auto; }

/* --- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 1100;
  background: rgb(255 255 255 / 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--site-line);
  font-family: var(--site-sans);
}
.site-bar {
  display: flex; align-items: center; gap: 1rem;
  max-width: 80rem; margin: 0 auto; padding: 0 1rem;
  height: var(--site-bar-h);
}
.site-logo {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--site-ink); text-decoration: none;
  font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em;
}
.site-logo:hover { color: var(--site-accent); }
.site-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.site-nav a {
  color: var(--site-ink); text-decoration: none; font-size: .95rem;
  padding: .45rem .7rem; line-height: 1.2;
}
.site-nav a:hover { color: var(--site-accent); }
.site-nav .site-lang {
  border: 1px solid var(--site-line); border-radius: 6px;
  font-size: .8rem; font-weight: 600; padding: .3rem .5rem; margin-left: .4rem;
}
.site-menu-toggle, .site-menu-button { display: none; }

.docs-nav {
  display: none; gap: .1rem; overflow-x: auto; scrollbar-width: none;
  max-width: 80rem; margin: 0 auto; padding: 0 .6rem;
  height: var(--site-sub-h); align-items: center;
  border-top: 1px solid var(--site-line);
}
.kind-docs .docs-nav { display: flex; }
.docs-nav a {
  color: var(--site-muted); text-decoration: none; white-space: nowrap;
  font-size: .9rem; padding: .35rem .6rem; border-radius: 6px;
}
.docs-nav a:hover { color: var(--site-ink); background: var(--site-soft); }

@media (max-width: 720px) {
  .site-menu-button {
    display: block; margin-left: auto; cursor: pointer;
    font-size: 1.4rem; padding: .2rem .5rem; color: var(--site-ink);
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--site-bar-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--site-line);
    padding: .25rem 0;
  }
  .site-menu-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: .8rem 1.25rem; }
  .site-nav a[data-page] { box-shadow: none !important; }
  .site-nav .site-lang { align-self: flex-start; margin: .5rem 1.25rem; }
}

/* adoctra's fixed TOC sidebar starts below the site header; the header
   and footer span the full width despite the sidebar padding of body.toc2. */
body.toc2 { --site-toc-w: 0em; }
@media screen and (min-width: 768px) {
  body.toc2 { --site-toc-w: 15em; }
  body.toc2 nav#toc.toc2 {
    top: calc(var(--site-bar-h) + var(--site-sub-h) + 1px);
    z-index: 900;
  }
  body.toc2 .site-header:not(.kind-docs) + * nav#toc.toc2,
  body.toc2 .site-header:not(.kind-docs) ~ * nav#toc.toc2 { top: calc(var(--site-bar-h) + 1px); }
}
@media screen and (min-width: 1280px) {
  body.toc2 { --site-toc-w: 20em; }
}
body.toc2 .site-header,
body.toc2 .site-footer { margin-inline-start: calc(-1 * var(--site-toc-w)); }

/* --- Footer ------------------------------------------------------------ */
.site-footer {
  flex-shrink: 0; margin-top: 3rem;
  background: #222; color: rgb(255 255 255 / .75);
  font-family: var(--site-sans); font-size: .875rem;
}
body.toc2 .site-footer { position: relative; z-index: 1000; }
.site-footer-inner { max-width: 62.5em; margin: 0 auto; padding: 1.5rem 1rem; }
.site-footer p { font-size: inherit; line-height: 1.6; margin: 0 0 .5rem; letter-spacing: 0; }
.site-footer a { color: #fff; }
.site-footer .site-disclaimer { color: rgb(255 255 255 / .55); font-size: .8rem; margin: 0; }

/* --- Landing page ------------------------------------------------------ */
body.landing #content { max-width: 72rem; }
.hero { padding: 3.5rem 0 2rem; text-align: center; font-family: var(--site-sans); }
.hero h1 {
  font-family: var(--site-sans); color: var(--site-ink);
  font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1;
  letter-spacing: -.03em; margin: 0 0 1rem; font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--site-accent); }
.hero .tagline {
  font-size: 1.2rem; color: var(--site-muted); max-width: 42rem;
  margin: 0 auto 1.75rem; line-height: 1.55;
}
.hero .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-bottom: 1.75rem; }
.button {
  display: inline-block; padding: .7rem 1.3rem; border-radius: 8px;
  font-weight: 600; text-decoration: none; font-size: 1rem;
  border: 1px solid var(--site-accent); color: var(--site-accent);
}
.button:hover { background: var(--site-soft); color: var(--site-accent-dark); }
.button.primary { background: var(--site-accent); color: #fff; }
.button.primary:hover { background: var(--site-accent-dark); color: #fff; }
.hero .install {
  display: inline-block; text-align: left; margin: 0;
  background: #1d1d1f; color: #f5f5f5; border-radius: 8px;
  padding: .8rem 1.2rem; font-size: .95rem;
}
.hero .install::before { content: "$ "; color: #9aa0a6; }
.hero .status { font-size: .85rem; color: var(--site-muted); margin-top: 1rem; }

ul.features {
  list-style: none; margin: 1rem 0 2rem; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
ul.features > li {
  margin: 0; padding: 1.1rem 1.2rem; border: 1px solid var(--site-line);
  border-radius: 10px; background: #fff; line-height: 1.55; font-size: 1rem;
}
ul.features > li > p { margin: 0; }
ul.features > li strong:first-child {
  display: block; font-family: var(--site-sans); color: var(--site-ink);
  font-size: 1.05rem; margin-bottom: .35rem;
}

/* --- Playground -------------------------------------------------------- */
body.app #content { max-width: none; padding-inline: 1rem; }
body.app #header { display: none; }
.pg { font-family: var(--site-sans); }
.pg-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin: .25rem 0 .75rem;
}
.pg-toolbar h1 { font-size: 1.3rem; margin: 0 auto 0 0; color: var(--site-ink); font-family: var(--site-sans); }
.pg-toolbar label { font-size: .875rem; color: var(--site-muted); display: inline-flex; align-items: center; gap: .3rem; }
.pg-toolbar select, .pg-toolbar button {
  font: inherit; font-size: .875rem; padding: .35rem .6rem;
  border: 1px solid var(--site-line); border-radius: 6px; background: #fff; cursor: pointer;
}
.pg-toolbar button:hover { border-color: var(--site-accent); color: var(--site-accent); }
.pg-panes {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  height: calc(100vh - var(--site-bar-h) - 9.5rem); min-height: 28rem;
}
.pg-panes > div { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--site-line); border-radius: 8px; overflow: hidden; }
.pg-pane-title {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--site-muted); padding: .4rem .7rem; background: var(--site-soft);
  border-bottom: 1px solid var(--site-line); display: flex; justify-content: space-between;
}
#pg-source {
  flex: 1; border: 0; resize: none; padding: .75rem; outline: none;
  font-family: var(--adoctra-mono); font-size: .9rem; line-height: 1.5; tab-size: 2;
}
#pg-preview { flex: 1; border: 0; width: 100%; background: #fff; }
#pg-html {
  flex: 1; margin: 0; padding: .75rem; overflow: auto; font-size: .8rem;
  line-height: 1.45; white-space: pre-wrap; background: #fff; display: none;
}
.pg-show-html #pg-preview { display: none; }
.pg-show-html #pg-html { display: block; }
#pg-diagnostics {
  list-style: none; margin: .6rem 0 0; padding: 0; font-size: .85rem;
  max-height: 7rem; overflow: auto;
}
#pg-diagnostics li { padding: .25rem .5rem; border-left: 3px solid #e0a800; background: #fff9e6; margin-bottom: .25rem; line-height: 1.4; cursor: pointer; }
#pg-diagnostics li.error { border-color: #c5221f; background: #fdecea; }
#pg-diagnostics li.info { border-color: #1a73e8; background: #e8f0fe; }
#pg-diagnostics li.ok { border-color: #188038; background: #e6f4ea; cursor: default; }
.pg-note { font-size: .8rem; color: var(--site-muted); margin-top: .5rem; }
@media (max-width: 800px) {
  .pg-panes { grid-template-columns: 1fr; height: auto; }
  .pg-panes > div { height: 60vh; }
}

.release-link { font-size: .9rem; margin-top: -.5rem; }
