/* ============================================================
   sitecake — docs layout
   Built on the Simple CMS design system. Pairs with site.css.
   Mobile-first · left contents ≥768 · right rail ≥1200
   Discipline: mint is the one accent. Navy is structure.
   ============================================================ */

/* Keep the standard header pinned while reading */
.site-nav { position: sticky; top: 0; z-index: 60; }

/* Align the standard nav + footer width with the docs shell (docs pages only).
   padding-inline only — .nav-inner shares this element and needs its own
   vertical padding (site.css) left alone, or the header loses its height. */
.site-nav .container,
.site-footer .container { max-width: 1340px; padding-inline: 24px; }
@media (min-width: 768px) {
  .site-nav .container,
  .site-footer .container { padding-inline: 32px; }
}
@media (min-width: 1200px) {
  .site-nav .container,
  .site-footer .container { padding-inline: 40px; }
}

/* ---- Shell (CSS grid: contents | article | on-this-page) ---- */
.docs {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

/* ============ Left contents ============ */
.docs-side { display: none; }
.docs-side .side-inner {
  position: sticky;
  top: var(--nav-h);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 56px 24px 48px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--n-200) transparent;
}
.docs-side .side-inner::-webkit-scrollbar { width: 3px; }
.docs-side .side-inner::-webkit-scrollbar-thumb { background: var(--n-200); border-radius: 2px; }

.docs-group + .docs-group { margin-top: 30px; }
.docs-group-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--n-400); font-weight: 600;
  margin: 0 0 10px 12px;
}
.docs-group nav { display: flex; flex-direction: column; gap: 1px; }
.docs-group a {
  text-decoration: none;
  font-size: 14px; font-weight: 500; color: var(--n-500);
  padding: 7px 12px; border-radius: 8px;
  transition: background .15s, color .15s;
}
.docs-group a:hover { background: var(--n-50); color: var(--charcoal); }
.docs-group a.active { background: var(--navy); color: #fff; font-weight: 600; }

/* ============ Mobile contents (disclosure) ============ */
.docs-contents {
  border: 1px solid var(--n-200);
  border-radius: var(--radius-md);
  margin: 24px 0 8px;
  overflow: hidden;
}
.docs-contents summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: var(--n-50);
  font-size: 14px; font-weight: 600; color: var(--navy);
}
.docs-contents summary::-webkit-details-marker { display: none; }
.docs-contents summary .ms { font-size: 19px; color: var(--n-400); }
.docs-contents summary .chev { margin-left: auto; transition: transform .22s; }
.docs-contents[open] summary .chev { transform: rotate(180deg); }
.docs-contents .contents-body { padding: 14px 14px 20px; }
.docs-contents .docs-group + .docs-group { margin-top: 20px; }
.docs-contents .docs-group-label { margin-left: 12px; }

/* ============ Center (article) ============ */
.docs-main { min-width: 0; padding: 56px 0 80px; }
.docs-article { max-width: 720px; }

/* breadcrumb / eyebrow */
.docs-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mint-deep); font-weight: 600;
  margin: 0 0 18px;
}

/* prose */
.prose h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto; font-variation-settings: "SOFT" 100;
  font-weight: 700; text-transform: lowercase; color: var(--navy);
  font-size: clamp(34px, 5vw, 48px); line-height: 1.05;
  letter-spacing: -0.015em; margin: 0;
}
.prose .lead {
  font-size: var(--fs-lead); line-height: 1.6; color: var(--n-500);
  margin: 22px 0 0; max-width: 60ch; text-wrap: pretty;
}
.prose h2 {
  font-family: var(--font-display);
  font-optical-sizing: auto; font-variation-settings: "SOFT" 100;
  font-weight: 700; text-transform: lowercase; color: var(--navy);
  font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.01em;
  margin: 64px 0 18px; scroll-margin-top: calc(var(--nav-h) + 16px);
}
.prose h3 {
  font-family: var(--font-ui); font-weight: 600; color: var(--navy);
  font-size: var(--fs-h3); line-height: 1.3;
  margin: 40px 0 12px; scroll-margin-top: calc(var(--nav-h) + 16px);
}
.prose p {
  font-size: var(--fs-body); line-height: 1.75; color: var(--charcoal);
  margin: 0 0 18px; max-width: 68ch; text-wrap: pretty;
}
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; max-width: 64ch; }
.prose li { font-size: var(--fs-body); line-height: 1.7; color: var(--charcoal); margin-bottom: 8px; }
.prose li::marker { color: var(--n-400); }
.prose strong { font-weight: 600; color: var(--navy); }

