/* ==========================================================================
   The Dissenter - Newspaper/Magazine Theme
   ========================================================================== */

/* CSS Custom Properties */
:root {
    /* Colors */
    --color-ink: #1a1a1a;
    --color-paper: #faf9f6;
    --color-accent: #8b0000;
    --color-accent-hover: #a52a2a;
    --color-muted: #666666;
    --color-border: #d4d4d4;
    --color-rule: #1a1a1a;

    /* Typography */
    --font-headline: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
    --font-masthead: 'Playfair Display', 'Georgia', serif;

    /* Spacing */
    --spacing-unit: 1rem;
    --content-width: 1200px;
    --article-width: 680px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
    font-size: 62.5%; /* 10px base for easy rem math */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1.7rem;
    line-height: 1.6;
    color: var(--color-ink);
    background-color: var(--color-paper);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ==========================================================================
   Layout
   ========================================================================== */

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

.outer {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.inner {
    width: 100%;
}

.site-main {
    flex: 1;
    padding: 2rem 0 4rem;
}

/* ==========================================================================
   Masthead / Header
   ========================================================================== */

.site-header {
    background: var(--color-paper);
    border-bottom: 3px double var(--color-rule);
    padding: 1.5rem 0 0;
}

.masthead-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.3rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.masthead-date {
    font-weight: 600;
}

.masthead-tagline {
    font-style: italic;
}

.masthead-main {
    text-align: center;
    padding: 2.5rem 0;
}

.masthead-title {
    font-family: var(--font-masthead);
    font-size: 5.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--color-ink);
    text-decoration: none;
}

.masthead-title:hover {
    color: var(--color-accent);
}

.masthead-logo img {
    max-height: 120px;
    width: auto;
    margin: 0 auto;
}

/* Navigation */
.masthead-nav {
    border-top: 1px solid var(--color-border);
    padding: 1rem 0;
}

.masthead-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.masthead-nav li {
    margin: 0;
}

.masthead-nav a {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-ink);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.masthead-nav a:hover,
.masthead-nav .nav-current a {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* ==========================================================================
   Featured Story (Lead Article)
   ========================================================================== */

.featured-story {
    margin-bottom: 4rem;
}

.featured-card {
    border: 1px solid var(--color-border);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.featured-card-link {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 400px;
}

.featured-card-image {
    margin: 0;
    overflow: hidden;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-card:hover .featured-card-image img {
    transform: scale(1.02);
}

.featured-card-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-label {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.featured-title {
    font-family: var(--font-headline);
    font-size: 3.6rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 1.5rem;
    color: var(--color-ink);
}

.featured-excerpt {
    font-size: 1.8rem;
    line-height: 1.6;
    color: var(--color-muted);
    margin: 0 0 2rem;
}

.featured-meta {
    display: flex;
    gap: 2rem;
    font-size: 1.4rem;
    color: var(--color-muted);
}

.featured-meta .byline {
    font-weight: 600;
    color: var(--color-ink);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section-header {
    margin: 3rem 0 2rem;
}

.section-title {
    font-family: var(--font-headline);
    font-size: 2.4rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-rule {
    height: 3px;
    background: var(--color-rule);
    width: 60px;
}

/* ==========================================================================
   Post Feed (Grid)
   ========================================================================== */

.post-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.post-card {
    border: 1px solid var(--color-border);
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.post-card-link {
    display: block;
    height: 100%;
}

.post-card-image {
    margin: 0;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-tag {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

.post-card-title {
    font-family: var(--font-headline);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    color: var(--color-ink);
}

.post-card-excerpt {
    font-size: 1.4rem;
    line-height: 1.5;
    color: var(--color-muted);
    margin: 0 0 1rem;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    color: var(--color-muted);
}

.post-card-meta .byline {
    font-weight: 600;
    color: var(--color-ink);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.pagination a {
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-ink);
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--color-ink);
    color: var(--color-paper);
}

.page-number {
    font-size: 1.3rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Single Post / Article Page
   ========================================================================== */

.post-full {
    max-width: var(--article-width);
    margin: 0 auto;
}

.post-full-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.post-full-tag {
    margin-bottom: 1.5rem;
}

.post-full-tag a {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-accent);
}

.post-full-tag a:hover {
    background: var(--color-accent);
    color: var(--color-paper);
}

.post-full-title {
    font-family: var(--font-headline);
    font-size: 4.2rem;
    font-weight: 900;
    line-height: 1.1;
    margin: 0 0 1.5rem;
    color: var(--color-ink);
}

.post-full-excerpt {
    font-family: var(--font-headline);
    font-size: 2rem;
    font-style: italic;
    line-height: 1.4;
    color: var(--color-muted);
    margin: 0 0 2rem;
}

.post-full-meta {
    display: flex;
    justify-content: center;
    gap: 3rem;
    font-size: 1.4rem;
    color: var(--color-muted);
}

.post-full-byline .byline-label {
    font-style: italic;
    margin-right: 0.5rem;
}

.post-full-byline .byline-author {
    font-weight: 700;
    color: var(--color-ink);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-full-date time {
    font-weight: 600;
}

.reading-time {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--color-border);
}

.post-full-image {
    margin: 0 0 3rem;
}

.post-full-image img {
    width: 100%;
}

.post-full-image figcaption {
    font-size: 1.3rem;
    color: var(--color-muted);
    font-style: italic;
    text-align: center;
    margin-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* Article Content - Clean and Modern */
.post-full-content {
    font-family: var(--font-body);
    font-size: 1.9rem;
    line-height: 1.75;
    color: var(--color-ink);
}

.post-full-content p {
    margin: 0 0 1.75rem;
}

.post-full-content > p:first-of-type::first-letter {
    font-family: var(--font-headline);
    font-size: 5.5rem;
    font-weight: 700;
    float: left;
    line-height: 0.85;
    margin: 0.5rem 1rem 0 0;
    color: var(--color-accent);
}

.post-full-content h2,
.post-full-content h3,
.post-full-content h4 {
    font-family: var(--font-headline);
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
}

.post-full-content h2 {
    font-size: 2.8rem;
}

.post-full-content h3 {
    font-size: 2.2rem;
}

.post-full-content h4 {
    font-size: 1.9rem;
}

.post-full-content blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--color-accent);
    background: rgba(139, 0, 0, 0.03);
    font-family: var(--font-headline);
    font-size: 2.1rem;
    font-style: italic;
    line-height: 1.5;
}

.post-full-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-full-content ul,
.post-full-content ol {
    margin: 0 0 1.75rem 2rem;
    padding: 0;
}

.post-full-content li {
    margin-bottom: 0.75rem;
}

.post-full-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.post-full-content img {
    margin: 2.5rem auto;
}

.post-full-content figure {
    margin: 2.5rem 0;
}

.post-full-content figcaption {
    font-size: 1.3rem;
    color: var(--color-muted);
    font-style: italic;
    text-align: center;
    margin-top: 0.75rem;
}

.post-full-content hr {
    border: none;
    height: 1px;
    background: var(--color-border);
    margin: 3rem auto;
    width: 50%;
}

.post-full-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1.5rem;
    background: #f4f4f4;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.post-full-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-full-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Article Footer */
.post-full-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-full-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.tags-label {
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-muted);
}

.post-full-tags .tag {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.post-full-tags .tag:hover {
    background: var(--color-ink);
    color: var(--color-paper);
}

/* ==========================================================================
   Read More Section
   ========================================================================== */

.read-more {
    max-width: var(--article-width);
    margin: 5rem auto 0;
    padding-top: 3rem;
    border-top: 3px double var(--color-rule);
}

.read-more-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.read-more-card a {
    display: block;
}

.read-more-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    margin-bottom: 1rem;
}

.read-more-card h4 {
    font-family: var(--font-headline);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.read-more-card time {
    font-size: 1.2rem;
    color: var(--color-muted);
}

/* ==========================================================================
   Page Headers (Tag, Author, Page templates)
   ========================================================================== */

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-family: var(--font-headline);
    font-size: 4rem;
    font-weight: 900;
    margin: 0 0 1rem;
}

.page-description {
    font-size: 1.8rem;
    color: var(--color-muted);
    margin: 0;
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
}

.tag-label {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.author-header .author-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--color-border);
}

.author-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 1.4rem;
    color: var(--color-muted);
}

.author-website {
    color: var(--color-accent);
}

/* Page template */
.page-full {
    max-width: var(--article-width);
    margin: 0 auto;
}

.page-full-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.page-full-title {
    font-family: var(--font-headline);
    font-size: 4rem;
    font-weight: 900;
    margin: 0;
}

.page-full-image {
    margin: 0 0 3rem;
}

.page-full-content {
    font-size: 1.9rem;
    line-height: 1.75;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 6rem 0;
}

.error-code {
    font-family: var(--font-headline);
    font-size: 8rem;
    font-weight: 900;
    color: var(--color-accent);
    margin: 0 0 1rem;
    line-height: 1;
}

.error-title {
    font-family: var(--font-headline);
    font-size: 2.4rem;
    margin: 0 0 1rem;
}

.error-description {
    font-size: 1.6rem;
    color: var(--color-muted);
    margin: 0 0 2rem;
}

.error-link {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 2rem;
    border: 2px solid var(--color-ink);
    transition: all 0.2s ease;
}

.error-link:hover {
    background: var(--color-ink);
    color: var(--color-paper);
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.1);
    z-index: 1000;
}

.reading-progress-bar {
    height: 100%;
    background: var(--color-accent);
    width: 0%;
    transition: width 0.1s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--color-ink);
    color: var(--color-paper);
    padding: 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.footer-title {
    font-family: var(--font-masthead);
    font-size: 2.8rem;
    font-weight: 900;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-description {
    font-size: 1.4rem;
    color: #999;
    margin: 0;
    max-width: 40ch;
}

.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-nav a {
    font-size: 1.3rem;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-nav a:hover {
    color: var(--color-paper);
}

.footer-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 1px solid #333;
    font-size: 1.2rem;
    color: #666;
}

.footer-meta a {
    color: #999;
}

.footer-meta a:hover {
    color: var(--color-paper);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 900px) {
    .featured-card-link {
        grid-template-columns: 1fr;
    }

    .featured-card-image {
        aspect-ratio: 16/9;
    }

    .featured-title {
        font-size: 2.8rem;
    }

    .post-feed {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-full-title {
        font-size: 3.2rem;
    }

    .read-more-feed {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    html {
        font-size: 55%;
    }

    .masthead-title {
        font-size: 3.5rem;
    }

    .masthead-top {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .masthead-nav ul {
        gap: 1.5rem;
    }

    .featured-card-content {
        padding: 2rem;
    }

    .featured-title {
        font-size: 2.4rem;
    }

    .post-feed {
        grid-template-columns: 1fr;
    }

    .post-full-title {
        font-size: 2.6rem;
    }

    .post-full-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .reading-time {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .post-full-content > p:first-of-type::first-letter {
        font-size: 4rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-nav ul {
        align-items: center;
    }

    .footer-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .read-more,
    .pagination {
        display: none;
    }

    .post-full {
        max-width: 100%;
    }

    .post-full-title {
        font-size: 24pt;
    }

    .post-full-content {
        font-size: 11pt;
        line-height: 1.5;
    }

    .post-full-content a {
        color: var(--color-ink);
        text-decoration: none;
    }
}
