/* ====================================
   GLOBAL THEME
==================================== */
body {
  background: #f3d07f; /* warm gold */
  font-family: 'Comic Sans MS', 'Baloo 2', cursive;
  overflow-x: hidden;
  color: #3e2723;
}

/* ====================================
   BOOK BACKGROUND CONTAINER (DESKTOP)
==================================== */
.container {
  position: relative;
  width: 100%;
  max-width: 950px;
  margin: 1.5rem auto;

  background: url('/pennacool/pcl123/competition/images/book_bg.png') no-repeat center center;
  background-size: contain;

  aspect-ratio: 1.7 / 1; /* landscape layout */

  border-radius: 8px;
  perspective: 2000px;
  overflow: visible;
}

/* ====================================
   RIGHT PAGE CONTENT (DESKTOP)
==================================== */
.storybook {
  position: absolute;
  top: 8%;
  left: 55%;
  width: 36%;
  height: 84%;
  transform-style: preserve-3d;
}

/* ====================================
   CARD — FLIPPING PAGES
==================================== */
.card {
  position: absolute;
  width: 100%;
  height: 100%;

  background: rgba(255,253,245,0.92);
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.25);

  padding: 1.2rem;
  opacity: 0;
  backface-visibility: hidden;
  transform-origin: left center;

  transition: transform 1s cubic-bezier(0.65,0,0.35,1),
              opacity 0.7s ease;
}

.card.active {
  opacity: 1;
  z-index: 5;
}

.card.prev {
  transform: rotateY(-180deg);
  z-index: 1;
}

/* ====================================
   TEXT STYLING
==================================== */
.card h2 {
  text-align: center;
  font-size: 1.55rem;
  color: #8b0000;
  font-weight: bold;
  text-shadow: 1px 1px 2px #ffdd8c;
  margin-bottom: 1.2rem;
}

.card p {
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-line;
  text-align: center;
  margin: 0 auto;
  color: #4e342e;
}

/* ====================================
   RESPONSIVE TEXTAREA (FORM)
==================================== */
.card textarea {
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  max-height: 350px;
  resize: vertical;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.6;
  padding: 1rem;
  border-radius: 10px;
}

/* ====================================
   SIDE NAVIGATION ARROWS (GREEN & ORANGE)
==================================== */
.side-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;

  font-size: 2rem;
  font-weight: bold;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: background .2s, transform .2s;
  border: none; /* keeps the clean, bold button look */
}

/* Green BACK button */
.left-arrow {
  left: -600px;
  background: #7ed957;   /* original back button green */
  color: #fff;           
}

/* Orange NEXT button */
.right-arrow {
  right: -70px;
  background: #ff8a50;   /* original next button orange */
  color: #fff;
}

.side-arrow:hover {
  transform: translateY(-50%) scale(1.08);
  filter: brightness(1.1); /* adds glow effect while keeping color */
}

/* MOBILE — bring arrows inward and resize */
@media (max-width: 768px) {
  .left-arrow { left: 10px; }
  .right-arrow { right: 10px; }

  .side-arrow {
    width: 45px;
    height: 45px;
    font-size: 1.6rem;
  }
}


/* ====================================
   FLOATING DECOR ON LEFT PAGE
==================================== */
.container::before,
.container::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;

  background-repeat: no-repeat;
  background-size: contain;

  opacity: 0.92;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
  z-index: 4;
}

@keyframes float {
  0%,100% { transform: translateY(0) rotate(0); }
  50%     { transform: translateY(-10px) rotate(5deg); }
}

.container::before {
  top: 18%;
  left: 40%;
  background-image: url('/pennacool/pcl123/competition/images/cmas3.png');
}

.container::after {
  bottom: 18%;
  left: 40%;
  background-image: url('/pennacool/pcl123/competition/images/cmas9.png');
}

/* ====================================
   MOBILE LAYOUT
==================================== */
@media (max-width: 768px) {

  .container {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;
    background-size: cover;
    background-position: center top;
    padding-bottom: 1rem;
  }

  .storybook {
    position: relative;
    top: 0;
    left: 0;
    width: 92%;
    margin: 1rem auto 0 auto;
    height: auto;
  }

  .card {
    position: relative;
    width: 100%;
    min-height: 480px;
    padding: 1.2rem;
    display: none;
    opacity: 0;
    transform: none;
    border-radius: 12px;
  }

  .card.active {
    display: block;
    opacity: 1;
  }

  .card.prev {
    display: none;
    opacity: 0;
  }

  .container::before,
  .container::after {
    width: 50px;
    height: 50px;
    left: 8%;
  }

  .container::before { top: 22%; }
  .container::after  { bottom: 22%; }

  .left-arrow { left: 10px; }
  .right-arrow { right: 10px; }

  .side-arrow {
    width: 45px;
    height: 45px;
    font-size: 1.6rem;
  }

  .card h2 { font-size: 1.3rem; }
  .card p  { font-size: 0.95rem; line-height: 1.55; }
}

/* ====================================
   REMOVE MOODLE ELEMENTS
==================================== */
#page-header,
footer#page-footer {
  display: none;
}

#region-main {
  background: transparent;
}
