/* =========================================================================
   shannonconnolly.org — monospace theme
   Design closely modeled on bradbarrish.com (Archie for Micro.blog).
   Plain CSS, no build step. Edit freely.
   ========================================================================= */

/* ----- Theme variables -------------------------------------------------- */
:root {
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --max-width: 800px;
    --content-padding: 1.5rem;

    /* Light theme (default) */
    --color-bg: #ffffff;
    --color-text: #232333;
    --color-text-muted: #666666;
    --color-primary: #1a1a2e;
    --color-link: #e62e8b;        /* hot pink — from The Yams */
    --color-link-hover: #c21f71;
    --color-border: #e0e0e0;
    --color-code-bg: #f5f5f5;
    --color-blockquote-border: #cccccc;
}

[data-theme="dark"] {
    --color-bg: #1d1f21;
    --color-text: #c9cacc;
    --color-text-muted: #999999;
    --color-primary: #e0e0e0;
    --color-link: #ff6fb5;        /* hot pink, lightened for dark mode */
    --color-link-hover: #ff9ecc;
    --color-border: #3a3a3a;
    --color-code-bg: #2d2d2d;
    --color-blockquote-border: #555555;
}

/* ----- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--gh-font-body, var(--font-mono));
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

a { color: var(--color-link); text-decoration: none; }

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

/* ----- Header / nav ----------------------------------------------------- */
.site-header {
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}
.site-header .inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.site-title {
    font-family: var(--gh-font-heading, var(--font-mono));
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-primary);
    text-decoration: none;
}
.site-title:hover { color: var(--color-link); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.site-nav ul {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a { color: var(--color-text); text-decoration: none; }
.site-nav a:hover { color: var(--color-link); }

.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-radius: 3px;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.theme-toggle:hover { border-color: var(--color-link); color: var(--color-link); }
.theme-toggle-dark { display: none; }
[data-theme="dark"] .theme-toggle-light { display: none; }
[data-theme="dark"] .theme-toggle-dark { display: inline; }

/* ----- Main layout ------------------------------------------------------ */
.site-main { flex: 1 0 auto; padding-bottom: 2rem; }

/* ----- Homepage intro --------------------------------------------------- */
.site-intro { margin-bottom: 2.5rem; }
.site-intro p { margin: 0; color: var(--color-text-muted); font-size: 1rem; }

/* ----- Post list -------------------------------------------------------- */
.post-card {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
}
.post-card:last-child { border-bottom: none; }
.post-card-date {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
}
.post-card-title {
    font-family: var(--gh-font-heading, var(--font-mono));
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem;
}
.post-card-title a { color: var(--color-primary); text-decoration: none; }
.post-card-title a:hover { color: var(--color-link); }
.post-card-excerpt {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* ----- List header (tag / author) -------------------------------------- */
.list-header { margin-bottom: 2rem; }
.list-header-kicker { font-size: 0.85rem; color: var(--color-text-muted); }
.list-header-title {
    font-family: var(--gh-font-heading, var(--font-mono));
    margin: 0.3rem 0 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}
.list-header-desc { margin: 0; color: var(--color-text-muted); font-size: 1rem; }

/* ----- Single post ------------------------------------------------------ */
.post-header { margin-bottom: 1.5rem; text-align: left; }
.post-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.post-meta-sep { margin: 0 0.4rem; }
.post-tag { color: var(--color-text-muted); text-decoration: none; }
.post-tag:hover { color: var(--color-link); }
.post-title {
    font-family: var(--gh-font-heading, var(--font-mono));
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
}

.post-image {
    max-width: var(--max-width);
    margin: 0 auto 2rem;
    padding: 0 var(--content-padding);
}
.post-image img { display: block; width: 100%; border-radius: 3px; }
.post-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ----- Prose content ---------------------------------------------------- */
.post-content { font-size: 1rem; line-height: 1.7; }
.post-content > * { margin-top: 0; margin-bottom: 1.5rem; }
.post-content > *:last-child { margin-bottom: 0; }
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-family: var(--gh-font-heading, var(--font-mono));
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.post-content h1 { font-size: 1.4rem; }
.post-content h2 { font-size: 1.25rem; }
.post-content h3 { font-size: 1.1rem; }
.post-content h4, .post-content h5, .post-content h6 { font-size: 1rem; }
.post-content a {
    color: var(--color-link);
    text-decoration: none;
    border-bottom: 1px solid var(--color-link);
}
.post-content a:hover {
    color: var(--color-link-hover);
    border-bottom-color: var(--color-link-hover);
}
.post-content ul, .post-content ol { padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.25rem; }
.post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--color-blockquote-border);
    color: var(--color-text-muted);
}
.post-content blockquote p { margin: 0; }
.post-content img { border-radius: 3px; }
.post-content figure { margin-left: 0; margin-right: 0; }
.post-content figcaption {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--color-code-bg);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
}
.post-content pre {
    background: var(--color-code-bg);
    padding: 1rem;
    border-radius: 3px;
    overflow-x: auto;
    line-height: 1.5;
}
.post-content pre code { background: none; padding: 0; }
.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
.post-content th, .post-content td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}
.post-content th { font-weight: 700; }

