/*
    udongein.css
    gggentooo, 250416

    styles used in all pages
*/

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

/* Fonts */
@font-face {
    font-family: "Naru";
    src: url("../fonts/Naru-thin.woff2") format("woff2");
    font-weight: 300;
}
@font-face {
    font-family: "Naru";
    src: url("../fonts/Naru-regular.woff2") format("woff2");
    font-weight: 500;
}
@font-face {
    font-family: "Naru";
    src: url("../fonts/Naru-bold.woff2") format("woff2");
    font-weight: 700;
}
@font-face {
    font-family: "M Plus";
    src: url("../fonts/Mplus1-Light.woff2") format("woff2");
    font-weight: 300;
}
@font-face {
    font-family: "M Plus";
    src: url("../fonts/Mplus1-500.woff2") format("woff2");
    font-weight: 500;
}
@font-face {
    font-family: "M Plus";
    src: url("../fonts/Mplus1-Bold.woff2") format("woff2");
    font-weight: 700;
}

/* Colors */
html {
    --main-background-color: #222;
    --main-text-color: #eee;
    --sub-background-color: #222d;
    --sub-background-color-mild: #ddd6;
    --sub-text-color: #ccc;
    --accent-color: #ef0f56;
    --inverted-background-color: var(--main-text-color);
    --inverted-text-color: var(--main-background-color);
}

/* Text size */
html {
    font-size: 16px;
}

/* Text styles */
h1, h2, h3, h4, h5, h6, p, a {
    color: var(--main-text-color);
}
h1 {
    font-size: 1.8em;
    margin-bottom: -1rem;
    padding-bottom: 0.2rem;
    border-bottom: 1.5px dashed var(--main-text-color);
}
.datestamp {
    font-weight: 300;
    font-size: 0.8em;
    color: var(--sub-text-color);
}
h3 {
    line-height: 120%;
    position: relative;
    margin-top: 16px;
}
h4 {
    padding: 0.2rem;
    background: var(--inverted-background-color);
    color: var(--inverted-text-color);
}
h4:not(:first-child) {
    margin-top: 0.5rem;
}
h2+h3,
h3:first-child {
    margin-top: 0;
}
h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    position: absolute;
    left: -12px;
    bottom: 4px;
}
h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
}
p {
    line-height: 160%;
    white-space: pre-line;
}
em {
    padding: 0 4px;
    background-color: var(--inverted-background-color);
    color: var(--inverted-text-color);
    font-style: normal;
    font-weight: bold;
}
q {
    font-weight: 700;
    color: var(--sub-text-color);
    font-style: italic;
    font-weight: bold;
}
small {
    color: var(--sub-text-color);
}
code {
    font-weight: 300;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--sub-background-color);
    color: var(--inverted-text-color);
    white-space: nowrap;
}
blockquote {
    max-width: 720px;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 700;
    background-color: var(--sub-background-color-mild);
    color: var(--main-text-color);
    font-style: italic;
    position: relative;
}
blockquote::before {
    content: '';
    display: inline-block;
    position: absolute;
    width: 2px;
    height: 100%;
    background-color: var(--accent-color);
    left: -8px;
    top: 0;
}
ul {
    position: relative;
    color: var(--main-text-color);
    list-style-position: inside;
    list-style-type: "◈  ";
}
ul ul {
    padding-left: 2em;
    list-style-type: "⟐  ";
}
li {
    padding: 0.2em 0;
    line-height: 1.5em;
}
li:not(:last-child) {
    border-bottom: 1px dashed var(--sub-background-color-mild);
}
li>.datestamp::after {
    content: '-';
    display: inline-block;
    padding: 0 4px;
}
a {
    font-weight: 300;
    color: var(--sub-text-color);
    font-size: 0.9em;
    text-decoration-style: dashed;
    text-underline-offset: 0.25rem;
}
a::after {
    content: '⇒';
}
a:hover {
    color: var(--accent-color);
}
button {
    font-family: 'Naru', 'Verdana', sans-serif;
    font-weight: 500;
    font-size: 0.8em;
    color: var(--main-text-color);
    background: var(--main-background-color);
    padding: 0 8px;
    border-radius: 4px;
    border: 1.5px solid var(--main-text-color);
    cursor: pointer;
    width: fit-content;
    height: 1.5rem;
}
button:hover {
    color: var(--inverted-text-color);
    background: var(--inverted-background-color);
}
*:focus {
    outline: 2px solid var(--main-background-color);
    box-shadow: 0 0 2px 4px var(--accent-color);
}
*:target {
    animation-name: flash_accent;
    animation-duration: 4s;
    animation-timing-function: ease-in-out;
}
@keyframes flash_accent {
    from {
        color: var(--accent-color);
    }
    to {
        color: var(--main-text-color);
    }
}

/* Wrappers and layouts */
body {
    font-family: 'Naru', 'Verdana', sans-serif;
    font-weight: 300;
    text-underline-offset: 0.2em;
    background-color: var(--sub-background-color);
    background: linear-gradient(171deg,rgba(42, 95, 155, 0.5) 21%, rgba(87, 199, 133, 0.5) 50%, rgba(237, 221, 83, 0.5) 66%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
    padding: 3em 1.5em;
}
section,
header,
footer,
.maxwidth_wrapper {
    width: 100%;
    max-width: 1200px;
}
section {
    display: flex;
    flex-direction: column;
    gap: 1em;
    padding: 1em 1.5em;
    border-radius: 6px;
    /* border: 3px double var(--sub-text-color); */
    background-color: var(--main-background-color);
}
section>section {
    gap: 0.25em;
    padding: 1em;
    border: 1px dashed var(--sub-text-color);
}
.horizontal_wrapper {
    display: flex;
    flex-direction: row;
    gap: 1em;
}
.horizontal_wrapper>.horizontal_element {
    width: 100%;
    padding: 0.5em 1em;
    border-radius: 6px;
    border: 1px dotted var(--sub-text-color);
}
.horizontal_wrapper>.horizontal_element li {
    font-size: 0.8em;
}
header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 1em 1.5em;
    border-radius: 6px;
    /* border: 1px dashed var(--sub-text-color); */
    background-color: var(--main-background-color);
}
header .pagetitle {
    font-weight: 500;
    font-size: 1.2em;
    color: var(--main-text-color);
    cursor: pointer;
}
nav {
    display: flex;
    gap: 1em;
    padding-left: 2em;
}
nav>*::before {
    content: '⟐';
    display: inline-block;
    padding-right: 1em;
}
header>button.darkmode {
    margin-left: auto;
}
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    padding-bottom: 1em;
}
.lang_buttons {
    display: flex;
    gap: 1em;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: -1em 0;
}

/* Functionality */
.hide {
    display: none;
}
.faint {
    color: var(--sub-text-color);
    font-size: 0.9em;
}

/* Mobile layout */
@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    header {
        gap: 0.5em;
    }
    nav {
        width: 100%;
        padding: 0;
    }
    nav>*::before {
        padding-right: 0.5em;
    }
    .horizontal_wrapper {
        flex-direction: column;
    }
    .lang_buttons {
        flex-direction: column;
    }
}