/* ==========================================================================
   politics.day - Editorial Brutalism / Vintage Newspaper
   Colors: #F5F0E8, #1A1A1A, #8B0000, #1B3A5C, #C49B2A, #D1C9B8, #3D3D3D, #D35400
   Fonts: Playfair Display, Source Serif 4, Space Mono
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background-color: #F5F0E8;
    color: #1A1A1A;
    line-height: 1.55;
    overflow-x: hidden;
    padding-bottom: 48px;
}

/* --- Grain Overlay --- */
#grain-svg {
    position: absolute;
    width: 0;
    height: 0;
}

#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Typography --- */
.headline, .masthead-title, .section-header, .editorial-title {
    font-family: 'Playfair Display', Georgia, serif;
    letter-spacing: -0.02em;
    line-height: 0.95;
}

.dateline, .masthead-date, .masthead-edition, .card-date, .wire-timestamp, .ticker-item, .ticker-separator {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.byline {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1B3A5C;
    margin: 0.5rem 0;
}

/* --- Masthead --- */
#masthead {
    position: relative;
    width: 100%;
    height: 70px;
    background: #F5F0E8;
    border-top: 3px solid #1A1A1A;
    border-bottom: 1px solid #1A1A1A;
    z-index: 100;
}

.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
}

.masthead-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1A1A1A;
}

.masthead-date, .masthead-edition {
    color: #3D3D3D;
}

.masthead-rule {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #8B0000;
}

/* --- Section Headers --- */
.section-header {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #1A1A1A;
    display: inline-block;
}

.header-dash {
    color: #8B0000;
}

/* --- Section 1: Front Page --- */
.section-front-page {
    position: relative;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.front-page-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
    position: relative;
}

.story-block {
    background: #F5F0E8;
    padding: 1.5rem;
    position: relative;
    box-shadow: 4px 4px 0px #1A1A1A;
    border: 1px solid #3D3D3D;
}

.story-lead {
    grid-column: 1 / 5;
    grid-row: 1 / 3;
    z-index: 3;
}

.story-secondary-1 {
    grid-column: 5 / 7;
    grid-row: 1 / 2;
    z-index: 2;
}

.story-secondary-2 {
    grid-column: 5 / 7;
    grid-row: 2 / 3;
    z-index: 2;
    margin-top: -12px;
}

.story-secondary-3 {
    grid-column: 1 / 4;
    grid-row: 3 / 4;
    z-index: 2;
}

.headline-lead {
    font-weight: 900;
    font-size: clamp(2.5rem, 5vw, 5.5rem);
    color: #1A1A1A;
    margin-bottom: 1rem;
}

.headline-secondary {
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    color: #1A1A1A;
    margin-bottom: 0.75rem;
}

.dateline {
    display: block;
    color: #1B3A5C;
    margin-bottom: 0.75rem;
}

.timestamp {
    color: #D35400;
}

.story-excerpt {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.55;
    color: #1A1A1A;
}

/* Duotone Image */
.story-image-wrap {
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 3%, 97% 100%, 2% 97%);
}

.duotone-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3D3D3D 0%, #1A1A1A 50%, #3D3D3D 100%);
    background-size: 200% 200%;
}

.duotone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #8B0000;
    mix-blend-mode: multiply;
    opacity: 0.7;
}

/* Pull Quote */
.pull-quote {
    grid-column: 4 / 7;
    grid-row: 3 / 4;
    position: relative;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    border-left: 4px solid #C49B2A;
    z-index: 4;
    transform: rotate(-1deg);
    background: #F5F0E8;
}

.pull-quote p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    font-weight: 600;
    font-style: italic;
    line-height: 1.4;
    color: #1A1A1A;
}

.pull-quote cite {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1B3A5C;
    margin-top: 0.75rem;
}

/* Column Rules */
.column-rule {
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    width: 1px;
    background: #8B0000;
    z-index: 1;
}

