/* =====================================================================
   GAZZA NEWS — neubrutalist newspaper that progressively breaks down
   Palette:
     #f5f0e8 Newsprint White (bg)
     #1a1a1a Ink Black (text)
     #d42020 Tabloid Red
     #1a4b8c Editorial Blue
     #fff3b0 Correction Yellow
     #fce4ec Exposed Pink
     #333333 Printing Plate (rules)
   Fonts: Abril Fatface (display), Lora (body), Roboto Condensed (labels)
   ===================================================================== */

:root {
    --bg: #f5f0e8;
    --ink: #1a1a1a;
    --red: #d42020;
    --blue: #1a4b8c;
    --yellow: #fff3b0;
    --pink: #fce4ec;
    --plate: #333333;

    --rule: 1px solid var(--plate);
    --rule-thick: 3px solid var(--ink);
    --rule-fat: 6px solid var(--ink);

    --font-display: 'Abril Fatface', 'Lora', Georgia, serif;
    --font-body: 'Lora', Georgia, 'Times New Roman', serif;
    --font-label: 'Roboto Condensed', 'Inter', Arial, sans-serif;

    /* progressive degradation knobs (script bumps them) */
    --rule-style: solid;
    --hed-rotate: 0deg;
    --bleed-blur: 2px;
    --bleed-spread: 8px;
    --paper-rotate: 0deg;
    --paper-opacity: 1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.paper {
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 3px,
            rgba(26,26,26,0.012) 3px,
            rgba(26,26,26,0.012) 4px
        ),
        radial-gradient(circle at 20% 10%, rgba(26,26,26,0.04) 0, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(26,26,26,0.03) 0, transparent 40%),
        var(--bg);
    transition: opacity 600ms ease, transform 600ms ease;
}

body[data-scroll-stage="4"] {
    transform: rotate(var(--paper-rotate));
    opacity: var(--paper-opacity);
}

/* ----- selection ----- */
::selection {
    background: var(--red);
    color: var(--bg);
}

/* =====================================================================
   1. MASTHEAD
   ===================================================================== */
.masthead {
    padding: 2.5rem clamp(1rem, 4vw, 3.5rem) 1.5rem;
    border-bottom: var(--rule-fat);
    position: relative;
}

.masthead-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-label);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    padding-bottom: 0.6rem;
}

.meta-center {
    color: var(--red);
    font-weight: 700;
    letter-spacing: 0.22em;
}

.masthead-rule {
    height: 1px;
    background: var(--ink);
    margin: 0.5rem 0;
}

.masthead-rule + .masthead-rule { margin-top: 0; }

.masthead-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(4rem, 14vw, 11rem);
    line-height: 0.95;
    letter-spacing: -0.015em;
    text-align: center;
    color: var(--ink);
    padding: 0.4rem 0 0.6rem;
    text-shadow:
        0 0 var(--bleed-blur) rgba(26,26,26,0.55),
        0 0 var(--bleed-spread) rgba(26,26,26,0.18);
    transition: text-shadow 600ms ease;
    position: relative;
}

/* Drip on the second Z – the masthead "melting" */
.title-letter {
    display: inline-block;
    transition: transform 600ms ease;
}
.title-letter:nth-child(4) {
    position: relative;
}
.title-letter:nth-child(4)::after {
    content: '';
    position: absolute;
    left: 38%;
    top: 88%;
    width: 6px;
    height: 0;
    background: var(--ink);
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
    transition: height 800ms ease;
}
body[data-scroll-stage="3"] .title-letter:nth-child(4)::after,
body[data-scroll-stage="4"] .title-letter:nth-child(4)::after {
    height: 28px;
}

body[data-scroll-stage="2"] .title-letter:nth-child(2),
body[data-scroll-stage="3"] .title-letter:nth-child(2),
body[data-scroll-stage="4"] .title-letter:nth-child(2) {
    transform: translateY(2px) rotate(-1deg);
}
body[data-scroll-stage="3"] .title-letter:nth-child(7),
body[data-scroll-stage="4"] .title-letter:nth-child(7) {
    transform: translateY(3px) rotate(1.2deg);
}

.masthead-tagline {
    font-family: var(--font-label);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    padding: 0.6rem 0 1.2rem;
    color: var(--plate);
}

