/*
Credit to Andy Bell's Modern CSS Reset
@link https://piccalil.li/blog/a-modern-css-reset/

🟣 = additions by Stephanie Eckles 
Twitter/Github/Codepen: @5t3ph
*/

/* Box sizing rules */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, 
which suggests default styling will be removed 

🟣 Selector updated to reduce specificity
*/
:where(ul, ol):where([role="list"]) {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Set core root defaults */
html:focus-within {
    scroll-behavior: smooth;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    line-height: 1.5;
    text-rendering: optimizeSpeed;
    /* 🟣 Set base font-family */
    font-family: system-ui, sans-serif;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    /* 🟣 Relatively sized thickness and offset */
    text-decoration-thickness: max(0.08em, 1px);
    text-underline-offset: 0.15em;
}

/* Make images easier to work with */
img,
picture,
/* 🟣 Add svg */
svg {
    display: block;
    max-width: 100%;
}

/* 🟣 Ensure images with a width attr responsively resize */
img[width] {
    height: auto;
}

/* 🟣 Give SVGs common baseline */
svg {
    /* Inherit from text color */
    fill: currentColor;

    /* Allow click events to "fall through" */
    pointer-events: none;
}

/* 🟣 Scroll margin allowance above anchor links */
:target {
    scroll-margin-top: 2rem;
}

/* 🟣 Scroll margin allowance below focused elements 
to ensure they are clearly in view */
:focus {
    scroll-margin-bottom: 8vh;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}