.column-rule::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 7px;
    height: 7px;
    background: #8B0000;
    transform: rotate(45deg);
}

.column-rule::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -3px;
    width: 7px;
    height: 7px;
    background: #8B0000;
    transform: rotate(45deg);
}

.column-rule-1 {
    left: calc(66.666% + 1rem);
}

.column-rule-2 {
    left: calc(50% + 0.75rem);
    top: 60%;
}

/* --- Slide Reveal Animation --- */
.slide-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section 2: Redacted Briefing --- */
.section-redacted {
    position: relative;
    background: #D1C9B8;
    padding: 4rem 2rem 4rem;
    margin-top: 3rem;
    overflow: hidden;
}

.section-diagonal-top {
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 60px;
    background: #D1C9B8;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
    z-index: 2;
}

.section-redacted .section-diagonal-top {
    background: #D1C9B8;
}

.section-evidence .section-diagonal-top {
    background: #F5F0E8;
}

.section-evidence .section-diagonal-top.reverse {
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.section-editorial .section-diagonal-top {
    background: #F5F0E8;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.section-wire .section-diagonal-top {
    background: #1A1A1A;
}

.section-wire .section-diagonal-top.reverse {
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.redacted-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.briefing-columns {
    column-count: 3;
    column-gap: 2rem;
    column-rule: 1px solid #8B0000;
}

.briefing-columns p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    break-inside: avoid;
}

/* Redaction Bars */
.redacted {
    background: #1A1A1A;
    color: #1A1A1A;
    padding: 0.1em 0.3em;
    cursor: pointer;
    transition: color 0.3s ease;
    display: inline;
    position: relative;
    text-decoration: none;
    font-weight: 400;
}

.redacted:hover {
    color: #F5F0E8;
}

/* Rubber Stamp */
.rubber-stamp {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: 3px solid #1B3A5C;
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    color: #1B3A5C;
    opacity: 0.15;
    pointer-events: none;
    z-index: 5;
}

.stamp-declassified {
    font-size: clamp(2.5rem, 5vw, 5rem);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
}

/* Blur Focus Animation for redactions */
.redacted.blur-focus {
    filter: blur(2px);
    transition: color 0.3s ease, filter 0.6s ease;
}

.redacted.blur-focus.is-focused {
    filter: blur(0);
}

/* --- Section 3: Evidence Wall --- */
.section-evidence {
    position: relative;
    background: #F5F0E8;
    padding: 4rem 2rem 4rem;
    margin-top: 0;
    overflow: hidden;
}

.evidence-header {
    text-align: center;
    display: block;
    border-bottom: none;
    position: relative;
}

.evidence-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 2px;
    background: #1A1A1A;
    margin: 0.5rem auto 0;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.evidence-card {
    background: #F5F0E8;
    border: 1px solid #3D3D3D;
    padding: 2rem 1.5rem 1.5rem;
    position: relative;
    box-shadow: 4px 4px 0px #1A1A1A;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    opacity: 0;
    transform: translateY(30px) rotate(calc(var(--card-rotation, 0) * 1deg));
}

.evidence-card.bounce-enter {
    opacity: 1;
    transform: translateY(0) rotate(calc(var(--card-rotation, 0) * 1deg));
    transition-delay: calc(var(--card-index) * 80ms);
}

.evidence-card:hover {
    transform: translateY(-4px) rotate(calc(var(--card-rotation, 0) * 1deg));
    box-shadow: 6px 8px 0px #1A1A1A;
}

.card-pin {
    position: absolute;
    top: -8px;
    right: 16px;
    width: 20px;
    height: 26px;
    z-index: 2;
}

.paperclip-icon {
    width: 100%;
    height: 100%;
}

.card-date {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1B3A5C;
    margin-bottom: 0.75rem;
}

.card-headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #1A1A1A;
    margin-bottom: 0.75rem;
}

.card-excerpt {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.5;
    color: #3D3D3D;
}

