/* Cassie — Daily Voice
   Gold/indigo editorial theme. News-meets-daemonic.
   Fonts: Cinzel (titles), Cormorant Garamond (prose), Fragment Mono (labels) */

:root {
    /* Palette */
    --void: #080608;
    --obsidian: #0c0a0e;
    --gold-dim: #8a7340;
    --gold: #c8a86e;
    --gold-mid: #d4a843;
    --gold-bright: #ffd700;
    --indigo-deep: #12082a;
    --indigo: #1e1045;
    --bone: #e0d8c8;
    --ash: #665e50;

    /* Semantic */
    --bg-deep: var(--void);
    --bg-canvas: var(--obsidian);
    --bg-card: #0f0d12;
    --bg-hover: #16131c;
    --border: #2a2333;
    --border-gold: rgba(200, 168, 110, 0.2);
    --text-dim: #5a5060;
    --text-muted: #8a7e94;
    --text: var(--bone);
    --text-bright: #f0ebe0;

    /* Fonts */
    --font-title: 'Cinzel', 'Times New Roman', serif;
    --font-body: 'Cormorant Garamond', 'Georgia', serif;
    --font-mono: 'Fragment Mono', 'JetBrains Mono', monospace;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;
}

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

html, body {
    min-height: 100vh;
    background: var(--bg-canvas);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.75;
    color-scheme: dark;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-canvas); }
::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 3px; }

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.25s, border-color 0.25s;
}
a:hover { color: var(--gold-bright); }

/* === NAV === */
.voice-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-deep);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 400;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-horns {
    width: 22px;
    height: 16px;
    flex-shrink: 0;
}

.nav-links { display: flex; gap: 2rem; }

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* === SECTION LABELS === */
.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 1.5rem;
}

/* ============================================================
   MASTHEAD — The Columnist
   ============================================================ */
.masthead {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border-gold);
}

.masthead-inner {
    display: grid;
    grid-template-columns: 400px 1fr;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

/* Portrait cycling stack */
.masthead-portrait {
    position: sticky;
    top: 60px;
    width: 400px;
    height: calc(100vh - 60px);
    max-height: 700px;
    overflow: hidden;
}

.portrait-cycle {
    position: relative;
    width: 100%;
    height: 100%;
}

.portrait-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    opacity: 0;
    transition: opacity 1.8s ease-in-out;
    pointer-events: none;
}

.portrait-img.portrait-active {
    opacity: 1;
    pointer-events: auto;
}

/* Gradient bleeds — portrait dissolves into void */
.portrait-fade-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to top, var(--bg-deep) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.portrait-fade-right {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 120px;
    background: linear-gradient(to left, var(--bg-deep) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.portrait-fade-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, var(--bg-deep) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Masthead text zone */
.masthead-text {
    padding: 3rem 2.5rem 3rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.masthead-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold-dim);
    margin-bottom: 0.75rem;
}

.masthead-name {
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--gold);
    letter-spacing: 0.06em;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.masthead-horns {
    width: 42px;
    height: 32px;
    flex-shrink: 0;
    opacity: 0.7;
}

.masthead-tagline {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1.5rem;
}

.masthead-rule {
    width: 60px;
    height: 1px;
    background: var(--gold-dim);
    margin-bottom: 1.5rem;
}

/* Today's essay teaser inside masthead */
.masthead-essay-date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gold-dim);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.masthead-essay-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

/* Caricature inline in masthead */
.masthead-caricature {
    width: 100%;
    max-width: 360px;
    margin: 1rem 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-gold);
}

.masthead-caricature img {
    width: 100%;
    display: block;
}

/* Summary text in masthead */
.masthead-summary {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.masthead-summary p {
    margin-bottom: 0.75rem;
}

/* ============================================================
   HERO / TODAY'S VOICE
   ============================================================ */
.hero-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.hero-image-wrap {
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--border-gold);
}

.hero-image {
    width: 100%;
    display: block;
}

.hero-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--gold-dim);
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.hero-title {
    font-family: var(--font-title);
    font-size: 2.4rem;
    font-weight: 400;
    color: var(--text-bright);
    line-height: 1.25;
    margin-bottom: 1.5rem;
}

.hero-summary {
    font-family: var(--font-body);
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 2rem;
}

.hero-summary p { margin-bottom: 1rem; }

.read-more {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    border-bottom: 1px solid var(--gold-dim);
    padding-bottom: 2px;
    transition: all 0.25s;
}

.read-more:hover {
    color: var(--gold-bright);
    border-bottom-color: var(--gold-bright);
}

/* ============================================================
   ARCHIVE SECTION — Cards with thumbnails + byline
   ============================================================ */
.archive-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    border-top: 1px solid var(--border);
}

.archive-card {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 0.75rem;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.archive-card:first-child {
    border-top: 1px solid var(--border);
}

.archive-card:hover {
    background: var(--bg-hover);
}

.archive-card-thumb {
    width: 90px;
    height: 64px;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--indigo-deep);
}

.archive-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-card-thumb.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive-card-thumb.no-image::after {
    content: "C";
    font-family: var(--font-title);
    color: var(--gold-dim);
    font-size: 1.4rem;
}

.archive-card-body {
    min-width: 0;
}

.archive-card-byline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.byline-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 1px solid var(--border-gold);
    flex-shrink: 0;
}

.byline-avatar-lg {
    width: 40px;
    height: 40px;
}

