/* https://www.joshwcomeau.com/css/custom-css-reset/ */

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. Remove default margin */
* {
    margin: 0;
}

body {
    /* 3. Add accessible line-height */
    line-height: 1.5;
    /* 4. Improve text rendering */
    -webkit-font-smoothing: antialiased;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
    font: inherit;
}

/* 7. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
/*
J-NOTE:
text-wrap: pretty is not supported in Safari or FF so
I'm removing it from my styles.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

/*
  9. Create a root stacking context
*/
#root,
#__next {
    isolation: isolate;
}

/*

END CSS RESET

*/

:root {
    /* Default font settings */
    /* https://modernfontstacks.com/ >>> Geometric Humanist */
    font-family: Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro,
        sans-serif;
    font-weight: normal;
    font-optical-sizing: auto;
    font-style: normal;
    font-variation-settings: "slnt" 0;

    /* Fluid type scale from utopia.fyi */
    --step--2: clamp(0.7738rem, 0.7838rem + -0.0129vw, 0.7813rem);
    --step--1: clamp(0.9375rem, 0.9048rem + 0.1635vw, 1.0315rem);
    --step-0: clamp(1.125rem, 1.038rem + 0.4348vw, 1.375rem);
    --step-1: clamp(1.35rem, 1.182rem + 0.8398vw, 1.8329rem);
    --step-2: clamp(1.62rem, 1.3337rem + 1.4317vw, 2.4432rem);
    --step-3: clamp(1.944rem, 1.4874rem + 2.2832vw, 3.2568rem);
    --step-4: clamp(2.3328rem, 1.6342rem + 3.4931vw, 4.3413rem);
    --step-5: clamp(2.7994rem, 1.7602rem + 5.1959vw, 5.787rem);

    /* Theme colors */
    --bg: hsl(0, 25%, 95%);
    --fg: hsl(0, 3%, 7%);
    --primary: hsl(41, 100%, 53%);
    --secondary: hsl(199, 60%, 45%);

    --flow-space: 1rem;
}

/* font sizing */
p,
ol,
ul {
    font-size: var(--step-0);
}
code {
    font-size: inherit;
}
h1 {
    font-size: var(--step-4);
}
h2 {
    font-size: var(--step-3);
}
h3 {
    font-size: var(--step-2);
}
h4 {
    font-size: var(--step-1);
}
#copyright {
    font-size: var(--step--2);
}
/*
we want pre and code to inherit font size by default
but we need to also set the font size for top-level code
blocks
*/
.post-container > pre {
    font-size: var(--step-0);
    overflow-x: scroll;
}

/*
=============
GLOBAL LAYOUT
=============
*/

main.content-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#landing,
#about,
#socials,
#blog,
.post-container {
    max-width: min(100ch, 90vw);
    /* Add empty space at the bottom of main containers */
    margin-bottom: 20vh;
}

/* Space adjacent post elements */
.flow > * + * {
    margin-top: var(--flow-space, 1em);
}

/* Used on all non post pages */
.banner {
    padding: 1rem;
    border: 2px solid black;
    text-align: center;
}

/*
=======
NAV BAR
=======
*/

#nav-bar {
    display: flex;
    gap: 2rem;


    @media screen and (max-width: 800px) {
        gap: 1rem;
    }

    @media screen and (max-width: 660px) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr 5px 1fr 1fr;
        gap: 0.5rem;

        > .spacer {
            height: 4px;
            grid-column: 1 / 3;
        }

        > #home {
            grid-column: 1 / 3;
        }

        > #copyright {
            grid-column: 1 / 3;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    padding: 1rem;
    border-bottom: 4px solid black;

    > .spacer {
        border: 1px solid black;
    }
    
}

.nav-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--fg);
    font-weight: bold;
    background: var(--primary);
    padding: 0.5rem;
    border: 2px solid black;
    min-width: fit-content;

    transition:
        transform ease-in 100ms,
        box-shadow ease-in 100ms;
    box-shadow: -4px 4px;
}

.nav-link:hover {
    transform: translate(4px, -4px);
    box-shadow: -10px 10px;
}

.nav-link:active {
    transform: translate(0px, 0px);
    box-shadow: 0px 0px;
}
 
#copyright {
    margin-left: auto;
    align-content: center;
}

/*
============
SOCIALS PAGE
============
*/

#socials-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid black;
}

.social-link {
    text-decoration: none;
    color: var(--fg);
    padding: 1rem;
    font-weight: bold;
    font-size: var(--step-1);
    transition: background-color 200ms linear;
}

.social-link:not(:last-child) {
    border-bottom: 2px solid black;
}

.social-link#github:hover {
    background-color: #6e5494;
}

.social-link#linkedin:hover {
    background-color: #0a66c2;
}

.social-link#bluesky:hover {
    background-color: #0285ff;
}

/*
=====
POSTS
=====
*/

/* section spacing */
/* override flow spacing on headers to separate sections */
h1,
h2,
h3,
h4,
h5 {
    margin-top: calc(var(--flow-space) * 3) !important;
}

/*
add empty space at the bottom of each post so it looks less dumb
*/
.post-container:last-child {
}

.post-container > blockquote {
    padding: 0.5rem;
    margin-left: 2rem;
    border-left: 4px solid var(--primary);
    font-style: italic;
    backdrop-filter: brightness(98%);
}

/* inline monospace text */
:not(pre) > code {
    background-color: #e2e2e2;
    border-radius: 4px;
    border: 2px solid #a8a8a8;
    padding-left: 2px;
    padding-right: 2px;
}

/* full code blocks */
.post-container > pre {
    border: 1px solid black;
    /* This padding applies to code-blocks without a language tagged */
    padding: 1rem;
}

/* IDK why the katex plugin was rendering a MathML and an HTML version
of the same thing. This style rule just hides the HTML version since I
like the rendering of the MathML one better. */
.katex-html {
    display: none;
}

.katex-block {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
