/* The developer docs' markdown (.docs-prose, DeveloperDocs::MarkdownComponent) and code colours
   (.docs-highlight, Rouge's token classes, DeveloperDocs::CodeBlockComponent), loaded by
   DeveloperDocs::LayoutComponent only. Colours are the Unified UI's tokens, so the palettes and dark
   mode carry them. Code and link colours are each token mixed with ui-1, the page's ink: darker on
   a light page, lighter on a dark one, so they read at 4.5:1 or better in both. */

@layer components {
  .docs-prose {
    --docs-link: color-mix(in oklab, var(--color-bm-blue) 80%, var(--color-ui-1));
    color: var(--color-ui-2);
    font-size: 1rem;
    line-height: 1.75;
  }

  .docs-prose > * + * {
    margin-top: 1rem;
  }

  .docs-prose h2 {
    margin-top: 2.5rem;
    color: var(--color-ui-1);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
  }

  .docs-prose h3 {
    margin-top: 2rem;
    color: var(--color-ui-1);
    font-size: 1rem;
    font-weight: 600;
  }

  .docs-prose a {
    color: var(--docs-link);
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .docs-prose a:hover {
    text-decoration-thickness: 2px;
  }

  .docs-prose strong {
    color: var(--color-ui-1);
    font-weight: 600;
  }

  .docs-prose a strong {
    color: inherit;
  }

  .docs-prose ul {
    padding-left: 1.5rem;
    list-style: disc;
  }

  .docs-prose ol {
    padding-left: 1.5rem;
    list-style: decimal;
  }

  .docs-prose li + li {
    margin-top: 0.25rem;
  }

  .docs-prose :not(pre) > code {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: var(--color-ui-7);
    color: var(--color-ui-1);
    font-family: var(--font-mono);
    font-size: 0.875em;
  }

  .docs-prose img {
    max-width: 100%;
    border: 1px solid var(--color-ui-6);
    border-radius: 0.5rem;
  }

  .docs-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
  }

  .docs-prose th,
  .docs-prose td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-ui-6);
    text-align: left;
  }

  .docs-prose blockquote {
    padding-left: 1rem;
    border-left: 3px solid var(--color-ui-6);
    color: var(--color-ui-3);
  }

  .docs-prose .docs-alert a {
    color: inherit;
  }

  .docs-prose .docs-alert p + p {
    margin-top: 0.5rem;
  }

  /* A field's description, in the field list's size and spacing. */
  .docs-prose-sm {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .docs-prose-sm > * + * {
    margin-top: 0.5rem;
  }

  .docs-highlight {
    --docs-string: color-mix(in oklab, var(--color-success) 50%, var(--color-ui-1));
    --docs-number: color-mix(in oklab, var(--color-warning) 50%, var(--color-ui-1));
    --docs-keyword: color-mix(in oklab, var(--color-bm-blue) 70%, var(--color-ui-1));
    --docs-name: color-mix(in oklab, var(--color-danger) 60%, var(--color-ui-1));
  }

  .docs-highlight :is(.c, .c1, .cm, .cs, .cp, .ch) {
    color: var(--color-ui-3);
    font-style: italic;
  }

  .docs-highlight :is(.s, .s1, .s2, .sb, .sd, .sh, .sx, .dl, .ss) {
    color: var(--docs-string);
  }

  .docs-highlight :is(.m, .mi, .mf, .mh, .mo, .il, .se) {
    color: var(--docs-number);
  }

  .docs-highlight :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .bp) {
    color: var(--docs-keyword);
  }

  /* JSON keys, object keys, curl's flags and PHP's variables. */
  .docs-highlight :is(.nl, .na, .nt, .nv) {
    color: var(--docs-name);
  }

  .docs-highlight :is(.o, .p) {
    color: var(--color-ui-3);
  }
}

/* A callout's paragraphs, darker (lighter in dark mode) than the shared alert's one-line text, as
   they run to several sentences. Outside the layers, to win over the alert's text-* utility. */
.docs-prose .docs-alert[data-alert-kind="info"] {
  color: color-mix(in oklab, var(--color-info) 50%, var(--color-ui-1));
}

.docs-prose .docs-alert[data-alert-kind="success"] {
  color: color-mix(in oklab, var(--color-success) 50%, var(--color-ui-1));
}

.docs-prose .docs-alert[data-alert-kind="warning"] {
  color: color-mix(in oklab, var(--color-warning) 50%, var(--color-ui-1));
}

.docs-prose .docs-alert[data-alert-kind="danger"] {
  color: color-mix(in oklab, var(--color-danger) 50%, var(--color-ui-1));
}
