/* ============================================================
   Every page that isn't the landing: docs, guides, comparison
   pages, changelog and legal. Loaded after landing.css, which
   supplies the shared header, buttons, section intros, closing
   and footer through body.site. Docs get three columns after
   screen-ruler.com's docs: page nav, the article, and "On this
   page" on the right. Other articles get the article and the
   "On this page" column.
   ============================================================ */

.site { --head: 56px; }

/* the old framed layout's leftovers */
.site.framed::before { display: none; }

/* ---------- Columns ---------- */
.site .docs,
.site .article-layout {
  display: grid;
  gap: 56px;
  align-items: start;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px var(--pad) 112px;
}
/* screen-ruler.com's docs constraints: a 1280px container, 200 / article / 220,
   64px apart, which leaves the article about 670px at desktop widths */
.site .docs { grid-template-columns: 200px minmax(0, 1fr) 220px; gap: 64px; max-width: 1280px; }
/* the header spans the same container on docs pages, so the logo sits over the page nav */
:is(#landing, .site):has(.docs) .header-inner { max-width: 1280px; }
.site .article-layout { grid-template-columns: minmax(0, 1fr) 200px; max-width: 1000px; }
.site .docs-main { min-width: 0; padding: 0; }
.site .docs-article { max-width: 720px; }
.site .article-layout .docs-article { margin: 0; }

/* the page nav (docs) and "On this page" stay put while the article scrolls */
.site .docs .sidebar,
.site .toc {
  position: sticky;
  top: calc(var(--head) + 32px);
  max-height: calc(100vh - var(--head) - 64px);
  overflow-y: auto;
  scrollbar-width: none;
}
.site .docs .sidebar {
  width: auto;
  height: auto;
  margin: 0 0 0 -12px;
  padding: 0;
  border: 0;
  background: none;
}
.site .docs .sidebar-nav { gap: 28px; }
.site .docs .sidebar-heading { margin: 0; padding: 0 12px; color: var(--eyebrow); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; }
.site .sidebar-link { font-size: var(--text-base); }
.site .sidebar-link:hover { background: var(--fill-hover); color: var(--primary); }
.site .sidebar-link.active { background: var(--fill); color: var(--primary); }
.site .sidebar-icon svg { width: 20px; height: 20px; }

.site .toc { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 1px solid var(--stroke); }
.site .toc-title { margin: 0 0 8px; color: var(--primary); font-size: var(--text-ui); font-weight: 600; }
.site .toc-link {
  margin-left: -17px;
  padding: 3px 0 3px 15px;
  border-left: 2px solid transparent;
  color: var(--secondary);
  font-size: var(--text-ui);
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.site .toc-link:hover { color: var(--primary); }
.site .toc-link.active { border-left-color: var(--accent); color: var(--primary); }

/* ---------- Article ---------- */
.site .prose { color: var(--primary); font-size: var(--text-lead); line-height: 1.7; }
.site .prose > * + * { margin-top: 18px; }
.site .prose h1 { margin: 0; font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.site .prose h2 { margin: 56px 0 0; font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; scroll-margin-top: calc(var(--head) + 32px); }
.site .prose h3 { margin: 32px 0 0; font-size: var(--text-md); font-weight: 600; letter-spacing: -0.01em; scroll-margin-top: calc(var(--head) + 32px); }
.site .prose h2 + *, .site .prose h3 + * { margin-top: 12px; }
.site .prose p, .site .prose li { color: var(--sub); }
.site .prose p { margin-bottom: 0; }
.site .prose strong { color: var(--primary); font-weight: 600; }
.site .prose .lead { margin-top: 16px; color: var(--secondary); font-size: var(--text-md); line-height: 1.55; }
.site .prose .article-date { margin: 12px 0 0; color: var(--secondary); font-size: var(--text-ui); }
.site .prose ul, .site .prose ol { margin-bottom: 0; padding-left: 22px; }
.site .prose li + li { margin-top: 6px; }
.site .prose a:not(.btn) { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.site .prose a:not(.btn):hover { color: var(--accent); text-decoration-color: currentColor; }
.site .prose code { padding: 2px 5px; border-radius: 5px; background: var(--fill); font-family: var(--font-mono); font-size: 0.88em; }
.site .prose hr { margin: 48px 0; border: 0; border-top: 1px solid var(--ghost-border); }

/* code blocks after screen-ruler.com: a soft fill, no outline; the copy button sits in
   its own column and long lines wrap, so nothing ever runs under it */
.site .code-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: var(--band);
}
.site .prose pre { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--band); font-size: var(--text-ui); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.site .prose .code-block pre { padding: 6px 8px; border-radius: 0; background: none; }
.site .prose pre code { padding: 0; background: none; font-size: inherit; }
.site .prose pre .accent { color: var(--accent); }
.site .prose pre .muted { color: var(--tertiary); }
.site .code-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.site .code-copy:hover:not(:disabled) { transform: none; background: var(--fill); color: var(--primary); }
.site .code-copy .icon-check { display: none; }
.site .code-copy.is-copied { background: var(--accent); color: var(--on-accent); }
.site .code-copy.is-copied .icon-copy { display: none; }
.site .code-copy.is-copied .icon-check { display: block; }

/* tables scroll sideways inside their own box on narrow screens */
.site .table-wrap { overflow-x: auto; border-radius: 14px; box-shadow: var(--edge) var(--ghost-border); }
.site .prose table { width: 100%; margin: 0; border-collapse: collapse; font-size: var(--text-base); }
.site .prose th, .site .prose td { padding: 11px 16px; border-bottom: 1px solid var(--ghost-border); text-align: left; vertical-align: top; }
.site .prose tr:last-child th, .site .prose tr:last-child td { border-bottom: 0; }
.site .prose th { color: var(--primary); font-weight: 600; white-space: nowrap; }
.site .prose td { color: var(--sub); }

/* "Next" at the foot of each docs page */
.site .next-topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px !important;
  padding: 18px 22px;
  border-radius: 14px;
  box-shadow: var(--edge) var(--ghost-border);
  color: var(--primary) !important;
  text-decoration: none !important;
  transition: background 0.15s;
}
.site .next-topic:hover { background: var(--fill-hover); }
.site .next-topic-label { display: block; color: var(--secondary); font-size: var(--text-ui); }
.site .next-topic-title { display: block; margin-top: 2px; font-size: var(--text-lead); font-weight: 600; }
.site .next-topic svg { flex: none; color: var(--secondary); }

/* ---------- Docs footer: one line, like the docs it closes ---------- */
:is(#landing, .site) footer.footer-min { padding: 0 var(--pad); background: var(--background); }
.site .footer-min-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1216px; margin: 0 auto; padding: 24px 0 32px; color: var(--secondary); font-size: var(--text-ui); }
.site .footer-min nav { display: flex; gap: 20px; }
.site .footer-min a { color: var(--secondary); }
.site .footer-min a:hover { color: var(--primary); }

/* ---------- Sign-in ---------- */
.site .auth { min-height: 100vh; padding: 40px var(--pad); }
.site .auth-card { gap: 24px; width: min(360px, 100%); }
.site .auth-logo { display: inline-flex; align-self: center; margin: 0; }
.site .auth-header { gap: 8px; }
.site .auth-header h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.site .auth-header p { color: var(--secondary); font-size: var(--text-body); line-height: 1.55; }
/* the consent page: where an agent sends you back, when that isn't this computer */
.site .auth-header p.warn { color: var(--warn); }
.site .auth-buttons { gap: 10px; }
.site .auth-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font: 600 var(--text-body)/1 var(--font-sans);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.site .auth-buttons button:hover:not(:disabled) { transform: none; }
.site .auth-buttons .primary { background: var(--btn-bg); color: var(--btn-fg); }
.site .auth-buttons .primary:hover:not(:disabled) { background: var(--btn-bg-hover); }
.site .auth-buttons .outline { background: transparent; color: var(--primary); box-shadow: var(--edge) var(--ghost-border); }
.site .auth-buttons .outline:hover:not(:disabled) { background: var(--ghost-bg-hover); box-shadow: var(--edge) var(--ghost-border-hover); }
.site .auth-card > p { color: var(--secondary); font-size: var(--text-ui); }
/* the consent page's local-only sign-in (the local stack has no GitHub or Google) */
.site .auth-buttons input { height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--primary); box-shadow: var(--edge) var(--ghost-border); font: var(--text-body) var(--font-sans); }
.site .auth-card > p a { color: var(--primary); text-decoration: underline; text-decoration-color: var(--ghost-border-hover); text-underline-offset: 3px; }

/* ---------- 404 ---------- */
.site .not-found { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 40px var(--pad); text-align: center; }
.site .not-found h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.site .not-found .closing-actions { flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .site .docs { grid-template-columns: 200px minmax(0, 1fr); }
  .site .docs .toc { display: none; }
}
@media (max-width: 900px) {
  .site .article-layout { grid-template-columns: minmax(0, 1fr); }
  .site .article-layout .toc { display: none; }
}
@media (max-width: 760px) {
  .site .docs { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .site .docs .sidebar { position: static; max-height: none; margin: 0 -12px; }
  .site .article-layout { padding-top: 40px; }
}
