/* =====================================================================
   OSE · Prose · styles/components/prose.css
   ---------------------------------------------------------------------
   Long-form text set from plain HTML: blog posts and policy-like pages.
   A reading column of ~68ch (--layout-prose), left-aligned on the page
   grid, with a calm vertical rhythm. Component tokens only: --prose-*.

   Markup
     <div class="container">
       <div class="prose">
         <p>Chọn trung tâm tiếng Anh cho con không chỉ là chọn nơi gần nhà.</p>
         <h2 id="si-so">1. Mỗi lớp bao nhiêu học viên?</h2>
         <p>… <a href="/khoa-hoc/">lộ trình</a> … <strong>tối đa 15 học viên</strong> …</p>
         <ul> <li>…</li> </ul>          <ol> <li>…</li> </ol>
         <blockquote><p>…</p><footer>Nguồn</footer></blockquote>
         <hr>
         <figure><img src="…" alt="…" width="…" height="…" loading="lazy">
           <figcaption>…</figcaption></figure>
         <div class="prose__table" role="region" aria-label="…" tabindex="0">
           <table> <thead>…</thead> <tbody>…</tbody> </table>
         </div>
       </div>
     </div>

   Rule     prose styles BARE elements only (no class attribute). Anything
            with a class is a component and keeps its own look (an
            .image-frame, a .btn, a .link), so components can sit inside
            an article untouched. Every direct child gets the flow space.
   Rhythm   blocks: --prose-flow apart (margins collapse, so the larger of
            two neighbours wins) · h2 / h3: more space above, little below,
            so a heading belongs to what follows · hr and figures: more
            space on both sides.
   Type     body: Questrial (the body role, 1.65 line-height for stacked
            Vietnamese diacritics) · h2 / h3: the heading roles · strong:
            the UI family at 600 (base.css) · list markers muted; ordered
            numbers in the mono data role · blockquote: the lead role with
            a rule at the start edge, source in small muted text ·
            figcaption and tables: small; table headings mono data labels.
   Links    bare <a>: the Link component's look and states, from
            --prose-link-* (hairline underline, lilac and thicker on hover,
            focus ring, muted when pressed). Hover and Tab the styleguide
            sample; the frozen states are on the Link demo.
   Tables   bare <table>: full width of the column, hairline rows. Wide
            tables go in .prose__table (scrolls sideways on phones; give
            it role="region", an aria-label and tabindex="0").
   Surfaces cream, navy and night: the tokens re-map.
   JS       none.
   ===================================================================== */

