/* Paulblish — Cyberpunk Brutalist Theme */

/* === Palette === */
:root {
    --bg: #0a0a0f;
    --surface: #14141f;
    --text: #b8b8c0;
    --text-bright: #e0dfd5;
    --accent-teal: #5e9e91;
    --accent-amber: #b89c4a;
    --accent-rose: #7a3b4e;
    --border: #2a2a35;
    --highlight: #1a2a28;
    --font-heading: "JetBrains Mono", "Fira Code", "Courier New", monospace;
    --font-body: "Inter", "system-ui", sans-serif;
}

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

/* === Base === */
html {
    font-size: 17px;
    line-height: 1.65;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* === Typography === */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-bright);
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 1.8rem;
}
h2 {
    font-size: 1.4rem;
}
h3 {
    font-size: 1.15rem;
}

p {
    margin-bottom: 1em;
}

/* === Links === */
a {
    color: var(--accent-teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #4e8a7e;
}

/* === Dead wikilinks === */
.wikilink-dead {
    color: var(--accent-rose);
    text-decoration: underline;
    text-decoration-style: dashed;
}

/* === Navigation === */
.site-nav {
    font-family: var(--font-heading);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.site-nav a {
    color: var(--text);
    font-size: 0.9rem;
}

.site-nav a:hover {
    color: var(--accent-teal);
    text-decoration: none;
}

.site-nav .nav-title {
    color: var(--text-bright);
    font-size: 1rem;
    font-weight: bold;
}

/* === Article metadata === */
.article-meta {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-meta h1 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.copy-url-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
    opacity: 0.35;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.copy-url-btn:hover,
.copy-url-btn.copied {
    opacity: 0.9;
}

.article-meta time {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 0.25rem;
}

.reading-time {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text);
    margin-left: 0.75rem;
}

.article-meta .description {
    margin-top: 0.75rem;
    font-style: italic;
    color: var(--text);
}

/* === Tags === */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--accent-amber);
    border: 1px solid var(--accent-amber);
    padding: 0.15em 0.5em;
    text-decoration: none;
}

.tag:hover {
    background: var(--highlight);
    text-decoration: none;
}

.tag:visited {
    color: var(--accent-amber);
}

/* === Article body === */
.article-body {
    line-height: 1.7;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 2em;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.article-body li {
    margin-bottom: 0.25em;
}

.article-body blockquote {
    border-left: 3px solid var(--accent-teal);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text);
    background: var(--surface);
    padding: 0.75em 1em;
}

.article-body img {
    max-width: 100%;
    height: auto;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border);
    padding: 0.5em 0.75em;
    text-align: left;
}

.article-body th {
    background: var(--surface);
    color: var(--text-bright);
    font-family: var(--font-heading);
    font-size: 0.85rem;
}

/* === Inline code === */
code {
    font-family: var(--font-heading);
    font-size: 0.9em;
    background: var(--surface);
    padding: 0.15em 0.35em;
}

/* Plain pre/code blocks (no language specified) */
pre {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1em;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
}

/* === Fenced code block wrapper (language-highlighted blocks) === */
.code-block {
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin: 1.5rem 0;
    background: var(--surface);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
    background: color-mix(in srgb, var(--surface) 50%, var(--border));
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 0.75rem;
}

.code-lang {
    color: var(--text);
    opacity: 0.6;
}

.code-copy-btn {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #fff;
    opacity: 0.35;
    transition: opacity 0.15s;
}

.code-copy-btn:hover,
.code-copy-btn.copied {
    opacity: 0.9;
}

/* Pygments .highlight inside .code-block — wrapper handles border/bg */
.code-block .highlight {
    background: none;
    border: none;
    padding: 1em;
    overflow-x: auto;
    margin: 0;
}

