/* Color palettes */
body.light {
    --background: #fbfff7;
    --background-alt: white;
    --text: #444;
    --primary: #64ac73;
    --primary-alt: #488042;
    --secondary: #835454;
    --secondary-alt: #b17d84;
}

body.dark {
    --background: #222;
    --background-alt: #333;
    --text: #fbfff7;
    --primary: #A6C9AD;
    --primary-alt: #80b68b;
    --secondary: #DB995A;
    --secondary-alt: #E5B68A;
}

/* Fonts */
@font-face {
    font-family: 'DM Mono';
    font-style: normal;
    font-display: swap;
    src: url("/fonts/DMMono-Regular.ttf");
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-display: block;
    src: url("/fonts/DMSans.ttf");
}

@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-display: swap;
    src: url("/fonts/DMSans-Italic.ttf");
}


/* Styling */
body {
    margin: 0px 8px;
    background-color: var(--background);
    color: var(--text);

    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;

    font-size: 16pt;
    line-height: 1.8em;

    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    scrollbar-gutter: stable;
}

#page {
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

header {
    padding: 0.5em 8px 1em 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--secondary) !important;
    background: linear-gradient(in hsl, var(--background), var(--background) 2.5em, transparent);
    z-index: 100;
}

footer {
    display: flex;
    align-items: center;
}

#intensionad {
    color: var(--text);
    font-size: 75%;
    width: 11em;
    opacity: 20%;
}

/* Resizing to look good on mobile and desktop */
@media (min-width: 816px) {
    article { min-width: 800px; }
    
    header {
        position: sticky;
        top: 0;
        height: 2em;
    }
}

@media (max-width: 815px) {
    header {
        flex-direction: column;
    }

    #page {
        width: 100%;
    }
}

@media (max-width: 450px) {
    body {
        font-size: 14px;
    }
}

/* Nav bar */
#logo {
    mask-image: url("/logo.svg");
    mask-size: contain;
    mask-repeat: no-repeat;
    height: 1.66em;
    width: 4.39em;
    background-color: var(--secondary);
}

#themebtn svg {
    vertical-align: -0.25em;
}

body.light #themebtn svg.light {
    display: none;
}

body.dark #themebtn svg.dark {
    display: none;
}

nav * {
    margin: 0 0.2em;
    cursor: pointer;
    user-select: none;
}

nav > a {
    padding: 0 0.2em;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border 0.25s ease;
}

nav > a:hover {
    border-bottom-color: var(--secondary-alt);
}

nav > a.selected {
    border-bottom: 1px solid var(--secondary);
}

/* Article styling */
article *:first-child {
    margin-top: 0;
}

article h1, h2, h3, h4, h5, h6 {
    color: var(--primary);
    font-weight: 500;
}

article p {
    text-align: justify;
    text-align-last: left;
}

article table {
    border-collapse: collapse;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--background-alt);
}

article th:not(:empty), td {
    border: 1px solid var(--text);
    padding: 4px;
}

article th:empty {
    border: none;
}

main a:link {
    color: var(--primary);
    text-decoration: none;
}

main a:visited {
    color: var(--primary-alt);
    text-decoration: none;
}

main a:hover {
    color: var(--primary-alt);
    text-decoration: underline;
}

/* Page header */
.info {
    margin-top: -1.5em;
    font-size: 0.8em;
}

.date {
    color: gray;
    margin-right: 16px;
}

/* Tag lists */
.taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.33em;
    align-items: center;
}

.taglist .tag {
    margin: 0.1em;
}

.tag {
    padding: 0.2em 0.5em;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.5em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    height: 1em;
}

.tag:hover {
    text-decoration: none;
}

.tagname::before {
    content: '#';
}

.tag:hover .tagname {
    text-decoration: underline;
}

.tagsize {
    font-size: 0.75em;
    color: gray;
    align-self: middle;
}

/* Page list object */
.pagelist {
    background-color: unset;
    width: 100%;
}

.pagelist th, td {
    border: none;
}

.pagelist tr {
    height: 32px;
}

.pagelist td:last-child {
    text-align: right;
    font-family: "DM Mono", monospace;
    color: gray;
    vertical-align: text-top;
}