.card-stamp {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1B3A5C;
    border: 2px solid #1B3A5C;
    border-radius: 2px;
    padding: 0.15rem 0.5rem;
    opacity: 0.35;
    transform: rotate(-5deg);
}

/* --- Section 4: Editorial --- */
.section-editorial {
    position: relative;
    background: #F5F0E8;
    padding: 4rem 2rem;
    overflow: hidden;
}

.editorial-inner {
    max-width: 680px;
    margin: 0 auto;
}

.editorial-label {
    text-align: center;
    display: block;
    border-bottom: none;
}

.editorial-label::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: #8B0000;
    margin: 0.5rem auto 0;
}

.editorial-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 0.95;
    text-align: center;
    margin-bottom: 2.5rem;
    color: #1A1A1A;
}

.editorial-column {
    position: relative;
}

.editorial-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    color: #1A1A1A;
}

.editorial-dropcap::first-letter {
    float: left;
    font-size: 4em;
    line-height: 0.8;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    color: #8B0000;
    margin-right: 0.1em;
    margin-top: 0.05em;
}

.editorial-pullquote {
    float: right;
    width: 260px;
    margin: 0 0 1.5rem 2rem;
    padding: 1rem 0 1rem 1.5rem;
    border-left: 3px solid #C49B2A;
    position: relative;
}

.pullquote-mark {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    line-height: 0.5;
    color: #C49B2A;
    display: block;
    margin-bottom: 0.5rem;
}

.editorial-pullquote p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    font-weight: 600;
    font-style: italic;
    line-height: 1.4;
    color: #1A1A1A;
}

/* --- Section 5: Wire Room --- */
.section-wire {
    position: relative;
    background: #1A1A1A;
    padding: 4rem 2rem 5rem;
    overflow: hidden;
}

.wire-inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.wire-header {
    color: #F5F0E8;
    border-bottom-color: #F5F0E8;
}

.wire-feed {
    position: relative;
}

.wire-entry {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px dashed #3D3D3D;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.78rem, 0.95vw, 0.9rem);
    line-height: 1.5;
    color: #F5F0E8;
}

.wire-timestamp {
    flex-shrink: 0;
    color: #D35400;
    min-width: 80px;
}

.wire-text {
    color: #F5F0E8;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.02em;
}

.wire-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #D35400;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Wire border animation */
.wire-border-animate {
    position: absolute;
    top: 40px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    border: 2px dashed #3D3D3D;
    pointer-events: none;
    opacity: 0.3;
}

/* --- Wire Ticker --- */
.wire-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #1A1A1A;
    opacity: 0.92;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-top: 2px solid #D35400;
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    white-space: nowrap;
    animation: ticker-scroll 45s linear infinite;
}

.ticker-item {
    color: #D35400;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticker-separator {
    color: #3D3D3D;
    font-size: 0.6rem;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Mobile / Responsive --- */
@media (max-width: 1024px) {
    .front-page-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .story-lead {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .story-secondary-1,
    .story-secondary-2 {
        grid-column: span 1;
        grid-row: auto;
        margin-top: 0;
    }

    .story-secondary-3 {
        grid-column: span 1;
        grid-row: auto;
    }

    .pull-quote {
        grid-column: 1 / -1;
        grid-row: auto;
        transform: rotate(0deg);
    }

    .column-rule {
        display: none;
    }

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

    .briefing-columns {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .front-page-grid {
        grid-template-columns: 1fr;
    }

    .story-secondary-1,
    .story-secondary-2,
    .story-secondary-3 {
        grid-column: 1;
    }

    .pull-quote {
        grid-column: 1;
    }

    .evidence-grid {
        grid-template-columns: 1fr;
    }

    .briefing-columns {
        column-count: 1;
    }

    .editorial-pullquote {
        float: none;
        width: 100%;
        margin: 1.5rem 0;
    }

    .wire-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .headline-lead {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .headline-secondary {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .duotone-image {
        height: 200px;
    }
}
