/* =============================================
   EBOOK – children's pastel edition
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;700;800&family=Nunito:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --paper:        #fff8f5;       /* warm vanilla white */
  --paper-dark:   #f5ddd8;       /* blush crease */
  --bg:           #fce8e8;       /* soft pink page background */
  --bg-outer:     #f9d6d6;       /* slightly deeper pink outer */
  --ink:          #4a3040;       /* warm dark plum instead of harsh black */
  --ink-muted:    #a07890;       /* muted rose-lilac */
  --shadow:       rgba(180, 100, 120, 0.18);
  --accent:       #d4607a;       /* raspberry accent */
  --accent-soft:  #f2a0b0;       /* blush accent */
  --nav-bg:       rgba(252, 232, 232, 0.7);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: linear-gradient(160deg, #fce8e8 0%, #fde8d0 100%);
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
}

/* floating soft bubbles in the background */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 340px; height: 340px;
  background: radial-gradient(circle, #fad4e0 0%, transparent 70%);
  top: -80px; right: -80px;
}
body::after {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #fde8c0 0%, transparent 70%);
  bottom: -60px; left: -60px;
}

/* ── Book wrapper ──────────────────────────── */
#book-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding: 16px;
}

/* ── The page card ─────────────────────────── */
#book-page {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 72dvh;
  max-height: 88dvh;
  background: var(--paper);
  border-radius: 16px 24px 24px 16px;
  box-shadow:
    -3px 0 6px rgba(212,96,122,0.1),
     8px 8px 32px rgba(180,100,120,0.22),
     inset -2px 0 6px rgba(212,96,122,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: left center;
  perspective: 1200px;
}

/* Soft dot-pattern texture */
#book-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(212,96,122,0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 1;
}

/* Left spine */
#book-page::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 20px; height: 100%;
  background: linear-gradient(to right, rgba(212,96,122,0.1), transparent);
  pointer-events: none;
  z-index: 1;
}

/* ── Cover mode ────────────────────────────── */
#book-page.is-cover {
  border-radius: 16px 24px 24px 16px;
  cursor: pointer;
}

#book-page.is-cover .page-inner {
  padding: 0;
  gap: 0;
}

#book-page.is-cover .cover-image {
  width: 100%;
  height: 100%;
  object-fit: contain;         /* always shows the full image */
  display: block;
  border-radius: 14px 22px 22px 14px;
  background: var(--paper);   /* fills any letterbox gaps with vanilla */
}

#book-page.is-cover .cover-tap-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255,248,245,0.82);
  color: var(--accent);
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 6px 18px;
  border-radius: 99px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(212,96,122,0.2);
  animation: floatHint 2s ease-in-out infinite;
}

@keyframes floatHint {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-5px); }
}

/* ── Page-turn animation ───────────────────── */
@keyframes turnPage {
  0%   { transform: rotateY(0deg);   opacity: 1; }
  40%  { transform: rotateY(-22deg); opacity: 0.5; }
  60%  { transform: rotateY(-22deg); opacity: 0.5; }
  100% { transform: rotateY(0deg);   opacity: 1; }
}

@keyframes fadeContent {
  0%,100% { opacity: 1; }
  35%,65% { opacity: 0; }
}

#book-page.turning             { animation: turnPage    0.65s ease-in-out forwards; }
#book-page.turning .page-inner { animation: fadeContent 0.65s ease-in-out forwards; }

/* ── Inner content ─────────────────────────── */
.page-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 24px 18px 30px;
  gap: 12px;
  overflow-y: auto;
}

/* chapter label */
.page-chapter {
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 700;
}

/* page title */
.page-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent);
}

/* illustration */
.page-image {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  max-height: 20000px;
  border: 3px solid var(--paper-dark);
  box-shadow: 0 4px 14px var(--shadow);
  flex-shrink: 0;
}

/* story text */
.page-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink);
  flex: 1;
}

.page-text p + p { margin-top: 0.85em; }

/* dropcap */
.page-text p:first-child::first-letter {
  font-family: 'Baloo 2', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  float: left;
  line-height: 0.85;
  margin: 4px 6px 0 0;
  color: var(--accent);
}

/* ── Page number bar ───────────────────────── */
.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 0;
  border-top: 2px dashed var(--paper-dark);
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* ── Navigation buttons ────────────────────── */
#book-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 16px;
}

.nav-btn {
  background: var(--nav-bg);
  border: 2px solid var(--paper-dark);
  cursor: pointer;
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 50%;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px var(--shadow);
}

.nav-btn:active  { transform: scale(0.88); }
.nav-btn:hover   { background: var(--paper-dark); box-shadow: 0 4px 14px var(--shadow); }
.nav-btn:disabled { opacity: 0.25; cursor: default; box-shadow: none; }

/* progress dots */
#progress-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-soft);
  transition: background 0.3s, transform 0.3s;
}
.dot.active {
  background: var(--accent);
  transform: scale(1.5);
}

/* ── Swipe hint ────────────────────────────── */
#swipe-hint {
  font-family: 'Baloo 2', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(160, 120, 144, 0.55);
  margin-top: 10px;
  transition: opacity 1s;
}
#swipe-hint.hidden { opacity: 0; }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
*= require book