/* inline code (design-system style) */
.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--n-50); border: 1px solid var(--n-200);
  border-radius: 5px; padding: 1px 6px; color: var(--navy);
}

/* prose links — the one action color */
.prose a {
  color: var(--mint-deep); text-decoration: none;
  font-weight: 500; border-bottom: 1.5px solid var(--mint);
  padding-bottom: .5px; transition: color .15s, border-color .15s;
}
.prose a:hover { color: var(--navy); border-color: var(--navy); }
/* Real .btn buttons occasionally sit inside .prose (e.g. template pages) —
   don't let the link-style rule above override their own color/padding/underline. */
.prose a.btn, .prose a.btn:hover { border-bottom: none; padding: 12px 22px; }
.prose a.btn { color: #fff; }
.prose a.btn.ghost, .prose a.btn.ghost:hover { color: var(--navy); }

/* ============ Code block (colored, no chrome) ============ */
.prose pre {
  position: relative;
  background: var(--n-50);
  border: 1px solid var(--n-200);
  border-radius: var(--radius-md);
  padding: 18px 48px 18px 22px; margin: 24px 0;
  overflow-x: auto; line-height: 1.7;
  scrollbar-width: thin; scrollbar-color: var(--n-300) transparent;
}
.prose pre::-webkit-scrollbar { height: 7px; }
.prose pre::-webkit-scrollbar-thumb { background: var(--n-300); border-radius: 4px; }
.prose pre code {
  font-family: var(--font-mono); font-size: 13.5px;
  color: var(--charcoal); background: none; border: none; padding: 0;
  white-space: pre;
}
/* light-theme syntax — brand-toned, no warm clutter */
.prose pre .c { color: var(--n-500); font-style: italic; } /* comment   */
.prose pre .t { color: #0f8a6e; }                          /* tag / keyword */
.prose pre .s { color: #0a7ba3; }                          /* string    */
.prose pre .a { color: var(--navy); }                      /* attribute */
.prose pre .p { color: var(--mint-deep); user-select: none; } /* prompt */

/* copy button — quiet, corner of the block */
.code-copy {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--n-200); background: var(--n-0);
  color: var(--n-400); cursor: pointer;
  display: grid; place-items: center;
  opacity: .5; transition: opacity .15s, color .15s, border-color .15s, background .15s;
}
.prose pre:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--charcoal); border-color: var(--n-300); background: var(--n-50); }
.code-copy .ms { font-size: 16px; }
.code-copy.copied { color: var(--mint-deep); border-color: var(--mint); opacity: 1; }

/* ============ Quiet note ============ */
.docs-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--lime-soft);
  border-radius: var(--radius-md);
  padding: 16px 20px; margin: 24px 0;
}
.docs-note .ms { color: var(--mint-deep); font-size: 20px; flex: none; margin-top: 1px; }
.docs-note p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--charcoal); max-width: none; }
.docs-note.key .ms { color: var(--navy); }

/* ============ Screenshots ============ */
/* Empty/icon placeholders no longer exist in docs — every .media-frame now
   wraps a real screenshot, shown at its own size and ratio, never cropped. */
