@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Josefin+Sans:wght@400;700&display=swap");

:root {
    /* Typography */
    --font-body: "Inter", sans-serif;
    --font-accent: "Josefin Sans", sans-serif;

    /* Shared colors that don't change between themes */
    --accent-primary: oklch(63% 0.15 200);
    --accent-secondary: oklch(50% 0.15 200);

    /* Syntax highlighting semantic colors (dark theme defaults) */
    --syntax-keyword: oklch(78% 0.15 320); /* Pink */
    --syntax-type: oklch(85% 0.1 200); /* Blue */
    --syntax-function: oklch(85% 0.15 140); /* Green */
    --syntax-string: oklch(90% 0.12 100); /* Yellow */
    --syntax-number: oklch(80% 0.15 280); /* Purple */
    --syntax-operator: oklch(78% 0.15 320); /* Pink */
    --syntax-comment: oklch(55% 0.08 240); /* Blue-grey */
    --syntax-deleted: oklch(65% 0.15 20); /* Red */
    --syntax-output: oklch(35% 0.02 240); /* Dark grey */

    /* Light theme defaults */
    --bg-primary: oklch(97.8% 0.004 180);
    --bg-secondary: oklch(100% 0 0);
    --bg-accent: oklch(98% 0.02 220);
    --text-primary: oklch(20% 0.04 180);
    --text-secondary: oklch(45% 0.02 180);
    --text-muted: oklch(60% 0 0);
    --accent-hover: var(--accent-secondary);
    --border-color: var(--text-primary);
    --shadow-color: var(--text-primary);
}

[data-theme="dark"] {
    --bg-primary: oklch(18% 0.02 200);
    --bg-secondary: oklch(22% 0.03 200);
    --bg-accent: oklch(18% 0.04 180);
    --text-primary: oklch(82% 0.08 180);
    --text-secondary: oklch(75% 0.06 180);
    --text-muted: oklch(65% 0.04 180);
    --accent-hover: oklch(75% 0.16 200);
    --border-color: var(--text-primary);
    --shadow-color: var(--text-primary);
}

[data-theme="light"] {
    /* Light theme syntax highlighting overrides */
    --syntax-function: oklch(45% 0.15 140); /* Dark green */
    --syntax-string: oklch(45% 0.12 60); /* Dark orange */
    --syntax-number: oklch(50% 0.15 280); /* Dark purple */
    --syntax-deleted: oklch(50% 0.15 15); /* Dark red */
    --syntax-keyword: oklch(58% 0.15 320); /* Pink */
    --syntax-type: oklch(65% 0.1 200); /* Blue */
}

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

/* ==========================================================================
   BASE COMPONENT CLASSES - Reusable neobrutalist components
   ========================================================================== */

/* Base button component */
.btn {
    font-family: var(--font-accent);
    font-weight: 700;
    display: inline-block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border: 3px solid var(--border-color);
    box-shadow: 4px 4px 0 var(--shadow-color);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--shadow-color);
}

.btn--primary {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
}

.btn--primary:hover {
    background-color: var(--accent-hover);
    color: var(--bg-accent);
}

.btn--secondary {
    background-color: var(--bg-accent);
    color: var(--text-primary);
}

.btn--secondary:hover {
    background-color: var(--bg-secondary);
}

.btn--small {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    border: 2px solid var(--border-color);
    box-shadow: 3px 3px 0 var(--shadow-color);
}

.btn--small:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--shadow-color);
}

