/* ===========================
   IMPORTS & VARIABLES
   =========================== */
@import url('https://fonts.cdnfonts.com/css/work-sans');

:root {
    --header-height: 100px;
    --sidebar-width: 400px;
}


/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    box-sizing: border-box;
    font-family: 'Work Sans', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    padding: 0;
    margin: 0;
    border: 0;
}


/* ===========================
   TYPOGRAPHY
   =========================== */
a {
    display: inline-block;
    color: rgb(0, 0, 0);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: blue;
}

pre,
code {
    text-wrap: wrap;
    font-family: monospace !important;
    font-size: 1.1em;
    background-color: #DDD;
    border-radius: 3px;
}

p > code {
    font-size: 1.1em;
    background-color: #DDD;
}


/* ===========================
   HEADER
   =========================== */
header {
    position: fixed;
    top: 0;
    padding: 20px;
    background-color: white;
    height: var(--header-height);
    font-weight: normal;
    font-size: 2em;
    z-index: 999;
    width: 100%;
}

header h1 {
    font-size: 0.9em;
    font-weight: 500;
    margin: 0;
}

header button {
    background-color: white;
    border: 1px solid #000;
    padding: 10px 20px;
    border-radius: 50px;
}

header button:hover {
    background-color: blue;
    color: #FFF;
    cursor: pointer;
}


/* ===========================
   MAIN LAYOUT
   =========================== */
main {
    display: flex;
    flex-wrap: wrap;
    min-height: 80vh;
    padding: 20px;
}


/* ===========================
   SIDEBAR
   =========================== */
main .sidebar {
    position: fixed;
    top: calc(40px + var(--header-height));
    max-width: var(--sidebar-width);
    max-height: 100vh;
}

main  .sidebar h2 {
    font-size: 1.2em;
}

main .sidebar ul {
    padding: 0;
    margin: 0;
    background-color: white;
    height: 75vh;
    overflow-y: scroll;
}

main .sidebar li {
    list-style-type: none;
    line-height: 1.6em;
}

.sidebar ul li > a {
    font-weight: 600;
    text-decoration: none;
    font-size: 1.3em;
}

.sidebar ul li > a:hover {
    text-decoration: none;
    color: blue;
}


/* ===========================
   CONTENT AREA
   =========================== */
#content {
    max-width: 800px;
    margin-left: calc(var(--sidebar-width) + 60px);
    margin-top: calc(40px + var(--header-height));
}

#content p {
    line-height: 1.3em;
    width: 90%;
}

#content h1{
    font-size: 3em;
}

#content h2 {
    margin-left: -25px;
    margin-top: 30px;
    padding-top: 30px;
}

#content h2[id] {
    scroll-margin-top: var(--header-height);
}

#content img {
    max-width: 100%;
    /* filter: drop-shadow(0 0 0.75rem #999); */

}

#content video {
    margin: 20px 0px;
    filter: drop-shadow(0 0 0.75rem #999);
}

#content figure {
    margin: 20px 0px;
}

#content figure figcaption {
    font-size: 0.8em;
    color: #666;
}

#content hr {
    border-top: 1px solid #000;
    margin-top: 40px;
}

#content p a,#content li a{
    text-decoration: underline;
}

#content p a::after, #content li a::after{
    content:" ↗";
}


/* ===========================
   LISTS & POSTS
   =========================== */
#list-posts {
    width: 90%;
}

#list-posts li {
    border-bottom: 1px solid #EEE;
    padding: 10px 0px;
}

#list-posts li time {
    font-size: 0.8em;
    display: block;
    line-height: 0.8em;
    margin: 6px 0;
}

#list-posts-mobile {
    display: none;
}

#liste-cours {
    padding: 0;
    margin: 0;
    margin-top: 40px;
}

#liste-cours li {
    list-style-type: none;
}

#liste-cours li img {
    max-width: 300px;
}


/* ===========================
   COMPONENTS
   =========================== */
.tag {
    font-size: 0.8em;
    padding: 2px 6px;
    border: 1px solid #666;
    border-radius: 10px;
}

.tag a {
    color: #666 !important;
}

.selected::before {
    content: "# ";
}

.toc {
    font-size: 0.8em;
    margin-top:20px;
    font-weight: normal;
}

.toc ol {
    padding: 0;
    margin: 0;
}

.toc a.active {
    color: blue;
}


/* ===========================
   CANVAS & RENDER
   =========================== */
#canvasDiv {
    position: absolute;
    top: var(--header-height);
    left: 0;
    z-index: -1;
}

#md {
    display: none;
}

#render {
    max-width: 100%;
}

#render img {
    max-width: 300px;
}


/* ===========================
   FOOTER
   =========================== */
footer {
    padding: 20px;
}


/* ===========================
   MEDIA QUERIES
   =========================== */
@media (max-width: 768px) {
    img,
    section {
        max-width: 300px;
    }

    pre,
    code {
        max-width: 300px;
    }

    iframe {
        max-width: 100%;
    }

    header button{
        position: fixed;
        bottom:20px;
        left:20px;
    }

    header h1{
        font-size: 0.8em;
    }

    #list-posts {
        display: none;
    }

    #list-posts-mobile {
        display: block;
        width: calc(100vw - 40px);
    }

    #content {
        margin-left: 0;
        margin-top: calc(var(--header-height));
        max-width: 100%;
    }

    #content h1{
        font-size: 2em;
    }

    #content img {
        min-width: 100%;
    }

    #content video {
        width: 100%;
    }

    main .sidebar .toc,main .sidebar h2 {
        display: none;
    }
}