/* Book Cover Styles - Realistic Book */
.book-cover {
    position: relative;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 auto 4rem !important;
    max-width: 25rem;
}

/* The actual book cover face */
.book-cover-inner {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--bulma-scheme-main-bis) 0%, #2f499e 50%, #1e40af 100%);
    padding: 4rem 3rem;
    border-radius: 4px;
    box-shadow:
        0 0 0 3px var(--bulma-scheme-main-ter),
        0 0 0 6px var(--bulma-scheme-main-bis),
        inset 0 0 60px rgba(0,0,0,0.3),
        0 30px 80px rgba(0,0,0,0.4),
        0 15px 40px rgba(0,0,0,0.3);
}

/* Book spine on the left */
.book-cover-inner::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right,
        #0a1530 0%,
        #0f1f47 25%,
        var(--bulma-scheme-main-bis) 60%,
        #2f499e 90%,
        #3d5aa8 100%);
    border-radius: 4px 0 0 4px;
    box-shadow:
        inset -8px 0 20px rgba(0,0,0,0.6),
        inset 0 0 3px rgba(0,0,0,0.4),
        -4px 0 12px rgba(0,0,0,0.4);
    z-index: -1;
}

/* Page edges visible from the right */
.book-cover-inner::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    bottom: 0;
    width: 8px;
    background: repeating-linear-gradient(
        0deg,
        #f8f9fa 0px,
        #e9ecef 1px,
        #f8f9fa 2px
    );
    border-radius: 0 2px 2px 0;
    box-shadow:
        inset -2px 0 5px rgba(0,0,0,0.2),
        2px 0 8px rgba(0,0,0,0.2);
    z-index: -1;
}

/* Leather texture overlay */
.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    opacity: 0.4;
    pointer-events: none;
    border-radius: 4px;
    z-index: 1;
}

/* Subtle shimmer effect on book cover */
.book-cover .shimmer-layer {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 6s infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, -5%); }
}

/* Embossed title effect */
.book-cover-inner .title {
    text-shadow:
        2px 2px 4px rgba(0,0,0,0.8),
        -1px -1px 0px rgba(255,255,255,0.1),
        0 0 30px rgba(102,126,234,0.4) !important;
    letter-spacing: 1px;
}

/* Ornate decorations */
.book-cover-inner .ornament {
    font-size: 2rem;
    color: rgba(255,255,255,0.7);
    text-shadow:
        0 0 10px rgba(102,126,234,0.6),
        0 2px 4px rgba(0,0,0,0.6),
        0 0 20px rgba(255,255,255,0.2);
}

/* Chapter Section Styles - Elegant Paper */
.chapter-section {
    background: linear-gradient(to bottom, var(--bulma-scheme-main) 0%, var(--bulma-scheme-main-bis) 100%) !important;
    border: 2px solid var(--bulma-scheme-main-ter) !important;
    padding: 2rem !important;
    margin-bottom: 2rem !important;
    box-shadow:
        inset 0 0 60px rgba(102,126,234,0.05),
        0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

/* Ornamental top border */
.chapter-section::before {
    content: '◆ ◆ ◆';
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bulma-scheme-main-ter);
    font-size: 0.7rem;
    letter-spacing: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.chapter-title {
    color: #363636 !important;
    text-shadow: 0 1px 2px rgba(102,126,234,0.2);
    font-family: Georgia, 'Times New Roman', serif;
    border-bottom: 3px solid var(--bulma-scheme-main-ter);
    padding-bottom: 0.75rem;
    margin-top: 1rem !important;
    font-weight: 700 !important;
    font-size: 2rem !important;
}

.chapter-link {
    color: #363636 !important;
    text-decoration: none !important;
    position: relative;
}
.chapter-link::after {
    content: '✦';
    margin-left: 0.5rem;
    color: var(--bulma-scheme-main-ter);
    font-size: 0.8em;
}

/* Story Card Styles - Elegant Book Pages */
.story-card {
    height: 100%;
    border: 2px solid var(--bulma-scheme-main-ter) !important;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow:
        0 2px 8px rgba(102,126,234,0.15),
        inset 0 0 30px rgba(248,249,250,0.5);
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%) !important;
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    position: relative;
}

/* Decorative corner embellishments */
.story-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 15px;
    height: 15px;
    border-top: 1px solid var(--bulma-scheme-main-bis);
    border-left: 1px solid var(--bulma-scheme-main-bis);
    opacity: 0.4;
}
.story-card::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 15px;
    height: 15px;
    border-bottom: 1px solid var(--bulma-scheme-main-bis);
    border-right: 1px solid var(--bulma-scheme-main-bis);
    opacity: 0.4;
}

