@font-face { 
    src:
        local('Source Code Pro'), 
        url('../assets/Source_Code_Pro/SourceCodePro-Regular.ttf') format('truetype');
    font-family: 'Source Code Pro';
}

:root 
{
    --open-website-nav-btn_size: 3rem;
    --open-website-nav-btn_margin: 2rem;
    --open-website-nav-btn_fs: 3rem;

    --background-color: rgb(26, 28, 32);
    --text-color: rgb(236, 239, 242);
    --delimiter-color: rgb(46, 48, 57);
    --link-color: rgb(115, 122, 222);
    --time-color: rgb(140, 144, 161);
    --quote-color: rgb(140, 144, 161);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: sans-serif;
}

code {
    font-family: "Source Code Pro", monospace;
}

.code-block {
    white-space-collapse: preserve;    
}

time {
    font-family: serif;
}

main {    
    margin: .75em;
    /* This margin is to let the text at the bottom of the page not be covered by #open-website-nav-btn */
    margin-bottom: calc(var(--open-website-nav-btn_size) + 2*var(--open-website-nav-btn_margin));
    font-size: 1.15rem;

    max-width: 72ch;
    flex-grow: 2;
}

@media (min-width: 850px) {
    main {
        margin-top: 1em;
        margin-inline: 1em;
        font-size: 1.25rem;
    }
}

@media (min-width: 1050px) {  
    main {
        margin-bottom: 1em;
        /* font-size: 1.25rem; */
    }
}

h1 {
    line-height: 3rem;
}

code {
    color: rgb(255, 132, 132);
}
time {
    color: rgb(177, 182, 201);
}

a {
    color: var(--link-color);
    overflow-wrap: break-word;
}
.static-link {
    overflow-wrap: break-word;
}

a:hover {
    color: rgb(88, 95, 222);
}

a, button {
    cursor: pointer;
}

q {
    color: var(--quote-color);
}

/* p, ul, ol {
    max-width: 80ch;
} */

p {
    line-height: 1.6;
    margin-block: .5rem;
}

ul, ol {
    line-height: 1.5;
    list-style-position: inside;
}

li > ul {
    margin-bottom: .5em;
    margin-left: 1em;
}

hr {
    border: 1px solid var(--delimiter-color);
}

iframe {
    border: none;
}

img {
    max-width: 100%;
}

#website-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    height: 100vh;
    min-width: 30vw;
    /* I specify the font-size in the parent because of the padding in em */
    font-size: var(--open-website-nav-btn_fs);
    padding: 1em;
    box-shadow: -1px 0px 7px rgb(133, 133, 133);
    background-color: rgb(26, 28, 32);
    
    flex-direction: column;
    justify-content: end;
}

/* E.g. while the nav is open, it isn't allowed to see an image fullscreen. */
body:has(#website-nav.flex) main > * {
    pointer-events: none;
}

#website-nav ul {
    font-size: inherit;
    line-height: 1.2;
    list-style: none;
    white-space: nowrap;
    /* text-align: right; */
}

#website-nav > button {
    /* only for desktop */
    display: none;
    margin-top: 5vh;
    background: unset;
    border: unset;
    font-size: 2rem;
    color: rgb(164, 164, 164);
    margin-left: auto;
    border-radius: 8px;
} 

#website-nav > button[title='minify nav'] {
    padding-right: .5em;
}
#website-nav > button[title='expand nav'] {
    padding-left: .5em;
}

#website-nav > button:hover {
    background-color: rgb(73 73 73 / 36%);
}

#open-website-nav-btn 
{
    background-color: var(--background-color);
    position: fixed;
    border-radius: 8px;
    bottom: var(--open-website-nav-btn_margin);
    right: var(--open-website-nav-btn_margin);

    padding: .85rem .65rem;

    border: 1px solid var(--link-color);
    transition: all 0.035s ease;
    /* box-shadow: 0 1px 2px rgba(46, 48, 57, 0.05); */
}

#open-website-nav-btn:hover {
    border-color: #999;
    box-shadow: 0 2px 4px rgba(46, 48, 57, 0.08);
}

#open-website-nav-btn:active {
    box-shadow: 0 1px 2px rgba(46, 48, 57, 0.1);
    transform: translateY(1px);
}

#open-website-nav-btn span[role=img] {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

#open-website-nav-btn span[role=img] span {
    width: 2.5rem;
    height: 4px;
    border-radius: 8px;
    background-color: var(--link-color);
}

/* 
  Desktop version */

@media (min-width: 1050px) {    
    body {
        display: flex;
        align-items: start;
        justify-content: center;
    }

    #website-nav {
        display: block;
        position: sticky;
        top: 0;
        min-width: unset;
        border-left: 1px solid var(--delimiter-color);
        box-shadow: unset;
        background-color: unset;
    }

    #website-nav > button.display-block {
        display: block;
    }

    #website-nav:has(.minified-list) {
        border-left: unset;
        padding-inline: 0;
    }
    .minified-list li a {
        visibility: hidden;
        font-size: 0;
    }

    #open-website-nav-btn {
        display: none;
    }
}  

/*
 * States */

.flex {
    display: flex;
}

.display-block {
    display: block;
}

.display-inline-block {
    display: inline-block;
}

.display-none {
    display: none;
}

.display-opaque {
    opacity: .5;
}
.display-opaque a,
.display-opaque button {
    pointer-events: none;
}

/* .hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
} */

/* body:has(.fullscreen) * {
    pointer-events: none;
} */


