
/* back button*/

.back-postcard {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 500;
  display: block;
  transition: transform 0.15s ease;
}

.back-postcard img {
  width: 90px;
  height: auto;
  filter: drop-shadow(2px 3px 5px rgba(0,0,0,0.3));
  transform: rotate(-6deg);
}

.back-postcard:hover img {
  transform: rotate(-2deg) scale(1.05);
}

.back-postcard-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--link-color);
  color: #fff;
  font-size: 0.75em;
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.back-postcard:hover .back-postcard-label {
  opacity: 1;
}
  
  
  
body {
  background-image: url("images/journalbg.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
}

input[type="checkbox"] {
  display: none;
}

.book-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

#flip_book {
  width: 380px;
  height: 520px;
  position: relative;
  transition: transform 0.9s ease;
  perspective: 2500px;
}


#cover_checkbox:checked ~ .book-wrap #flip_book {
  transform: translateX(100px);
}

.page {
  width: 380px;
  height: 520px;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 0 6px 6px 0;
  transform-origin: left;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition-duration: 0.6s;
}

#cover_page {
  border-radius: 4px 6px 6px 4px;
  z-index: 99;
}

.front_page,
.back_page {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  background-repeat: no-repeat;
}

.back_page {
  transform: rotateY(180deg);
}

.front_page label,
.back_page label {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
  z-index: 5;
}

.cover-front {
  background-image: url("images/front.png");
  background-size: cover;
  background-position: center;
}

.cover-back {
  background-image: url("images/back.png");
  background-size: cover;
  background-position: center;
}

/* each spread image split left/right across two adjacent page faces */
.bg-intro-left     { background-image: url("images/intro.png");   background-size: 200% 100%; background-position: left top; }
.bg-intro-right    { background-image: url("images/intro.png");   background-size: 200% 100%; background-position: right top; }
.bg-aboutme-left   { background-image: url("images/aboutme.png"); background-size: 200% 100%; background-position: left top; }
.bg-aboutme-right  { background-image: url("images/aboutme.png"); background-size: 200% 100%; background-position: right top; }
.bg-blank-left     { background-image: url("images/blank.png");   background-size: 200% 100%; background-position: left top; }
.bg-blank-right    { background-image: url("images/blank.png");   background-size: 200% 100%; background-position: right top; }
.bg-last-left      { background-image: url("images/last.png");    background-size: 200% 100%; background-position: left top; }
.bg-last-right     { background-image: url("images/last.png");    background-size: 200% 100%; background-position: right top; }

.back_cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 380px;
  height: 520px;
  border-radius: 6px 4px 4px 6px;
  z-index: 1;
}

.page_text {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  padding: 30px;
  font-size: 14px;
}
.left-text { left: 40px; top: 120px; width: 260px; }
.right-text { right: 30px; top: 120px; width: 260px; }

/* resting stack */
#page1 { z-index: 8; }
#page2 { z-index: 6; }
#page3 { z-index: 4; }

/* cover open */
#cover_checkbox:checked ~ .book-wrap #flip_book #cover_page {
  transform: rotateY(-180deg);
  z-index: 15;
}

/* back cover sits at the bottom of the stack at rest */
#backcover_page {
  z-index: 1;
  border-radius: 6px 4px 4px 6px;
}

/* closing the book: flip the back cover over the stack */
#backcover_checkbox:checked ~ .book-wrap #flip_book #backcover_page {
  transform: rotateY(-180deg);
  z-index: 25;
}

/* recenter the closed book (must come AFTER the cover_checkbox rule) */
#backcover_checkbox:checked ~ .book-wrap #flip_book {
  transform: translateX(380px);
}


/* page flips */
#page1_checkbox:checked ~ .book-wrap #flip_book #page1 { transform: rotateY(-180deg); z-index: 20; }
#page2_checkbox:checked ~ .book-wrap #flip_book #page2 { transform: rotateY(-180deg); z-index: 21;}
#page3_checkbox:checked ~ .book-wrap #flip_book #page3 { transform: rotateY(-180deg); z-index: 22;}