.story-card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem !important;
}
.story-card-link {
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.story-title {
    color: #363636 !important;
    font-weight: 600;
    line-height: 1.4;
    font-family: Georgia, 'Times New Roman', serif;
    text-shadow: 0 1px 1px rgba(102,126,234,0.1);
}
.story-snippet {
    color: #666 !important;
    flex: 1;
    line-height: 1.7;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
}

.reading-time {
    font-style: italic;
    opacity: 0.8;
}

.story-read-more {
    margin-top: 1rem;
}

.read-arrow {
    color: var(--bulma-scheme-main-ter) !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.story-card:hover,
.story-card:active,
.story-card:focus-within {
    transform: translateY(-4px);
    box-shadow:
        0 8px 25px rgba(102,126,234,0.25),
        0 0 20px rgba(102,126,234,0.2),
        inset 0 0 40px rgba(248,249,250,0.8);
    border-color: #5a67d8 !important;
}
.story-card:hover::before,
.story-card:hover::after {
    opacity: 1;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    .book-cover {
        max-width: 90%;
        overflow: hidden;
    }
    .book-cover-inner {
        padding: 2.5rem 1.5rem !important;
    }
    /* Hide spine and page edges on mobile */
    .book-cover-inner::before,
    .book-cover-inner::after {
        display: none;
    }
    .book-cover .subtitle.is-6 {
        font-size: 0.7rem !important;
        letter-spacing: 2px !important;
    }
    .book-cover .title.is-1 {
        font-size: 2rem !important;
        margin-bottom: 0.75rem !important;
    }
    .book-cover .subtitle.is-5 {
        font-size: 1rem !important;
    }
    .book-cover-inner .ornament {
        font-size: 1.8rem;
    }
    .chapter-section {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    .chapter-section .title.is-3 {
        font-size: 1.5rem !important;
    }
    .chapter-section .card {
        margin-bottom: 1rem;
    }
    .chapter-section .card .title.is-5 {
        font-size: 1.15rem !important;
    }
}

/* Extra Small Mobile */
@media screen and (max-width: 480px) {
    .book-cover {
        max-width: 95%;
    }
    .book-cover-inner {
        padding: 2rem 1rem !important;
    }
    .book-cover .title.is-1 {
        font-size: 1.75rem !important;
    }
    .book-cover-inner .ornament {
        font-size: 1.5rem;
    }
    .chapter-section {
        padding: 1rem 0.75rem !important;
        border-left-width: 3px !important;
    }
}

/* Dark Mode - Enhanced Book */
[data-theme="dark"] .book-cover-inner {
    background: linear-gradient(135deg, #0f1f47 0%, var(--bulma-scheme-main-bis) 50%, #2f499e 100%);
    box-shadow:
        0 0 0 3px var(--bulma-scheme-main-ter),
        0 0 0 6px var(--bulma-scheme-main-bis),
        inset 0 0 60px rgba(0,0,0,0.5),
        0 30px 80px rgba(0,0,0,0.6),
        0 15px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .book-cover-inner::before {
    background: linear-gradient(to right,
        #050a1a 0%,
        #0a1530 25%,
        #0f1f47 60%,
        var(--bulma-scheme-main-bis) 90%,
        #2f499e 100%);
}

[data-theme="dark"] .book-cover::after {
    background: repeating-linear-gradient(
        0deg,
        #d4d6d9 0px,
        #c1c3c6 1px,
        #d4d6d9 2px
    );
}

[data-theme="dark"] .book-cover-inner .ornament {
    color: rgba(255,255,255,0.95);
    text-shadow:
        0 0 20px rgba(102,126,234,1),
        0 3px 6px rgba(0,0,0,1),
        0 0 40px rgba(255,255,255,0.5);
}

[data-theme="dark"] .chapter-section {
    background: linear-gradient(to bottom, var(--bulma-scheme-main) 0%, var(--bulma-scheme-main-bis) 100%) !important;
    border-color: var(--bulma-scheme-main-ter) !important;
    box-shadow:
        inset 0 0 60px rgba(102,126,234,0.1),
        0 4px 15px rgba(0,0,0,0.5);
}

[data-theme="dark"] .chapter-section::before {
    color: var(--bulma-scheme-main-ter);
    text-shadow: 0 0 8px rgba(102,126,234,0.6);
}

[data-theme="dark"] .chapter-title {
    color: #e2e8f0 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 0 10px rgba(102,126,234,0.3);
    border-bottom-color: var(--bulma-scheme-main-ter);
}

[data-theme="dark"] .chapter-link {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .chapter-link::after {
    color: #8b9fe8;
    text-shadow: 0 0 8px rgba(139,159,232,0.6);
}

[data-theme="dark"] .story-card {
    background: linear-gradient(to bottom, #2d3748 0%, #1a202c 100%) !important;
    border-color: #4a5568 !important;
    box-shadow:
        0 2px 8px rgba(0,0,0,0.4),
        inset 0 0 30px rgba(102,126,234,0.05);
}

[data-theme="dark"] .story-card::before,
[data-theme="dark"] .story-card::after {
    border-color: var(--bulma-scheme-main-ter);
    opacity: 0.4;
}

[data-theme="dark"] .story-card:hover,
[data-theme="dark"] .story-card:active,
[data-theme="dark"] .story-card:focus-within {
    border-color: var(--bulma-scheme-main-ter) !important;
    background: linear-gradient(to bottom, #374151 0%, #2d3748 100%) !important;
    box-shadow:
        0 8px 25px rgba(0,0,0,0.6),
        0 0 20px rgba(102,126,234,0.3),
        inset 0 0 40px rgba(102,126,234,0.1);
}

[data-theme="dark"] .story-card:hover::before,
[data-theme="dark"] .story-card:hover::after {
    opacity: 0.8;
}

[data-theme="dark"] .story-title {
    color: #e2e8f0 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 0 8px rgba(102,126,234,0.2);
}

[data-theme="dark"] .story-snippet {
    color: #cbd5e0 !important;
}

[data-theme="dark"] .read-arrow {
    color: #8b9fe8 !important;
    text-shadow: 0 0 8px rgba(139,159,232,0.5);
}
