/* ==========================================================================
   monopole.news - Broadsheet Newspaper Digital Experience
   ========================================================================== */

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

:root {
    --paper-white: #FAFAFA;
    --ink-black: #1A1A1A;
    --newsprint-gray: #F0F0F0;
    --rule-gray: #D0D0D0;
    --ticker-black: #0A0A0A;
    --red-alert: #C02020;
    --link-blue: #1A4A80;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.75;
    color: var(--ink-black);
    background-color: var(--paper-white);
}

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

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Ticker Bar
   ========================================================================== */

.ticker-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--ticker-black);
    color: #FFFFFF;
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-label {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    background-color: var(--red-alert);
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.ticker-track {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: tickerScroll 45s linear infinite;
    padding-left: 100%;
}

.ticker-item {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #FFFFFF;
    letter-spacing: 0.01em;
}

.ticker-separator {
    margin: 0 24px;
    color: var(--red-alert);
    font-size: 10px;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

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

.masthead {
    padding-top: 52px; /* account for fixed ticker */
    background-color: var(--paper-white);
    text-align: center;
    padding-bottom: 0;
}

.masthead-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 0;
}

.masthead-date {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-black);
    opacity: 0.6;
}

.edition-label {
    color: var(--ink-black);
}

.date-text {
    color: var(--ink-black);
}

.masthead-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-weight: 900;
    font-size: clamp(48px, 8vw, 96px);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink-black);
    margin-bottom: 8px;
}

.masthead-dot {
    color: var(--red-alert);
}

.masthead-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--ink-black);
    opacity: 0.5;
    margin-bottom: 20px;
}

.masthead-rule {
    height: 1px;
    background-color: var(--ink-black);
    margin: 0 auto;
    width: 0;
    transition: width 0.8s ease-out;
}

.masthead-rule.revealed {
    width: 100%;
}

.masthead-double-rule {
    height: 3px;
    border-top: 3px double var(--ink-black);
    margin: 4px auto 0;
    width: 0;
    transition: width 0.8s ease-out 0.15s;
}

.masthead-double-rule.revealed {
    width: 100%;
}

/* ==========================================================================
   Newspaper Grid
   ========================================================================== */

.newspaper-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.newspaper-grid > .story {
    padding: 20px 20px;
    border-right: 1px solid var(--rule-gray);
}

.newspaper-grid > .story:last-child {
    border-right: none;
}

/* Column spans */
.lead-story {
    grid-column: span 3;
}

.secondary-story {
    grid-column: span 2;
}

.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

/* ==========================================================================
   Stories
   ========================================================================== */

.story-category {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-black);
    margin-bottom: 8px;
    opacity: 0.7;
}

.story-category--red {
    color: var(--red-alert);
    opacity: 1;
}

.lead-headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(40px, 6vw, 80px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--ink-black);
    margin-bottom: 16px;
}

.headline-accent {
    color: var(--red-alert);
}

.lead-subtitle {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(16px, 1.4vw, 20px);
    line-height: 1.5;
    color: var(--ink-black);
    opacity: 0.7;
    margin-bottom: 16px;
    font-style: italic;
}

.secondary-headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--ink-black);
    margin-bottom: 12px;
}

.brief-headline {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.2;
    color: var(--ink-black);
    margin-bottom: 8px;
}

.story-byline {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--ink-black);
    opacity: 0.5;
}

.story-body {
    margin-bottom: 20px;
}

.story-body p,
.story-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.75;
    color: var(--ink-black);
    margin-bottom: 12px;
}

.brief-text {
    font-size: clamp(13px, 0.9vw, 15px);
    line-height: 1.65;
}

/* ==========================================================================
   Lead Section
   ========================================================================== */

.lead-section {
    padding: 30px 0;
    background-color: var(--paper-white);
}

/* ==========================================================================
   Section Dividers
   ========================================================================== */

