@import 'fonts';
@import 'styles';
@import './toastify.scss';
@import './colors.scss';

:root {
  --breakpoint-xs-width : #{$breakpoint-xs-width};
  --breakpoint-s-width : #{$breakpoint-s-width};
  --breakpoint-m-width : #{$breakpoint-m-width};
  --breakpoint-l-width : #{$breakpoint-l-width};
  --scrollbar-width: 17px;
  --nav-width: #{base(9)};

  --theme-bg: var(--theme-elevation-0);
  --theme-input-bg: var(--theme-elevation-0);
  --theme-text: var(--theme-elevation-800);
  --theme-baseline: #{$baseline-px};
  --theme-baseline-body-size: #{$baseline-body-size};
  --font-body: 'Suisse Intl', system-ui;
  --font-mono: monospace;
  --font-serif: 'Merriweather', serif;

  --z-popup: 10;
  --z-nav: 20;
  --z-modal: 30;
  --z-status: 40;

  --gutter-h: #{base(5)};

  @include large-break {
    --gutter-h: #{base(3)};
    --nav-width: #{base(8)};
  }

  @include mid-break {
    --gutter-h: #{base(2)};
    --nav-width: 0px;
  }

  @include small-break {
    --gutter-h: #{base(.5)};
  }
}

/////////////////////////////
// GLOBAL STYLES
/////////////////////////////

* {
  box-sizing: border-box;
}

html {
  @extend %body;
  background: var(--theme-bg);
  -webkit-font-smoothing: antialiased;

  &[data-theme=dark] {
    --theme-bg: var(--theme-elevation-0);
    --theme-text: var(--theme-elevation-1000);
    --theme-input-bg: var(--theme-elevation-50);
    color-scheme: dark;

    ::selection {
      color: var(--color-base-1000);
    }

    ::-moz-selection {
      color: var(--color-base-1000);
    }
  }

  @include mid-break {
    font-size: 12px;
  }
}

html,
body,
#app {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--theme-text);
  margin: 0;
}

::selection {
  background: var(--theme-success-500);
  color: var(--theme-base-800);
}

::-moz-selection {
  background: var(--theme-success-500);
  color: var(--theme-base-800);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1 {
  @extend %h1;
}

h2 {
  @extend %h2;
}

h3 {
  @extend %h3;
}

h4 {
  @extend %h4;
}

h5 {
  @extend %h5;
}

h6 {
  @extend %h6;
}

p {
  margin: 0 0 $baseline;
}

ul,
ol {
  padding-left: $baseline;
  margin: 0 0 $baseline;
}

a {
  color: currentColor;

  &:focus {
    opacity: .8;
    outline: none;
  }

  &:active {
    opacity: .7;
    outline: none;
  }
}

svg {
  vertical-align: middle;
}

dialog {
  width: 100%;
  border: 0;
  padding: 0;
  color: currentColor;
}

.payload__modal-item {
  min-height: 100%;
  background: transparent;
}

.payload__modal-container--enterDone {
  overflow: auto;
}

.payload__modal-item--enter,
.payload__modal-item--enterDone {
  z-index: var(--z-modal);
}

@import '~payload-user-css';
