/* ===================================
   gazza.news - Styles
   Muji meets Italian Newsroom
   =================================== */

/* CSS Custom Properties with @property registration for animated fluid typography */
@property --headline-size {
    syntax: '<length>';
    inherits: true;
    initial-value: 3rem;
}

@property --body-size {
    syntax: '<length>';
    inherits: true;
    initial-value: 1rem;
}

@property --caption-size {
    syntax: '<length>';
    inherits: true;
    initial-value: 0.8rem;
}

:root {
    /* Color Palette */
    --ink-sepia: #2c2418;
    --cypress-green: #2d4a3e;
    --terracotta-clay: #b8654a;
    --unbleached-linen: #f4efe7;
    --warm-parchment: #ebe3d5;
    --aged-brass: #8b7355;
    --stone-gray: #7a7267;
    --pale-sage: #d4ddd4;

    /* Typography Sizes (Variable-Fluid) */
    --headline-size: clamp(2.4rem, 6vw, 5.6rem);
    --section-headline-size: clamp(1.4rem, 2.8vw, 2.2rem);
    --body-size: clamp(0.95rem, 1.4vw, 1.15rem);
    --caption-size: clamp(0.7rem, 1vw, 0.85rem);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--ink-sepia);
    background-color: var(--unbleached-linen);
    overflow-x: hidden;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================
   Navigation
   =================================== */
.nav-bar {
    position: relative;
    z-index: 100;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    color: var(--aged-brass);
    letter-spacing: 0.02em;
}

.nav-sep {
    color: var(--aged-brass);
    font-size: 14px;
    user-select: none;
}

.nav-link {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: var(--caption-size);
    color: var(--aged-brass);
    text-decoration: none;
    letter-spacing: 0;
    transition: color 400ms ease, letter-spacing 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover {
    color: var(--cypress-green);
    letter-spacing: 0.04em;
}

/* ===================================
   Split-Screen Layout System
   =================================== */
.split-section {
    position: relative;
    display: grid;
    min-height: 50vh;
}

.split-equal {
    grid-template-columns: 1fr 1fr;
}

.split-wide-left {
    grid-template-columns: 2fr 1fr;
}

.split-wide-right {
    grid-template-columns: 1fr 2fr;
}

.split-left {
    padding: clamp(2rem, 4vw, 5rem);
    background-color: var(--unbleached-linen);
}

.split-right {
    padding: clamp(2rem, 4vw, 5rem);
    background-color: var(--warm-parchment);
    /* Herringbone Weave Pattern */
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(235, 227, 213, 0.5) 4px,
            rgba(235, 227, 213, 0.5) 8px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 4px,
            rgba(244, 239, 231, 0.5) 4px,
            rgba(244, 239, 231, 0.5) 8px
        );
    transition: background-color 300ms ease;
}

.split-right:hover {
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(235, 227, 213, 0.7) 4px,
            rgba(235, 227, 213, 0.7) 8px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 4px,
            rgba(244, 239, 231, 0.7) 4px,
            rgba(244, 239, 231, 0.7) 8px
        );
}

.split-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background-color: var(--aged-brass);
    pointer-events: none;
    z-index: 2;
}

.split-wide-left .split-divider {
    left: 66.666%;
}

.split-wide-right .split-divider {
    left: 33.333%;
}

/* ===================================
   Hero Section
   =================================== */
#hero {
    min-height: 65vh;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.olive-branch {
    position: absolute;
    top: -20px;
    left: -30px;
    width: 140px;
    height: auto;
    opacity: 0.6;
    transform: rotate(-15deg);
}

.hero-headline {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: var(--headline-size);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--ink-sepia);
    max-width: 90%;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.magpie-silhouette {
    position: absolute;
    bottom: 2rem;
    right: 1rem;
    width: 120px;
    height: 80px;
}

.hero-editorial-note {
    max-width: 80%;
}

.editorial-label {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: var(--caption-size);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terracotta-clay);
    display: block;
    margin-bottom: 1rem;
}

.editorial-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.72;
    color: var(--ink-sepia);
    margin-bottom: 1.5rem;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.editorial-date {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: var(--caption-size);
    color: var(--stone-gray);
}

/* ===================================
   Fold Line
   =================================== */
.fold-line {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    position: relative;
}

.fold-leaf {
    width: 30px;
    height: 50px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fold-leaf.visible {
    opacity: 1;
}

.fold-leaf .leaf-outline {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2.4s ease-in-out;
}

.fold-leaf.animate .leaf-outline {
    stroke-dashoffset: 0;
}

.fold-leaf .leaf-vein,
.fold-leaf .leaf-vein-left,
.fold-leaf .leaf-vein-right {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 2s ease-in-out 0.8s;
}

.fold-leaf.animate .leaf-vein,
.fold-leaf.animate .leaf-vein-left,
.fold-leaf.animate .leaf-vein-right {
    stroke-dashoffset: 0;
}

.fold-leaf .leaf-fill {
    transition: opacity 0.8s ease 2.4s;
}

.fold-leaf.animate .leaf-fill {
    opacity: 0.2;
}

/* ===================================
   Morse Code Dividers
   =================================== */
.morse-divider {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.morse-divider svg {
    width: 60%;
    height: 2px;
}

/* ===================================
   Section Headlines
   =================================== */
.section-headline {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: var(--section-headline-size);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--ink-sepia);
    margin-bottom: 2rem;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================
   Collection Section
   =================================== */
.collection-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.news-fragment {
    margin-bottom: 1rem;
}

.fragment-category {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: var(--caption-size);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--terracotta-clay);
    display: block;
    margin-bottom: 0.5rem;
}

.fragment-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--ink-sepia);
    margin-bottom: 0.75rem;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.fragment-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.72;
    color: var(--ink-sepia);
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-olive {
    display: block;
    width: 60px;
    height: 20px;
    margin: 1.5rem 0;
    opacity: 0.5;
}

