/* ==========================================================================
   politics.quest - Dark-Academia Scholarly Archive
   Palette: Deep Navy #0D1B2A, Old Gold #C9A84C, Vellum #E8DCC8,
            Storm Blue #415A77, Pewter #8E9AAF, Wine #722F37
   Fonts: Cormorant Garamond (display), EB Garamond (body), Libre Franklin (UI)
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0D1B2A;
    color: #E8DCC8;
    font-family: "EB Garamond", Georgia, serif;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.8;
    overflow-x: hidden;
}

::selection {
    background-color: #722F37;
    color: #E8DCC8;
}

/* --- Running Header --- */
#running-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 2rem;
    background: linear-gradient(180deg, #0D1B2A 60%, transparent);
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8E9AAF;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

#running-header.visible {
    opacity: 1;
}

.header-rule-left,
.header-rule-right {
    display: block;
    width: 60px;
    height: 1px;
    background-color: #415A77;
}

#current-chapter {
    white-space: nowrap;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.hero-ornament-top,
.hero-ornament-bottom {
    position: absolute;
    width: 200px;
}

.hero-ornament-top {
    top: 15%;
}

.hero-ornament-bottom {
    bottom: 15%;
}

.hero-ornament-top svg,
.hero-ornament-bottom svg {
    width: 100%;
    height: auto;
}

.hero-content {
    position: relative;
    top: 11.8%; /* nudge toward 61.8% from center */
}

.hero-subtitle {
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #8E9AAF;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: clamp(2.6rem, 5vw, 5rem);
    font-weight: 600;
    color: #E8DCC8;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.hero-epigraph {
    max-width: 45ch;
    margin: 0 auto;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #8E9AAF;
}

.epigraph-attribution {
    font-size: 0.85rem;
    color: #415A77;
    font-style: normal;
}

/* --- Chapter Sections --- */
.chapter {
    position: relative;
    padding: 6rem 2rem 4rem;
    max-width: 100%;
    overflow: visible;
}

.chapter-header {
    margin-left: 15vw;
    max-width: 55ch;
    margin-bottom: 3rem;
}

.chapter-numeral {
    display: block;
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: #C9A84C;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    color: #E8DCC8;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.ornamental-divider {
    width: 200px;
    margin-top: 0.5rem;
}

.ornamental-divider svg {
    width: 100%;
    height: auto;
}

/* --- Chapter Body (Broken Grid) --- */
.chapter-body {
    position: relative;
    margin-left: 15vw;
    max-width: 55ch;
}

.primary-column {
    position: relative;
}

.primary-column p {
    margin-bottom: 1.5rem;
}

/* Drop Cap */
.drop-cap::first-letter {
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: 3.8rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.1em;
    color: #C9A84C;
}

/* Wine emphasis */
.wine-emphasis {
    color: #722F37;
    font-weight: 500;
}

/* Footnote references */
.footnote-ref {
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.7rem;
    color: #C9A84C;
    vertical-align: super;
    line-height: 0;
    margin-left: 2px;
    cursor: default;
}

/* Featured Block / Blockquote */
.featured-block {
    position: relative;
    margin: 2.5rem 0;
    padding: 2rem 2rem 2rem 2.5rem;
    border: 1px solid #8E9AAF;
    transition: border-color 0.5s ease;
}

.featured-block:hover {
    border-color: #C9A84C;
}

.featured-block p {
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.6;
    color: #E8DCC8;
    margin-bottom: 0.75rem;
}

.featured-block cite {
    display: block;
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.8rem;
    font-style: normal;
    color: #8E9AAF;
    letter-spacing: 0.05em;
}

/* --- Margin Annotations --- */
.margin-annotation {
    position: absolute;
    right: -14vw;
    width: 12vw;
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #8E9AAF;
}

.margin-annotation:nth-of-type(1) {
    top: 0;
}

.margin-annotation:nth-of-type(2) {
    top: 40%;
}

.annotation-marker {
    display: block;
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: 1rem;
    font-weight: 600;
    color: #C9A84C;
    margin-bottom: 0.25rem;
}

.annotation-commentary {
    font-style: italic;
    color: #415A77;
    border-left: 1px solid #415A77;
    padding-left: 0.75rem;
}

/* --- Endmarks --- */
.endmark {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    opacity: 0.6;
}

.endmark svg {
    width: 24px;
    height: 24px;
}

/* --- Overlapping Section Transitions --- */
.chapter:nth-child(even) {
    background-color: rgba(65, 90, 119, 0.08);
}

.chapter + .chapter {
    margin-top: -2rem;
    padding-top: 8rem;
}

/* --- Colophon / Footer --- */
#colophon {
    padding: 6rem 2rem 4rem;
    text-align: center;
}

.colophon-ornament {
    width: 300px;
    margin: 0 auto 2rem;
}

.colophon-ornament svg {
    width: 100%;
    height: auto;
}

.colophon-text {
    font-family: "Cormorant Garamond", "Georgia", serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #E8DCC8;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.colophon-meta {
    font-family: "Libre Franklin", "Helvetica Neue", sans-serif;
    font-size: 0.75rem;
    color: #415A77;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- Content Fade-in Animation --- */
.chapter-body {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter-body.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1100px) {
    .margin-annotation {
        position: relative;
        right: auto;
        width: 100%;
        margin-top: 2rem;
        padding: 1rem;
        border-top: 1px solid #415A77;
    }

    .margin-annotation:nth-of-type(2) {
        top: auto;
    }
}

@media (max-width: 768px) {
    .chapter-header,
    .chapter-body {
        margin-left: 5vw;
        max-width: 90vw;
    }

    .hero-content {
        top: 5%;
    }

    .chapter-numeral {
        font-size: 2.5rem;
    }

    .drop-cap::first-letter {
        font-size: 2.8rem;
    }
}
