/*
 * Scopes
 *
 */

@use './reset.scss' as reset;
@forward './reset.scss';

@mixin typographyBasis() {
  font-family: var(--font-family-default);
  font-weight: var(--font-weight-basis);
  font-size: var(--font-size-small); // has to be 16px
  font-style: normal;
  line-height: var(--line-height-basis);
  color: var(--token-color-text-neutral, #333);
}

@mixin coreDefault() {
  @include typographyBasis();

  // The new DNB font needs font smoothing to be thinner on webkit and FF
  /* stylelint-disable-next-line */
  -moz-osx-font-smoothing: grayscale;

  /* stylelint-disable-next-line */
  -webkit-font-smoothing: antialiased;

  /* stylelint-disable-next-line */
  -webkit-tap-highlight-color: rgba(0 0 0 / 0);

  /**
  * Ensure consistency and use the same as HTML reset -> html {...}
  * between base and code package
  */
  tab-size: 4;

  /* stylelint-disable-next-line */
  -webkit-text-size-adjust: 100%;

  word-break: break-word;

  // Will add this to the body tag – later we can test for a version mismatch
  --eufemia-version: '11.3.0';

  @content;
}

@mixin bodyDefault() {
  @include reset.reset();
  @include coreDefault();

  @media print {
    // Use hard coded colors, because of theming and color swaps
    background-color: white;
    color: black;
  }

  .eufemia-theme {
    @include typographyBasis();
  }

  @content;
}

@mixin htmlDefault() {
  html {
    &:not([data-visual-test]) {
      scroll-behavior: smooth;

      @media (prefers-reduced-motion: reduce) {
        scroll-behavior: auto;
      }
    }
    font-size: 100%;

    // IS_SAFARI_MOBILE
    @supports (-webkit-touch-callout: none) {
      @supports (font: -apple-system-body) {
        font: -apple-system-body; /* stylelint-disable-line */
      }
    }
  }

  // reset ePlatform css
  @include reset.resetLegacyStyles();
}