.section-divider {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.major-divider {
    border-top: 1px solid var(--ink-black);
    margin-top: 10px;
    margin-bottom: 10px;
}

.minor-divider {
    border-top: 1px solid var(--rule-gray);
    margin-top: 10px;
    margin-bottom: 10px;
}

.section-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-title {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-black);
    white-space: nowrap;
}

.section-rule {
    flex: 1;
    height: 1px;
    background-color: var(--rule-gray);
}

/* ==========================================================================
   Below the Fold
   ========================================================================== */

.below-fold {
    padding: 30px 0;
    background-color: var(--newsprint-gray);
}

.below-fold .newspaper-grid > .story {
    border-right-color: var(--rule-gray);
}

/* ==========================================================================
   Data Visualizations
   ========================================================================== */

.data-viz {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-gray);
}

.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.viz-title {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-black);
}

.viz-unit {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--ink-black);
    opacity: 0.5;
}

.chart {
    width: 100%;
    height: auto;
}

.grid-line {
    stroke: var(--rule-gray);
    stroke-width: 0.5;
}

.axis-line {
    stroke: var(--ink-black);
    stroke-width: 1;
}

.chart-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    fill: var(--ink-black);
    opacity: 0.6;
}

.data-line {
    stroke: var(--ink-black);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.data-line--secondary {
    stroke: var(--rule-gray);
    stroke-width: 1.5;
    stroke-dasharray: 4 3;
}

.data-point {
    fill: var(--ink-black);
    stroke: var(--paper-white);
    stroke-width: 1.5;
}

.bar {
    fill: var(--ink-black);
}

.legend-line {
    stroke: var(--ink-black);
    stroke-width: 1.5;
}

.legend-line--secondary {
    stroke: var(--rule-gray);
    stroke-dasharray: 4 3;
}

/* Data viz animation: lines draw in */
.data-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.data-line.animate-in {
    stroke-dashoffset: 0;
}

/* Bar animation: grow from bottom */
.bar {
    transform-origin: bottom;
    transform: scaleY(0);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bar.animate-in {
    transform: scaleY(1);
}

/* ==========================================================================
   Pull Quote
   ========================================================================== */

.pullquote-section {
    padding: 50px 0;
    background-color: var(--paper-white);
}

.pullquote-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.pullquote p {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 52px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink-black);
    margin-bottom: 20px;
}

.pullquote-cite {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-black);
    opacity: 0.5;
    font-style: normal;
}

/* ==========================================================================
   Opinion Section
   ========================================================================== */

.opinion-section {
    padding: 30px 0 40px;
    background-color: var(--paper-white);
}

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

.site-footer {
    background-color: var(--ticker-black);
    color: var(--paper-white);
    padding: 0;
}

.footer-rule {
    height: 3px;
    border-top: 3px double var(--rule-gray);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    text-align: center;
}

.footer-masthead {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(24px, 3vw, 36px);
    color: var(--paper-white);
    margin-bottom: 20px;
}

.footer-dot {
    color: var(--red-alert);
}

.footer-sections {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rule-gray);
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--rule-gray);
    opacity: 0.5;
}

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

/* Tablet: 3 columns */
@media (max-width: 1024px) {
    .newspaper-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lead-story {
        grid-column: span 2;
    }

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

    .col-span-3 {
        grid-column: span 3;
    }

    .col-span-2 {
        grid-column: span 2;
    }

    .col-span-1 {
        grid-column: span 1;
    }
}

/* Mobile: single column */
@media (max-width: 640px) {
    .newspaper-grid {
        grid-template-columns: 1fr;
    }

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

    .newspaper-grid > .story {
        border-right: none;
        border-bottom: 1px solid var(--rule-gray);
        padding: 16px 0;
    }

    .newspaper-grid > .story:last-child {
        border-bottom: none;
    }

    .masthead-inner {
        padding: 24px 16px 0;
    }

    .lead-headline {
        font-size: clamp(32px, 8vw, 48px);
    }

    .ticker-label {
        padding: 0 8px;
        font-size: 10px;
    }

    .viz-header {
        flex-direction: column;
        gap: 4px;
    }

    .footer-sections {
        gap: 12px;
    }
}
