/* Newspaper-like, elegant serif typography */
:root {
    --max-width: 900px;
    /* core colors */
    --bg: #fff;
    --accent: #000;
    --muted: #666;
    --link: #1a0dab;

    /* surfaces */
    --header-bg: #f9f9f9;
    --footer-bg: #f9f9f9;

    /* borders */
    --border: #eee;
    /* primary border */
    --border-light: #f0f0f0;
    --border-lighter: #fafafa;
    --border-alt: #f7f7f7;
    --nav-border: #ddd;

    /* blockquote / accents */
    --quote-text: #2b2b2b;
    --quote-bg: #faf8f4;
    --quote-accent: #d3c5b2;
    --quote-cite: #6b625a;

    --lock-background: rgba(255, 255, 255, 0.85);
}

/* Dark mode: follow user/browser preference */
@media (prefers-color-scheme: dark) {
    :root {
        /* override for dark */
        --bg: #0b0b0c;
        --accent: #e6e6e6;
        --muted: #9aa0a6;
        --link: #8ab4f8;

        --header-bg: #0f0f10;
        --footer-bg: #0f0f10;

        --border: #1b1b1b;
        --border-light: #202020;
        --border-lighter: #161616;
        --border-alt: #171717;
        --nav-border: #222;

        --quote-text: #dcdcdc;
        --quote-bg: #0f1112;
        --quote-accent: #2b6fb6;
        /* subtle blue accent */
        --quote-cite: #9aa0a6;

        --lock-background: rgba(15, 17, 18, 0.85);
    }
}

html,
body {
    height: 100%;
}

body {
    font-family: 'IM Fell French Canon', 'Merriweather', Georgia, serif;
    line-height: 1.6;
    color: var(--accent);
    background: var(--bg);
    margin: 0;
}

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

a:hover {
    text-decoration: underline;
}

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

.container {
    max-width: var(--max-width);
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    background: var(--header-bg);
}

.site-header .container {
    margin-bottom: 0.5rem;
}

.site-title {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700
}

.site-title a {
    color: inherit;
    text-decoration: none
}

.main-nav {
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    margin-top: 0.5rem;
    border-bottom: 1px solid var(--nav-border);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700
}

.lede {
    font-size: 1.05rem;
    color: var(--muted);
    margin-top: 0
}

.title {
    font-size: 2.2rem;
    margin: 0 0 .25rem
}

.article .published {
    color: var(--muted);
    font-size: .95rem
}

.article-body {
    font-size: 1.05rem;
    margin-top: 1rem;
}

.article-body p {
    margin: 1rem 0
}

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

.post-list li {
    padding: .75rem 0;
    border-bottom: 1px solid var(--border-light)
}

.muted {
    color: var(--muted)
}

.series {
    font-style: italic;
    font-size: .9rem;
    color: var(--muted);
    margin-left: .5rem;
    margin-top: -0.75rem;
}

.reading-time {
    font-style: italic;
    font-size: .9rem;
    color: var(--muted);
    margin-left: .5rem;
    margin-top: -0.75rem;
}

.site-footer {
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    margin-top: 3rem;
    color: var(--muted);
    font-size: .9rem;
    background: var(--footer-bg);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer-right {
    text-align: right;
}

/* Header inner: center the title */
.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-title {
    font-family: 'Manufacturing Consent', Georgia, serif;
    font-size: 3.2rem;
    margin: 0;
    font-weight: 400;
    text-align: center;
}

.site-description {
    font-size: 1rem;
    font-style: italic;
    color: var(--muted);
    margin-top: -1rem;
    text-align: center;
}

.site-title a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

/* drop cap */
.article-body>p:first-of-type::first-letter {
    float: left;
    font-size: 4rem;
    line-height: 1;
    padding-right: .08rem;
    padding-top: .05rem;
    font-weight: 700;
    color: var(--accent);
}

.article-body blockquote+p::first-letter {
    margin-top: 0.25rem;
}


@media (min-width:900px) {
    .article {
        max-width: 700px;
        margin: 0 auto
    }
}

/* Homepage: series sections */
.series-section {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-light)
}

.series-title {
    font-size: 1.4rem;
    margin: 0 0 .5rem
}

