.editorial-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.editorial-layout > * {
    min-width: 0;
}

.work-paper {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-top: 3px solid var(--brand-navy);
    border-radius: 14px;
    padding: 42px 44px;
    box-shadow: 0 10px 30px rgba(16, 42, 56, 0.04);
}

.work-header {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-subtle);
}

.work-type {
    display: inline-block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--brand-gold);
    margin-bottom: 10px;
}

.work-title {
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    font-weight: 600;
    color: var(--brand-navy);
    line-height: 1.18;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.work-byline {
    font-size: 0.96rem;
    font-style: italic;
    color: var(--ink-muted);
    margin-bottom: 14px;
}

.work-byline a {
    color: var(--brand-navy);
    font-weight: 600;
    font-style: normal;
    border-bottom: 1px dotted var(--brand-gold);
}

.work-byline a:hover {
    color: var(--brand-gold);
}

.work-cats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.work-cat-pill {
    font-size: 0.82rem;
    font-style: italic;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--brand-gold-soft);
    color: var(--brand-navy);
}

.work-cat-pill:hover {
    background: var(--brand-navy);
    color: #FFFFFF;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.work-tags-label {
    font-size: 0.9rem;
    margin-right: 2px;
}

.work-tag-link {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.84rem;
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.35));
    color: var(--ink-muted, inherit);
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.work-tag-link:hover {
    border-color: var(--brand-gold, #b8860b);
    color: var(--brand-gold, #b8860b);
}

/* Reading Controls Toolbar */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: -10px 0 26px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
}

.reader-font-group,
.reader-mode-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reader-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--brand-navy);
    font-family: 'Lora', Georgia, serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.reader-btn:hover:not(:disabled) {
    border-color: var(--brand-gold);
    color: var(--brand-gold);
}

.reader-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.reader-btn-reset {
    min-width: 52px;
    font-size: 0.76rem;
    color: var(--ink-muted);
}

.reader-btn.is-active {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: var(--bg-canvas);
}

[data-theme="dark"] .reader-btn.is-active {
    background: var(--brand-gold);
    border-color: var(--brand-gold);
    color: #0E171D;
}

.reader-only-btn {
    display: none;
}

/* Cover & Book Metadata */
.work-cover {
    margin: 0 auto 28px;
    text-align: center;
}

.work-cover img {
    max-width: 100%;
    max-height: 420px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.book-details-box {
    background: var(--bg-canvas);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--brand-gold);
    border-radius: 0 10px 10px 0;
    padding: 18px 22px;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.book-meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    color: var(--ink-muted);
}

.book-meta-list strong {
    color: var(--brand-navy);
}

.btn-buy-book {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 999px;
    background: var(--brand-navy);
    color: #FFFFFF;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1rem;
}

.btn-buy-book:hover {
    background: var(--brand-gold);
}

/* Work Content */
.work-body {
    font-size: var(--reader-font-size, 1.07rem);
    line-height: 1.95;
    color: var(--ink-primary);
    overflow-wrap: anywhere;
    transition: font-size 0.15s ease;
}

.work-body.is-poem {
    max-width: 600px;
    margin: 0 auto;
}

.work-body p {
    margin-bottom: 1.35em;
}

.work-body a {
    color: var(--brand-gold);
    text-decoration: underline;
}

.work-tags {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.88rem;
    color: var(--ink-muted);
    font-style: italic;
}

/* Share Bar */
.share-bar {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-navy);
    letter-spacing: 0.4px;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-card);
    background: var(--bg-canvas);
    color: var(--brand-navy);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.share-btn:hover {
    background: var(--brand-navy);
    color: #FFFFFF;
    border-color: var(--brand-navy);
}

.share-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Author Box */
.author-box {
    margin-top: 26px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-gold-soft);
    flex-shrink: 0;
}

.author-avatar-fallback {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.author-box-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.author-box-name a:hover {
    color: var(--brand-gold);
}

.author-box-bio {
    font-size: 0.92rem;
    color: var(--ink-muted);
    line-height: 1.65;
}

.bio-read-more {
    color: var(--brand-gold);
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}

.bio-read-more:hover {
    color: var(--brand-navy);
    text-decoration: underline;
}

/* Related Works */
.related-section {
    margin-top: 34px;
}

.related-heading {
    font-size: 1.55rem;
    color: var(--brand-navy);
    margin-bottom: 16px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 16px 18px;
}

.related-card:hover {
    border-color: var(--brand-gold);
}

.related-card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand-navy);
    line-height: 1.25;
    margin-bottom: 6px;
    display: block;
}

