/**
 * Short Story Single View Styles
 * Designed specifically for single short stories / one-shots
 * 
 * @package Nhalavn
 * @version 1.0.3
 */

/* ==========================================================================
   1. COLOR PALETTES & THEME VARIABLES
   ========================================================================== */
:root {
    --st-primary: #059669;
    --st-primary-rgb: 5, 150, 105;
    --st-primary-hover: #047857;
    --st-accent: #d97706;
    
    /* Light Theme (Default) */
    --st-bg: #f8fafc;
    --st-paper-bg: #ffffff;
    --st-paper-border: rgba(0, 0, 0, 0.06);
    --st-paper-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.025);
    --st-text: #1e293b;
    --st-text-muted: #64748b;
    --st-text-subtle: #94a3b8;
    --st-card-bg: rgba(255, 255, 255, 0.95);
    --st-toolbar-bg: rgba(255, 255, 255, 0.94);
    --st-toolbar-border: rgba(0, 0, 0, 0.08);
    --st-dropcap-color: var(--st-primary);
    --st-quote-bg: rgba(5, 150, 105, 0.04);
    --st-quote-border: var(--st-primary);
}

/* Sepia Theme (Vintage Literary Paper) */
body.st-theme-sepia,
.st-theme-sepia {
    --st-bg: #f5eedc;
    --st-paper-bg: #faf4e6;
    --st-paper-border: rgba(146, 116, 74, 0.15);
    --st-paper-shadow: 0 10px 30px -5px rgba(100, 75, 40, 0.07);
    --st-text: #3c2f1f;
    --st-text-muted: #78644e;
    --st-text-subtle: #9f8a74;
    --st-card-bg: rgba(250, 244, 230, 0.95);
    --st-toolbar-bg: rgba(245, 238, 220, 0.96);
    --st-toolbar-border: rgba(146, 116, 74, 0.16);
    --st-dropcap-color: #8c5d2c;
    --st-quote-bg: rgba(140, 93, 44, 0.05);
    --st-quote-border: #8c5d2c;
}

/* Dark Theme (Night Reading) */
body.st-theme-dark,
body.dark-mode .st-short-story-wrapper,
.st-theme-dark {
    --st-bg: #0b1120;
    --st-paper-bg: #151e32;
    --st-paper-border: rgba(255, 255, 255, 0.07);
    --st-paper-shadow: 0 14px 34px -5px rgba(0, 0, 0, 0.45);
    --st-text: #e2e8f0;
    --st-text-muted: #94a3b8;
    --st-text-subtle: #64748b;
    --st-card-bg: rgba(21, 30, 50, 0.95);
    --st-toolbar-bg: rgba(15, 23, 42, 0.95);
    --st-toolbar-border: rgba(255, 255, 255, 0.08);
    --st-dropcap-color: #34d399;
    --st-quote-bg: rgba(52, 211, 153, 0.06);
    --st-quote-border: #10b981;
}

/* Midnight Theme (Deep OLED Black) */
body.st-theme-midnight,
.st-theme-midnight {
    --st-bg: #000000;
    --st-paper-bg: #090d16;
    --st-paper-border: rgba(255, 255, 255, 0.05);
    --st-paper-shadow: 0 16px 40px -5px rgba(0, 0, 0, 0.7);
    --st-text: #cbd5e1;
    --st-text-muted: #8392a7;
    --st-text-subtle: #526075;
    --st-card-bg: rgba(9, 13, 22, 0.96);
    --st-toolbar-bg: rgba(0, 0, 0, 0.96);
    --st-toolbar-border: rgba(255, 255, 255, 0.07);
    --st-dropcap-color: #10b981;
    --st-quote-bg: rgba(16, 185, 129, 0.05);
    --st-quote-border: #059669;
}

/* Overall Wrapper */
.st-short-story-wrapper {
    background-color: var(--st-bg);
    color: var(--st-text);
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================================================
   1b. LITERARY BREADCRUMBS
   ========================================================================== */
.st-breadcrumb-wrap {
    margin-bottom: 1.5rem;
}
.st-breadcrumb {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 7px 18px;
    background: var(--st-card-bg);
    border: 1px solid var(--st-paper-border);
    border-radius: 999px;
    font-size: 13px;
    list-style: none !important;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.025);
}
.st-breadcrumb-item,
.st-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--st-text-muted);
    list-style: none !important;
    margin: 0;
    padding: 0;
}
.st-breadcrumb-item::before,
.st-breadcrumb li::before {
    display: none !important;
    content: none !important;
}
.st-breadcrumb-item a {
    color: var(--st-text);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}