/* Koenig editor image widths (wide / full-bleed cards) */
.post-content .kg-width-wide {
    position: relative;
    width: 100vw;
    max-width: var(--max-width);
    margin-left: 50%;
    transform: translateX(-50%);
}
.post-content .kg-width-full {
    position: relative;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.post-content .kg-width-full img { width: 100%; }

/* ----- Subscribe CTA ---------------------------------------------------- */
.post-footer { margin-top: 2.5rem; }
.subscribe-cta {
    border: 1px solid var(--color-border);
    border-radius: 3px;
    padding: 1.5rem;
    text-align: center;
}
.subscribe-cta h3 {
    font-family: var(--gh-font-heading, var(--font-mono));
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}
.subscribe-cta p { margin: 0 0 1rem; color: var(--color-text-muted); font-size: 0.9rem; }

.subscribe-form { margin: 0; }
.subscribe-form-row { display: flex; gap: 0.5rem; }
.subscribe-input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 3px;
}
.subscribe-input::placeholder { color: var(--color-text-muted); }
.subscribe-input:focus { outline: none; border-color: var(--color-link); }
.subscribe-form .button { border: none; cursor: pointer; white-space: nowrap; }
.subscribe-message { font-size: 0.85rem; margin: 0.75rem 0 0; display: none; }
.subscribe-message-success { color: var(--color-link); }
.subscribe-message-error { color: #c0392b; }
.subscribe-form.success .subscribe-message-success { display: block; }
.subscribe-form.error .subscribe-message-error { display: block; }
.subscribe-form.success .subscribe-form-row { display: none; }
.subscribe-form.loading .subscribe-form-row { opacity: 0.6; }

.button {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--color-bg);
    background: var(--color-link);
    padding: 0.5rem 1rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}
.button:hover { background: var(--color-link-hover); }

/* ----- Comments --------------------------------------------------------- */
.post-comments { margin-top: 2.5rem; }

/* ----- Pagination ------------------------------------------------------- */
.pagination {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem var(--content-padding) 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}
.pagination a { color: var(--color-link); text-decoration: none; }
.pagination a:hover { color: var(--color-link-hover); }
.pagination .page-number { color: var(--color-text-muted); }

/* ----- Error page ------------------------------------------------------- */
.error-page { text-align: center; padding: 3rem 0; }
.error-code { font-size: 3rem; margin: 0; font-weight: 700; color: var(--color-primary); }
.error-message { color: var(--color-text-muted); margin: 0.5rem 0 2rem; }

/* ----- Footer ----------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer a { color: var(--color-text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--color-link); }

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 600px) {
    :root { --content-padding: 1rem; }
    .site-header .inner { flex-direction: column; align-items: flex-start; }
    .site-nav { gap: 0.8rem; }
    .subscribe-form-row { flex-direction: column; }
}
