/* ==========================================================================
   THE GILDED LEDGER — Ghost 6.0 Fantasy Quest Log Theme
   Materials: Aged Wood, Stitched Saddle Leather, Wrought Iron, Copper & Brass
   ========================================================================== */

:root {
    /* Leather & Wood Palette */
    --leather-base: #3a2013;
    --leather-dark: #221109;
    --leather-highlight: #56321e;
    --stitch-thread: #c89d66;

    /* Old Metals */
    --iron-dark: #1d2024;
    --iron-mid: #343940;
    --iron-highlight: #68707a;

    --copper-dark: #5e2c18;
    --copper-mid: #9e4f2d;
    --copper-bright: #d47a4e;

    --brass-dark: #6b4c1e;
    --brass-mid: #b3873b;
    --brass-bright: #e7c272;

    /* Parchment & Ink */
    --parchment-light: #f5ebd6;
    --parchment-mid: #ead8b5;
    --parchment-edge: #cfb587;
    --ink-primary: #26180d;
    --ink-muted: #5c432c;

    /* Wax Seals */
    --wax-crimson: #8f1d1d;
    --wax-emerald: #215c36;
    --wax-cobalt: #224470;

    /* Typography */
    --font-display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    --font-heading: 'Cinzel', Georgia, serif;
    --font-body: 'Crimson Pro', Georgia, serif;

    /* Transitions */
    --ease-tactile: cubic-bezier(0.25, 0.9, 0.3, 1);
}

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

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--ink-primary);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.65;
    background-color: #1f140d;
    overflow-x: hidden;
    position: relative;
}

/* ==========================================================================
   1. AGED WOOD TABLETOP BACKGROUNDS (Switchable via Ghost Custom Settings)
   ========================================================================== */

body[data-wood="Aged Walnut"],
body:not([data-wood]) {
    background-color: #24160e;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(12, 6, 3, 0.55) 0px,
            rgba(12, 6, 3, 0.55) 3px,
            transparent 3px,
            transparent 180px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 200, 140, 0.025) 0px,
            rgba(255, 200, 140, 0.025) 2px,
            rgba(0, 0, 0, 0.08) 2px,
            rgba(0, 0, 0, 0.08) 6px
        ),
        radial-gradient(circle at 50% 25%, #3d2517 0%, #190e08 85%);
}

body[data-wood="Weathered Oak"] {
    background-color: #332417;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(20, 13, 8, 0.5) 0px,
            rgba(20, 13, 8, 0.5) 3px,
            transparent 3px,
            transparent 165px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 225, 180, 0.03) 0px,
            rgba(255, 225, 180, 0.03) 2px,
            rgba(0, 0, 0, 0.06) 2px,
            rgba(0, 0, 0, 0.06) 5px
        ),
        radial-gradient(circle at 50% 25%, #543d28 0%, #24180f 85%);
}

body[data-wood="Ebonized Ash"] {
    background-color: #151415;
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.7) 0px,
            rgba(0, 0, 0, 0.7) 3px,
            transparent 3px,
            transparent 190px
        ),
        radial-gradient(circle at 50% 25%, #2a2726 0%, #0d0c0c 85%);
}

/* ==========================================================================
   2. AMBIENT TAVERN CANDLELIGHT OVERLAY
   ========================================================================== */

.ambient-candlelight {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    transition: background 0.6s ease, opacity 0.6s ease;
}

body[data-ambiance="Candlelight"] .ambient-candlelight,
body:not([data-ambiance]) .ambient-candlelight {
    background: radial-gradient(circle at 50% 18%, rgba(255, 184, 84, 0.16), transparent 65%);
    animation: candle-flicker 5s infinite alternate ease-in-out;
}

body[data-ambiance="Deep Hearth"] .ambient-candlelight {
    background: radial-gradient(circle at 50% 20%, rgba(235, 92, 36, 0.22), rgba(60, 15, 5, 0.18) 70%);
    animation: candle-flicker 3.5s infinite alternate ease-in-out;
}

body[data-ambiance="Moonlit Study"] .ambient-candlelight {
    background: radial-gradient(circle at 50% 15%, rgba(125, 168, 225, 0.16), rgba(10, 18, 34, 0.25) 75%);
}

@keyframes candle-flicker {
    0% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.9; transform: scale(0.99); }
}

/* ==========================================================================
   3. LEATHER-BOUND TOME & HARDWARE (Wrought Iron, Copper, Brass)
   ========================================================================== */

