/* =============================================================================
   QuickCare Design System — BASE ELEMENTS   (@layer qc.base)
   -----------------------------------------------------------------------------
   Token-driven defaults for bare HTML elements. These are LAYERED, so on pages
   still using the legacy stack the unlayered Bootstrap Reboot + base.css win and
   nothing changes. On design-system pages (e.g. /styleguide.html) and migrated
   templates this is the typographic baseline. One family: Roboto.
   ========================================================================== */
@layer qc.base {

  html { line-height: var(--qc-lh-base); }

  body {
    margin: 0;
    font-family: var(--qc-font-base);
    font-size: var(--qc-fs-base);
    font-weight: var(--qc-fw-regular);
    line-height: var(--qc-lh-base);
    color: var(--qc-text);
    background-color: var(--qc-surface-muted);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Headings ---------------------------------------------------------------- */
  h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--qc-space-4);
    font-family: var(--qc-font-heading);
    font-weight: var(--qc-fw-bold);
    line-height: var(--qc-lh-tight);
    letter-spacing: var(--qc-ls-tight);
    color: inherit;                 /* inherit so inverse/dark sections recolor headings too */
    text-wrap: balance;
  }
  h1 { font-size: var(--qc-fs-h1); }
  h2 { font-size: var(--qc-fs-h2); }
  h3 { font-size: var(--qc-fs-h3); }
  h4 { font-size: var(--qc-fs-h4); }
  h5 { font-size: var(--qc-fs-xl); }
  h6 { font-size: var(--qc-fs-lg); }

  /* Text -------------------------------------------------------------------- */
  p { margin: 0 0 var(--qc-space-4); }
  p:last-child { margin-bottom: 0; }

  small { font-size: var(--qc-fs-sm); }
  strong, b { font-weight: var(--qc-fw-bold); }

  a {
    color: var(--qc-color-primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 0.06em;
    transition: color var(--qc-dur-fast) var(--qc-ease-standard);
  }
  a:hover { color: var(--qc-color-primary-dark); }

  /* Lists ------------------------------------------------------------------- */
  ul, ol { margin: 0 0 var(--qc-space-4); padding-left: var(--qc-space-6); }
  li { margin-bottom: var(--qc-space-1); }

  /* Misc -------------------------------------------------------------------- */
  hr {
    border: 0;
    border-top: 1px solid var(--qc-border);
    margin: var(--qc-space-8) 0;
  }

  blockquote {
    margin: 0 0 var(--qc-space-4);
    padding-left: var(--qc-space-4);
    border-left: 4px solid var(--qc-color-primary);
    color: var(--qc-text-muted);
  }

  code, kbd, samp, pre {
    font-family: var(--qc-font-mono);
    font-size: 0.9em;
  }
  code {
    padding: 0.15em 0.35em;
    background: var(--qc-surface-sunken);
    border-radius: var(--qc-radius-sm);
  }
  pre {
    margin: 0 0 var(--qc-space-4);
    padding: var(--qc-space-4);
    overflow: auto;
    background: var(--qc-surface-sunken);
    border-radius: var(--qc-radius-md);
  }
  pre code { padding: 0; background: none; }

  figure { margin: 0 0 var(--qc-space-4); }

  /* Tables ------------------------------------------------------------------ */
  table { border-collapse: collapse; width: 100%; }
  th { text-align: left; font-weight: var(--qc-fw-semibold); }
  th, td {
    padding: var(--qc-space-3) var(--qc-space-4);
    border-bottom: 1px solid var(--qc-border);
  }
}
