/* ==========================================
   Honey Tales Africa - Book Pages Stylesheet
   ========================================== */

/* --- Book Hero --- */
.book-hero {
    position: relative;
    background: linear-gradient(160deg, #3A6B50 0%, #2B503F 60%, #223F32 100%);
    padding: 100px 20px 60px;
    overflow: hidden;
}

.book-hero-inner {
    display: flex;
    align-items: center;
    gap: 60px;
    min-height: 70vh;
}

.book-hero-cover {
    flex: 0 0 320px;
    animation: float1 4s ease-in-out infinite;
}

.book-cover-video {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: block;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.book-hero-info {
    flex: 1;
}

.book-number {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    font-family: 'Bubblegum Sans', cursive;
    font-size: 0.95rem;
    padding: 5px 18px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.book-hero-info h1 {
    font-size: 3rem;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 6px;
    line-height: 1.1;
}

.book-hero-subtitle {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 1.4rem;
    color: var(--honey);
    margin-bottom: 16px;
}

.book-hero-author {
    font-size: 1.1rem;
    color: var(--brown);
    font-style: italic;
    font-weight: 600;
    margin-bottom: 20px;
}

.book-description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.8;
    margin-bottom: 28px;
    max-width: 520px;
}

.book-details-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.book-detail {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--white);
    font-family: 'Bubblegum Sans', cursive;
    font-size: 0.9rem;
    padding: 5px 16px;
    border-radius: 50px;
}

.book-hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 3;
}

.book-hero-wave svg {
    display: block;
    width: 100%;
    height: 80px;
}

/* --- Sample Pages --- */
.sample-section {
    background: var(--cream);
    padding: 80px 0;
}

.sample-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 4px 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--honey) transparent;
    justify-content: center;
}

.sample-strip::-webkit-scrollbar {
    height: 6px;
}

.sample-strip::-webkit-scrollbar-track {
    background: transparent;
}

.sample-strip::-webkit-scrollbar-thumb {
    background: var(--honey);
    border-radius: 3px;
}

.sample-thumb {
    flex: 0 0 220px;
    height: 290px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    scroll-snap-align: start;
    transition: transform var(--transition), box-shadow var(--transition);
}

.sample-thumb:hover {
    transform: scale(1.04) translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.sample-coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.sample-coming-soon p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.sample-coming-soon .btn {
    margin-top: 8px;
}

/* --- Page Lightbox --- */
.page-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-height: 88vh;
    max-width: 88vw;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    line-height: 1;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    line-height: 1;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

/* --- Fun Facts --- */
.book-facts-section {
    padding: 80px 0;
    position: relative;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.fact-card {
    border-radius: var(--radius);
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border-top: 4px solid transparent;
    transition: box-shadow var(--transition);
    position: relative;
}

.book-facts-section {
    background: var(--cream);
}

.fact-card {
    background: #fff;
    border-top-color: var(--honey);
}

.fact-card {
    transform-origin: center bottom;
    will-change: transform;
}

.fact-card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fact-card-icon img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
}

/* ---- Fact card active/leaving states (keyframes live in styles.css) ---- */

/* Card active states */
.fact-card[data-anim="0"].fact-card--active {
    animation: fc-bulge 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="1"].fact-card--active {
    animation: fc-tilt 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="2"].fact-card--active {
    animation: fc-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="3"].fact-card--active {
    animation: fc-lift 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="4"].fact-card--active {
    animation: fc-swell 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="5"].fact-card--active {
    animation: fc-lean 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="6"].fact-card--active {
    animation: fc-spring 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="7"].fact-card--active {
    animation: fc-rock 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="8"].fact-card--active {
    animation: fc-jolt 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="9"].fact-card--active {
    animation: fc-settle 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="10"].fact-card--active {
    animation: fc-slide 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}
.fact-card[data-anim="11"].fact-card--active {
    animation: fc-lurch 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.16); z-index: 2;
}

