/* @abrq/ui prose layer — long-form reading for rendered-Markdown surfaces (G11).
   Plain CSS, tokens only — works in Tailwind apps (apply `abrq-prose` to the
   rendered-HTML container) AND in no-build consumers (G10) that vendor this
   file. Both tiers and `.abrq-invert` come free via the custom properties.

   Voice: calm utility scale (not marketing display), ~70ch measure on flow
   content with code blocks and tables released to the full container width,
   light surface-card code blocks (the DocsDemo precedent — never a dark slab
   inside a light page; `.abrq-invert` is for brand bands, not code), GFM
   tables in the Th mono-caps voice.

   First consumer: abrq-docs. Next: abrq-deliver release notes, dip/mgmt help
   panels. */

.abrq-prose {
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
}

/* Measure: flow content reads at ~70ch; block artifacts use the container. */
.abrq-prose > * {
  max-width: 70ch;
}
.abrq-prose > pre,
.abrq-prose > table,
.abrq-prose > figure,
.abrq-prose > .abrq-prose-wide {
  max-width: none;
}

/* ---- headings: utility scale, display voice only at h1 ------------------- */
.abrq-prose h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.abrq-prose h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}
.abrq-prose h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}
.abrq-prose h4 {
  margin: 1.25rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

/* Heading anchors: hover-revealed AND keyboard-revealed (a11y — a hover-only
   affordance is invisible to keyboard users). Markup: a trailing
   <a class="heading-anchor" href="#slug">#</a> inside the heading. */
.abrq-prose .heading-anchor {
  margin-inline-start: 0.4em;
  color: var(--muted);
  font-size: 0.85em;
  text-decoration: none;
  opacity: 0;
}
.abrq-prose :is(h1, h2, h3, h4):hover .heading-anchor,
.abrq-prose .heading-anchor:focus-visible {
  opacity: 1;
}

/* ---- flow ------------------------------------------------------------------ */
.abrq-prose p {
  margin: 0 0 1rem;
}
.abrq-prose a {
  color: var(--primary);
  text-decoration: none;
}
.abrq-prose a:hover {
  text-decoration: underline;
}
.abrq-prose strong {
  font-weight: 600;
}
.abrq-prose ul,
.abrq-prose ol {
  margin: 0 0 1rem;
  padding-inline-start: 1.4rem;
}
.abrq-prose li + li {
  margin-top: 0.3rem;
}
.abrq-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.abrq-prose blockquote {
  margin: 0 0 1rem;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--border);
  color: var(--muted);
}

/* <hr> speaks the dot–dash rhythm on product surfaces (same pattern as
   .abrq-rule; color via the border token). */
.abrq-prose hr {
  height: 1px;
  margin: 2rem 0;
  border: 0;
  color: var(--border);
  background-image: repeating-linear-gradient(
    90deg,
    currentColor 0,
    currentColor 2px,
    transparent 2px,
    transparent 7px,
    currentColor 7px,
    currentColor 15px,
    transparent 15px,
    transparent 20px
  );
}

/* ---- code: mono ink on a light surface card -------------------------------- */
.abrq-prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
}
.abrq-prose pre {
  margin: 0 0 1rem;
  padding: 1rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}
.abrq-prose pre code {
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
}
.abrq-prose kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.05em 0.35em;
}

/* ---- GFM tables: the Th voice ----------------------------------------------- */
.abrq-prose table {
  margin: 0 0 1rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.abrq-prose th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  text-align: start;
}
.abrq-prose th,
.abrq-prose td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  vertical-align: top;
}

/* GFM task lists */
.abrq-prose input[type="checkbox"] {
  accent-color: var(--primary);
}