.series-post-list {
    list-style: none;
    padding: 0;
    margin: 0
}

.series-post-list li {
    padding: .5rem 0;
    border-bottom: 1px solid var(--border-lighter)
}

.post-snippet {
    color: var(--muted);
    margin: .25rem 0;
    font-size: 0.98rem
}

/* Author profile styles */
.author-profile .author-top {
    margin-bottom: 1rem
}

.author-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border)
}

.author-meta {
    flex: 1
}

.author-name {
    margin: 0 0 .25rem
}

.author-social {
    list-style: none;
    padding: 0;
    display: flex;
    gap: .5rem;
    margin: 0 0 .5rem
}

.author-bio {
    margin: 1rem 0
}

.author-posts {
    list-style: none;
    padding: 0
}

.author-posts li {
    padding: .5rem 0;
    border-bottom: 1px solid var(--border-alt)
}

blockquote {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--quote-text);
    background: var(--quote-bg);
    border-left: 3px solid var(--quote-accent);
    margin: 1.5rem 0;
    padding: 1rem 1.25rem 1rem 1.5rem;
    position: relative;
}

blockquote::before {
    content: "“";
    position: absolute;
    left: 0.45rem;
    top: -0.2rem;
    font-size: 3rem;
    line-height: 1;
    color: var(--quote-accent);
    font-family: "Georgia", serif;
}

blockquote p {
    margin: 0;
}

blockquote footer,
blockquote cite {
    display: block;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--quote-cite);
    margin-top: 0.75rem;
    text-align: right;
}

blockquote footer::before,
blockquote cite::before {
    content: "— ";
}

blockquote.pull {
    float: right;
    width: 45%;
    margin: 0.5rem 0 1rem 1.5rem;
    font-size: 1.15rem;
    border-left: none;
    border-right: 3px solid var(--quote-accent);
    text-align: right;
}

/* --- Password Protection UI --- */

/* The container that holds the lock screen */
.protected-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
    /* Approximate height of a short post */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    overflow: hidden;

    /* Background Pattern:
       This simulates "blurred text" behind the lock screen 
       using a repeating gradient of the 'border-lighter' color.
    */
    background-image:
        repeating-linear-gradient(var(--bg),
            var(--bg) 15px,
            var(--border-lighter) 15px,
            var(--border-lighter) 25px);
}

/* The actual card containing the input */
.lock-screen {
    font-family: "Georgia", serif;
    background: var(--lock-background);
    /* --bg with transparency */
    backdrop-filter: blur(8px);
    /* The blur effect */
    -webkit-backdrop-filter: blur(8px);
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--accent);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    z-index: 10;
}

.lock-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
}

.lock-icon {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.lock-icon::before {
    content: "🔒";
    font-size: 1.2rem;
}

.lock-message {
    font-size: 0.95rem;
    color: var(--quote-cite);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.lock-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.lock-input {
    flex-grow: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--nav-border);
    background: var(--bg);
    color: var(--accent);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.lock-input:focus {
    border-color: var(--accent);
}

.lock-button {
    padding: 0.6rem 1.2rem;
    background: var(--accent);
    color: var(--bg);
    border: 1px solid var(--accent);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.lock-button:hover {
    opacity: 0.85;
}

.lock-error {
    /* Hardcoded semantic error red */
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 1rem;
    /* Hidden by default */
    display: none;
}

/* --- Decryption Animation Effects --- */

/* We use an animation instead of a transition so we can 
   control the pacing (ease-out) independent of the class addition.
*/
@keyframes optical-resolve {
    0% {
        filter: blur(8px);
        opacity: 0;
        transform: scale(0.98);
        /* Subtle zoom for extra polish */
    }

    40% {
        /* Text becomes readable but still slightly fuzzy */
        opacity: 1;
        filter: blur(3px);
    }

    100% {
        filter: blur(0);
        opacity: 1;
        transform: scale(1);
    }
}

/* The class we will apply via JS */
.decrypt-animating {
    /* 2.0s matches the JS duration (40 steps * 50ms) */
    animation: optical-resolve 2s ease-out forwards;
    will-change: filter, opacity, transform;
}