/* Flip Book – scoped for WordPress hero */

.flip-book-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.flip-book-wrapper input[type="checkbox"] {
    display: none;
}

/* Prevent theme img styles from leaking in */
#flip_book img {
    display: block;
    margin: 0;
    padding: 0;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}

/* Kapak görseli */
@keyframes coverPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%       { transform: translate(-50%, -50%) scale(1.06); }
}

.cover-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 55%;
    height: auto;
    pointer-events: none;
    z-index: 1;
    animation: coverPulse 2.8s ease-in-out infinite;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Kapak açılınca görsel kaybolsun */
#cover_checkbox:checked ~ #flip_book .cover-image {
    animation: none;
}

/* FLIP BOOK – dimensions scaled 1.3× from original */
#flip_book {
    width: 387px;
    height: 546px;
    position: relative;
    transition-duration: 1s;
    perspective: 2000px;
    transform: rotate(-12deg);
}

.front_cover,
.back_cover {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 3px 6px 6px 3px;
    background-image: url(./creative_coding-flip_book-main/assets/images/flip_book_edge_shading.webp);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f2c6d4;
    box-shadow: 0 0 5px 0 rgba(25, 25, 25, 0.25);
}

.front_cover {
    position: absolute;
    cursor: pointer;
    transform-origin: center left;
    transition: transform 0.5s;
    z-index: 99;
    transform-style: preserve-3d;
}

.front_cover label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
}

.page {
    width: 374px;
    height: 520px;
    position: absolute;
    top: 13px;
    left: 1px;
    border-radius: 0 6px 6px 0;
    background-color: white;
    transform-origin: left;
    transform-style: preserve-3d;
    transform: rotateY(0deg);
    transition-duration: 0.5s;
}

.front_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
}

.front_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.back_page {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    z-index: 100;
}

.back_page label {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: pointer;
    z-index: 100;
}

.edge_shading {
    width: 374px;
    height: 520px;
    position: absolute;
    z-index: 98;
}

.front_content {
    width: 373px;
    height: 517px;
    position: absolute;
    top: 1px;
    border-radius: 0 6px 6px 0;
    z-index: 97;
}

.back_content {
    width: 373px;
    height: 517px;
    position: absolute;
    top: 1px;
    left: 1px;
    border-radius: 6px 0 0 6px;
    z-index: 97;
}

.back_cover {
    position: relative;
    z-index: -1;
}

#page1 { z-index: 8; }
#page2 { z-index: 5; }
#page3 { z-index: 4; }
#page4 { z-index: 3; }
#page5 { z-index: 2; }
#page6 { z-index: 1; }

/* CSS-only flip interactions via sibling combinator */
#cover_checkbox:checked ~ #flip_book {
    transform: translateX(187px) rotate(-12deg);
}

#cover_checkbox:checked ~ #flip_book .front_cover {
    transform: rotateY(-180deg);
    transition: transform 1.5s, z-index 0.5s 0.5s;
    z-index: 1;
}

#cover_checkbox:checked ~ #flip_book #cover {
    width: 80%;
    height: 80%;
    position: absolute;
}

#page1_checkbox:checked ~ #flip_book #page1 {
    transform: rotateY(-180deg);
    z-index: 3;
}

#page2_checkbox:checked ~ #flip_book #page2 {
    transform: rotateY(-180deg);
    z-index: 4;
}

#page3_checkbox:checked ~ #flip_book #page3 {
    transform: rotateY(-180deg);
    z-index: 5;
}

#page4_checkbox:checked ~ #flip_book #page4 {
    transform: rotateY(-180deg);
    z-index: 9;
}

#page5_checkbox:checked ~ #flip_book #page5 {
    transform: rotateY(-180deg);
    z-index: 10;
}

#page6_checkbox:checked ~ #flip_book #page6 {
    transform: rotateY(-180deg);
    z-index: 11;
}