.tabletop-stage {
    position: relative;
    z-index: 2;
    max-width: 1040px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 4rem;
}

.ledger-tome-wrapper {
    position: relative;
}

/* Protruding Brass & Copper Bookmark Tabs */
.ledger-bookmark-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0 1.5rem;
    margin-bottom: -4px;
    position: relative;
    z-index: 2;
}

.metal-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem 0.55rem;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(0, 0, 0, 0.65);
    border-bottom: none;
    box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.45), 0 -2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s var(--ease-tactile), filter 0.2s ease;
}

.metal-tab--brass {
    background: linear-gradient(180deg, var(--brass-bright) 0%, var(--brass-mid) 45%, var(--brass-dark) 100%);
    color: #211405;
}

.metal-tab--copper {
    background: linear-gradient(180deg, var(--copper-bright) 0%, var(--copper-mid) 48%, var(--copper-dark) 100%);
    color: #fff3e6;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.metal-tab:hover,
.metal-tab.is-active {
    transform: translateY(-4px);
    filter: brightness(1.08);
}

.metal-tab__rivet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff5d6, #3d2610);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* Main Leather Book Cover */
.ledger-tome {
    position: relative;
    z-index: 3;
    background-color: var(--leather-base);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(255, 198, 130, 0.14), transparent 60%),
        linear-gradient(90deg, rgba(12, 5, 2, 0.78) 0%, rgba(36, 18, 9, 0.15) 4%, transparent 9%, transparent 95%, rgba(12, 5, 2, 0.55) 100%),
        linear-gradient(160deg, var(--leather-highlight) 0%, var(--leather-base) 45%, var(--leather-dark) 100%);
    border-radius: 10px 18px 18px 10px;
    padding: 1.25rem 1.25rem 1.25rem 2.6rem;
    border: 2px solid #160a04;
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.78),
        0 6px 14px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 210, 160, 0.25);
}

/* Leather Spine & Tarnished Brass Hinges */
.leather-spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 34px;
    background: linear-gradient(90deg, #160a04 0%, #3d2113 42%, #1d0e07 82%, #120803 100%);
    border-radius: 8px 0 0 8px;
    border-right: 1px solid rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    pointer-events: none;
}

.spine-band {
    width: 100%;
    height: 10px;
    background: linear-gradient(180deg, rgba(255, 200, 150, 0.18), rgba(0, 0, 0, 0.65));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.brass-hinge {
    width: 44px;
    height: 26px;
    margin-left: 12px;
    background: linear-gradient(180deg, var(--brass-bright), var(--brass-mid) 50%, var(--brass-dark));
    border: 1px solid #2b1a07;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 245, 210, 0.6);
    position: relative;
}

.brass-hinge::after {
    content: "";
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2b1a07;
}

/* Wrought-Iron Riveted Corner Brackets */
.iron-corner {
    position: absolute;
    width: 46px;
    height: 46px;
    z-index: 6;
    pointer-events: none;
    background: linear-gradient(135deg, var(--iron-highlight) 0%, var(--iron-mid) 45%, var(--iron-dark) 100%);
    border: 1px solid #0d0f11;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
}

.iron-corner i {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #a5aeb8, #1c1f24);
    box-shadow: 0 1px 1px #000;
}

.iron-corner--tl {
    top: -3px;
    left: -3px;
    border-radius: 9px 0 28px 0;
}
.iron-corner--tl i:nth-child(1) { top: 7px; left: 7px; }
.iron-corner--tl i:nth-child(2) { top: 7px; left: 26px; }
.iron-corner--tl i:nth-child(3) { top: 26px; left: 7px; }

.iron-corner--tr {
    top: -3px;
    right: -3px;
    border-radius: 0 17px 0 28px;
}
.iron-corner--tr i:nth-child(1) { top: 7px; right: 7px; }
.iron-corner--tr i:nth-child(2) { top: 7px; right: 26px; }
.iron-corner--tr i:nth-child(3) { top: 26px; right: 7px; }

.iron-corner--bl {
    bottom: -3px;
    left: -3px;
    border-radius: 0 28px 0 9px;
}
.iron-corner--bl i:nth-child(1) { bottom: 7px; left: 7px; }
.iron-corner--bl i:nth-child(2) { bottom: 7px; left: 26px; }
.iron-corner--bl i:nth-child(3) { bottom: 26px; left: 7px; }

.iron-corner--br {
    bottom: -3px;
    right: -3px;
    border-radius: 28px 0 17px 0;
}
.iron-corner--br i:nth-child(1) { bottom: 7px; right: 7px; }
.iron-corner--br i:nth-child(2) { bottom: 7px; right: 26px; }
.iron-corner--br i:nth-child(3) { bottom: 26px; right: 7px; }

/* Saddle-Stitched Inner Leather Border */
.ledger-stitched-frame {
    border: 2px dashed rgba(212, 166, 106, 0.55);
    border-radius: 10px;
    padding: 1.5rem 1.65rem 1.75rem;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   4. HEADER: HAMMERED COPPER TITLE PLAQUE & CANDLELIGHT CONTROLS
   ========================================================================== */

.ledger-header__top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.ambiance-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(18, 9, 4, 0.65);
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(179, 135, 59, 0.35);
}

.ambiance-switcher__icon {
    color: var(--brass-bright);
    font-size: 0.85rem;
    margin-right: 0.15rem;
}

.brass-chip {
    background: transparent;
    border: 1px solid transparent;
    color: #d9be93;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brass-chip:hover {
    color: #fff5df;
}

.brass-chip.is-active {
    background: linear-gradient(180deg, var(--brass-bright), var(--brass-mid));
    color: #211304;
    border-color: #2a1805;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.quill-scribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--brass-bright) 0%, var(--brass-mid) 55%, var(--brass-dark) 100%);
    color: #1f1204;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid #241404;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 245, 215, 0.65);
    transition: transform 0.18s ease, filter 0.18s ease;
}

.quill-scribe-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

/* Hammered Copper Title Plaque */
.copper-title-plaque {
    position: relative;
    text-align: center;
    padding: 1.35rem 2.25rem;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 195, 150, 0.22), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(45, 16, 6, 0.35), transparent 50%),
        linear-gradient(180deg, #b55e36 0%, #8c4122 50%, #5c2712 100%);
    border: 2px solid #2c1207;
    border-radius: 8px;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 215, 180, 0.45),
        inset 0 0 18px rgba(32, 11, 4, 0.55);
}

