/* concepts.news -- vintage newspaper editorial */
/* Palette: #F5F0E8 (parchment), #2C1810 (dark umber), #3B2F2F (dark coffee), #7A6B5D (warm gray), #8B3A3A (burgundy), #C4A882 (gold), #EDE6DA (linen), #1A1512 (ink) */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #F5F0E8;
    color: #3B2F2F;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
}

/* Newsprint grain texture via SVG filter */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: #8B3A3A;
    z-index: 10000;
    width: 0%;
    transition: width 0.1s linear;
}

/* Pilcrow navigation */
.pilcrow-nav {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9000;
    background: none;
    border: none;
    color: #8B3A3A;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    font-family: 'Playfair Display', serif;
    animation: pilcrow-pulse 4s ease-in-out infinite;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pilcrow-nav:hover {
    animation: none;
    transform: rotate(90deg);
}

@keyframes pilcrow-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* TOC panel */
.toc-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: #1A1512;
    z-index: 9500;
    padding: 3rem 2rem;
    transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.toc-panel.open {
    right: 0;
}

.toc-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    color: #C4A882;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.toc-heading {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #C4A882;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #4A3228;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 1rem;
}

.toc-link {
    font-family: 'Lora', serif;
    font-size: 1rem;
    color: #EDE6DA;
    text-decoration: none;
    transition: color 0.25s ease;
}

.toc-link:hover {
    color: #C4A882;
}

/* Masthead */
.masthead {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    border-bottom: 1px solid #8B3A3A;
    scroll-snap-align: start;
    position: relative;
}

.masthead-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.015em;
    color: #2C1810;
    font-variant: small-caps;
    opacity: 0;
    transform: translateY(10px);
    animation: masthead-fade 1.2s ease-out 0.3s forwards;
}

@keyframes masthead-fade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dateline {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7A6B5D;
    margin-top: 1rem;
    padding: 0.5rem 2rem;
    border-top: 1px solid #C4A882;
    border-bottom: 1px solid #C4A882;
    opacity: 0;
    animation: masthead-fade 1.2s ease-out 0.8s forwards;
}

/* Editions */
.editions {
    position: relative;
}

.edition {
    min-height: 100svh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.edition.in-view {
    opacity: 1;
    transform: translateY(0);
}

.edition.out-view {
    opacity: 0.3;
    transform: scale(0.97);
    filter: blur(1px);
}

.edition-inner {
    width: 100%;
    max-width: 72rem;
    display: grid;
    grid-template-columns: 1fr minmax(0, 42rem) 1fr;
    position: relative;
}

.reading-column {
    grid-column: 2;
}

/* Headlines */
.edition-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.015em;
    color: #2C1810;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.edition-subhead {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    color: #4A3228;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

/* Body text */
.body-text {
    margin-bottom: 1.5rem;
    color: #3B2F2F;
}

.body-text em {
    font-style: italic;
}

/* Drop caps */
.has-dropcap::first-letter {
    font-family: 'Playfair Display', serif;
    font-size: 4.5em;
    float: left;
    line-height: 0.8;
    padding-right: 0.08em;
    padding-top: 0.05em;
    color: #8B3A3A;
    text-shadow: 1px 1px 0 #C4A882;
}

/* Pull quotes */
.pull-quote {
    margin: 2.5rem -4rem;
    padding: 2rem 4rem;
    text-align: center;
    border-top: 1px solid #C4A882;
    border-bottom: 1px solid #C4A882;
    position: relative;
}

.pull-quote::before,
.pull-quote::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #C4A882;
}

.pull-quote::before {
    top: 3px;
}

.pull-quote::after {
    bottom: 3px;
}

.pull-quote p {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #8B3A3A;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.pull-attribution {
    font-family: 'Lora', serif;
    font-style: normal;
    font-size: 1.2rem;
    color: #C4A882;
    display: block;
    margin-top: 0.5rem;
}

/* Section dividers */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
    color: #8B3A3A;
    font-size: 0.65rem;
    position: relative;
    scroll-snap-align: none;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: #C4A882;
}

/* Margin notes */
.margin-note {
    position: absolute;
    right: -14rem;
    width: 12rem;
    font-family: 'DM Sans', sans-serif;
    font-style: italic;
    font-size: 0.82rem;
    color: #7A6B5D;
    line-height: 1.5;
    transform: rotate(-1.5deg);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.edition.in-view .margin-note {
    opacity: 1;
}

@media (max-width: 1200px) {
    .margin-note {
        display: none;
    }
}

/* Edition final / Coda */
.edition-final {
    text-align: center;
}

.coda-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-domain {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-variant: small-caps;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #2C1810;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
}

.final-ornament {
    color: #C4A882;
    font-size: 1.5rem;
    margin-top: 1rem;
}

/* Colophon / Footer */
.colophon {
    background: #1A1512;
    padding: 2.5rem 2rem;
    text-align: center;
}

.colophon-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7A6B5D;
}

/* Sidebar cards (hover-lift) */
.sidebar-card {
    background: #EDE6DA;
    padding: 1.25rem;
    border: 1px solid #C4A882;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(26, 21, 18, 0.08);
}

.sidebar-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(26, 21, 18, 0.12);
}

.sidebar-card:hover .sidebar-card-title {
    color: #8B3A3A;
}

.sidebar-card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #2C1810;
    transition: color 0.25s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .edition-inner {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }

    .reading-column {
        grid-column: 1;
    }

    .pull-quote {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1.5rem 1rem;
    }

    .toc-panel {
        width: 100%;
        right: -100%;
    }

    .masthead-title {
        font-variant: normal;
    }
}
