/*
    udongein.css
    gggentooo, 250416

    styles used in all pages
*/

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=42dot+Sans:wght@300..800&family=M+PLUS+Rounded+1c:wght@300;400;700&display=swap');

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-thumb {
    border: 6px solid rgba(0, 0, 0, 0);
    background-clip: padding-box;
    -webkit-border-radius: 7px;
    background-color: #666666;
}
::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}
::-webkit-scrollbar-corner {
    background-color: transparent;
}

/* Colors */
html {
    --real-white: #fff;

    --popn-white: #f5f4f2;
    --popn-yellow: #f8e02b;
    --popn-green: #31d13e;
    --popn-blue: #306ef5;
    --popn-red: #eb2314;

    --apple-red: #ed7b64;
    --apple-green: #65ac44;

    --main-background-color: #eee;
    --main-text-color: #333;
    --sub-background-color: #333d;
    --sub-background-color-mild: #3333;
    --sub-text-color: #777;
    --inverted-background-color: var(--main-text-color);
    --inverted-text-color: var(--main-background-color);
    --accent-color: var(--popn-red);
}
html.dark {
    --main-background-color: #333;
    --main-text-color: #eee;
    --sub-background-color: #eeed;
    --sub-background-color-mild: #eee3;
    --sub-text-color: #ccc;
    --accent-color: var(--popn-green);
}

/* 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;
}
h1, h2, h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
}
.datestamp {
    font-weight: 300;
    font-size: 0.8em;
    color: var(--sub-text-color);
}
h3 {
    line-height: 100%;
    position: relative;
    margin-top: 16px;
}
h2+h3,
h3:first-child {
    margin-top: 0;
}
h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
}
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;
}
em.alert {
    background-color: var(--sub-background-color);
    font-weight: 400;
    position: relative;
}
em.alert::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 100%;
    background-color: var(--accent-color);
    position: absolute;
    left: -0.5em;
}
em.alert.backup::before {
    background-color: var(--apple-red);
}
em.alert.translate::before {
    background-color: var(--apple-green);
}
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-size: 0.9em;
    font-weight: 500;
    background-color: var(--sub-background-color-mild);
    color: var(--main-text-color);
    font-style: italic;
    position: relative;
    white-space: pre-line;
}
blockquote::before {
    content: '';
    display: inline-block;
    position: absolute;
    width: 2px;
    height: 100%;
    background-color: var(--accent-color);
    left: -8px;
    top: 0;
}
ul {
    max-width: 720px;
    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.5em 0;
}
li:not(:last-child) {
    border-bottom: 1.5px dotted var(--sub-background-color);
}
li>.datestamp::after {
    content: '-';
    display: inline-block;
    padding: 0 4px;
}
a {
    font-weight: 300;
    color: var(--main-text-color);
}
a::after {
    content: '⇒';
}
a:hover {
    color: var(--accent-color);
}
em>a {
    font-weight: 500;
    color: inherit;
}
button {
    font-family: '42dot Sans', 'M PLUS Rounded 1c', 'Verdana', sans-serif;
    font-size: 0.8rem;
    color: var(--main-text-color);
    background: var(--main-background-color);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1.5px solid var(--main-text-color);
    cursor: pointer;
    width: fit-content;
}
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: '42dot Sans', 'M PLUS Rounded 1c', 'Verdana', sans-serif;
    font-weight: 400;
    text-underline-offset: 0.1em;
    background-color: var(--main-background-color);
    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);
}
.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.9rem;
}
header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: baseline;
    padding: 1em 1.5em;
    border-radius: 6px;
    border: 1px dashed var(--sub-text-color);
}
header .pagetitle {
    font-weight: 300;
    font-size: 1.4em;
    color: var(--main-text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.2em;
}
header .pagetitle::before {
    content: '';
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    background-image: url(../img/favicon.ico);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
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;
}
.buttons-absolute {
    position: fixed;
    bottom: 4rem;
    right: 4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}
.buttons-absolute>button {
    color: var(--sub-text-color);
    border: 1px solid var(--sub-text-color);
    font-weight: 300;
}

/* Functionality */
.hide {
    display: none !important;
}
.button.fold {
    margin-left: auto;
    min-width: fit-content;
}
.ja {
    color: var(--sub-text-color);
    font-size: 0.8em;
}

/* Decorations */
.official::before {
    content: "공식";
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    margin-right: 0.5em;
}

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