.copper-rivet {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--brass-bright), var(--brass-dark));
    border: 1px solid #241305;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.copper-rivet--tl { top: 9px; left: 9px; }
.copper-rivet--tr { top: 9px; right: 9px; }
.copper-rivet--bl { bottom: 9px; left: 9px; }
.copper-rivet--br { bottom: 9px; right: 9px; }

.plaque-kicker {
    margin: 0 0 0.25rem;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f4cfa4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.plaque-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.65rem, 3.6vw, 2.55rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.04em;
}

.plaque-title a {
    color: #fff3dc;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(24, 8, 2, 0.9), 0 0 18px rgba(255, 198, 120, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.plaque-logo {
    max-height: 44px;
    width: auto;
}

.plaque-description {
    margin: 0.45rem auto 0;
    max-width: 620px;
    font-size: 1rem;
    font-style: italic;
    color: #f5dec2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* Primary Navigation Ribbon */
.ledger-ribbon-nav {
    margin-top: 0.95rem;
    display: flex;
    justify-content: center;
}

.ribbon-nav-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.1rem;
    background: rgba(20, 10, 5, 0.65);
    border: 1px solid rgba(196, 152, 82, 0.35);
    border-radius: 6px;
}

.ribbon-nav-item a {
    color: #e6cca0;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.2rem 0.35rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ribbon-nav-item a:hover,
.ribbon-nav-item.is-current a {
    color: var(--brass-bright);
    border-bottom-color: var(--brass-bright);
}

/* ==========================================================================
   5. WAX SEAL FILTERS, IRON SEARCH BAR & BRASS TOOLS
   ========================================================================== */

.ledger-controls {
    margin: 1.35rem 0 1.5rem;
    padding: 0.95rem 1.1rem;
    background: rgba(24, 12, 6, 0.68);
    border: 1px solid rgba(186, 141, 68, 0.35);
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.wax-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.seal-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(205, 163, 98, 0.35);
    background: rgba(45, 25, 14, 0.85);
    color: #edd7b4;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.seal-filter:hover {
    border-color: var(--brass-bright);
    background: rgba(68, 39, 22, 0.95);
}

.seal-filter.is-active {
    background: linear-gradient(180deg, #f3e4c6, #d9bf91);
    color: #231407;
    border-color: var(--brass-bright);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.seal-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.75);
}
.seal-dot--brass { background: var(--brass-mid); }
.seal-dot--active { background: var(--wax-crimson); }
.seal-dot--completed { background: var(--wax-emerald); }
.seal-dot--lore { background: var(--wax-cobalt); }

.seal-count {
    font-size: 0.7rem;
    padding: 0.05rem 0.42rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
}

.seal-filter.is-active .seal-count {
    background: rgba(38, 24, 13, 0.16);
}

.ledger-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
}