/* Base card component */
.card {
    border: 2px solid var(--border-color);
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.card--large {
    border: 3px solid var(--border-color);
    box-shadow: 6px 6px 0 var(--shadow-color);
}

.card--accent {
    background-color: var(--accent-primary);
    color: oklch(100% 0 0);
}

.card--highlight {
    background-color: var(--bg-accent);
    border-left: 4px solid var(--accent-primary);
}

/* Layout components */
.flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.bordered-accent {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
}

/* Search components */
.search-container {
    max-width: 1100px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.search-input {
    flex: 1;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    border: 3px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 4px 4px 0 var(--shadow-color);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--shadow-color);
    background-color: var(--bg-accent);
}

.search-results {
    margin-top: 2rem;
}

.search-summary {
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.no-results {
    text-align: center;
    padding: 3rem 0;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 2rem;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-accent);
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.2rem;
}

h3,
h4,
h5,
h6 {
    font-size: 1rem;
}

p {
    font-size: 1rem;
}

hr {
    border: none;
    height: 3px;
    background-color: var(--border-color);
    margin: 2rem 0;
    box-shadow: 0 3px 0 var(--shadow-color);
    position: relative;
}

hr::before {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 9px;
    background-color: var(--accent-primary);
    box-shadow: 2px 2px 0 var(--shadow-color);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 0.125rem;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.header {
    padding: 1rem 0;
    margin-bottom: 1.25rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.site-title {
    font-size: 2.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    border: none;
    padding: 0;
}

.site-title:hover {
    color: var(--accent-hover);
    border: none;
}

.site-title a {
    border: none;
}

.site-description {
    font-family: var(--font-accent);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 18.75rem;
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 3px solid var(--accent-primary);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding-top: 5rem;
}

.nav.nav-open {
    left: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 3px solid var(--border-color);
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 3px 3px 0 var(--shadow-color);
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-icons a:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--shadow-color);
    background-color: var(--accent-primary);
    color: oklch(100% 0 0);
}

.social-icons svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem 0;
}

.nav-item {
    border-bottom: 2px solid var(--accent-primary);
}

.nav-item:first-child {
    border-top: 2px solid var(--accent-primary);
}

.nav-link {
    display: block;
    padding: 1.25rem 1.875rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-size: 1rem;
    border: none;
    width: 100%;
}

.nav-link:hover {
    background-color: var(--accent-primary);
    color: oklch(100% 0 0);
    border: none;
}

.theme-toggle {
    font-size: 1.2rem;
}

[data-theme="light"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: none;
}

.menu-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.625rem;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
}

.menu-toggle span {
    display: block;
    width: 1.5625rem;
    height: 3px;
    background-color: var(--text-primary);
    margin: 0.3125rem 0;
    transition: all 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.menu-toggle span:nth-child(1) {
    top: 0.5rem;
}

.menu-toggle span:nth-child(2) {
    top: 1.125rem;
}

.menu-toggle span:nth-child(3) {
    top: 1.75rem;
}

.menu-toggle.menu-active span:nth-child(1) {
    transform: translateX(-50%) rotate(45deg);
    top: 1.125rem;
}

.menu-toggle.menu-active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.menu-active span:nth-child(3) {
    transform: translateX(-50%) rotate(-45deg);
    top: 1.125rem;
}

.post-card {
    margin-bottom: 1.875rem;
}

.post-header {
    padding: 1.5625rem 1.875rem;
    margin-bottom: 1.25rem;
}

.post-title {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    color: oklch(100% 0 0);
}

.post-title a {
    color: inherit;
    text-decoration: none;
    border: none;
    padding: 0;
}

.post-title a:hover {
    color: inherit;
    border: none;
}

.post-content {
    padding: 0;
}

.post-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

.post-excerpt {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.post-single ul,
.post-single ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
}

.post-single li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-single blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.post-single strong {
    font-weight: 700;
}

.post-single pre code {
    background: none;
    padding: 1rem;
    display: block;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2.1875rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--border-color);
}

.author-info {
    padding: 1.5625rem;
    margin: 1.875rem 0;
}