@layer components {
  .prose {
    max-inline-size: var(--prose-measure);
    color: var(--prose-text);
    font: var(--prose-font);
    letter-spacing: var(--prose-tracking);
  }

  /* ---- Flow ---------------------------------------------------------- */
  .prose > * + * {
    margin-block-start: var(--prose-flow);
  }

  .prose > * + :where(h2) {
    margin-block-start: var(--prose-h2-space);
  }

  .prose > * + :where(h3) {
    margin-block-start: var(--prose-h3-space);
  }

  .prose > :where(h2, h3) + * {
    margin-block-start: var(--prose-heading-follow);
  }

  /* ---- Headings ------------------------------------------------------ */
  .prose :where(h2:not([class])) {
    color: var(--prose-heading-color);
    font: var(--prose-h2-font);
    letter-spacing: var(--prose-h2-tracking);
  }

  .prose :where(h3:not([class])) {
    color: var(--prose-heading-color);
    font: var(--prose-h3-font);
    letter-spacing: var(--prose-h3-tracking);
  }

  /* ---- Lists --------------------------------------------------------- */
  .prose :where(ul:not([class]), ol:not([class])) {
    padding-inline-start: var(--prose-list-indent);
  }

  .prose :where(ul:not([class]), ol:not([class])) > li + li,
  .prose :where(li) > :where(ul:not([class]), ol:not([class])) {
    margin-block-start: var(--prose-list-gap);
  }

  .prose :where(ul:not([class]), ol:not([class])) > li::marker {
    color: var(--prose-marker-color);
  }

  .prose :where(ol:not([class])) > li::marker {
    font: var(--prose-marker-font);
  }

  /* ---- Links (the Link component's look, for bare <a>) ---------------- */
  .prose :where(a:not([class])) {
    border-radius: var(--prose-link-radius);
    color: var(--prose-link-text);
    text-decoration-line: underline;
    text-decoration-color: var(--prose-link-underline);
    text-decoration-thickness: var(--prose-link-underline-thickness);
    text-underline-offset: var(--prose-link-underline-offset);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition:
      color var(--prose-link-duration) var(--prose-link-ease),
      text-decoration-color var(--prose-link-duration) var(--prose-link-ease),
      text-decoration-thickness var(--prose-link-duration) var(--prose-link-ease),
      box-shadow var(--prose-link-duration) var(--prose-link-ease);
  }

  /* Order matters: visited < focus < hover < active. */
  .prose :where(a:not([class])):visited {
    color: var(--prose-link-text);
    text-decoration-color: var(--prose-link-underline);
  }

  .prose :where(a:not([class])):focus-visible {
    box-shadow: var(--prose-link-focus-ring);
  }

  @media (hover: hover) {
    .prose :where(a:not([class])):hover {
      text-decoration-color: var(--prose-link-underline-hover);
      text-decoration-thickness: var(--prose-link-underline-thickness-hover);
    }
  }

  .prose :where(a:not([class])):active {
    color: var(--prose-link-text-active);
    text-decoration-color: var(--prose-link-underline-hover);
    text-decoration-thickness: var(--prose-link-underline-thickness-hover);
  }

  /* ---- Quote --------------------------------------------------------- */
  .prose :where(blockquote:not([class])) {
    padding-inline-start: var(--prose-quote-padding-inline);
    border-inline-start: var(--prose-quote-rule-width) solid var(--prose-quote-rule);
    color: var(--prose-quote-color);
    font: var(--prose-quote-font);
  }

  .prose :where(blockquote:not([class])) > * + * {
    margin-block-start: var(--prose-quote-gap);
  }

  .prose :where(blockquote:not([class])) :where(footer, cite) {
    color: var(--prose-quote-cite-color);
    font-size: var(--prose-quote-cite-font-size);
    font-style: normal;
  }

  /* ---- Rule ---------------------------------------------------------- */
  .prose > :where(hr:not([class])) {
    block-size: 0;
    margin-block: var(--prose-rule-space);
    border: none;
    border-block-start: var(--prose-rule-width) solid var(--prose-rule);
  }

  /* ---- Figures and images -------------------------------------------- */
  .prose > :where(figure:not([class])) {
    margin-block: var(--prose-figure-space);
  }

  .prose :where(figure:not([class])) > :where(img:not([class])) {
    inline-size: 100%;
  }

  .prose :where(img:not([class])) {
    border-radius: var(--prose-figure-radius);
    background-color: var(--prose-figure-bg);
  }

  .prose :where(figcaption:not([class])) {
    margin-block-start: var(--prose-caption-gap);
    color: var(--prose-caption-color);
    font-size: var(--prose-caption-font-size);
    line-height: var(--prose-caption-leading);
  }

  /* ---- Tables -------------------------------------------------------- */
  .prose__table {
    max-inline-size: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-radius: var(--prose-table-radius);
  }

  .prose__table:focus-visible {
    box-shadow: var(--prose-table-focus-ring);
  }

  .prose :where(table:not([class])) {
    inline-size: 100%;
    border-collapse: collapse;
    font-size: var(--prose-table-font-size);
    line-height: var(--prose-table-leading);
  }

  .prose :where(table:not([class])) :where(th, td) {
    padding-block: var(--prose-table-cell-padding-block);
    padding-inline: var(--prose-table-cell-padding-start) var(--prose-table-cell-padding-end);
    border-block-end: var(--prose-table-rule-width) solid var(--prose-table-rule);
    text-align: start;
    vertical-align: top;
  }

  .prose :where(table:not([class])) :where(th) {
    color: var(--prose-table-head-color);
    font: var(--prose-table-head-font);
    letter-spacing: var(--prose-table-head-tracking);
  }

  .prose :where(table:not([class])) :where(thead th) {
    border-block-end-color: var(--prose-table-rule-head);
  }
}
