/* ===============================
   PREMIUM STORY READING LAYOUT
================================ */

body.cerita-show-page {
    background-color: #f8fafc;
    margin: 0;
    padding: 0;
}

/* 1. HEADER MERAH */
.story-header {
    background-color: #8b1a1a; /* Dark Red */
    padding: 1.5rem 1rem 3.5rem; /* Reduced top padding */
    text-align: center;
    position: relative;
    color: white;
}

.back-btn-float {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.back-btn-float:hover {
    color: white;
    opacity: 0.8;
}

.parwa-main-title {
    font-family: 'Oleo Script', cursive;
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: 1px;
    color: #8b1a1a; /* Red fill */
    text-shadow: 
        -2px -2px 0 #fff,  
         2px -2px 0 #fff,
        -2px  2px 0 #fff,
         2px  2px 0 #fff,
         0px  3px 10px rgba(0,0,0,0.2); /* White outline via shadows */
    text-transform: capitalize;
    display: inline-block;
}

.sub-parwa-subtitle {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

/* 2. CARD CONTENT */
.story-detail-container {
    margin-top: 2rem; /* Changed from -3rem to 2rem to remove overlap */
    padding-bottom: 5rem;
}

.story-content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    padding: 3rem 5rem;
    max-width: 960px;
    margin: 0 auto;
}

.story-title-heading {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: #1a1a1a;
    text-align: center; /* Centered the title */
}

/* 3. TYPOGRAPHY */
.story-text-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.story-text-body p {
    margin-bottom: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .related-story-card {
        flex: 0 0 300px;
    }
}

@media (max-width: 768px) {
    .parwa-main-title {
        font-size: 3.5rem;
    }
    .sub-parwa-subtitle {
        font-size: 1.5rem;
    }
    .story-header {
        padding: 2rem 1rem 3rem;
    }
    .story-content-card {
        padding: 2rem;
        margin-top: 1.5rem;
    }
    .back-btn-float {
        top: 1rem;
        left: 1rem;
    }
}

/* 4. RELATED STORIES SECTION */
.related-stories-section {
    background: #f0f2f5;
    padding: 3rem 0;
    border-top: 1px solid #e2e8f0;
}

.related-title {
    font-size: 1.4rem;
    color: #1a1a1a;
    letter-spacing: 0.3px;
}

/* Carousel wrapper with fade edges */
.related-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.related-carousel-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0.25rem 1.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex: 1;
}

.related-carousel-scroll::-webkit-scrollbar {
    display: none;
}

/* Individual related card */
.related-story-card {
    flex: 0 0 340px;
    min-width: 0;
}

.related-story-card .card {
    border-radius: 14px !important;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    background: #ffffff;
    border: 1px solid #e8eef4 !important;
}

.related-story-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1) !important;
}

.related-story-card .card-body {
    padding: 1.75rem !important;
}

.related-story-card h5 {
    font-size: 1.05rem;
    color: #1e293b;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.related-story-card .text-muted.small {
    font-size: 0.82rem;
    color: #64748b !important;
}

/* Carousel nav buttons */
.carousel-nav {
    background: #fff;
    border: 1.5px solid #dce3ea;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.carousel-nav:hover {
    background: #8b1a1a;
    color: #fff;
    border-color: #8b1a1a;
    box-shadow: 0 4px 14px rgba(139, 26, 26, 0.25);
}

/* Read more button */
.btn-premium-red {
    background-color: #8b1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-premium-red:hover {
    background-color: #6d1414;
    color: #fff;
    box-shadow: 0 4px 14px rgba(139, 26, 26, 0.3);
}

@media (max-width: 576px) {
    .related-story-card {
        flex: 0 0 260px;
    }

    .related-title {
        font-size: 1.2rem;
    }
}

/* ===============================
   PREMIUM PAGINATION & READING MODE
   =============================== */

/* Reading Mode Switcher */
.reading-mode-selector {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    width: fit-content;
    margin: 0 auto 2.5rem;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.premium-toggle {
    background: #e2e8f0;
    padding: 3px;
    border-radius: 30px;
    display: inline-flex;
    border: none;
}

.premium-toggle .btn-outline-premium {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.premium-toggle .btn-outline-premium.active {
    background: #8b1a1a;
    color: white;
    box-shadow: 0 4px 10px rgba(139, 26, 26, 0.2);
}

.premium-toggle .btn-outline-premium:hover:not(.active) {
    color: #8b1a1a;
    background: rgba(226, 232, 240, 0.5);
}

/* Pagination container */
#story-pagination {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* Premium Pagination Links */
.premium-pagination {
    display: flex;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    gap: 0.4rem;
}

.premium-pagination .page-item .page-link {
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-weight: 600;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    text-decoration: none;
    cursor: pointer;
}

.premium-pagination .page-item.active .page-link {
    background: #8b1a1a;
    border-color: #8b1a1a;
    color: white !important;
    box-shadow: 0 4px 10px rgba(139, 26, 26, 0.2);
}

.premium-pagination .page-item .page-link:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #8b1a1a;
}

.premium-pagination .page-item.disabled .page-link {
    opacity: 0.35;
    pointer-events: none;
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

/* Page Transitions */
.story-page {
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
}

.story-page.fade-out {
    opacity: 0;
    transform: translateY(12px);
}

/* Header Specific Navigation Overrides */
.story-header .reading-mode-selector {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 1rem auto 0;
}

.story-header .premium-toggle {
    background: rgba(255, 255, 255, 0.2);
}

.story-header .premium-toggle .btn-outline-premium {
    color: rgba(255, 255, 255, 0.85);
}

.story-header .premium-toggle .btn-outline-premium.active {
    background: white;
    color: #8b1a1a !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.story-header .premium-toggle .btn-outline-premium:hover:not(.active) {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Pagination in Header */
.story-header .premium-pagination .page-item .page-link {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.story-header .premium-pagination .page-item.active .page-link {
    background: white;
    border-color: white;
    color: #8b1a1a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.story-header .premium-pagination .page-item .page-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.story-header .premium-pagination .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.35);
}


