/* ===================================
   MARGIN NOTES — CATEGORY BAR
   =================================== */

.margin-notes-cats {
    max-width: 800px;
    margin: -1.5rem auto 3rem;
}

.margin-notes-cats ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.margin-notes-cats a {
    display: inline-block;
    padding: 0.5rem 1.15rem;
    border: 1px solid rgba(201, 169, 97, 0.35);
    border-radius: 50px;
    color: var(--cream);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    background: rgba(13, 13, 13, 0.35);
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.margin-notes-cats a:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.margin-notes-cats a.active {
    background: rgba(201, 169, 97, 0.9);
    border-color: var(--gold);
    color: var(--rich-black);
    font-weight: 600;
}

/* Excerpt is now a div (the_excerpt outputs its own <p>) */
.margin-note-excerpt p {
    margin: 0;
}

/* ===================================
   MARGIN NOTES — GENERAL CATEGORY PAGE
   =================================== */

.margin-notes-eyebrow {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.category-description {
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.7;
}

.category-description p + p {
    margin-top: 1rem;
}

/* ===================================
   MARGIN NOTES — SERIES PAGE
   (category-behind-the-chapters.php)
   =================================== */

.series-page {
    min-height: 100vh;
    padding-top: 72px;
}

/* Hero */
.series-hero {
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(201, 169, 97, 0.25);
    overflow: hidden;
}

.series-hero.has-image {
    background-color: var(--rich-black);
}

/* Photo fills the right side of the hero and fades softly into the dark behind the text */
.series-hero.has-image::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 65%;
    background-image: var(--series-hero-image);
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 30%, #000 60%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 30%, #000 60%);
    pointer-events: none;
}

.series-hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.series-eyebrow {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.series-eyebrow::after {
    content: '';
    width: 140px;
    height: 1px;
    background: var(--gold);
    opacity: 0.7;
}

.series-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--cream);
    letter-spacing: 3px;
    text-transform: uppercase;
    max-width: 560px;
}

.series-script {
    font-family: var(--font-accent);
    font-size: 3.25rem;
    color: var(--gold);
    line-height: 1.2;
    margin-top: 0.5rem;
}

.series-script em {
    font-style: normal;
}

.series-book-line {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--cream);
    opacity: 0.85;
    margin-top: 1rem;
}

/* Body */
.series-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3.5rem 2rem 4rem;
}

.series-container .margin-notes-cats {
    margin: 0 auto 3rem;
}

.series-intro {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--cream);
    margin-bottom: 3.5rem;
}

.series-intro p + p {
    margin-top: 1.25rem;
}

.series-intro em {
    color: var(--gold);
}

.series-section-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
}

.series-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(201, 169, 97, 0.5);
}

/* Installment list */
.series-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.series-entry-link {
    display: grid;
    grid-template-columns: 240px 1fr;
    text-decoration: none;
    color: inherit;
    background: rgba(26, 58, 74, 0.3);
    border: 1px solid rgba(201, 169, 97, 0.25);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.series-entry-link:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 169, 97, 0.6);
    box-shadow: 0 8px 24px rgba(201, 169, 97, 0.2);
}

.series-entry-thumb {
    position: relative;
    min-height: 180px;
    background: rgba(13, 13, 13, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(201, 169, 97, 0.2);
}

.series-entry-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-entry-number-large {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--gold);
    opacity: 0.6;
}

.series-entry-body {
    padding: 1.75rem 2rem;
}

.series-entry-meta {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.6rem;
}

.series-entry-sep {
    opacity: 0.5;
    margin: 0 0.4rem;
}