.iron-search-box {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    background: #17191c;
    border: 2px solid var(--iron-mid);
    border-radius: 6px;
    color: #b7bec7;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.12);
}

.iron-search-box:focus-within {
    border-color: var(--brass-mid);
}

.iron-search-box input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #f4e6cc;
    font-family: var(--font-body);
    font-size: 0.98rem;
}

.iron-search-box input::placeholder {
    color: #8b8275;
    font-style: italic;
}

.brass-utility-buttons {
    display: flex;
    gap: 0.5rem;
}

.brass-tool-btn {
    padding: 0.46rem 0.85rem;
    border-radius: 6px;
    background: linear-gradient(180deg, #4b525c 0%, #2c3138 100%);
    border: 1px solid #121417;
    color: #e4d5bc;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: all 0.18s ease;
}

.brass-tool-btn:hover {
    border-color: var(--brass-mid);
    color: var(--brass-bright);
}

/* ==========================================================================
   6. EXPANDABLE QUEST ENTRIES & SMOOTH SQUARE IMAGE ENLARGEMENT
   ========================================================================== */

.quest-ledger-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quest-entry {
    background:
        radial-gradient(ellipse at top left, rgba(255, 252, 244, 0.65), transparent 70%),
        linear-gradient(180deg, var(--parchment-light) 0%, var(--parchment-mid) 100%);
    border: 1px solid #7d5b34;
    border-left: 5px solid var(--brass-mid);
    border-radius: 7px;
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.45),
        inset 0 0 24px rgba(166, 128, 72, 0.24);
    transition: transform 0.22s var(--ease-tactile), box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.quest-entry:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.58),
        inset 0 0 24px rgba(166, 128, 72, 0.28);
}

.quest-entry.is-expanded {
    border-left-color: var(--copper-mid);
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.68),
        inset 0 0 32px rgba(166, 128, 72, 0.3);
}

.quest-entry.is-filtered-out {
    display: none;
}

/* Clickable Header Area */
.quest-entry__main {
    display: flex;
    align-items: flex-start;
    gap: 1.15rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.quest-entry__main:focus-visible {
    outline: 2px solid var(--copper-mid);
    outline-offset: -3px;
}

/* Bolted Copper & Brass Square Artwork Frame (68x68px -> 260x260px on expand) */
.quest-artwork-frame {
    position: relative;
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    padding: 4px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--brass-bright) 0%, var(--copper-mid) 50%, var(--iron-dark) 100%);
    border: 1px solid #2b1808;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 200, 0.55);
    transition:
        width 0.45s var(--ease-tactile),
        height 0.45s var(--ease-tactile),
        padding 0.45s var(--ease-tactile),
        box-shadow 0.45s var(--ease-tactile);
}

/* Enlarge small square image into medium square image when entry expands */
.quest-entry.is-expanded .quest-artwork-frame {
    width: 260px;
    height: 260px;
    padding: 8px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 240, 200, 0.65);
}

.quest-artwork-frame--medium {
    width: 260px;
    height: 260px;
    padding: 8px;
}

.frame-bolt {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff4d4, #3b220c);
    z-index: 3;
    transition: width 0.35s ease, height 0.35s ease;
}

.quest-entry.is-expanded .frame-bolt,
.quest-artwork-frame--medium .frame-bolt {
    width: 7px;
    height: 7px;
}

.frame-bolt--tl { top: 2px; left: 2px; }
.frame-bolt--tr { top: 2px; right: 2px; }
.frame-bolt--bl { bottom: 2px; left: 2px; }
.frame-bolt--br { bottom: 2px; right: 2px; }

.quest-artwork-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 3px;
    background: #1d140e;
    border: 1px solid rgba(0, 0, 0, 0.65);
}

.quest-artwork-inner img,
.fallback-emblem,
.emblem-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Quest Title, Metadata & Excerpt */
.quest-summary {
    flex: 1 1 auto;
    min-width: 0;
}

