@layer posti.reset, posti.design-tokens.core, posti.theme;

@layer posti.reset {
  /* 1. Use a more-intuitive box-sizing model */
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    box-sizing: border-box;
    /* 2. Remove default margin */
    margin: 0;
    padding: 0;
    /* 3. Enforce consistent font family */
    font-family: var(
      --postids-font-family-posti,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      Roboto,
      Helvetica,
      Arial,
      sans-serif,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol"
    );
  }

  body {
    /* 4. Add accessible line-height */
    line-height: 1.5;
    /* 5. Improve text rendering */
    -webkit-font-smoothing: antialiased;
  }

  /* 6. Improve media defaults */
  img,
  picture,
  video,
  canvas {
    display: block;
    max-width: 100%;
    height: auto;
  }

  /* 7. Inherit fonts for form controls */
  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  /* 8. Avoid text overflows */
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  /* 9. Improve line wrapping */
  p {
    text-wrap: pretty;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }

  /*
  10. Create a root stacking context
*/
  #root {
    isolation: isolate;
  }

  /* 11. Remove default list styles */
  ol,
  ul,
  menu {
    list-style: "";
  }

  /* 12. Provide buffer spacing when directing to :target links */
  :target,
  :is(h1, h2, h3, h4, h5, h6) {
    scroll-margin-block-start: 3rem;
  }

  /* 13. Enable keyword animations */
  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }
}