/* Card leaving states */
.fact-card[data-anim="0"].fact-card--leaving  { animation: fc-bulge-out  0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="1"].fact-card--leaving  { animation: fc-tilt-out   0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="2"].fact-card--leaving  { animation: fc-pop-out    0.6s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="3"].fact-card--leaving  { animation: fc-lift-out   0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="4"].fact-card--leaving  { animation: fc-swell-out  0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="5"].fact-card--leaving  { animation: fc-lean-out   0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="6"].fact-card--leaving  { animation: fc-spring-out 0.6s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="7"].fact-card--leaving  { animation: fc-rock-out   0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="8"].fact-card--leaving  { animation: fc-jolt-out   0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="9"].fact-card--leaving  { animation: fc-settle-out 0.6s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="10"].fact-card--leaving { animation: fc-slide-out  0.5s  cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.fact-card[data-anim="11"].fact-card--leaving { animation: fc-lurch-out  0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* Icon active states */
.fact-card[data-anim="0"].fact-card--active .fact-card-icon img  { animation: fi-magnify 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.06s forwards; }
.fact-card[data-anim="1"].fact-card--active .fact-card-icon img  { animation: fi-spin    0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s forwards; }
.fact-card[data-anim="2"].fact-card--active .fact-card-icon img  { animation: fi-bounce  0.6s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }
.fact-card[data-anim="3"].fact-card--active .fact-card-icon img  { animation: fi-buzz    0.7s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }
.fact-card[data-anim="4"].fact-card--active .fact-card-icon img  { animation: fi-flutter 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s forwards; }
.fact-card[data-anim="5"].fact-card--active .fact-card-icon img  { animation: fi-zigzag  0.7s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }
.fact-card[data-anim="6"].fact-card--active .fact-card-icon img  { animation: fi-leap    0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.03s forwards; }
.fact-card[data-anim="7"].fact-card--active .fact-card-icon img  { animation: fi-swing   0.7s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }
.fact-card[data-anim="8"].fact-card--active .fact-card-icon img  { animation: fi-charge  0.6s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s forwards; }
.fact-card[data-anim="9"].fact-card--active .fact-card-icon img  { animation: fi-rock    0.7s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }
.fact-card[data-anim="10"].fact-card--active .fact-card-icon img { animation: fi-dash    0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.03s forwards; }
.fact-card[data-anim="11"].fact-card--active .fact-card-icon img { animation: fi-snap    0.6s  cubic-bezier(0.34, 1.56, 0.64, 1) 0.04s forwards; }

/* Icon exit states */
.fact-card[data-anim="0"].fact-card--leaving .fact-card-icon img  { animation: fi-magnify-out 0.45s ease-out forwards; }
.fact-card[data-anim="1"].fact-card--leaving .fact-card-icon img  { animation: fi-spin-out    0.45s ease-out forwards; }
.fact-card[data-anim="2"].fact-card--leaving .fact-card-icon img  { animation: fi-bounce-out  0.45s ease-out forwards; }
.fact-card[data-anim="3"].fact-card--leaving .fact-card-icon img  { animation: fi-buzz-out    0.45s ease-out forwards; }
.fact-card[data-anim="4"].fact-card--leaving .fact-card-icon img  { animation: fi-flutter-out 0.45s ease-out forwards; }
.fact-card[data-anim="5"].fact-card--leaving .fact-card-icon img  { animation: fi-zigzag-out  0.45s ease-out forwards; }
.fact-card[data-anim="6"].fact-card--leaving .fact-card-icon img  { animation: fi-leap-out    0.45s ease-out forwards; }
.fact-card[data-anim="7"].fact-card--leaving .fact-card-icon img  { animation: fi-swing-out   0.45s ease-out forwards; }
.fact-card[data-anim="8"].fact-card--leaving .fact-card-icon img  { animation: fi-charge-out  0.45s ease-out forwards; }
.fact-card[data-anim="9"].fact-card--leaving .fact-card-icon img  { animation: fi-rock-out    0.45s ease-out forwards; }
.fact-card[data-anim="10"].fact-card--leaving .fact-card-icon img { animation: fi-dash-out    0.45s ease-out forwards; }
.fact-card[data-anim="11"].fact-card--leaving .fact-card-icon img { animation: fi-snap-out    0.45s ease-out forwards; }

.fact-card h3 {
    font-size: 1.4rem;
    color: var(--brown);
    margin-bottom: 10px;
}

.fact-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Order Section --- */
.order-section {
    background: var(--cream);
    padding: 80px 0;
    text-align: center;
}

.order-section h2 {
    font-size: 2.4rem;
    color: var(--brown);
    margin-bottom: 12px;
}

.order-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.order-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Other Books Sidebar --- */
.other-books {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
}

.other-books-label {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 0.8rem;
    color: var(--brown);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    padding: 4px 12px;
}

.other-book-tile {
    display: block;
    width: 110px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
}

.other-book-tile:hover {
    transform: scale(1.06) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.other-book-tile img {
    width: 100%;
    display: block;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.other-book-tile-label {
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-family: 'Bubblegum Sans', cursive;
    font-size: 0.65rem;
    text-align: center;
    padding: 4px 4px;
    line-height: 1.2;
}

/* --- Back link --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brown);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 0;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--action);
}

/* --- Responsive --- */
@media (max-width: 968px) {
    .other-books {
        flex-direction: row;
        justify-content: center;
        order: 3;
    }

    .other-book-tile {
        width: 70px;
    }

    .book-hero-inner {
        flex-direction: column;
        gap: 36px;
        min-height: auto;
        text-align: center;
    }

    .book-hero-cover {
        flex: none;
        width: 260px;
    }

    .book-hero-info h1 {
        font-size: 2.2rem;
    }

    .book-details-row {
        justify-content: center;
    }

    .book-description {
        margin-left: auto;
        margin-right: auto;
    }

    .facts-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .book-hero-cover {
        width: 220px;
    }

    .book-hero-info h1 {
        font-size: 1.9rem;
    }

    .sample-thumb {
        flex: 0 0 170px;
        height: 225px;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}
