/*
    My CSS Reset, heavily ripped off from people better at CSS than I am, like:
    * CSS Remedy by Jen Simmons https://github.com/jensimmons/cssremedy
    * Andy Bell https://piccalil.li/blog/a-more-modern-css-reset/
    * Josh W Comeau https://www.joshwcomeau.com/css/custom-css-reset/
    * Mayank https://github.com/mayank99/reset.css
    * Elly Joel https://www.ellyloel.com/projects/modern-css-reset/
    LICENSE: Public Domain
*/

* {
    box-sizing: border-box;
}

*:before,
*:after {
    box-sizing: inherit;
}

html {
    line-height: 1.5;
    line-sizing: normal;

    /* 
        Fixes safari's text-sizing issue https://www.farai.xyz/codelab/blog/strange-safari-codeblocks/ 
    */
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

/*
    Add smooth scrolling unless a user wants reduced motion

*/
@media (prefers-reduced-motion: no-preference) {
    html:focus-within {
        scroll-behavior: smooth;
    }
}

/*
    Adds some margin when yous scroll to an element
*/
:target {
    scroll-margin-block: 5ex;
}

body {
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
}

/*
    Typography helpers
*/

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
}

/*
    Prevent overflowing text
*/
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

caption,
figcaption,
label,
legend {
    line-height: 1.375;
}

/*
    Following two rules are to help with images
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: block;
    vertical-align: middle;
    max-width: 100%;
}

img,
svg,
video,
canvas {
    height: auto;
}

/*
    Prevents weird behavior with font elements: https://iam.farai.xyz/codelab/16px-inputs/
*/
input,
button,
textarea,
select {
    font: inherit;
}

/*
    Things to do with audio elements
*/

audio {
    width: 100%;
}

audio:not([controls]) {
    display: none;
}

/*
    Learnt this the hard way: https://meowni.ca/hidden.is.a.lie.html
*/
[hidden] {
    display: none !important;
}

/*
    To visually hide an element: https://www.a11y-collective.com/blog/visually-hidden/
*/
.visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}html {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
    line-height: 1.5;
}

body {
    margin-inline: auto;
    max-width: 80ch;
    padding: 0.5rem;
}

.highlight > pre {
    padding: 1rem;
    overflow-x: auto;
}

img, svg, video, canvas, audio, iframe, embed, object {
    margin-inline: auto;
}

.scrollable {
    overflow-x: auto;
}
