/*
 * packages/ui — L2 Base styles (ADR 0014 D6): thẻ HTML trần tự có kiểu chữ.
 * Component không gắn cỡ, màu, độ đậm chữ lên các thẻ này; cần khác thì thêm biến thể vào gói.
 */
@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-400-vietnamese.woff2) format("woff2");
  unicode-range:
    u+0102-0103, u+0110-0111, u+0128-0129, u+0168-0169, u+01a0-01a1,
    u+01af-01b0, u+0300-0301, u+0303-0304, u+0308-0309, u+0323, u+0329,
    u+1ea0-1ef9, u+20ab;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-400-latin-ext.woff2) format("woff2");
  unicode-range:
    u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab,
    u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-400-latin.woff2) format("woff2");
  unicode-range:
    u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215,
    u+feff, u+fffd;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-500-vietnamese.woff2) format("woff2");
  unicode-range:
    u+0102-0103, u+0110-0111, u+0128-0129, u+0168-0169, u+01a0-01a1,
    u+01af-01b0, u+0300-0301, u+0303-0304, u+0308-0309, u+0323, u+0329,
    u+1ea0-1ef9, u+20ab;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-500-latin-ext.woff2) format("woff2");
  unicode-range:
    u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab,
    u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-500-latin.woff2) format("woff2");
  unicode-range:
    u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215,
    u+feff, u+fffd;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-600-vietnamese.woff2) format("woff2");
  unicode-range:
    u+0102-0103, u+0110-0111, u+0128-0129, u+0168-0169, u+01a0-01a1,
    u+01af-01b0, u+0300-0301, u+0303-0304, u+0308-0309, u+0323, u+0329,
    u+1ea0-1ef9, u+20ab;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-600-latin-ext.woff2) format("woff2");
  unicode-range:
    u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab,
    u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-600-latin.woff2) format("woff2");
  unicode-range:
    u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215,
    u+feff, u+fffd;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-700-vietnamese.woff2) format("woff2");
  unicode-range:
    u+0102-0103, u+0110-0111, u+0128-0129, u+0168-0169, u+01a0-01a1,
    u+01af-01b0, u+0300-0301, u+0303-0304, u+0308-0309, u+0323, u+0329,
    u+1ea0-1ef9, u+20ab;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-700-latin-ext.woff2) format("woff2");
  unicode-range:
    u+0100-02ba, u+02bd-02c5, u+02c7-02cc, u+02ce-02d7, u+02dd-02ff, u+0304,
    u+0308, u+0329, u+1d00-1dbf, u+1e00-1e9f, u+1ef2-1eff, u+2020, u+20a0-20ab,
    u+20ad-20c0, u+2113, u+2c60-2c7f, u+a720-a7ff;
}

@font-face {
  font-family: Be Vietnam Pro;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(./fonts/be-vietnam-pro-700-latin.woff2) format("woff2");
  unicode-range:
    u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc, u+0304,
    u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193, u+2212, u+2215,
    u+feff, u+fffd;
}

@layer ds-base {
  *, *::before, *::after { box-sizing: border-box; }

  html { -webkit-text-size-adjust: 100%; }

  body {
    margin: 0;
    font: var(--ds-text-body-md);
    color: var(--ds-ink);
    background: var(--ds-surface-canvas);
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--ds-ink); text-wrap: balance; }
  h1 { font: var(--ds-text-display); letter-spacing: var(--ds-tracking-tight); }
  h2 { font: var(--ds-text-headline); }
  h3 { font: var(--ds-text-title-lg); }
  h4 { font: var(--ds-text-title-md); }
  h5 { font: var(--ds-text-label-lg); }
  h6 { font: var(--ds-text-label-md); color: var(--ds-ink-muted); }

  p { margin: 0; }
  small { font: var(--ds-text-body-sm); color: var(--ds-ink-muted); }
  strong, b { font-weight: var(--ds-weight-semibold); }

  a { color: var(--ds-accent-display); text-decoration: underline; text-underline-offset: var(--ds-underline-offset); }
  a:hover { text-decoration-thickness: var(--ds-border-width-thick); }

  ul, ol { margin: 0; padding-left: var(--ds-space-6); }
  li + li { margin-top: var(--ds-space-1); }

  label, legend { font: var(--ds-text-label-lg); color: var(--ds-ink); }

  code, kbd, samp, pre { font-family: var(--ds-font-mono); font-size: var(--ds-code-scale); }

  hr { border: 0; border-top: var(--ds-border-width) solid var(--ds-line-subtle); margin: var(--ds-space-4) 0; }

  table { border-collapse: collapse; width: 100%; }
  th { font: var(--ds-text-label-lg); text-align: left; color: var(--ds-ink-muted); }
  th, td { padding: var(--ds-space-2) var(--ds-space-3); border-bottom: var(--ds-border-width) solid var(--ds-line-subtle); }

  button, input, select, textarea { font: inherit; color: inherit; }

  ::placeholder { color: var(--ds-ink-placeholder); }
  ::selection { background: var(--ds-accent-faded); color: var(--ds-ink); }

  :focus-visible {
    outline: var(--ds-focus-width) solid var(--ds-focus-ring);
    outline-offset: var(--ds-focus-offset);
  }

  /* Biến thể chữ (D6): component cần chữ khác mặc định của thẻ thì gắn lớp này, không viết font/color lên thẻ */
  .text-muted { color: var(--ds-ink-muted); }
  .text-body-sm { font: var(--ds-text-body-sm); }
  .text-body-md { font: var(--ds-text-body-md); }
  .text-title-lg { font: var(--ds-text-title-lg); }
  .text-headline { font: var(--ds-text-headline); }
  .text-label-md { font: var(--ds-text-label-md); }

  /* Nhịp giữa các khối trong vùng nội dung dài (giáo án, tài liệu) */
  .body-content > * + * { margin-top: var(--ds-space-4); }
  .body-content > :is(h2, h3, h4):not(:first-child) { margin-top: var(--ds-space-8); }
  .body-content p, .body-content li { font: var(--ds-text-body-lg); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: var(--ds-duration-instant); animation-duration: var(--ds-duration-instant); animation-iteration-count: 1; }
  }
}

/* Opt-in modern chrome and its portal host share tokens without changing legacy siblings. */
@layer ds-base {
  .ds-design-scope { min-width: 0; min-height: 0; height: 100%; font: var(--ds-text-body-md); color: var(--ds-ink); background: var(--ds-surface-canvas); color-scheme: light; }
  .ds-design-scope[data-ds-theme="dark"] { color-scheme: dark; }
  .ds-design-scope[data-ds-layout="contents"] { display: contents; }
  .ds-design-portals { position: absolute; inset: 0; pointer-events: none; }
  .ds-design-portals > * { pointer-events: auto; }
}
