@charset "utf-8";
/* The Cases technical reference (cases-reference.html). Loaded after site.css and set in the same "page" layer, so
   it reuses the homepage's tokens, masthead, buttons, colophon and theme handling. The class
   names of the article, contents and diagram dialog are the ones js/cases-article.js looks for. */
@layer page {
  .pb-reference { --tone: #12707A; }

  /* ---------- Hero ---------- */
  .pbr-hero { align-items: start; padding-bottom: clamp(48px, 6vw, 80px); }
  .pbr-hero-main { grid-column: 1 / -1; }
  .pbr-hero .pb-lede { max-width: none; }
  .pbr-logo .product-logo { width: auto; height: 38px; margin-bottom: 30px; animation: pb-rise 1s var(--ease-out) both; }
  .pbr-hero h1 { font-size: clamp(40px, 5vw, 72px); }
  .pbr-note {
    grid-column: 1 / -1; display: flex; gap: 14px; margin-top: clamp(40px, 5vw, 64px); padding-top: 20px;
    border-top: 1px solid var(--border); font-size: 15px; color: var(--fg-muted);
  }
  .pbr-note span { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }

  /* ---------- Contents and article ---------- */
  .pbr-layout {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 32px; align-items: start;
    max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad) clamp(80px, 10vw, 140px);
  }
  .pbr-toc {
    grid-column: 1 / span 3; position: sticky; top: calc(var(--mast-h) + 28px);
    max-height: calc(100dvh - var(--mast-h) - 56px); overflow: auto; padding-top: 20px; border-top: 3px solid var(--rule);
  }
  .pbr-toc .cases-toc-title { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
  .pbr-toc-overview { margin-top: 18px; }
  .pbr-toc .cases-toc-group { margin-top: 20px; }
  .pbr-toc .cases-toc-category { margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-subtle); }
  .pbr-toc .cases-toc-link {
    display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--border);
    font-size: 14px; line-height: 1.4; color: var(--fg-muted); transition: color .2s, border-color .2s, padding .3s var(--ease-out);
  }
  .pbr-toc .cases-toc-link:hover { color: var(--fg); border-color: var(--fg-subtle); }
  .pbr-toc .cases-toc-link[aria-current="location"] { padding-left: 18px; border-color: var(--accent); color: var(--fg); font-weight: 700; }

  /* Where a linked heading lands (the page's scroll-padding-top); js/cases-article.js reads it as a plain length. */
  .pbr-article { --article-scroll-offset: 92px; grid-column: 5 / -1; min-width: 0; font-size: 17px; color: var(--fg-muted); }
  .pbr-article > * + * { margin-top: 18px; }
  .pbr-article :is(h2, h3, h4, h5) { color: var(--fg); text-wrap: balance; }
  .pbr-article h2 {
    margin-top: 72px; padding-top: 28px; border-top: 3px solid var(--rule);
    font-size: clamp(34px, 3.8vw, 54px); font-weight: 300; line-height: 1.04; letter-spacing: -.045em;
  }
  .pbr-article h2:first-child { margin-top: 0; }
  .pbr-article h3 { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--border); font-size: clamp(28px, 2.8vw, 40px); font-weight: 300; line-height: 1.1; letter-spacing: -.035em; }
  .pbr-article h4 { margin-top: 40px; font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
  .pbr-article h5 { margin-top: 28px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-subtle); }
  .pbr-article h2 + *, .pbr-article h3 + *, .pbr-article h4 + * { margin-top: 16px; }
  .pbr-article .article-chapter { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
  .pbr-article .chapter-copy {
    display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%;
    color: var(--fg-subtle); opacity: 0; transition: opacity .2s, color .2s, border-color .2s;
  }
  .pbr-article .chapter-copy svg { width: 16px; height: 16px; }
  .pbr-article .article-chapter:hover .chapter-copy, .pbr-article .chapter-copy:focus-visible { opacity: 1; }
  .pbr-article .chapter-copy:hover { color: var(--accent); border-color: var(--accent); }
  .pbr-article strong { color: var(--fg); font-weight: 700; }
  .pbr-article a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
  .pbr-article a:hover { color: var(--accent); }
  .pbr-article ul, .pbr-article ol { display: grid; gap: 8px; }
  .pbr-article ul > li { position: relative; padding-left: 22px; }
  .pbr-article ul > li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
  .pbr-article ol { counter-reset: item; }
  .pbr-article ol > li { counter-increment: item; position: relative; padding-left: 34px; }
  .pbr-article ol > li::before { content: counter(item, decimal-leading-zero); position: absolute; left: 0; font-size: 14px; font-weight: 700; color: var(--accent); }
  .pbr-article li > :is(ul, ol) { margin-top: 8px; }
  .pbr-article blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--tone); color: var(--fg); }
  .pbr-article hr { height: 0; margin: 72px 0 0; border: 0; }
  .pbr-article hr + :is(h2, h3) { margin-top: 0; }
  .pbr-article :not(pre) > code {
    padding: .1em .4em; border-radius: 5px; background: var(--surface-sunken); font-size: .86em; color: var(--fg);
  }
  .pbr-article pre:not(.mermaid) {
    overflow-x: auto; padding: 18px 20px; border: 1px solid var(--border); background: var(--code-bg);
    font: 13px/1.7 var(--font-mono); color: var(--fg);
  }
  .pbr-article .article-table { overflow-x: auto; border-top: 3px solid var(--rule); }
  .pbr-article table { width: 100%; border-collapse: collapse; font-size: 15px; }
  .pbr-article th { padding: 12px 14px 12px 0; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-subtle); }
  .pbr-article td { padding: 12px 14px 12px 0; border-top: 1px solid var(--border); vertical-align: top; }
  .pbr-article td:first-child { color: var(--fg); font-weight: 600; }
  .pbr-article .pbr-chapter-table td { color: var(--fg); font-weight: 600; }

  /* Diagrams: Mermaid draws in light colours, so each one sits on a light plate in both themes. */
  .pbr-article .article-flowchart {
    position: relative; margin-top: 28px; padding: 28px 20px 20px; border: 1px solid var(--border); border-radius: 16px;
    background: #f6f7f9; overflow-x: auto;
  }
  .pbr-article .article-flowchart .mermaid { margin: 0; color: #14161c; font-size: 13px; text-align: center; }
  .pbr-article .article-flowchart .mermaid svg { margin: 0 auto; }
  .pbr-article .article-flowchart-compact .mermaid svg { max-width: 560px; }
  .pbr-article .flowchart-expand {
    position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px;
    border: 1px solid #d8dbe2; border-radius: 50%; background: #fff; color: #14161c; transition: background .2s, color .2s;
  }
  .pbr-article .flowchart-expand svg { width: 16px; height: 16px; }
  .pbr-article .flowchart-expand:hover { background: #14161c; color: #fff; }
  .pbr-article .flowchart-section-title { font-size: 21px; }

  .pbr-dialog {
    width: min(94vw, 900px); max-width: none; height: min(90vh, 1000px); max-height: none; padding: 0;
    border: 1px solid var(--border); border-radius: 18px; background: var(--bg); color: var(--fg); overflow: hidden;
  }
  .pbr-dialog::backdrop { background: color-mix(in srgb, #000 55%, transparent); }
  .pbr-dialog .flowchart-dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
  .pbr-dialog .flowchart-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
  .pbr-dialog .flowchart-dialog-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
  .pbr-dialog .flowchart-dialog-title { margin-top: 4px; font-size: 24px; font-weight: 300; letter-spacing: -.03em; }
  .pbr-dialog .flowchart-dialog-close { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 50%; transition: background .2s, color .2s, transform .4s var(--ease-out); }
  .pbr-dialog .flowchart-dialog-close:hover { background: var(--fg); color: var(--bg); transform: rotate(90deg); }
  .pbr-dialog .flowchart-dialog-canvas { overflow: auto; padding: 24px; background: #f6f7f9; color: #14161c; }
  .pbr-dialog .flowchart-dialog-canvas svg { margin: 0 auto; }

  .pbr-colophon { grid-template-columns: minmax(0, 1fr); }

  @media (max-width: 1100px) {
    .pbr-toc { grid-column: 1 / span 4; }
    .pbr-article { grid-column: 5 / -1; }
  }
  @media (max-width: 900px) {
    .pbr-layout { grid-template-columns: minmax(0, 1fr); }
    .pbr-toc { grid-column: 1; position: static; max-height: none; margin-bottom: 56px; }
    .pbr-article { grid-column: 1; }
    .pbr-article .chapter-copy { opacity: 1; }
  }
  @media (max-width: 600px) {
    .pbr-back span { display: none; }
    .pbr-article { font-size: 16px; }
  }
}