.st-breadcrumb-item a:hover {
    color: var(--st-primary);
}
.st-breadcrumb-separator {
    color: var(--st-text-subtle);
    font-size: 10px;
    user-select: none;
    display: inline-flex;
    align-items: center;
    margin: 0 2px;
    opacity: 0.6;
}
.st-breadcrumb-current {
    color: var(--st-primary);
    font-weight: 700;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   2. READING PROGRESS BAR
   ========================================================================== */
.st-progress-bar-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3.5px;
    background: transparent;
    z-index: 1080;
    pointer-events: none;
}
.st-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #d97706 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: width 0.1s linear;
}

/* ==========================================================================
   3. STICKY TOP READER BAR (Appears on scroll)
   ========================================================================== */
.st-sticky-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: var(--st-toolbar-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--st-toolbar-border);
    padding: 8px 16px;
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.st-sticky-bar.is-visible {
    transform: translateY(0);
}
body.admin-bar .st-sticky-bar.is-visible {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar .st-sticky-bar.is-visible {
        top: 46px;
    }
}
.st-bar-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.st-bar-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.st-bar-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(var(--st-primary-rgb), 0.12);
    color: var(--st-primary);
    white-space: nowrap;
}
.st-bar-story-title {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--st-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-bar-percent {
    font-size: 12px;
    color: var(--st-text-muted);
    font-weight: 600;
    white-space: nowrap;
}
.st-bar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.st-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--st-toolbar-border);
    background: rgba(0, 0, 0, 0.03);
    color: var(--st-text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0;
}
.st-tool-btn:hover {
    background: rgba(var(--st-primary-rgb), 0.12);
    color: var(--st-primary);
    border-color: rgba(var(--st-primary-rgb), 0.3);
    transform: translateY(-1px);
}
.st-tool-btn.active {
    background: var(--st-primary);
    color: #ffffff;
    border-color: var(--st-primary);
}

/* ==========================================================================
   4. HERO STORY HEADER CARD
   ========================================================================== */
.st-hero-card {
    background: var(--st-card-bg);
    border: 1px solid var(--st-paper-border);
    border-radius: 24px;
    box-shadow: var(--st-paper-shadow);
    padding: 32px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.st-hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(48px) saturate(160%);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    transform: scale(1.1);
}
.st-hero-content {
    position: relative;
    z-index: 1;
}

/* 3D Book Cover */
.st-book-wrap {
    perspective: 1000px;
    display: inline-block;
}
.st-book-3d {
    width: 200px;
    height: 290px;
    position: relative;
    border-radius: 12px;
    box-shadow: 
        0 14px 30px -5px rgba(0, 0, 0, 0.28),
        0 2px 6px rgba(0, 0, 0, 0.12),
        -6px 0 12px -3px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    transform-style: preserve-3d;
}
.st-book-3d:hover {
    transform: translateY(-6px) rotateY(-5deg);
    box-shadow: 
        0 24px 40px -8px rgba(0, 0, 0, 0.35),
        -8px 0 16px -3px rgba(0, 0, 0, 0.3);
}
.st-book-spine {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(0,0,0,0.45) 0%, rgba(255,255,255,0.18) 45%, rgba(0,0,0,0.15) 100%);
    z-index: 3;
    pointer-events: none;
}
.st-book-sheen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 60%);
    z-index: 2;
    pointer-events: none;
}
.st-book-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hero Typography & Badges */
.st-hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--st-text);
    margin-bottom: 12px;
}
@media (max-width: 768px) {
    .st-hero-title {
        font-size: 1.65rem;
    }
}
.st-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.st-pill-oneshot {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}
.st-pill-completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}
.st-pill-genre {
    background: rgba(0, 0, 0, 0.05);
    color: var(--st-text-muted);
    border: 1px solid var(--st-paper-border);
}
.st-pill-genre:hover {
    background: rgba(var(--st-primary-rgb), 0.1);
    color: var(--st-primary);
    border-color: rgba(var(--st-primary-rgb), 0.25);
}

/* Metric Chips */
.st-metric-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 20px;
}
.st-metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.035);
    border: 1px solid var(--st-paper-border);
    font-size: 12.5px;
    color: var(--st-text);
    transition: all 0.2s ease;
}
.st-metric-chip i {
    font-size: 14px;
}
.st-metric-chip strong {
    font-weight: 700;
}
.st-metric-chip small {
    color: var(--st-text-muted);
}

/* Excerpt / Epigraph */
.st-hero-excerpt {
    font-style: italic;
    color: var(--st-text-muted);
    font-size: 14px;
    line-height: 1.6;
    padding: 12px 18px;
    border-left: 3px solid var(--st-quote-border);
    background: var(--st-quote-bg);
    border-radius: 0 10px 10px 0;
    margin-bottom: 22px;
}