.author-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.author-bio {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer {
    padding: 1.875rem;
    text-align: center;
    margin-top: 3rem;
}

.footer-text {
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 3rem 0;
}

.page-info {
    font-family: var(--font-accent);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.terms-container,
.taxonomy-container {
    max-width: 1100px;
    margin: 0 auto;
}

.page-title {
    font-family: var(--font-accent);
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.terms-list {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .site-title {
        font-size: 1.8rem;
    }

    .site-description {
        font-size: 0.8rem;
    }

    .post-header {
        padding: 1.25rem;
    }

    .post-title {
        font-size: 1.4rem;
    }

    .post-single .post-title {
        font-size: 2rem;
    }

    .theme-toggle {
        font-size: 1rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.8rem;
    }

    .nav-link {
        padding: 0.75rem 0.9375rem;
    }

    .post-header {
        padding: 0.9375rem;
    }

    .post-title {
        font-size: 1.2rem;
    }

    .post-single .post-title {
        font-size: 1.7rem;
    }

    .read-more {
        padding: 0.625rem 1rem;
        font-size: 0.8rem;
    }
}

/* Search result styles */
.search-result-item {
    display: block !important;
    text-align: left;
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.search-result-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--accent-primary);
    margin-bottom: 0.75rem;
}

.search-result-summary {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-result-tag {
    font-size: 0.7rem;
    color: var(--accent-primary);
    background-color: transparent;
    border: 2px solid var(--accent-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0;
}

/* Code blocks - neobrutalist container styling */
.highlight {
    border: 3px solid var(--border-color);
    box-shadow: 4px 4px 0 var(--shadow-color);
    margin: 1.5rem 0;
    overflow: hidden;
}

/* Inline code */
code {
    background-color: var(--bg-accent);
    color: var(--text-primary);
    padding: 0.125rem 0.375rem;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 0.875rem;
}

/* Hugo generated Chroma styles - using semantic CSS variables */
.chroma a {
    border: none;
}
.bg {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}
.chroma {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}
.chroma .lnlinks {
    outline: none;
    text-decoration: none;
    color: inherit;
}
.chroma .lntd {
    vertical-align: top;
    padding: 0;
    margin: 0;
    border: 0;
}
.chroma .lntable {
    border-spacing: 0;
    padding: 0;
    margin: 0;
    border: 0;
}
.chroma .hl {
    background-color: oklch(28% 0.02 260);
}
.chroma .lnt {
    white-space: pre;
    -webkit-user-select: none;
    user-select: none;
    margin-right: 0.4em;
    padding: 0 0.4em 0 0.4em;
    color: var(--syntax-comment);
}
.chroma .ln {
    white-space: pre;
    -webkit-user-select: none;
    user-select: none;
    margin-right: 0.4em;
    padding: 0 0.4em 0 0.4em;
    color: var(--syntax-comment);
}
.chroma .line {
    display: flex;
}
/* Keywords */
.chroma .k,
.chroma .kc,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .nt {
    color: var(--syntax-keyword);
}
/* Types */
.chroma .kt {
    color: var(--syntax-type);
}
.chroma .kd,
.chroma .nb,
.chroma .nl,
.chroma .nv,
.chroma .vc,
.chroma .vg,
.chroma .vi,
.chroma .vm {
    color: var(--syntax-type);
    font-style: italic;
}
/* Functions */
.chroma .na,
.chroma .nc,
.chroma .nf,
.chroma .fm {
    color: var(--syntax-function);
}
/* Strings */
.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .dl,
.chroma .sd,
.chroma .s2,
.chroma .se,
.chroma .sh,
.chroma .si,
.chroma .sx,
.chroma .sr,
.chroma .s1,
.chroma .ss {
    color: var(--syntax-string);
}
/* Numbers */
.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il,
.chroma .mo {
    color: var(--syntax-number);
}
/* Operators */
.chroma .o,
.chroma .ow {
    color: var(--syntax-operator);
}
/* Comments */
.chroma .c,
.chroma .ch,
.chroma .cm,
.chroma .c1,
.chroma .cs {
    color: var(--syntax-comment);
}
.chroma .cp,
.chroma .cpf {
    color: var(--syntax-keyword);
}
/* Deleted/Generic */
.chroma .gd {
    color: var(--syntax-deleted);
}
.chroma .gi {
    color: var(--syntax-function);
    font-weight: bold;
}
.chroma .go {
    color: var(--syntax-output);
}
/* Other formatting */
.chroma .bp {
    font-style: italic;
}
.chroma .ge {
    text-decoration: underline;
}
.chroma .gh {
    font-weight: bold;
}
.chroma .gu {
    font-weight: bold;
}
.chroma .gl {
    text-decoration: underline;
}