/* ===================================
   Timeline (Collection Right Panel)
   =================================== */
.collection-right {
    display: flex;
    align-items: flex-start;
    padding-top: clamp(3rem, 6vw, 7rem);
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    border-left: 1px solid var(--aged-brass);
    padding-left: 1.5rem;
}

.timeline-entry {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.timeline-time {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    font-size: var(--caption-size);
    color: var(--terracotta-clay);
    letter-spacing: 0.05em;
}

.timeline-note {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--caption-size);
    font-style: italic;
    color: var(--stone-gray);
    line-height: 1.5;
}

/* ===================================
   Feature Section
   =================================== */
.feature-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
}

.pull-quote {
    border: none;
    padding: 0;
    margin: 0;
}

.pull-quote p {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    line-height: 1.4;
    color: var(--ink-sepia);
    margin-bottom: 1rem;
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pull-quote cite {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: var(--caption-size);
    font-style: normal;
    color: var(--stone-gray);
}

.rosemary-sprig {
    width: 40px;
    height: 80px;
    opacity: 0.5;
}

/* Diamond Lattice Background */
.diamond-lattice-bg {
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 23px,
            rgba(45, 74, 62, 0.05) 23px,
            rgba(45, 74, 62, 0.05) 24px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 23px,
            rgba(45, 74, 62, 0.05) 23px,
            rgba(45, 74, 62, 0.05) 24px
        );
    background-color: var(--warm-parchment);
}

.feature-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feature-article {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.feature-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--ink-sepia);
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-byline {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: var(--caption-size);
    color: var(--stone-gray);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.feature-article p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.72;
    color: var(--ink-sepia);
    transition: font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===================================
   Archive Section
   =================================== */
.archive-panel {
    display: flex;
    flex-direction: column;
}

.archive-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.archive-link {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: var(--body-size);
    line-height: 1.5;
    color: var(--ink-sepia);
    text-decoration: none;
    background-image: linear-gradient(var(--terracotta-clay), var(--terracotta-clay));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 400ms ease, color 400ms ease, font-size 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: 2px;
}

.archive-link:hover {
    background-size: 100% 1px;
    color: var(--cypress-green);
}

/* ===================================
   Colophon / Footer
   =================================== */
.colophon {
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.colophon-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.colophon-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--ink-sepia);
}

.colophon-sep {
    color: var(--aged-brass);
    font-size: 1rem;
}

.colophon-date {
    font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    font-size: var(--caption-size);
    color: var(--stone-gray);
}

.colophon-dots {
    width: 200px;
    height: 60px;
    margin: 0 auto;
    background-image: radial-gradient(circle, rgba(184, 101, 74, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
}

/* ===================================
   Magpie Flight Animation Container
   =================================== */
.magpie-flight-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 65vh;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

/* ===================================
   Interlocking Circles Pattern (Section Transitions)
   =================================== */
.morse-divider {
    background-image: radial-gradient(circle at center, rgba(139, 115, 85, 0.08) 8px, transparent 8px);
    background-size: 16px 16px;
}

/* ===================================
   Dot Grid Pattern for Pull Quotes
   =================================== */
.pull-quote {
    position: relative;
    padding: 2rem;
    background-image: radial-gradient(circle, rgba(184, 101, 74, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ===================================
   Responsive / Tablet
   =================================== */
@media (max-width: 1024px) {
    .split-section {
        grid-template-columns: 1fr !important;
    }

    .split-divider {
        display: none;
    }

    .split-right {
        border-top: 1px solid var(--aged-brass);
    }

    .hero-left {
        min-height: 50vh;
    }

    .magpie-silhouette {
        bottom: 1rem;
        right: 0.5rem;
        width: 80px;
        height: 53px;
    }

    .olive-branch {
        width: 100px;
    }
}

@media (max-width: 640px) {
    .nav-bar {
        padding: 1rem;
        gap: 0.3rem;
    }

    .hero-headline {
        max-width: 100%;
    }

    .hero-editorial-note {
        max-width: 100%;
    }

    .pull-quote p {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }
}

/* ===================================
   Link Underline Animation (Global)
   =================================== */
a:not(.archive-link):not(.nav-link) {
    color: var(--cypress-green);
    text-decoration: none;
    background-image: linear-gradient(var(--terracotta-clay), var(--terracotta-clay));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 400ms ease;
}

a:not(.archive-link):not(.nav-link):hover {
    background-size: 100% 1px;
}

/* ===================================
   Selection Color
   =================================== */
::selection {
    background-color: var(--pale-sage);
    color: var(--ink-sepia);
}