/* Hero CTA Buttons */
.st-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.st-btn-start-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 14.5px;
    border: none;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    cursor: pointer;
}
.st-btn-start-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.45);
    color: #ffffff;
}
.st-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--st-paper-border);
    color: var(--st-text);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.st-btn-action:hover {
    background: rgba(var(--st-primary-rgb), 0.08);
    color: var(--st-primary);
    border-color: rgba(var(--st-primary-rgb), 0.25);
    transform: translateY(-1.5px);
}
.st-btn-action.active,
.st-btn-action.td-is-following {
    background: var(--st-primary);
    color: #ffffff !important;
    border-color: var(--st-primary);
}

/* ==========================================================================
   5. LITERARY READING PAPER & TYPOGRAPHY
   ========================================================================== */
.st-reading-area {
    margin: 40px auto;
    transition: max-width 0.3s ease;
}
.st-reading-paper {
    background: var(--st-paper-bg);
    border: 1px solid var(--st-paper-border);
    border-radius: 20px;
    box-shadow: var(--st-paper-shadow);
    padding: 48px 56px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
@media (max-width: 768px) {
    .st-reading-paper {
        padding: 24px 20px;
        border-radius: 14px;
    }
    .st-reading-area {
        margin: 20px auto;
    }
}

/* Story Header Inside Paper */
.st-paper-header {
    text-align: center;
    padding-bottom: 28px;
    margin-bottom: 36px;
    border-bottom: 1px dashed var(--st-paper-border);
}
.st-paper-header .st-paper-ornament {
    font-size: 16px;
    color: var(--st-primary);
    letter-spacing: 6px;
    margin-bottom: 8px;
    opacity: 0.85;
}
.st-paper-title {
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.3;
    color: var(--st-text);
    margin-bottom: 10px;
}
.st-paper-meta {
    font-size: 13.5px;
    color: var(--st-text-muted);
}

/* Content Body */
.st-story-content {
    color: var(--st-text);
    font-size: 18px;
    line-height: 1.85;
    text-align: justify;
    word-break: break-word;
    font-family: 'Merriweather', Georgia, serif;
    transition: font-size 0.2s ease, line-height 0.2s ease, font-family 0.2s ease;
}
.st-story-content p {
    margin-bottom: 1.8em;
    text-indent: 1.8em;
}
.st-story-content p:first-of-type {
    text-indent: 0;
}

/* Horizontal Divider (<hr>) and Translator Box in Short Story Content */
.st-story-content hr {
    position: relative;
    border: 0;
    height: 1px;
    background: var(--st-paper-border, rgba(0, 0, 0, 0.12));
    margin: 2.5rem auto;
    width: 85%;
    max-width: 540px;
    overflow: visible;
}
.st-story-content hr::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--st-text-muted, #94a3b8);
    border-radius: 50%;
}
.st-story-content .td-translator-box {
    position: relative;
    margin: 2.25rem 0 1.5rem;
    padding: 1.25rem 1.65rem;
    background: rgba(99, 102, 241, 0.05);
    border-left: 4px solid #6366f1;
    border-top: 1px solid rgba(99, 102, 241, 0.18);
    border-right: 1px solid rgba(99, 102, 241, 0.18);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(99, 102, 241, 0.05);
    color: var(--st-text);
    font-style: normal;
    text-align: left;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.st-story-content .td-translator-box::after {
    content: "✍️";
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.15rem;
    opacity: 0.35;
    pointer-events: none;
}
.st-story-content .td-translator-box p {
    margin-bottom: 0.75rem !important;
    text-indent: 0 !important;
    line-height: 1.75;
}
.st-story-content .td-translator-box p:first-child {
    font-weight: 700;
    color: #4f46e5;
}
.st-story-content .td-translator-box p:last-child {
    margin-bottom: 0 !important;
}

/* Drop Cap (Artistic First Letter) */
.st-has-dropcap .st-story-content > p:first-of-type::first-letter,
.st-has-dropcap .st-story-content > div:first-of-type > p:first-of-type::first-letter {
    font-size: 3.6em;
    float: left;
    line-height: 0.8;
    margin-right: 12px;
    margin-top: 4px;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: bold;
    color: var(--st-dropcap-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Font Families */
.st-font-serif .st-story-content {
    font-family: 'Merriweather', 'Lora', Georgia, 'Times New Roman', serif;
}
.st-font-sans .st-story-content {
    font-family: 'Manrope', 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: left;
}

/* Story End / Outro */
.st-story-end-marker {
    text-align: center;
    padding: 36px 0 20px;
    margin-top: 40px;
    border-top: 1px dashed var(--st-paper-border);
}
.st-end-ornament {
    font-size: 16px;
    letter-spacing: 8px;
    color: var(--st-primary);
    margin-bottom: 8px;
}
.st-end-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--st-text-muted);
}

/* ==========================================================================
   6. AUTHOR SIGNATURE & REACTION BAR
   ========================================================================== */
.st-author-signature-box {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--st-paper-border);
    border-radius: 16px;
    padding: 20px;
    margin: 32px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.st-author-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.st-author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--st-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.st-author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--st-text);
    margin-bottom: 2px;
}
.st-author-note {
    font-size: 12.5px;
    color: var(--st-text-muted);
}

