/* ============================================================
   rational.today — Brutalist Newspaper Design
   ============================================================ */

/* --- Variables --- */
:root {
    --black: #141414;
    --cream: #faf8f5;
    --red: #c41e3a;
    --gray: #2c2c2c;
    --fold: #e8e4de;
    --yellow: #f5c518;

    --font-headline: 'Bebas Neue', sans-serif;
    --font-body: 'IBM Plex Serif', serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --grid-border: 1px solid #141414;
    --baseline: 1.4rem;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    background: var(--cream);
    color: var(--black);
}

body {
    font-family: var(--font-body);
    background: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Edition Counter (Fixed) --- */
#edition-counter {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: var(--black);
    color: var(--cream);
    padding: 0.4rem 0.75rem;
    border-left: 4px solid var(--red);
}

.edition-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fold);
}

.edition-number {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--yellow);
    letter-spacing: 0.02em;
}

/* --- Masthead Header --- */
#masthead {
    border-bottom: var(--grid-border);
    border-top: 4px solid var(--black);
    background: var(--cream);
}

#masthead-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

#masthead-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: var(--grid-border);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
}

.masthead-divider {
    color: var(--fold);
    font-weight: bold;
}

#masthead-title {
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: var(--grid-border);
    position: relative;
}

#masthead-title::before,
#masthead-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: var(--black);
    transform: translateY(-50%);
}

#masthead-title::before { left: 0; }
#masthead-title::after { right: 0; }

#site-title {
    font-family: var(--font-headline);
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: 0.05em;
    line-height: 1;
    color: var(--black);
    text-transform: uppercase;
}

#masthead-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray);
}

.breaking {
    color: var(--red);
    font-weight: 700;
}

/* --- Hero Section --- */
#hero {
    background: var(--black);
    background-image:
        radial-gradient(circle, rgba(250,248,245,0.18) 1px, transparent 1px);
    background-size: 4px 4px;
    position: relative;
    border-bottom: 4px solid var(--black);
    overflow: hidden;
}

#hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 1.4rem,
        rgba(250,248,245,0.04) 1.4rem,
        rgba(250,248,245,0.04) calc(1.4rem + 1px)
    );
    pointer-events: none;
}

#hero-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

#hero-dateline {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--red);
    padding-left: 0.75rem;
    color: var(--red);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#hero-headline {
    font-family: var(--font-headline);
    font-size: clamp(4rem, 10vw, 9rem);
    line-height: 0.95;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    max-width: 900px;
}

#hero-deck {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--fold);
    max-width: 560px;
    border-left: 2px solid var(--fold);
    padding-left: 1rem;
}

/* --- Dateline Stamps --- */
.dateline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-left: 4px solid var(--gray);
    padding-left: 0.6rem;
    color: var(--gray);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.dateline.activated {
    border-left-color: var(--red);
    color: var(--red);
}

.date-stamp {
    color: inherit;
}

.dateline-category {
    font-weight: 700;
    color: inherit;
}

/* --- Main Content Grid --- */
#content-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr;
    gap: 0;
    border-left: var(--grid-border);
    border-right: var(--grid-border);
}

/* Grid Cell Base */
.grid-cell {
    border: var(--grid-border);
    border-left: none;
    border-top: none;
    padding: 1.5rem;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.6s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.4s ease;
}

.grid-cell.revealed {
    opacity: 1;
    clip-path: inset(0 0 0 0);
}

/* --- Article Types --- */
.article-primary {
    grid-column: 1 / 2;
}

.article-secondary {
    grid-column: 2 / 3;
}

.article-pullquote {
    grid-column: 3 / 4;
}

.sidebar {
    grid-column: 4 / 5;
    grid-row: 1 / 3;
    background: var(--black);
    color: var(--cream);
}

.sidebar .dateline {
    color: var(--fold);
    border-left-color: var(--red);
}

.sidebar .dateline.activated {
    border-left-color: var(--yellow);
    color: var(--yellow);
}

.article-wide {
    grid-column: 1 / 3;
}

.article-medium {
    grid-column: 3 / 4;
}

