@import url(@fontsource-variable/jetbrains-mono/index.css);
/* Global Styles for Terminal Blog */
:root {
    /* Dark theme (default) */
    --bg-color: #2e3440;
    --text-color: #d8dee9;
    --secondary-text-color: #c8c8c8;
    --accent-color: #90a8c0;
    --secondary-color: #7890a8;
    --border-color: #3b4351;
    --header-color: #eceff4;
    --terminal-green: #a3be8c;
    --terminal-yellow: #ebcb8b;
    --terminal-red: #bf616a;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Light theme */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg-color: #eceff4;
        --text-color: #2e3440;
        --secondary-text-color: #4c566a;
        --accent-color: #486090;
        --secondary-color: #6078a8;
        --border-color: #d1d5db;
        --header-color: #2e3440;
        --terminal-green: #4b644b;
        --terminal-yellow: #ebcb8b;
        --terminal-red: #bf616a;
    }
}

/* Light theme override (for switch) */
:root[data-theme="light"] {
    --bg-color: #eceff4;
    --text-color: #2e3440;
    --secondary-text-color: #4c566a;
    --accent-color: #486090;
    --border-color: #d1d5db;
    --header-color: #2e3440;
    --terminal-green: #4b644b;
    --terminal-yellow: #ebcb8b;
    --terminal-red: #bf616a;
}


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

html, body {
    font-family: var(--font-mono);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    height: 100%;
    width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 120px);
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.terminal-path {
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 5px 10px;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: inline-block;
}

.search-container {
    .search-result {
        margin: 0.5rem 0;
    }

    .search-result a {
        color: var(--accent-color);
    }

    .search-result a:hover {
        text-decoration: underline;
    }

    .result-date {
        color: var(--secondary-text-color);
        font-size: 0.75rem;
    }
}

.content-box {
    border: 1px solid var(--accent-color);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: border-color 0.3s ease;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0;
}

.nav a {
    font-size: 1rem;
}

.nav a::before {
    content: "./";
    opacity: 0.7;
}

.nav a.home::before {
    content: "";
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1em;
    background-color: var(--text-color);
    margin-left: 0.2em;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.footer {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--secondary-text-color);
}

.footer svg {
    vertical-align: middle;
}

.footer .floating {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border: none;
    outline: none;
    padding: 15px;
}

#toTopBtn {
    display: none;
    background: var(--border-color);
    border: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    cursor: pointer;
}

#toTopBtn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Theme Switcher */
.theme-switcher {
    background: var(--border-color);
    border: none;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-switcher:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Contents */
h1.title {
    color: var(--header-color);
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

div.content {
    margin: 1rem auto;

    span.date {
        color: var(--secondary-text-color);
        font-size: 0.9rem;
        font-weight: 300;
        margin-bottom: 1.5rem;
        display: block;
    }

    span.list-date {
        color: var(--secondary-text-color);
        font-size: 0.9rem;
        font-weight: 300;
        margin-bottom: 1.5rem;
    }

    span.draft-badge {
        color: var(--secondary-text-color);
        font-weight: 300;
    }

    ul, ol, li {
        list-style-position: inside;
    }

    ul {
        padding-left: 20px;
        margin-top: 0.5em;
        margin-bottom: 1em;
    }

    ul li {
        padding-left: 0.5em;
        margin-bottom: 0.5em;
        line-height: 1.3;
    }

    pre {
        padding: 1rem;
        margin: 1rem auto;
    }

    /* Highlighted Code Blocks */

    pre.astro-code,
    pre.astro-code span {
        background-color: #3b4252 !important;
    }

    table {
        border-collapse: collapse;
    }

    table,
    th,
    td {
        border: 1px dashed var(--secondary-text-color);
        padding: 10px;
    }

    h1, h2, h3, h4 {
        margin: 0.5rem 0;
        line-height: 1.3;
    }

    a {
        text-decoration: underline 1px;
    }


    div.callout-info div.callout-content a {
        color: dodgerblue;
    }
    div.callout-warning div.callout-content a {
        color: steelblue;
    }

    blockquote {
        border-left: 1px solid var(--accent-color);
        color: var(--text-color);
        padding: 20px;
        font-style: italic;
        margin-left: 0;
        margin-right: 0;
    }

    /* Responsive Images */

    img {
        max-width: 100%;
        height: 100%;
    }
}


/* Terminal Commands */
.command {
    color: var(--terminal-green);
    margin-right: 0.5rem;
}

.command::before {
    content: "$ ";
    opacity: 0.7;
}

/* helper Class */
.fade-in {
    opacity: 1;
    transition-property: opacity;
    transition-duration: .7s;
    transition-timing-function: cubic-bezier(.4, 0, 1, 1);
}

.fade-out {
    opacity: 0;
    transition-property: opacity;
    transition-duration: .7s;
    transition-timing-function: cubic-bezier(.4, 0, 1, 1);
}

/* Media Queries */
@media (max-width: 768px) {
    .terminal-path {
        font-size: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .content-box {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .terminal-path {
        font-size: 0.9rem;
    }

    .nav {
        gap: 0.8rem;
    }

    .content-box {
        padding: 1rem;
    }
}

/* Printing */
@media print {
    /* Hide elements not needed for print */
    nav.nav, .search-container, footer, div.extra-post {
        display: none;
    }
}