.series-entry-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--gold);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.series-entry-excerpt {
    color: var(--cream);
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.series-entry-excerpt p {
    margin: 0;
}

.series-entry-read {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: var(--gold);
}

.series-empty {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed rgba(201, 169, 97, 0.3);
    border-radius: 12px;
    color: var(--cream);
    opacity: 0.85;
}

/* Series — responsive */
@media (max-width: 768px) {
    .margin-notes-cats {
        margin: -2rem auto 2.5rem;
    }

    .margin-notes-cats a {
        font-size: 0.85rem;
        padding: 0.45rem 0.95rem;
    }

    .series-hero {
        min-height: 360px;
    }

    .series-hero.has-image::before {
        width: 100%;
        opacity: 0.4;
        background-position: center 25%;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 95%);
        mask-image: linear-gradient(180deg, #000 0%, transparent 95%);
    }

    .series-hero-inner {
        padding: 3rem 1.5rem;
    }

    .series-title {
        font-size: 2.4rem;
    }

    .series-script {
        font-size: 2.6rem;
    }

    .series-container {
        padding: 2.5rem 1.5rem 3rem;
    }

    .series-entry-link {
        grid-template-columns: 1fr;
    }

    .series-entry-thumb {
        min-height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(201, 169, 97, 0.2);
    }

    .series-entry-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .series-title {
        font-size: 1.9rem;
        letter-spacing: 2px;
    }

    .series-script {
        font-size: 2.2rem;
    }

    .series-eyebrow::after {
        width: 60px;
    }

    .series-section-title {
        font-size: 0.95rem;
        letter-spacing: 3px;
    }
}

/* Posts without a featured image (non-series categories): text-only card */
.series-entry.no-thumb .series-entry-link {
    grid-template-columns: 1fr;
}

.series-container .margin-notes-pagination {
    margin-top: 2.5rem;
}


/* ===================================
   MARGIN NOTES — MAIN ARCHIVE CARDS
   =================================== */

.margin-notes-archive .margin-notes-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.margin-notes-archive .margin-note-card {
    background: rgba(26, 58, 74, 0.3);
    border: 1px solid rgba(201, 169, 97, 0.25);
    border-radius: 12px;
    overflow: hidden;
}

.margin-notes-archive .margin-note-link {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    color: inherit;
    text-decoration: none;
    transition: background 0.3s ease;
}

.margin-notes-archive .margin-note-link:hover {
    background: rgba(201, 169, 97, 0.05);
}

.margin-notes-archive .margin-note-card-thumb {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    background: rgba(13, 13, 13, 0.5);
    border-right: 1px solid rgba(201, 169, 97, 0.2);
}

.margin-notes-archive .margin-note-card-thumb img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.margin-notes-archive .margin-note-card-body {
    min-width: 0;
    padding: 1.75rem 2rem;
}

.margin-notes-archive .margin-note-date {
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 0.65rem;
}

.margin-notes-archive .margin-note-card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.margin-notes-archive .margin-note-excerpt {
    color: var(--cream);
    line-height: 1.65;
    opacity: 0.85;
}

.margin-notes-archive .margin-note-excerpt p {
    margin: 0;
}

/* Cards without featured images */
.margin-notes-archive .margin-note-link:not(:has(.margin-note-card-thumb)) {
    grid-template-columns: 1fr;
}

/* Mobile layout */
@media (max-width: 768px) {
    .margin-notes-archive .margin-note-link {
        grid-template-columns: 1fr;
    }

    .margin-notes-archive .margin-note-card-thumb {
        height: 220px;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid rgba(201, 169, 97, 0.2);
    }

    .margin-notes-archive .margin-note-card-body {
        padding: 1.5rem;
    }
}


/* ===================================
   MARGIN NOTES — SINGLE POST: SERIES NAV
   (Behind the Chapters posts)
   =================================== */

.margin-note-series-label {
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.margin-note-series-label a {
    color: var(--gold);
    text-decoration: none;
}

.margin-note-series-label a:hover {
    text-decoration: underline;
}

.chapter-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 3.5rem 0 2rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(201, 169, 97, 0.3);
}

.chapter-nav-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.4rem 1.6rem;
    background: rgba(26, 58, 74, 0.3);
    border: 1px solid rgba(201, 169, 97, 0.25);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.chapter-nav-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 169, 97, 0.6);
    box-shadow: 0 8px 24px rgba(201, 169, 97, 0.2);
}

.chapter-nav-next {
    text-align: right;
}

.chapter-nav-label {
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
}

.chapter-nav-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    line-height: 1.35;
    color: var(--cream);
}

.margin-notes-single .margin-notes-back {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.margin-notes-back-sep {
    color: var(--gold);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .chapter-nav {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 2.5rem 0 1.5rem;
    }

    .chapter-nav-spacer {
        display: none;
    }

    .chapter-nav-next {
        text-align: left;
    }
}
