@font-face {
    font-family: 'Libre Baskerville';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/libre-baskerville-v14-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Libre Baskerville';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/libre-baskerville-v14-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/courier-prime-v7-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/courier-prime-v7-latin-700.woff2') format('woff2');
}

:root {
    --bg-color: #fff;
    --text-color: #000;
    --link-color: #355E3B;
    --link-hover-color: #467A57;
    --code-bg: #f5f5f5;
    --border-color: #ccc;
    --muted-color: #666;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --link-color: #6fa774;
        --link-hover-color: #8fc794;
        --code-bg: #2a2a2a;
        --border-color: #444;
        --muted-color: #999;
    }
}

body {
    font-family: 'Libre Baskerville', serif;
    line-height: 1.4;
    max-width: 65ch;
    margin: 40px auto;
    padding: 0 20px;
    color: var(--text-color);
    background: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin: 1.5em 0 0.5em 0;
}

h1 {
    margin-top: 0;
}

p, ul, ol {
    margin: 0 0 1em 0;
}

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

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

header {
    text-align: center;
    margin-bottom: 2em;
}

.site-title {
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-color);
}

.site-title:hover {
    color: var(--link-color);
}

code {
    font-family: 'Courier Prime', monospace;
    background: var(--code-bg);
    padding: 2px 4px;
}

pre {
    background: var(--code-bg);
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

pre code {
    font-family: 'Courier Prime', monospace;
    background: none;
    padding: 0;
}

.codehilite {
    font-family: 'Courier Prime', monospace;
    background: var(--code-bg);
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

.codehilite code {
    font-family: 'Courier Prime', monospace;
    background: none;
    padding: 0;
}

blockquote {
    margin: 1em 0;
    padding-left: 1em;
    border-left: 4px solid var(--border-color);
}

.callout {
    margin: 1.5em 0;
    padding: 1em 1.25em;
    background: var(--code-bg);
    border-left: 4px solid var(--link-color);
    border-radius: 0 4px 4px 0;
}

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

th, td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

th {
    background: var(--code-bg);
}

img {
    max-width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    margin: 1em auto;
}

picture {
    display: block;
}

figure {
    margin: 1.5em 0;
}

figure img {
    margin-bottom: 0.5em;
}

figcaption {
    text-align: center;
    font-size: 0.85em;
    color: var(--muted-color);
    font-style: italic;
}

.date {
    color: var(--muted-color);
    font-size: 0.9em;
    margin-bottom: 1.5em;
}

.post-list li {
    margin-bottom: 0.5em;
}

.post-date {
    color: var(--muted-color);
    font-size: 0.7em;
}

footer {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5em;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.9em;
}

.social-links a:hover {
    color: var(--link-color);
}

.lead-magnet {
    display: flex;
    align-items: center;
    gap: 1.5em;
    margin: 1.5em 0;
    padding: 1.25em;
    background: var(--code-bg);
    border-left: 4px solid var(--link-color);
    border-radius: 0 4px 4px 0;
}

.lead-magnet-text {
    flex: 1;
}

.lead-magnet-text p {
    margin: 0 0 0.75em 0;
}

.lead-magnet-text .subscribe-button {
    margin: 0;
}

.lead-magnet-image {
    flex-shrink: 0;
}

.lead-magnet-image img {
    max-width: 160px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.lead-magnet-image figure {
    margin: 0;
}

.lead-magnet-image figcaption {
    display: none;
}

@media (max-width: 500px) {
    .lead-magnet {
        flex-direction: column;
        text-align: center;
    }

    .lead-magnet-text .subscribe-button {
        margin: 0 auto;
    }
}

.subscribe-form-container {
    margin-top: 2em;
    padding: 1.5em;
    background: var(--code-bg);
    border-radius: 8px;
    text-align: center;
}

.subscribe-form-container h3 {
    margin: 0 0 0.75em 0;
}

.subscribe-form {
    display: flex;
    gap: 0.5em;
    justify-content: center;
    flex-wrap: wrap;
}

.subscribe-form input[type="email"] {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9em;
    padding: 0.6em 1em;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
    min-width: 220px;
}

.subscribe-form button {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.9em;
    padding: 0.6em 1.5em;
    background: var(--link-color);
    color: var(--bg-color);
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}

.subscribe-form button:hover {
    background: var(--link-hover-color);
}

.subscribe-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.subscribe-status {
    margin-top: 0.75em;
    font-size: 0.9em;
}

.subscribe-status.success {
    color: var(--link-color);
}

.subscribe-status.error {
    color: #c0392b;
}

.subscribe-button {
    display: block;
    width: fit-content;
    margin: 1.5em auto 0;
    padding: 0.75em 1.5em;
    background: var(--link-color);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 700;
    border-radius: 6px;
}

.subscribe-button:hover {
    background: var(--link-hover-color);
    color: var(--bg-color);
}