.code-block .highlight pre {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* === Line numbers (Pygments linenos="table") === */
.highlighttable {
    width: 100%;
    border-collapse: collapse;
}

.highlighttable .linenos {
    user-select: none;
    padding: 1em 0.75em 1em 1em;
    text-align: right;
    vertical-align: top;
    border-right: 1px solid var(--border);
    width: 1%;
    white-space: nowrap;
}

.highlighttable .linenos .linenodiv pre {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    color: var(--text);
    opacity: 0.35;
}

.highlighttable .code {
    padding: 0;
    width: 100%;
}

.highlighttable .code .highlight {
    padding: 1em;
}

/* === Pygments token colours (CP2077-aligned) === */
.highlight .k,
.highlight .kn,
.highlight .kd,
.highlight .kc {
    color: var(--accent-teal);
} /* keywords */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sa {
    color: var(--accent-amber);
} /* strings */
.highlight .c,
.highlight .c1,
.highlight .cm {
    color: #555566;
    font-style: italic;
} /* comments */
.highlight .n {
    color: var(--text);
} /* names */
.highlight .nf,
.highlight .nb {
    color: var(--text-bright);
} /* functions, builtins */
.highlight .o,
.highlight .p {
    color: var(--text);
} /* operators, punctuation */
.highlight .mi,
.highlight .mf {
    color: var(--accent-rose);
} /* numbers */
.highlight .nn {
    color: var(--accent-teal);
} /* module names */

/* === Home page === */
.ascii-banner {
    font-family: var(--font-heading);
    color: var(--accent-teal);
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: none;
    border: none;
    padding: 0;
}

.home-avatar {
    margin-bottom: 1.5rem;
}

.home-avatar .avatar {
    width: 120px;
    height: 120px;
    border: 1px solid var(--accent-teal);
    display: block;
}

/* === Listings === */
.listing h1 {
    margin-top: 0;
}

.listing h2 {
    font-size: 1rem;
    color: var(--text);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.article-list {
    list-style: none;
    padding: 0;
}

.article-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4em 0;
    border-bottom: 1px solid var(--border);
}

.article-list time {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text);
    white-space: nowrap;
    margin-left: 1rem;
}

/* === Article prev/next nav === */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-top: 2rem;
}

.article-nav-prev,
.article-nav-next {
    flex: 1;
}

.article-nav-next {
    text-align: right;
}

/* === Recent posts (home page) === */
.recent-posts {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.recent-posts h2 {
    margin-top: 0;
}

.recent-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts li {
    margin-bottom: 0.4rem;
}

/* === Social icons === */
.social-icons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.site-nav .social-icons {
    margin-left: auto;
}

.social-icon {
    color: var(--text);
    display: flex;
    align-items: center;
    line-height: 1;
}

.social-icon:hover {
    color: var(--accent-teal);
    text-decoration: none;
}

.social-icon svg {
    display: block;
}

/* === Mobile nav === */
.nav-toggle-input {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
    align-items: center;
}

.nav-toggle-label:hover {
    color: var(--accent-teal);
}

@media (max-width: 640px) {
    .site-nav {
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        order: 10;
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 0;
        border-top: 1px solid var(--border);
    }

    .nav-toggle-input:checked ~ .nav-links {
        display: flex;
    }

    .nav-toggle-label {
        display: flex;
    }
}

.site-footer .social-icons {
    justify-content: center;
    margin-top: 0.5rem;
}

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text);
    font-family: var(--font-heading);
}

.site-footer a {
    color: var(--accent-teal);
}

.footer-links {
    margin-top: 0.4rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* === Callouts === */
.callout {
    border-left: 4px solid var(--accent-teal);
    background: color-mix(in srgb, var(--accent-teal) 8%, var(--surface));
    border-radius: 0 4px 4px 0;
    margin: 1.5rem 0;
    padding: 0;
    overflow: hidden;
}

.callout-title {
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: color-mix(in srgb, var(--accent-teal) 15%, var(--surface));
    color: var(--accent-teal);
}

.callout-body {
    padding: 0.75rem 1rem;
}

.callout-body p:first-child {
    margin-top: 0;
}
.callout-body p:last-child {
    margin-bottom: 0;
}

.callout-warning {
    border-left-color: #f0c040;
}
.callout-warning .callout-title {
    background: color-mix(in srgb, #f0c040 15%, var(--surface));
    color: #f0c040;
}

.callout-danger,
.callout-caution {
    border-left-color: var(--accent-pink);
}
.callout-danger .callout-title,
.callout-caution .callout-title {
    background: color-mix(in srgb, var(--accent-pink) 15%, var(--surface));
    color: var(--accent-pink);
}

.callout-tip,
.callout-success {
    border-left-color: #6bcb77;
}
.callout-tip .callout-title,
.callout-success .callout-title {
    background: color-mix(in srgb, #6bcb77 15%, var(--surface));
    color: #6bcb77;
}

/* === Collapsible callouts === */
.callout-collapsible details {
    /* reset browser default padding/margin on details */
    margin: 0;
}

.callout-collapsible summary.callout-title {
    cursor: pointer;
    user-select: none;
    list-style: none; /* Firefox */
    display: flex;
    align-items: center;
    gap: 0.4em;
}

/* Remove the default disclosure triangle in all browsers */
.callout-collapsible summary.callout-title::-webkit-details-marker {
    display: none;
}
.callout-collapsible summary.callout-title::marker {
    display: none;
}

/* Chevron icon — rotates when open */
.callout-fold {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); /* points right (collapsed) */
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: 1px; /* optical alignment */
}

.callout-collapsible details[open] .callout-fold {
    transform: rotate(45deg); /* points down (expanded) */
}

/* === Highlights === */
mark {
    background: color-mix(in srgb, #f0c040 35%, transparent);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}
