/**
 * Based on https://github.com/sindresorhus/modern-normalize
 *
 * Attributions
 *
 * The MIT License (MIT)
 * Copyright (c) Nicolas Gallagher
 * Copyright (c) Jonathan Neal
 * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
 */

/**
 * We dont support rules like this now, implement box-sizing for each used element
 * *,
 * ::before,
 * ::after {
 *   box-sizing: border-box;
 * }
 */

div,
address,
article,
aside,
figure,
footer,
header,
main,
nav,
section,
form,
label,
time,
h1,
h2,
h3,
h4,
h5,
h6,
i,
img,
a,
li,
ul,
ol,
p,
span {
  /**
   * Use a better box model (opinionated).
   */
  box-sizing: border-box;
}

/**
 * 1. Layout source https://twitter.com/ChallengesCss/status/1471128244720181258
 * 2. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
 * 3. For visual editors
 */
html {
  /* 1 */
  display: grid;
  min-height: 100%;
  /* 2 */
  font-family: Arial, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.2;
  /* webstudio custom opinionated preset */
  /* 3. We decided to use preserve in visual builders:
    Preserves multiple spaces & trailing spaces,
    Matches what users see while editing to final output (Provides more predictable WYSIWYG experience)

  vs text editors' collapse (default): Normalizes multiple spaces into one, Removes trailing whitespace, Better for clean text content
  */
  white-space-collapse: preserve;
}

/**
 * 1. Remove the margin in all browsers.
 */
body {
  /* 1 */
  margin: 0;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * 1. Add the correct height in Firefox.
 * 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
 * 3. width: 100% inside flexbox will overflow <hr> out of it
 */
hr {
  /* 1 */
  height: 0;
  /* 2 */
  color: inherit;
  /* 3 */
  box-sizing: border-box;
}

/**
Add the correct text decoration in Chrome, Edge, and Safari.

!!!Skipped as we don't support this logic!!!

abbr[title] {
  text-decoration: underline dotted;
}
*/

/**
 * Add the correct font weight in Edge and Safari.
 */
b,
strong {
  font-weight: 700;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/**
 * 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
 * 2. Correct the odd 'em' font sizing in all browsers.
 */
code,
kbd,
samp,
pre {
  /* 1 */
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  /* 2 */
  font-size: 1em;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/**
 * Add the correct font size in all browsers.
 */
small {
  font-size: 80%;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/**
 * Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
Tabular data
============
*/

/**
 * 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
 * 2. Correct table border color inheritance in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
 */
table {
  /* 1 */
  text-indent: 0;
  /* 2 */
  border-color: inherit;
  box-sizing: border-box;
}

/*
Forms
=====
*/

input,
textarea,
optgroup,
/* These are non-standard tags, defined this way to be able to access in component presets */
radio,
checkbox,
button,
select {
  /* 1 */
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  /* 2 */
  margin: 0;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/* Input and Textarea uses border style inset by default, wich we don't support in style panel. */
input,
textarea {
  border-style: solid;
}

/*
Radio and checkbox have by default border style "none", we are setting it here to reflect in the style panel.

These are non-standard tags, defined this way to be able to access in component presets
*/
radio,
checkbox {
  border-style: none;
}

/**
 * Remove the inheritance of text transform in Edge and Firefox.
 */
button,
select {
  border-style: solid;
  text-transform: none;
}

/**
Correct the inability to style clickable types in iOS and Safari.

!!!Skipped as we don't support this logic!!!

button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
}
*/

/**
Remove the inner border and padding in Firefox.

!!!Skipped as we don't support this logic!!!

::-moz-focus-inner {
  border-style: none;
  padding: 0;
}
*/

/**
Restore the focus styles unset by the previous rule.

!!!Skipped as we don't support this logic!!!

:-moz-focusring {
  outline: 1px dotted ButtonText;
}
*/

/**
Remove the additional ':invalid' styles in Firefox.
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737

!!!Skipped as we don't support this logic!!!

:-moz-ui-invalid {
  box-shadow: none;
}
*/

/**
 * Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
 */
legend {
  padding: 0;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/**
 * Add the correct vertical alignment in Chrome and Firefox.
 */
progress {
  vertical-align: baseline;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}

/**
Correct the cursor style of increment and decrement buttons in Safari.

!!!Skipped as we don't support this logic!!!

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}
*/

/**
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.

!!!Skipped as we don't support this logic!!!

[type='search'] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}
*/

/**
Remove the inner padding in Chrome and Safari on macOS.

!!!Skipped as we don't support this logic!!!

::-webkit-search-decoration {
  -webkit-appearance: none;
}
*/

/**
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to 'inherit' in Safari.

!!!Skipped as we don't support this logic!!!

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}
*/

/*
Interactive
===========
*/

/**
 * Add the correct display in Chrome and Safari.
 */
summary {
  display: list-item;
  /* webstudio custom opinionated presets */
  box-sizing: border-box;
}