.prose figure { margin: 28px 0; }
.prose figure .media-frame {
  border: 1px solid var(--n-200);
  background: var(--n-100);
  display: grid; place-items: center; color: var(--n-300);
}
.prose figure .media-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.prose figure .media-frame .ms { font-size: 44px; }
/* video variant: simple, flat darker-gray slot */
.prose figure.video .media-frame { background: var(--n-300); color: #fff; cursor: pointer; }
.prose figure.video .play {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(31,42,68,.6); display: grid; place-items: center;
  transition: background .15s;
}
.prose figure.video .media-frame:hover .play { background: var(--navy); }
.prose figure.video .play .ms { font-size: 28px; font-variation-settings: 'FILL' 1; margin-left: 3px; color: #fff; }
.prose figcaption {
  font-family: var(--font-mono); font-size: 12px; color: var(--n-400);
  margin-top: 10px; line-height: 1.5;
}

/* ============ Prev / next ============ */
.docs-prevnext {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 720px; margin-top: 56px;
}
.docs-prevnext a {
  text-decoration: none;
  border: 1px solid var(--n-200); border-radius: var(--radius-md);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, background .15s;
}
.docs-prevnext a:hover { border-color: var(--mint); background: var(--n-50); }
.docs-prevnext .pn-dir {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--n-400); font-weight: 600;
}
.docs-prevnext .pn-title { font-size: 15px; font-weight: 600; color: var(--navy); }
.docs-prevnext .next { text-align: right; }
.docs-prevnext .next:only-child { grid-column: 2; }

/* ============ Right on-this-page ============ */
.docs-onpage { display: none; }
.docs-onpage .onpage-inner {
  position: sticky; top: var(--nav-h);
  padding: 56px 0 48px 8px;
}
.docs-onpage .onpage-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--n-400); font-weight: 600; margin-bottom: 14px;
}
.docs-onpage nav { display: flex; flex-direction: column; }
.docs-onpage a {
  text-decoration: none; font-size: 13px; line-height: 1.45;
  color: var(--n-400); padding: 6px 0 6px 14px;
  border-left: 2px solid var(--n-200);
  transition: color .15s, border-color .15s;
}
.docs-onpage a:hover { color: var(--charcoal); }
.docs-onpage a.active { color: var(--mint-deep); border-left-color: var(--mint); font-weight: 600; }

/* ============ Responsive ============ */
@media (min-width: 768px) {
  .docs { grid-template-columns: 248px minmax(0, 1fr); column-gap: 56px; padding: 0 32px; }
  .docs-side { display: block; }
  .docs-contents { display: none; }
}
@media (min-width: 1200px) {
  .docs { grid-template-columns: 248px minmax(0, 1fr) 200px; column-gap: 60px; padding: 0 40px; }
  .docs-onpage { display: block; }
}

/* ── Release-notes table ─────────────────────────────────────────────────── */
/* Wrapper scrolls on its own so the page body never scrolls sideways. */
.rn-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}
.rn-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 15px;
}
.rn-table th,
.rn-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--n-200);
  vertical-align: top;
}
.rn-table th {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n-500);
  white-space: nowrap;
}
.rn-table td:first-child {
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.rn-table td:nth-child(2) { white-space: nowrap; color: var(--n-500); }
.rn-table tr:last-child td { border-bottom: none; }

/* ── Blog ────────────────────────────────────────────────────────────────── */
.blog-wrap {
  max-width: 760px;
  padding-top: 56px;
  padding-bottom: 72px;
}
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 40px;
}
.blog-list article h2 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 8px;
}
.blog-list article p { margin: 0; color: var(--n-500); }
.blog-back { margin-top: 56px; }

/* Inline table of contents carried over from the old blog markup. */
.blog-toc {
  background: var(--n-50);
  border: 1px solid var(--n-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 32px 0;
}
.blog-toc-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n-500);
  margin-bottom: 10px;
}
.blog-toc ul { margin: 0; padding-left: 18px; }
.article-byline { color: var(--n-500); font-size: 15px; }