.quest-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.quest-date {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.quest-tag-badge {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 4px;
    background: rgba(158, 79, 45, 0.16);
    border: 1px solid rgba(158, 79, 45, 0.45);
    color: #692b12;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}

.quest-featured-badge {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: #7d5211;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Wax Seal Status Badges */
.wax-seal {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.6rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff6e8;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}

.wax-seal--active {
    background: radial-gradient(circle at 30% 30%, #b82929, var(--wax-crimson));
    border: 1px solid #4f0c0c;
}

.wax-seal--completed {
    background: radial-gradient(circle at 30% 30%, #2f7d4b, var(--wax-emerald));
    border: 1px solid #12361f;
}

.wax-seal--lore {
    background: radial-gradient(circle at 30% 30%, #315e96, var(--wax-cobalt));
    border: 1px solid #122640;
}

.quest-title {
    margin: 0 0 0.3rem;
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2.1vw, 1.48rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--ink-primary);
    transition: color 0.2s ease;
}

.quest-entry__main:hover .quest-title {
    color: #7c2d12;
}

.quest-excerpt {
    margin: 0;
    color: var(--ink-muted);
    font-size: 0.98rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quest-entry.is-expanded .quest-excerpt {
    -webkit-line-clamp: unset;
    color: #3d2817;
    font-style: italic;
}

/* Rotating Brass Latch Toggle */
.quest-latch {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
    padding-top: 0.2rem;
}

.brass-latch-ring {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--brass-bright), var(--brass-mid) 55%, var(--brass-dark));
    color: #211304;
    border: 1px solid #2b1806;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 245, 215, 0.65);
    transition: transform 0.38s var(--ease-tactile);
}

.quest-entry.is-expanded .brass-latch-ring {
    transform: rotate(180deg);
}

.quest-latch__hint {
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* ==========================================================================
   7. UNFURLING PARCHMENT DRAWER & GHOST RICH-TEXT STYLING
   ========================================================================== */

.quest-drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease-tactile);
}

.quest-entry.is-expanded .quest-drawer {
    grid-template-rows: 1fr;
}

.quest-drawer__inner {
    overflow: hidden;
}

.parchment-sheet {
    padding: 0 1.45rem 1.35rem;
}

.parchment-sheet--single {
    background:
        radial-gradient(ellipse at top left, rgba(255, 252, 244, 0.7), transparent 70%),
        linear-gradient(180deg, var(--parchment-light) 0%, var(--parchment-mid) 100%);
    border: 1px solid #7d5b34;
    border-radius: 8px;
    padding: 1.75rem 2rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), inset 0 0 32px rgba(166, 128, 72, 0.25);
}

.parchment-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.25rem 0 1.25rem;
    color: var(--brass-dark);
}

.parchment-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(125, 91, 52, 0.65), transparent);
}

.parchment-divider i {
    font-style: normal;
    font-size: 0.9rem;
}

/* Rich Chronicle Typography & Ghost Koenig Editor Cards */
.quest-chronicle-content {
    color: var(--ink-primary);
    font-size: 1.08rem;
    line-height: 1.72;
}

.quest-chronicle-content > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 3.1rem;
    line-height: 0.85;
    padding: 0.15rem 0.55rem 0 0;
    color: #7c2d12;
}

.quest-chronicle-content h2,
.quest-chronicle-content h3,
.quest-chronicle-content h4 {
    font-family: var(--font-heading);
    color: #361d0b;
    margin: 1.45rem 0 0.55rem;
    letter-spacing: 0.03em;
}

.quest-chronicle-content a {
    color: #822b12;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* Bullet Lists Styled as Inked Quest Objectives */
.quest-chronicle-content ul {
    list-style: none;
    padding-left: 0.25rem;
    margin: 1rem 0;
}

.quest-chronicle-content ul li {
    position: relative;
    padding-left: 1.45rem;
    margin-bottom: 0.45rem;
}

.quest-chronicle-content ul li::before {
    content: "◆";
    position: absolute;
    left: 0;
    top: 0.05rem;
    color: var(--copper-mid);
    font-size: 0.82rem;
}

/* Blockquotes Styled as Scribe Margin Notes */
.quest-chronicle-content blockquote {
    margin: 1.25rem 0;
    padding: 0.85rem 1.15rem;
    background: rgba(179, 135, 59, 0.14);
    border-left: 4px solid var(--brass-dark);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #3f2814;
}

.quest-chronicle-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 3px solid #6b4c1e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.quest-chronicle-content hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8c6536, transparent);
    margin: 1.6rem 0;
}