/* ---- Ticker ---- */
.ticker {
    border-top: var(--rule-thick);
    border-bottom: var(--rule-thick);
    background: var(--ink);
    color: var(--bg);
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
}

.ticker-track {
    display: flex;
    gap: 1.6rem;
    align-items: center;
    white-space: nowrap;
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    padding: 0.7rem 0;
    animation: ticker-scroll 65s linear infinite;
    will-change: transform;
}

.ticker-item {
    color: var(--bg);
    font-weight: 400;
}

.ticker-bullet {
    color: var(--red);
    font-weight: 700;
    font-size: 1.1rem;
}

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

/* =====================================================================
   2. FRONT PAGE — broadsheet 3-column
   ===================================================================== */
.frontpage {
    padding: 2.5rem clamp(1rem, 4vw, 3.5rem) 3rem;
    border-bottom: var(--rule);
    position: relative;
}

.section-label {
    font-family: var(--font-label);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--plate);
    border-top: var(--rule);
    border-bottom: var(--rule);
    padding: 0.35rem 0;
    margin-bottom: 1.6rem;
    text-align: center;
}

.section-label--inverse {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
}

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    align-items: start;
}

.column {
    padding: 0 1.4rem;
    border-right: 1px var(--rule-style) var(--plate);
    transition: transform 700ms ease, border-right-style 400ms ease;
}

.column:last-child { border-right: none; }
.column:first-child { padding-left: 0; }
.column:last-child { padding-right: 0; }

/* drift at deeper stages */
body[data-scroll-stage="2"] .col-1 { transform: translateX(-4px) rotate(-0.4deg); }
body[data-scroll-stage="2"] .col-3 { transform: translateX(4px) rotate(0.4deg); }
body[data-scroll-stage="3"] .col-1 { transform: translateX(-8px) rotate(-1.5deg); }
body[data-scroll-stage="3"] .col-2 { transform: translateY(6px); }
body[data-scroll-stage="3"] .col-3 { transform: translateX(10px) rotate(0.9deg); }
body[data-scroll-stage="4"] .col-1 { transform: translateX(-14px) rotate(-1.8deg); }
body[data-scroll-stage="4"] .col-2 { transform: translateY(10px) rotate(0.4deg); }
body[data-scroll-stage="4"] .col-3 { transform: translateX(16px) rotate(1.4deg); }

.hed {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 0.7rem;
    transition: transform 600ms ease, text-shadow 600ms ease;
}

.hed-1 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
.hed-2 { font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.hed-3 { font-size: clamp(1.55rem, 2.3vw, 2.1rem); }

body[data-scroll-stage="2"] .hed { transform: rotate(-0.5deg); }
body[data-scroll-stage="3"] .hed { transform: rotate(-0.8deg); }
body[data-scroll-stage="4"] .hed { transform: rotate(-1.2deg); }

.ink-bleed {
    text-shadow:
        0 0 var(--bleed-blur) rgba(26,26,26,0.5),
        0 0 var(--bleed-spread) rgba(26,26,26,0.2);
}

.byline {
    font-family: var(--font-label);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    border-top: var(--rule);
    border-bottom: var(--rule);
    padding: 0.3rem 0;
    margin: 0.5rem 0 0.8rem;
}

.dateline {
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
}

.dateline::first-line {
    /* mock dateline boldness */
}

.body {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.05vw, 1.02rem);
    line-height: 1.7;
    margin-bottom: 0.85rem;
    text-align: justify;
    hyphens: auto;
}

.body em { font-style: italic; }

.column .body:first-of-type::first-letter {
    font-family: var(--font-display);
    font-size: 3.4em;
    float: left;
    line-height: 0.85;
    padding: 0.1em 0.1em 0 0;
    color: var(--red);
}

.pull-quote {
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.25;
    color: var(--ink);
    border-top: var(--rule-thick);
    border-bottom: var(--rule-thick);
    padding: 0.9rem 0;
    margin: 1rem 0;
    text-align: center;
}

.rough-list {
    list-style: none;
    padding: 0.4rem 0 0.6rem 0;
    margin: 0.5rem 0;
    border-top: var(--rule);
    border-bottom: var(--rule);
}

.rough-list li {
    padding: 0.2rem 0 0.2rem 1.4rem;
    position: relative;
    font-size: 0.95rem;
}

