﻿/* Simple 3D hardback at fixed 360x540px (2:3 ratio) */

/* Container with perspective */
.book-container {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    text-decoration: none;
}

/* Initial opening animation */
@keyframes initAnimation {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(-30deg);
    }
}

/* 3D book box */
.book {
    width: 360px;
    height: 540px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-30deg);
    transition: 4s ease;
    animation: 4s ease 0s 1 initAnimation;
}

/* Front cover (the <img>) */
.book> :first-child {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    height: 540px;
    transform: translateZ(28px);
    background-color: #000000;
    border-radius: 0 2px 2px 0;
    box-shadow: 5px 5px 20px #666;
}

/* Ensure the image fills the front face */
.book>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Right-side pages block (white thickness) */
.book::before {
    position: absolute;
    content: "";
    left: 0;
    top: 4px;
    width: 52px;
    height: 532px;
    transform: translateX(333px) rotateY(90deg);
    background: linear-gradient(90deg, #fff 0%, #f9f9f9 5%, #fff 10%, #f9f9f9 15%, #fff 20%, #f9f9f9 25%, #fff 30%, #f9f9f9 35%, #fff 40%, #f9f9f9 45%, #fff 50%, #f9f9f9 55%, #fff 60%, #f9f9f9 65%, #fff 70%, #f9f9f9 75%, #fff 80%, #f9f9f9 85%, #fff 90%, #f9f9f9 95%, #fff 100%);
}

/* Back cover */
.book::after {
    position: absolute;
    top: 0;
    left: 0;
    content: "";
    width: 360px;
    height: 540px;
    transform: translateZ(-28px);
    background-color: #000000;
    border-radius: 0 2px 2px 0;
    box-shadow: -10px 0 50px 10px #666;
}