/* Post-reading Reaction Bar */
.st-reaction-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 0 10px;
}
.st-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid var(--st-paper-border);
    background: var(--st-paper-bg);
    color: var(--st-text);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}
.st-react-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.st-btn-like {
    color: #e11d48;
}
.st-btn-like:hover,
.st-btn-like.is-liked {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
}
.st-btn-nominate {
    color: #d97706;
}
.st-btn-nominate:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}
.st-btn-bookmark {
    color: var(--st-primary);
}
.st-btn-bookmark:hover,
.st-btn-bookmark.td-is-following {
    background: var(--st-primary);
    color: #ffffff;
    border-color: var(--st-primary);
}

/* Heartbeat animation when liked */
@keyframes stHeartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}
.st-btn-like.is-liked i {
    animation: stHeartBeat 0.8s ease-in-out;
}

/* ==========================================================================
   7. ZEN / FOCUS MODE
   ========================================================================== */
body.st-zen-active header#masthead,
body.st-zen-active footer.site-footer,
body.st-zen-active .st-hero-card,
body.st-zen-active .ct-pastoral-breadcrumb,
body.st-zen-active #td-reviews-section,
body.st-zen-active #comments-section,
body.st-zen-active .st-related-stories,
body.st-zen-active .st-author-signature-box,
body.st-zen-active .st-reaction-bar {
    display: none !important;
}
body.st-zen-active .st-reading-area {
    margin: 20px auto;
}
body.st-zen-active .st-reading-paper {
    box-shadow: none;
    border: none;
    background: transparent;
}
.st-exit-zen-btn {
    display: none;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1090;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}
.st-exit-zen-btn:hover {
    background: var(--st-primary);
    border-color: var(--st-primary);
    transform: translateY(-1px);
}
body.st-zen-active .st-exit-zen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   8. SETTINGS MODAL STYLING
   ========================================================================== */
.st-theme-palette-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.st-theme-opt {
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.st-theme-opt:hover {
    transform: translateY(-2px);
}
.st-theme-opt.active {
    border-color: var(--st-primary);
    box-shadow: 0 0 0 3px rgba(var(--st-primary-rgb), 0.25);
}
.st-opt-light {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
}
.st-opt-sepia {
    background: #faf4e6;
    color: #3c2f1f;
    border-color: #eeddbb;
}
.st-opt-dark {
    background: #151e32;
    color: #e2e8f0;
    border-color: #2a3754;
}
.st-opt-midnight {
    background: #000000;
    color: #cbd5e1;
    border-color: #222;
}

/* ==========================================================================
   9. RELATED SHORT STORIES CARDS
   ========================================================================== */
.st-related-card {
    background: var(--st-paper-bg);
    border: 1px solid var(--st-paper-border);
    border-radius: 14px;
    padding: 12px;
    height: 100%;
    display: flex;
    gap: 12px;
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--st-text);
}
.st-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(var(--st-primary-rgb), 0.3);
    color: var(--st-text);
}
.st-related-thumb {
    width: 60px;
    height: 84px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.st-related-title {
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.st-related-meta {
    font-size: 11.5px;
    color: var(--st-text-muted);
}

/* ==========================================================================
   11. HTML5 CANVAS READER COMPATIBILITY
   ========================================================================== */
.st-reading-paper.reader-board {
    background-color: var(--st-paper-bg) !important;
    color: var(--st-text) !important;
    border: 1px solid var(--st-paper-border) !important;
    box-shadow: var(--st-paper-shadow) !important;
}

.st-reading-paper .td-canvas-reader-root {
    margin: 16px 0 24px 0 !important;
    width: 100% !important;
    position: relative !important;
}

.st-reading-paper .td-canvas-viewport {
    width: 100% !important;
    position: relative !important;
}

.st-reading-paper .td-canvas-slice {
    display: block !important;
    width: 100% !important;
    background-color: transparent !important;
}

.st-reading-paper .td-raw-content-hidden {
    display: none !important;
}