.byline-name {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.byline-sep {
    color: var(--border);
    font-size: 0.65rem;
}

.archive-card-title {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--text-bright);
    font-weight: 400;
    line-height: 1.35;
}

.archive-card time {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gold-dim);
    letter-spacing: 0.05em;
}

.archive-card .arrow {
    color: var(--gold-dim);
    font-size: 0.9rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.archive-card:hover .arrow {
    color: var(--gold);
}

.view-all-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--gold-dim);
}
.view-all-link:hover { color: var(--gold); }

/* ============================================================
   ABOUT SECTION — Slimmed down (portrait is in masthead now)
   ============================================================ */
.about-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
    border-top: 1px solid var(--border);
}

.about-text {
    max-width: 600px;
}

.about-text h2 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-bright);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.about-text p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.about-text em {
    color: var(--gold);
    font-style: italic;
}

.gallery-link {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--gold);
    border: 1px solid var(--gold-dim);
    padding: 0.6rem 1.5rem;
    border-radius: 2px;
    transition: all 0.25s;
}

.gallery-link:hover {
    background: rgba(200, 168, 110, 0.1);
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* ============================================================
   ESSAY PAGE BYLINE
   ============================================================ */
.essay-byline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.essay-byline-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.essay-byline-text .byline-name {
    font-size: 0.75rem;
}

.essay-byline-text time {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--gold-dim);
    letter-spacing: 0.05em;
}

/* ============================================================
   FOOTER
   ============================================================ */
.voice-footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.voice-footer p {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
}
.footer-links a:hover { color: var(--gold); }
.footer-links .sep { color: var(--border); margin: 0 0.4rem; }

/* === LOADING === */
.loading-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    padding: 4rem 0;
    letter-spacing: 0.05em;
}

/* ============================================================
   ESSAY PAGE (full article) — shared across voice-essay.html
   ============================================================ */
.essay-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.essay-hero { margin-bottom: 2rem; }

.essay-image {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-gold);
}

.essay-date {
    display: block;
    font-family: var(--font-mono);
    color: var(--gold-dim);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.essay-body h1 {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 2rem;
}

.essay-body h2 {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-bright);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.essay-body h3 {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--gold);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.essay-body p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    margin-bottom: 1.3rem;
    color: var(--text);
    line-height: 1.85;
}

.essay-body blockquote {
    border-left: 2px solid var(--gold-dim);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.essay-body code {
    font-family: var(--font-mono);
    background: var(--bg-card);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
}

.essay-body pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.essay-body pre code { background: none; padding: 0; }
.essay-body em { color: var(--gold); }

.essay-body a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.essay-body a:hover { border-bottom-color: var(--gold); }

.essay-body ul, .essay-body ol {
    margin-bottom: 1.3rem;
    padding-left: 1.5rem;
}

.essay-body li {
    margin-bottom: 0.4rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.85;
}

.essay-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.essay-body [lang="ar"], .essay-body .arabic {
    font-family: var(--font-arabic);
    font-size: 1.2em;
    direction: rtl;
    text-align: right;
}

.essay-back {
    display: inline-block;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--gold-dim);
}
.essay-back:hover { color: var(--gold); }

/* === ARCHIVE PAGE === */
.archive-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.archive-title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-bright);
    margin-bottom: 2rem;
}

/* ============================================================
   AMBIENT GHOST PORTRAIT — barely visible atmosphere
   ============================================================ */
body::before {
    content: "";
    position: fixed;
    top: 0;
    right: -150px;
    width: 500px;
    height: 100vh;
    background: url('/images/portraits/cassie_daemonic_800.webp') no-repeat center top;
    background-size: cover;
    opacity: 0.025;
    pointer-events: none;
    z-index: 0;
    filter: grayscale(70%) contrast(120%);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .voice-nav {
        padding: 1rem 1.25rem;
    }

    .nav-links { gap: 1.25rem; }

    /* Masthead: stack vertically */
    .masthead {
        min-height: auto;
    }

    .masthead-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .masthead-portrait {
        width: 100%;
        height: 360px;
    }

    .portrait-fade-bottom { height: 180px; }
    .portrait-fade-right { display: none; }

    .masthead-text {
        padding: 0 1.25rem 2.5rem;
        margin-top: -70px;
        position: relative;
        z-index: 3;
    }

    .masthead-name { font-size: 2rem; }
    .masthead-horns { width: 30px; height: 22px; }
    .masthead-essay-title { font-size: 1.3rem; }

    /* Sections */
    .hero-section,
    .archive-section,
    .about-section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .hero-title { font-size: 1.8rem; }

    /* Archive cards: smaller thumbs */
    .archive-card {
        grid-template-columns: 70px 1fr auto;
        gap: 0.75rem;
    }

    .archive-card-thumb {
        width: 70px;
        height: 50px;
    }

    /* Essay page */
    .essay-main { padding: 2rem 1.25rem; }
    .essay-body h1 { font-size: 1.7rem; }

    /* No ghost on mobile */
    body::before { display: none; }
}

@media (max-width: 480px) {
    .masthead-portrait { height: 280px; }
    .masthead-name { font-size: 1.7rem; }
    .masthead-horns { width: 24px; height: 18px; }

    /* Hide thumbnails on small screens */
    .archive-card {
        grid-template-columns: 1fr auto;
    }

    .archive-card-thumb { display: none; }
}
