/* Font Faces */
@font-face {
    font-family: agave;
    src: url(../fonts/mono/Agave-Regular.ttf);
}

@font-face {
    font-family: VictorMonoItalics;
    src: url(../fonts/VictorMono/victormono_italics.ttf);
}

/* Color Scheme */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #5990ac;
        --color-primary-dim: #5990ac7f;
        --color-text: #ffffff;
        --color-text-dim: #ffffff7f;
        --color-background: #000000;
        --color-background-dim: #4a4a4a5a;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        --color-primary: #5990ac;
        --color-primary-dim: #5990ac7f;
        --color-text: #000000;
        --color-text-dim: #5a5a5a;
        --color-background: #ffffff;
        --color-background-dim: #a5a5a57f;
    }
}

/* Body Styles */
body {
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    line-height: 1.6;
    background-color: var(--color-background);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    text-align: left;
    height: 100vh;
    margin: auto;
    margin-inline: 27%;
    transition: margin 0.3s ease-in-out;
}

/* Header and Footer */
header {
    flex: 0;
}

footer {
    width: 100%;
    flex: 0;
    font-size: 0.9rem;
    align-self: center;
    padding: 1rem 0;
    text-align: center;
}

/* Navigation */
nav {
    font-size: 1.1rem;
    margin: auto;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;

    & > a {
        word-wrap: break-word;
    }
}

/* Search Input */
#searchSiteInput {
    background: var(--color-background);
    color: var(--color-text);
    border: 1px solid var(--color-primary);
    border-radius: 5px;
    margin-left: 1rem;
    padding: 0.5rem;

    ::placeholder {
        color: white;
    }

    &:focus {
        outline: none;
    }

    &:active {
        outline: none;
    }
}

#site_search_result {
    margin-top: 0.5rem;
    margin-left: 1rem;
}

a {
    color: #5990ac;
    text-decoration: none;

    /* font-size: 1.4rem; */
    transition: color 150ms ease-in-out;
}

/* Thank you, @kepano! */
a:not(.plain):not(.tag):not(.internal-link):not(.footnote):not(
        .reversefootnote
    ):not(.post-card):not(.notes-card):not(.anchor) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='gray' class='w-6 h-6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25' /%3E%3C/svg%3E%0A");
    background-position: right 33%;
    background-repeat: no-repeat;
    background-size: 0.7em;
    padding-right: 0.75em;
}

a:hover {
    /* color:#5990ac; */
    text-decoration: underline;
}

a:active {
    /* color: white; */
    text-decoration: none;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    padding: 0;
    margin-top: 0.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: left;
    word-break: break-word;
    color: var(--color-primary);
}