/* Ghost Callout & Toggle Cards inside Parchment */
.kg-callout-card {
    border-radius: 6px !important;
    border: 1px solid rgba(125, 91, 52, 0.45) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Expanded Drawer Footer Actions */
.parchment-footer {
    margin-top: 1.35rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(125, 91, 52, 0.55);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.parchment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.parchment-tag-chip {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-decoration: none;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(125, 91, 52, 0.12);
}

.parchment-tag-chip:hover {
    background: rgba(125, 91, 52, 0.25);
    color: var(--ink-primary);
}

.parchment-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brass-action-link,
.brass-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #3d250c;
    background: linear-gradient(180deg, var(--brass-bright) 0%, var(--brass-mid) 55%, var(--brass-dark) 100%);
    color: #211304;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 245, 215, 0.65);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.brass-action-link:hover,
.brass-action-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
}

/* ==========================================================================
   8. SINGLE POST, ARCHIVE BANNERS, PAGINATION & FOOTER
   ========================================================================== */

.scroll-breadcrumb {
    margin-bottom: 1rem;
}

.single-scroll-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.single-scroll-heading {
    flex: 1 1 320px;
}

.single-scroll-title {
    margin: 0.35rem 0 0.5rem;
    font-family: var(--font-heading);
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--ink-primary);
}

.single-scroll-lead {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    font-style: italic;
    color: var(--ink-muted);
}

.scribe-byline {
    font-family: var(--font-heading);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--ink-muted);
}

.scribe-byline a {
    color: #692b12;
    font-weight: 700;
    text-decoration: none;
}

.adjacent-quests-nav {
    margin-top: 1.35rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.adjacent-quest-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 7px;
    background: rgba(24, 12, 6, 0.75);
    border: 1px solid rgba(196, 152, 82, 0.4);
    color: #f4e4c8;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.adjacent-quest-card:hover {
    border-color: var(--brass-bright);
    transform: translateY(-2px);
}

.adjacent-quest-card--next {
    text-align: right;
}

.adjacent-quest-card__dir {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass-bright);
}

.adjacent-quest-card__title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
}

/* Tag & Author Archive Plaque */
.archive-banner-plaque {
    margin-bottom: 1.35rem;
    padding: 1.15rem 1.35rem;
    background: rgba(24, 12, 6, 0.72);
    border: 1px solid rgba(196, 152, 82, 0.4);
    border-radius: 8px;
    color: #f5e6cb;
}

.archive-banner-plaque__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.archive-banner-plaque .quest-tag-badge {
    background: rgba(231, 194, 114, 0.16);
    border-color: rgba(231, 194, 114, 0.45);
    color: var(--brass-bright);
}

.archive-banner-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.55rem;
    color: #fff2d9;
}

.archive-banner-desc {
    margin: 0.35rem 0 0;
    color: #dec7a1;
    font-style: italic;
}

/* Empty State */
.empty-parchment-notice {
    text-align: center;
    padding: 2.25rem 1.5rem;
    background: var(--parchment-light);
    border: 1px dashed #7d5b34;
    border-radius: 8px;
}

.empty-parchment-notice.is-hidden {
    display: none;
}

.empty-parchment-notice h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-heading);
}

/* Ghost Pagination */
.pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: #e6cca0;
}

.pagination a {
    padding: 0.35rem 0.85rem;
    border-radius: 5px;
    background: linear-gradient(180deg, var(--brass-bright), var(--brass-mid));
    color: #211304;
    font-weight: 700;
    text-decoration: none;
}

/* Ledger Footer */
.ledger-footer {
    margin-top: 2rem;
    text-align: center;
}

.brass-filigree-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
    color: var(--brass-mid);
}

.brass-filigree-divider span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(196, 152, 82, 0.55), transparent);
}

.ledger-footer__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #cbb084;
}

.ledger-footer__meta a {
    color: var(--brass-bright);
    text-decoration: none;
}

/* ==========================================================================
   9. RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 680px) {
    .tabletop-stage {
        padding: 1rem 0.5rem 2.5rem;
    }

    .ledger-tome {
        padding: 0.85rem 0.75rem 0.95rem 1.65rem;
    }

    .leather-spine {
        width: 22px;
    }

    .brass-hinge {
        width: 28px;
        height: 20px;
        margin-left: 6px;
    }

    .ledger-stitched-frame {
        padding: 1rem 0.9rem 1.25rem;
    }

    .quest-entry__main {
        flex-wrap: wrap;
        gap: 0.85rem;
    }

    .quest-entry.is-expanded .quest-artwork-frame,
    .quest-artwork-frame--medium {
        width: 100%;
        max-width: 260px;
        height: 240px;
    }

    .parchment-sheet--single {
        padding: 1.2rem 1.1rem;
    }
}
