/* Dark Nord Theme for Skyler Blog */
/* Inspired by read.cv minimalist style */

:root {
    /* Nord Polar Night (backgrounds) */
    --nord0: #2e3440;
    --nord1: #3b4252;
    --nord2: #434c5e;
    --nord3: #4c566a;

    /* Nord Snow Storm (text) */
    --nord4: #d8dee9;
    --nord5: #e5e9f0;
    --nord6: #eceff4;

    /* Nord Frost (accents) */
    --nord7: #8fbcbb;
    --nord8: #88c0d0;
    --nord9: #81a1c1;
    --nord10: #5e81ac;

    /* Nord Aurora (syntax highlighting) */
    --nord11: #bf616a;
    --nord12: #d08770;
    --nord13: #ebcb8b;
    --nord14: #a3be8c;
    --nord15: #b48ead;

    /* Applied colors */
    --bg-color: var(--nord0);
    --bg-secondary: var(--nord1);
    --text-color: var(--nord4);
    --text-muted: var(--nord3);
    --text-bright: var(--nord6);
    --link-color: var(--nord8);
    --link-hover: var(--nord7);
    --border-color: var(--nord2);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
    line-height: 1.8;
    min-height: 100vh;
}

/* read.cv style: minimal, lots of whitespace, max 680px */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - just the name */
header {
    margin-bottom: 80px;
}

header h1 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
}

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

header a:hover {
    color: var(--link-color);
}

/* Post list */
main {
    flex: 1;
}

.post-list {
    list-style: none;
}

.post-item {
    margin-bottom: 48px;
}

.post-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 8px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.post-item a:hover .post-title {
    color: var(--link-color);
}

.post-date {
    font-size: 14px;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    margin-top: 80px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--bg-secondary);
    color: var(--text-bright);
}

.pagination .current {
    background: var(--nord2);
    color: var(--text-bright);
}

/* Article page */
article {
    flex: 1;
}

.post-header {
    margin-bottom: 48px;
}

.post-header .post-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-bright);
}

.post-header .post-date {
    font-size: 14px;
    color: var(--text-muted);
}

/* Post content */
.post-content {
    font-size: 17px;
    line-height: 1.9;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--text-bright);
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-content h1 { font-size: 28px; }
.post-content h2 { font-size: 24px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }

.post-content p {
    margin-bottom: 24px;
}

.post-content a {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.post-content a:hover {
    color: var(--link-hover);
}

.post-content strong {
    color: var(--text-bright);
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    border-left: 3px solid var(--nord3);
    padding-left: 20px;
    margin: 24px 0;
    color: var(--text-muted);
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 48px 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

/* Code blocks */
.post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.9em;
}

.post-content code:not(pre code) {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--nord7);
}

.post-content pre {
    background: var(--nord1);
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* highlight.js Nord theme */
.hljs {
    background: var(--nord1);
    color: var(--nord4);
}

.hljs-comment,
.hljs-quote {
    color: var(--nord3);
    font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-addition {
    color: var(--nord9);
}

.hljs-number,
.hljs-string,
.hljs-meta .hljs-meta-string,
.hljs-literal,
.hljs-doctag,
.hljs-regexp {
    color: var(--nord14);
}

.hljs-title,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
    color: var(--nord8);
}

.hljs-attribute,
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-class .hljs-title,
.hljs-type {
    color: var(--nord7);
}

.hljs-symbol,
.hljs-bullet,
.hljs-subst,
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-link {
    color: var(--nord13);
}

.hljs-built_in,
.hljs-deletion {
    color: var(--nord11);
}

.hljs-formula {
    color: var(--nord15);
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
}

.post-content th,
.post-content td {
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: left;
}

.post-content th {
    background: var(--bg-secondary);
    color: var(--text-bright);
    font-weight: 600;
}

.post-content tr:nth-child(even) {
    background: rgba(59, 66, 82, 0.3);
}

/* Post navigation */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.post-nav a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 16px;
    border-radius: 8px;
    transition: background 0.2s ease;
    max-width: 45%;
}

.post-nav a:hover {
    background: var(--bg-secondary);
}

.post-nav .prev {
    align-items: flex-start;
}

.post-nav .next {
    align-items: flex-end;
    margin-left: auto;
}

.post-nav .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.post-nav .title {
    font-size: 15px;
    color: var(--link-color);
    line-height: 1.4;
}

/* Back to home */
.back-home {
    display: inline-block;
    margin-top: 32px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-home:hover {
    color: var(--link-color);
}

/* Comments section */
.comments {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: 24px;
}

/* KaTeX styles override */
.katex {
    font-size: 1.05em;
}

.katex-display {
    margin: 24px 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 48px 20px;
    }

    header {
        margin-bottom: 48px;
    }

    .post-header .post-title {
        font-size: 26px;
    }

    .post-content {
        font-size: 16px;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav a {
        max-width: 100%;
    }

    .post-nav .next {
        align-items: flex-start;
    }
}
