/* THE BUZZ - MEADOW THEME */
:root {
    --color-primary: #76C043;
    /* Grass Green */
    --color-secondary: #FFD93D;
    /* Sun Yellow */
    --color-accent: #FF6B6B;
    /* Ladybird Red */
    --color-sky: #87CEEB;
    --color-text: #2C3E50;
    --color-white: #FFFFFF;
    --color-bg: #F0F9FF;
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Quicksand', sans-serif;

    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 10px 20px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* NAVIGATION */
.back-to-books {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--color-white);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: bold;
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.back-to-books:hover {
    transform: translateX(-5px);
}

.ebook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* COVER */
.cover {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 60px;
    animation: fadeIn 1s ease-out;
}

/* COVER WRAPPER & OVERLAY */
.cover-wrapper {
    position: relative;
    width: 500px;
    max-width: 100%;
    margin: 0 auto 30px auto;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.cover-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
}

.cover-image {
    width: 100%;
    height: auto !important;
    /* Reset to auto so wrapper controls size if needed, but aspect-ratio handles it */
    aspect-ratio: 1 / 1 !important;
    object-fit: cover;
    display: block;
    border-radius: 20px;
    /* Box shadow and margin moved to wrapper */
    margin-bottom: 0;
    box-shadow: none;
    transform: none;
    /* Transform moved to wrapper */
}

/* Ensure hover effect on image doesn't conflict */
.cover-image:hover {
    transform: none;
}

.cover-title-overlay {
    position: absolute;
    top: 10%;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    color: #FFD700;
    /* Gold */
    text-shadow:
        3px 3px 0px #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    pointer-events: none;
    /* Let clicks pass through to image if needed */
    z-index: 10;
    padding: 0 20px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

/* Hiding original subtitles visually but keeping for semantics/structure if needed, 
   though HTML has visually-hidden class. keeping .subtitle styles just in case */
.subtitle {
    font-size: 1.5rem;
    color: var(--color-primary);
    font-weight: 600;
}

/* SPREADS */
.spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 120px;
    min-height: 80vh;
    opacity: 0;
    /* For scroll reveal */
    transform: translateY(30px);
}

.spread-left {
    order: 1;
}

.spread-right {
    order: 2;
}

.spread:nth-child(even) .spread-left {
    order: 2;
}

.spread:nth-child(even) .spread-right {
    order: 1;
}

.spread-image {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease;
}

.spread-image:hover {
    transform: scale(1.02);
}

.spread-text {
    padding: 40px;
    background: var(--color-white);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.spread-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
}

.spread-text p {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.spread-text p:last-child {
    margin-bottom: 0;
}

/* SOUND EFFECTS & EMPHASIS */
.sound-effect {
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
    font-weight: bold;
    transform: rotate(-2deg);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .spread {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: auto;
        margin-bottom: 80px;
    }

    .spread:nth-child(even) .spread-left {
        order: 1;
        /* Reset order for stacking */
    }

    .spread:nth-child(even) .spread-right {
        order: 2;
    }

    .cover h1 {
        font-size: 2.5rem;
    }

    .spread-text p {
        font-size: 1.1rem;
    }
}

/* ANIMATIONS */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}