.rough-list li::before {
    content: '\25A0';
    color: var(--red);
    position: absolute;
    left: 0.2rem;
    top: 0.05rem;
    font-size: 0.85rem;
}

.ascii-figure {
    border: var(--rule-thick);
    padding: 0.6rem;
    margin: 0.6rem 0 1rem;
    background: var(--bg);
}

.ascii-art {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.1;
    color: var(--ink);
    white-space: pre;
    text-align: center;
}

.ascii-figure figcaption {
    font-family: var(--font-label);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--plate);
    text-align: center;
    margin-top: 0.4rem;
    border-top: 1px dashed var(--plate);
    padding-top: 0.3rem;
}

/* ---- Correction (yellow callout) ---- */
.correction-box {
    margin: 2rem auto 0;
    max-width: 36em;
    background: var(--yellow);
    border: var(--rule-fat);
    padding: 1rem 1.2rem;
    box-shadow: 8px 8px 0 var(--ink);
    transform: rotate(-1deg);
}

.correction-label {
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.4rem;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.3rem;
}

.correction-box p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* =====================================================================
   3. THE TEAR — Editorial section with jagged clip-path
   ===================================================================== */
.tear-section {
    position: relative;
    background: var(--pink);
    padding: 0;
    margin-top: 0;
}

.tear-edge {
    height: 28px;
    background: var(--bg);
    width: 100%;
    /* default: straight line; jagged when "torn" class is added */
    transition: clip-path 500ms ease;
}

.tear-top {
    /* This sits inside the pink section, displays bg above tear */
    background: var(--bg);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
}

.tear-bottom {
    background: var(--bg);
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
}

/* When .torn is added, the jagged path appears */
.tear-top.torn {
    clip-path: polygon(
        0 0, 100% 0, 100% 100%,
        97% 60%, 94% 95%, 91% 50%, 88% 85%, 85% 45%,
        82% 90%, 79% 55%, 76% 80%, 73% 40%, 70% 92%,
        67% 50%, 64% 75%, 61% 35%, 58% 88%, 55% 60%,
        52% 78%, 49% 42%, 46% 90%, 43% 55%, 40% 82%,
        37% 38%, 34% 88%, 31% 50%, 28% 78%, 25% 45%,
        22% 90%, 19% 60%, 16% 80%, 13% 42%, 10% 92%,
        7% 50%, 4% 85%, 0 60%
    );
}

.tear-bottom.torn {
    clip-path: polygon(
        0 100%, 100% 100%, 100% 0,
        97% 40%, 94% 5%, 91% 50%, 88% 15%, 85% 55%,
        82% 10%, 79% 45%, 76% 20%, 73% 60%, 70% 8%,
        67% 50%, 64% 25%, 61% 65%, 58% 12%, 55% 40%,
        52% 22%, 49% 58%, 46% 10%, 43% 45%, 40% 18%,
        37% 62%, 34% 12%, 31% 50%, 28% 22%, 25% 55%,
        22% 10%, 19% 40%, 16% 20%, 13% 58%, 10% 8%,
        7% 50%, 4% 15%, 0 40%
    );
}

.tear-inner {
    padding: 3rem clamp(1rem, 5vw, 4rem) 3.5rem;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.tear-headline {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    color: var(--ink);
    text-align: center;
    margin: 1.4rem 0 0.6rem;
    transform: rotate(-0.6deg);
}

.tear-byline {
    font-family: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--red);
    text-align: center;
    margin-bottom: 1.8rem;
}

.tear-body {
    font-family: var(--font-body);
    max-width: 36em;
    margin: 0 auto;
    font-size: clamp(1rem, 1.15vw, 1.1rem);
    line-height: 1.75;
}

.tear-body p {
    margin-bottom: 1rem;
    text-indent: 1.5em;
}
.tear-body p:first-child { text-indent: 0; }

.signature {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    text-align: right;
    margin-top: 2rem !important;
    text-indent: 0 !important;
    transform: rotate(-1.5deg);
}

/* =====================================================================
   4. CLASSIFIED CHAOS — masonry of rotated boxes
   ===================================================================== */
.classifieds {
    padding: 3rem clamp(1rem, 4vw, 3.5rem);
    background: var(--bg);
    border-top: var(--rule-fat);
}