.related-card-meta {
    font-size: 0.84rem;
    font-style: italic;
    color: var(--ink-muted);
}

/* Sidebar Widgets */
.editorial-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 86px;
}

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 20px 22px;
}

.widget-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-navy);
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--brand-navy);
    line-height: 1.35;
}

.widget-item-title:hover {
    color: var(--brand-gold);
}

.widget-item-meta {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--ink-muted);
}

.poet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.poet-count {
    font-size: 0.8rem;
    color: var(--brand-gold);
    font-style: italic;
}

/* Distraction-Free Reader Mode */
body.is-reader-mode .top-utility-bar,
body.is-reader-mode .header-bar,
body.is-reader-mode .editorial-sidebar,
body.is-reader-mode .author-box,
body.is-reader-mode .comments-section,
body.is-reader-mode .related-section,
body.is-reader-mode .footer-bar {
    display: none !important;
}

body.is-reader-mode .main-wrapper {
    max-width: 820px;
    padding-top: 24px;
    padding-bottom: 56px;
}

body.is-reader-mode .editorial-layout {
    grid-template-columns: 1fr;
}

body.is-reader-mode .reader-only-btn {
    display: inline-flex;
}

body.is-reader-mode .reader-toolbar {
    position: sticky;
    top: 12px;
    z-index: 40;
    box-shadow: 0 6px 20px rgba(16, 42, 56, 0.08);
}

.work-body.is-poem {
    white-space: normal;
    line-height: 1.65;
}

.work-body.is-poem p {
    margin: 0 0 0.45em;
}

.work-body.is-poem p:last-child {
    margin-bottom: 0;
}

.work-body.is-prose {
    overflow-wrap: break-word;
    word-break: break-word;
}
/* Responsive Breakpoints (kept at bottom so overrides apply properly) */
@media (max-width: 960px) {
    .editorial-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .editorial-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .work-paper {
        padding: 22px 16px;
    }
}

@media (max-width: 580px) {
    .author-box {
        flex-direction: column;
        text-align: center;
    }
}


.qc-modal[hidden] {
    display: none !important;
}

.qc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.qc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 24, 0.72);
    backdrop-filter: blur(3px);
}

.qc-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--bg-card, #ffffff);
    color: var(--ink-primary, #102a38);
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.3));
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.qc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
}

.qc-title {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink-primary, #102a38);
}

.qc-close-btn {
    background: transparent;
    border: none;
    color: var(--ink-muted, #64748b);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.qc-close-btn:hover {
    color: var(--brand-gold, #c5a059);
}

.qc-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    padding: 20px 22px 24px;
    align-items: start;
}

@media (max-width: 720px) {
    .qc-body {
        grid-template-columns: 1fr;
    }
}

.qc-canvas-wrap {
    background: var(--bg-canvas, #f4f1ea);
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qc-canvas {
    max-width: 100%;
    max-height: 410px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.qc-field {
    margin-bottom: 16px;
}

.qc-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink-primary, #102a38);
}

.qc-hint {
    font-weight: 400;
    color: var(--ink-muted, #64748b);
}

.qc-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.35));
    background: var(--bg-canvas, #faf7f0);
    color: var(--ink-primary, #102a38);
    font-family: 'Lora', Georgia, serif;
    font-size: 0.92rem;
    line-height: 1.55;
    resize: vertical;
}

.qc-textarea:focus {
    outline: none;
    border-color: var(--brand-gold, #c5a059);
}

.qc-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qc-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.35));
    background: var(--bg-canvas, transparent);
    color: var(--ink-primary, inherit);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.qc-chip:hover {
    border-color: var(--brand-gold, #c5a059);
}

.qc-chip.active {
    background: #102a38;
    color: #faf7f0;
    border-color: var(--brand-gold, #c5a059);
}

.qc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.qc-btn-primary {
    flex: 1;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--brand-gold, #c5a059);
    background: #102a38;
    color: #faf7f0;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
}

.qc-btn-primary:hover {
    background: #183b4e;
}

.qc-btn-secondary {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-card, rgba(148, 163, 184, 0.35));
    background: transparent;
    color: var(--ink-primary, inherit);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.qc-status {
    margin: 10px 0 0;
    font-size: 0.82rem;
    color: var(--brand-gold, #b8860b);
    min-height: 1.1em;
}