h1 {
    font-size: 2.3rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

/* Paragraphs and Body Text */
.body {
    padding: 1rem;
    flex: 1 0 auto;

    & > a,
    & > ul > li > a,
    & > ol > li > a,
    & > ul > li > p > a,
    & > ol > li > p > a,
    & > p > a {
        color: #5990ac;
    }

    & > p {
        margin: 1;
        padding: 1;
    }

    & > a,
    & > p,
    & > ul > li,
    & > ol > li,
    & > ul > li > a,
    & > ol > li > a {
        font-size: 1.1rem;
    }
}

img {
    &:hover {
        opacity: 0.85;
    }
}

img {
    width: 80%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 9px;
}

img:hover {
    opacity: 0.85;
}

/* Embedded Content */
iframe {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 80%;
    height: auto;
}

.all-tags,
.tagged-posts {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;

    & > a {
        font-size: 1.2rem;
        background-color: #1e1e1e;
        border-radius: 5px;
        padding: 0.5rem;
        margin: 0.3rem;
    }
}

.tags-paceholder {
    display: flex;
    margin-bottom: 1rem;
}

.anchor {
    opacity: 0;

    transition: opacity 150ms ease-in-out;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    &:hover {
        .anchor {
            opacity: 1;
        }
    }
}

.tag {
    display: inline-block;
    font-weight: 500;
    background-color: var(--color-background-dim);
    border-radius: 2px;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    width: fit-content;
    padding: 0.3rem;
}

.authors-paceholder {
    display: flex;

    & > p {
        margin: 0;
        margin-bottom: 0.8rem;
    }
}

.author {
    display: inline-block;
    background-color: #1e1e1e;
    border-radius: 2px;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    width: fit-content;
    padding: 0.3rem;
}

.posts {
    display: flex;
    flex-direction: column;
    /* align-items: center; */
    margin: auto;

    & > a {
        background-color: var(--color-background);
        color: var(--color-text);
        border-radius: 5px;
        margin: 0.5rem;
        padding: 0.5rem;
        word-wrap: break-word;
        text-decoration: none;

        transition:
            background-color 150ms ease-in-out,
            scale 0.1s ease-in-out;
    }

    & > a:hover {
        background-color: var(--color-background-dim);
    }

    & > a:active {
        scale: 0.95;
    }
}

.post-description {
    border-bottom: 1px solid var(--color-text-dim);
    margin-bottom: 1rem;
}

.post-card-div {
    color: var(--color-text-dim);
    display: grid;

    & > * {
        padding-inline: 1rem;
    }

    & > p {
        margin: 0;
        padding: 0;
        padding-inline: 1rem;
        margin-left: 1rem;
        font-size: 1.1rem;
    }

    & > h3 {
        margin: 0;
    }
}

.body > img {
    /* center the image wrt the screen*/
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
    margin-bottom: 2rem;

    max-width: 100%;
    height: auto;
    width: auto\9;
    /* ie8 */
}

#chart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#hoverDiv {
    background-color: var(--color-background);

    box-shadow: 0 0 15px #1e1e1e7a;
    margin: 1rem;

    display: flex;
    flex-direction: column;

    padding: 0.5rem;

    border-radius: 0.3rem;

    & > p {
        margin-top: 0.2rem;
        margin-bottom: 0.2rem;
        padding: 0;
        font-size: 0.85rem;
    }

    & > img {
        margin: 0;
        margin-left: auto;
        margin-right: auto;
        border-radius: 0.1rem;
        width: 100%;
        padding: 0;
    }

    & > .date {
        color: var(--color-text-dim);
    }
}

/* Code styling */
/* pre code {
      font-family: agave, monospace;
      display: block;
      background: #41414193;
      border: 1.5px solid #ffffff35;
      border-radius: 5px;
      white-space: pre;
      -webkit-overflow-scrolling: touch;
      overflow-x: scroll;
      max-width: 100%;
      min-width: 100px;
      padding: 1rem;
  } */

pre code {
    font-family: agave, monospace;
    background: white;
    overflow-x: scroll;
    scrollbar-width: none;
    border-radius: 0.5rem;
    line-height: 1.2;
}

pre code.hljs {
    background: #1e1e2d;
}

p > code,
li > code,
dd > code,
td > code {
    font-family: agave, monospace;
    background: #41414193;
    color: white;
    border: 1.5px solid #ffffff35;
    border-radius: 5px;
    word-wrap: break-word;
    font-size: inherit;
    box-decoration-break: clone;
    padding: 0.1rem 0.3rem 0.2rem;
    border-radius: 0.2rem;
}

blockquote {
    & > p {
        font-family: VictorMonoItalics;
        font-size: 1.1rem;
        margin-left: 1rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    border-left: 3px solid var(--color-primary);
    margin-left: 0rem;
}

@media (max-width: 1200px) {
    body {
        margin-inline: 20%;
    }

    iframe {
        width: auto;
        height: auto;
    }

    img {
        width: 90%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 900px) {
    body {
        margin-inline: 15%;
    }

    iframe {
        width: auto;
        height: auto;
    }

    img {
        width: 90%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 650px) {
    nav {
        font-size: 1.05rem;
    }

    iframe {
        width: auto;
        height: auto;
    }

    body {
        margin-inline: 8%;
    }

    footer {
        font-size: 1rem;
    }

    img {
        width: 90%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .body {
        & > a,
        & > p,
        & > ul > li,
        & > ol > li,
        & > ul > li > a,
        & > ol > li > a {
            font-size: 1rem;
        }

        & > h1 {
            font-size: 1.8rem;
        }

        & > h2 {
            font-size: 1.5rem;
        }
    }

    .post-card,
    .notes-card {
        & > p,
        & > .post-card-div > p,
        & > .notes-card-div > p {
            font-size: 0.9rem;
        }

        & > h3 {
            font-size: 1.3rem;
        }
    }

    pre code.hljs {
        width: 95%;
    }

    img {
        width: 100%;
        height: auto;
    }
}
