/* Copyright (C) 2026  decipaliz <decipaliz@disroot.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>. */

@import url('https://fonts.cdnfonts.com/css/br-cobane');
@import url('https://fonts.cdnfonts.com/css/br-shape');
@import url('https://fonts.cdnfonts.com/css/jetbrains-mono-2');

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

:root {
    color-scheme: light dark;

    --clr-white: light-dark(#f5f0e7, #32302f);
    --clr-lightgray: light-dark(#d8d4cb, #3c3836);
    --clr-blue: light-dark(#0073b5, #b8bb26);
    --clr-darkgray: light-dark(#5a5f66, #8e857d);
    --clr-red: #d74647;
    --clr-dark: light-dark(#43474e, #d5c4a1);
    --clr-code: light-dark(#5a5f66, #8ec07c);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--clr-white);
    font-family: 'BR Shape', sans-serif;
    font-size: 1rem;
    line-height: 1.5rem;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

header, .mobile-header-nav-top {
    background-color: var(--clr-lightgray);
    padding: 10px 32px;
    height: 80px;
    display: flex;
    align-items: center;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.header-link {
    font-family: 'BR Cobane', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--clr-blue);
    text-decoration: none;
    border: 3px solid transparent;
    padding: 5px;
}

.header-link:hover {
    border-color: var(--clr-blue);
}

.header-link:active {
    color: var(--clr-lightgray);
    border-color: var(--clr-blue);
    background-color: var(--clr-blue);
}

.header-list {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

main {
    margin: 120px 40px 40px;
}

a, button {
    color: var(--clr-blue);
    text-decoration: none;
    border: 2px solid transparent;
    outline: none;
    background-color: transparent;
    cursor: pointer;
}

a:hover, a:focus, button:hover, button:focus {
    border-color: var(--clr-blue);
}

a:active, button:active {
    color: var(--clr-white);
    border-color: var(--clr-blue);
    background-color: var(--clr-blue);
}

a.no-decor, a.no-decor:hover, a.no-decor:focus, a.no-decor:active {
    border: none;
    outline: none;
    background: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'BR Cobane', sans-serif;
    font-weight: 600;
    color: var(--clr-dark);
    margin: 3rem 0 1rem;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.375rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}


code {
    font-family: 'JetBrains Mono', monospace;
    color: var(--clr-code);
}

footer {
    margin: 0 40px;
    border-top: 2px solid var(--clr-darkgray);
    color: var(--clr-darkgray);
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-list-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.blog-list-item-title h2 {
    margin: 0;
    font-family: 'BR Shape', sans-serif;
    font-size: 1.5rem;
    line-height: 2rem;
}

.blog-list-item-date, .post-date {
    color: var(--clr-darkgray);
}

.blog-list-item-tags, .post-tags ul {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-list-item-tags li, .post-tags li {
    --color: var(--clr-red);
    border: 2px solid var(--color);
    color: var(--color);
    padding: 0 3px;
}

.post-title {
    margin: 0;
}

.post-top {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--clr-darkgray);
}

.post-content {
    margin-top: 40px;
}

.post-content pre {
    overflow-x: auto;
}

.mobile-header-menu {
    display: none;
}

.mobile-header-nav {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: var(--clr-lightgray);
}

.footer-neocities {
    border: none !important;
    background-color: transparent !important;
    padding: 0;
}

.status {
    color: var(--clr-dark);
    margin: 1rem 0;
    font-size: 1.25rem;
}

.status.first {
    margin-top: 2rem;
}

.status::after {
    content: '...';
    animation: status-dots 2s infinite;
}

@keyframes status-dots {
    0%, 100% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

@media (max-width: 769px) {
    .header-list {
        display: none;
    }

    .mobile-header-menu {
        display: block;
    }


    .mobile-header-nav.active {
        opacity: 1;
        pointer-events: unset;
    }

    .mobile-header-nav-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    .mobile-header-nav .header-list {
        display: flex;
        flex-direction: column;
        padding: 0 15px;
    }

    .mobile-header-nav .header-list-item,
    .mobile-header-nav .header-list-item a,
    .mobile-header-nav .header-list-item .header-link {
        display: block;
        width: 100%;
        text-align: center;
    }

    .blog-list-item {
        justify-content: space-between;
    }

    .blog-list-item-title h2 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .blog-list-item-date {
        white-space: nowrap;
        font-size: 0.875rem;
        line-height: 1.325rem;
    }

    .blog-list-item-tags {
        display: none;
    }

    .post-top {
        align-items: start;
        gap: 15px;
        flex-direction: column;
    }

    .post-tags ul {
        flex-wrap: wrap;
    }
}

.header-list-item:has([data-light-button]) {
    display: none;
}

.header-list-item:has([data-dark-button]) {
    display: block;
}

:root[data-theme="dark"] .header-list-item:has([data-light-button]) {
    display: block;
}

:root[data-theme="dark"] .header-list-item:has([data-dark-button]) {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .header-list-item:has([data-light-button]) {
        display: block;
    }

    .header-list-item:has([data-dark-button]) {
        display: none;
    }

    :root[data-theme="light"] .header-list-item:has([data-light-button]) {
        display: none;
    }

    :root[data-theme="light"] .header-list-item:has([data-dark-button]) {
        display: block;
    }
}