.classifieds-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    text-align: center;
    margin: 0.6rem 0 2.2rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    transform: rotate(-0.5deg);
}

.classifieds-grid {
    column-count: 4;
    column-gap: 1.2rem;
}

@media (max-width: 1100px) { .classifieds-grid { column-count: 3; } }
@media (max-width: 760px)  { .classifieds-grid { column-count: 2; } }
@media (max-width: 480px)  { .classifieds-grid { column-count: 1; } }

.classified {
    --rotation: 0deg;
    --tint: var(--bg);
    background: var(--tint);
    border: 3px solid var(--ink);
    padding: 1rem 1rem 0.9rem;
    margin: 0 0 1.2rem;
    transform: rotate(var(--rotation));
    box-shadow: 5px 5px 0 var(--ink);
    break-inside: avoid;
    transition: transform 250ms ease, box-shadow 250ms ease;
    cursor: default;
}

.classified:hover {
    transform: rotate(0deg) translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--red);
}

.cls-cat {
    font-family: var(--font-label);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red);
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
}

.cls-headline {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.cls-foot {
    font-family: var(--font-label);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--plate);
    border-top: 1px dashed var(--plate);
    padding-top: 0.3rem;
    text-align: right;
}

/* =====================================================================
   5. COLOPHON — cramped footer
   ===================================================================== */
.colophon {
    background: var(--ink);
    color: var(--bg);
    padding: 2rem clamp(1rem, 4vw, 3.5rem) 1.6rem;
    font-family: var(--font-label);
    font-size: 0.8rem;
    line-height: 1.6;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.colophon-rule {
    height: 2px;
    background: var(--bg);
    margin: 0.4rem 0 1rem;
}

.colophon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
    padding: 0.6rem 0 1rem;
}

@media (max-width: 760px) {
    .colophon-grid { grid-template-columns: repeat(2, 1fr); }
}

.col-block p {
    font-size: 0.72rem;
    margin-bottom: 0.18rem;
    color: var(--bg);
}

.col-label {
    font-family: var(--font-label);
    font-weight: 700;
    color: var(--yellow);
    border-bottom: 1px solid var(--bg);
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
}

.printers-mark {
    font-size: 1.1rem;
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
    color: var(--red);
}

.recycled {
    text-align: center;
    font-style: italic;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 0.6rem 0 0.4rem;
    color: var(--yellow);
}

.copy {
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: var(--bg);
    opacity: 0.7;
    padding-top: 0.3rem;
    text-transform: uppercase;
}

/* =====================================================================
   REDACTION — interactive hover-to-reveal
   ===================================================================== */
.redact {
    background: var(--ink);
    color: var(--ink);
    padding: 0 0.25em;
    border-radius: 1px;
    cursor: help;
    transition: background-color 320ms ease, color 320ms ease;
    user-select: none;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    position: relative;
}

.redact:hover,
.redact.revealed {
    background: transparent;
    color: var(--ink);
    user-select: text;
}

.redact.shake {
    animation: shake-error 200ms ease 0s 3;
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-1px); }
    75%      { transform: translateX(1px); }
}

/* =====================================================================
   PROGRESSIVE DEGRADATION — column rules
   ===================================================================== */
body[data-scroll-stage="0"] { --rule-style: solid; }
body[data-scroll-stage="1"] { --rule-style: solid; }
body[data-scroll-stage="2"] { --rule-style: dashed; }
body[data-scroll-stage="3"] { --rule-style: dotted; }
body[data-scroll-stage="4"] { --rule-style: none; }

body[data-scroll-stage="3"] {
    --bleed-blur: 3px;
    --bleed-spread: 14px;
}
body[data-scroll-stage="4"] {
    --bleed-blur: 4px;
    --bleed-spread: 22px;
    --paper-rotate: 1deg;
    --paper-opacity: 0.95;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
    .columns { grid-template-columns: 1fr; }
    .column {
        border-right: none;
        border-bottom: 1px var(--rule-style) var(--plate);
        padding: 1rem 0;
    }
    .column:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
    .masthead { padding: 1.5rem 1rem; }
    .ticker-track { font-size: 0.8rem; }
    .masthead-meta {
        flex-direction: column;
        gap: 0.2rem;
        align-items: center;
        text-align: center;
    }
    .pull-quote { font-size: 1.1rem; }
}