.article-sticky {
    grid-column: 4 / 5;
    background: var(--black);
    color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-tertiary {
    grid-column: span 1;
}

.sidebar-secondary {
    grid-column: 4 / 5;
    background: var(--fold);
}

/* --- Article Headlines --- */
.article-headline {
    font-family: var(--font-headline);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    letter-spacing: 0.03em;
    line-height: 1.05;
    color: var(--black);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.sidebar .article-headline,
.article-sticky .article-headline {
    color: var(--cream);
}

/* --- Article Body Text --- */
.article-body {
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--gray);
}

.sidebar .article-body {
    color: var(--fold);
}

.article-body.two-column {
    column-count: 2;
    column-gap: 1.25rem;
    column-rule: 1px solid var(--fold);
}

.article-body p {
    margin-bottom: 0.6rem;
}

.article-body p:last-child {
    margin-bottom: 0;
}

/* --- Pull Quote Blocks --- */
.pull-quote-block {
    background: var(--cream);
    border-left: 5px solid var(--red);
    padding: 1rem 1rem 1rem 1.25rem;
    margin-bottom: 1rem;
    transform: rotate(-0.4deg);
}

.pull-quote-yellow {
    background: var(--yellow);
    border-left: 5px solid var(--black);
    transform: rotate(-0.6deg);
    padding: 1.25rem;
    width: 100%;
}

.pull-quote-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--black);
    margin-bottom: 0.5rem;
}

.pull-quote-attr {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray);
}

.pull-quote-yellow .pull-quote-text {
    font-size: 0.95rem;
    color: var(--black);
}

.pull-quote-yellow .pull-quote-attr {
    color: var(--gray);
}

/* --- Propositions List (Sidebar) --- */
.propositions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.proposition-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(250,248,245,0.15);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--fold);
}

.proposition-item:last-child {
    border-bottom: none;
}

.prop-number {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--red);
    flex-shrink: 0;
    min-width: 1.5rem;
    font-size: 0.8rem;
}

.prop-text {
    color: var(--fold);
}

/* --- Index List --- */
.index-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.index-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--fold);
}

.index-item:last-child {
    border-bottom: none;
}

.index-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
}

.index-value {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--black);
}

/* --- Footer --- */
#masthead-footer {
    border-top: 4px solid var(--black);
    background: var(--cream);
}

#footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-left: var(--grid-border);
    border-right: var(--grid-border);
}

.footer-col {
    padding: 1.25rem 1.5rem;
    border-right: var(--grid-border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-col:last-child {
    border-right: none;
}

.footer-col-center {
    text-align: center;
    align-items: center;
    border-right: var(--grid-border);
}

.footer-col-right {
    align-items: flex-end;
    text-align: right;
}

.footer-head {
    font-family: var(--font-headline);
    font-size: 1.4rem;
    letter-spacing: 0.05em;
    color: var(--black);
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--gray);
}

.footer-text.mono {
    font-family: var(--font-mono);
    color: var(--gray);
}

.footer-rule {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--red);
    line-height: 1;
}

#footer-bar {
    background: var(--black);
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.65rem 1.5rem;
    flex-wrap: wrap;
}

.footer-bar-text {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fold);
}

.footer-bar-divider {
    font-family: var(--font-mono);
    color: var(--red);
    font-size: 0.75rem;
}

/* --- Baseline grid overlay on hero --- */
#hero {
    background-color: var(--black);
}

/* --- Mono label utility --- */
.mono-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    #content-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .sidebar {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
    }

    .article-primary { grid-column: 1 / 2; }
    .article-secondary { grid-column: 2 / 3; }
    .article-pullquote { grid-column: 1 / 2; }
    .article-wide { grid-column: 1 / 3; }
    .article-medium { grid-column: 1 / 2; }
    .article-sticky { grid-column: 2 / 3; }
    .article-tertiary { grid-column: span 1; }
    .sidebar-secondary { grid-column: 3 / 4; }

    .article-body.two-column {
        column-count: 1;
    }
}

@media (max-width: 720px) {
    #content-grid {
        grid-template-columns: 1fr 1fr;
    }

    .sidebar { grid-column: 1 / 3; grid-row: auto; }
    .article-primary { grid-column: 1 / 2; }
    .article-secondary { grid-column: 2 / 3; }
    .article-pullquote { grid-column: 1 / 3; }
    .article-wide { grid-column: 1 / 3; }
    .article-medium { grid-column: 1 / 2; }
    .article-sticky { grid-column: 2 / 3; }
    .article-tertiary { grid-column: span 1; }
    .sidebar-secondary { grid-column: 1 / 3; }

    #footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-col {
        border-right: none;
        border-bottom: var(--grid-border);
    }

    .footer-col-right { align-items: flex-start; text-align: left; }
    .footer-col-center { align-items: flex-start; text-align: left; }

    #masthead-title::before,
    #masthead-title::after {
        display: none;
    }

    #edition-counter {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 480px) {
    #content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .article-primary,
    .article-secondary,
    .article-pullquote,
    .article-wide,
    .article-medium,
    .article-sticky,
    .article-tertiary,
    .sidebar-secondary {
        grid-column: 1 / 2;
    }
}
