/***
    The new CSS reset - version 1.8.4 (last updated 14.2.2023)
    GitHub page: https://github.com/elad2412/the-new-css-reset
***/

/*
    Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
    - The "symbol *" part is to solve Firefox SVG sprite bug
 */
*:where(
        :not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)
    ) {
    all: unset;
    display: revert;
}

/* Preferred box-sizing value */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reapply the pointer cursor for anchor tags */
a,
button {
    cursor: revert;
}

/* For images to not be able to exceed their container */
img {
    max-inline-size: 100%;
    max-block-size: 100%;
}

/* removes spacing between cells in tables */
table {
    border-collapse: collapse;
}

/* Safari - solving issue when using user-select:none on the <body> text input doesn't working */
input,
textarea {
    user-select: auto;
    -webkit-user-select: auto;
}

/* revert the 'white-space' property for textarea elements on Safari */
textarea {
    white-space: revert;
}

/* minimum style to allow to style meter element */
meter {
    -webkit-appearance: revert;
    appearance: revert;
}

/* preformatted text - use only for this feature */
:where(pre) {
    all: revert;
}

/* reset default text opacity of input placeholder */
::placeholder {
    color: unset;
}

/* remove default dot (•) sign */
::marker {
    content: initial;
}

/* fix the feature of 'hidden' attribute.
   display:revert; revert to element instead of attribute */
:where([hidden]) {
    display: none;
}

/* revert for bug in Chromium browsers
   - fix for the content editable attribute will work properly.
   - webkit-user-select: auto; added for Safari in case of using user-select:none on wrapper element*/
:where([contenteditable]:not([contenteditable="false"])) {
    -moz-user-modify: read-write;
    -webkit-user-modify: read-write;
    overflow-wrap: break-word;
    line-break: after-white-space;
    -webkit-line-break: after-white-space;
    user-select: auto;
    -webkit-user-select: auto;
}

/* apply back the draggable feature - exist only in Chromium and Safari */
:where([draggable="true"]) {
    -webkit-user-drag: element;
}

/* Revert Modal native behavior */
:where(dialog:modal) {
    all: revert;
}

/*
 * Switch to border-box model for all elements
 * Avoid min-width: auto on flex and grid items
 */
*,
*::before,
*::after {
    box-sizing: border-box;
    min-width: 0;
}

/* Break words to prevent overflows */
html {
    overflow-wrap: break-word;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    min-height: 100dvh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
}

/* Remove default margin and padding */
*:where(body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
    margin: 0;
    padding: 0;
}

/* Remove list styles if they have a class */
*:where(ol, ul):where([class]) {
    list-style: none;
    padding-left: 0;
}

/* Prevent elements to exceed their container */
*:where(
        img,
        table,
        td,
        blockquote,
        pre,
        code,
        input,
        textarea,
        select,
        video,
        svg,
        iframe
    ) {
    max-width: 100%;
}

/* Keep aspect-ratio */
*:where(iframe, img, input, select, textarea) {
    height: auto;
}

/* Give links default styles */
:where(a:not([class])) {
    text-decoration-skip-ink: auto;
}

/* Styles for tables */
:where(table) {
    table-layout: fixed;
    border-collapse: collapse;
    vertical-align: top;
}

/* Remove border on images and iframes */
:where(img, iframe) {
    border-style: none;
}

/* Fill color matching to text color */
:where(svg:not([fill])) {
    fill: currentColor;
}

/*
  * 1. Change the inconsistent appearance in all browsers.
  * 2. Add typography inheritance in all browsers.
  */
:where(input, button, textarea, select) {
    margin: 0;
    background-color: transparent; /* 1 */
    color: inherit; /* 1 */
    font-family: inherit; /* 2 */
    font-size: inherit; /* 2 */
    line-height: inherit; /* 2 */
    letter-spacing: inherit; /* 2 */
    vertical-align: middle;
}

/*
  * 1. Correct the inheritance and scaling of font size in all browsers.
  * 2. Correct the odd `em` font sizing in all browsers.
  */

:where(pre, code, kbd, samp) {
    font-family: monospace, monospace; /* 1 */
    font-size: 1em; /* 2 */
}

:where(pre) {
    tab-size: 2;
    white-space: pre-wrap;
    line-height: normal;
    overflow: auto;
}

:where(form, fieldset) {
    border: none;
}

:where(fieldset) {
    margin: 0;
    padding: 1em;
}

:where(legend) {
    max-width: 100%;
    border: 0;
    color: inherit;
    white-space: normal;
}

:where(label) {
    display: inline-block;
    cursor: pointer;
}

:where(textarea) {
    overflow: auto;
    vertical-align: top;
    resize: vertical;
    white-space: pre-wrap;
}

/*
  * Change the cursor on busy elements in all browsers.
  */

:where([aria-busy="true"]) {
    cursor: progress;
}

/*
  * Change the cursor on control elements in all browsers.
  */

:where([aria-controls]) {
    cursor: pointer;
}

/*
  * Change the cursor on disabled, not-editable, or otherwise
  * inoperable elements in all browsers.
  */

:where([aria-disabled="true"], [disabled]) {
    cursor: not-allowed;
}

/*
  * Change the display on visually hidden accessible elements
  * in all browsers.
  */

:where([aria-hidden="false"][hidden]) {
    display: revert;
}

:where([aria-hidden="false"][hidden]:not(:focus)) {
    clip: rect(0, 0, 0, 0);
    position: absolute;
}

/* Remove all animations on demand */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
    }
}

/**
 * Bootstrap
 */

@media (prefers-reduced-motion: no-preference) {
    :root {
        scroll-behavior: smooth;
    }
}