/* ===== SmartMinds — Brand Styles ===== */

:root {
  --red: #ED3B3B;
  --orange: #F7941D;
  --yellow: #FBC531;
  --green: #6DC067;
  --teal: #2BAEE0;
  --purple: #8E5FB5;
  --pink: #EC1E79;
  --navy: #1B4869;
  --cream: #FFFCF5;
  --paper: #FFFFFF;
  --ink: #33475B;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(27, 72, 105, 0.12);
  --shadow-hover: 0 16px 40px rgba(27, 72, 105, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, .display {
  font-family: 'Baloo 2', cursive;
  color: var(--navy);
  margin: 0 0 0.4em;
  line-height: 1.15;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.rainbow-rule {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--teal), var(--purple), var(--pink));
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Baloo 2', cursive;
  font-size: 1.05rem;
  padding: 14px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-primary { background: var(--pink); color: white; }
.btn-secondary { background: white; color: var(--navy); border: 2px solid var(--navy); box-shadow: none; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- Header ---- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(27,72,105,0.08);
  overflow: visible;
}
.nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  max-width: 1180px;
  margin: 0 auto;
  overflow: visible;
}
.brand { position: relative; display: block; width: 96px; height: 54px; flex: 0 0 auto; }
.brand-badge {
  position: absolute; top: 2px; left: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  width: 136px; height: 136px; border-radius: 50%;
  background: #FFFFFF; box-shadow: var(--shadow); padding: 10px;
}
.brand-badge img { height: 100%; width: 100%; object-fit: contain; }
@media (max-width: 600px) {
  .brand { width: 66px; height: 40px; }
  .brand-badge { width: 92px; height: 92px; }
}
.brand-name { font-family: 'Baloo 2', cursive; font-size: 1.3rem; color: var(--navy); }
nav.main-nav ul { display: flex; gap: 28px; }
nav.main-nav a {
  font-family: 'Baloo 2', cursive;
  font-size: 1rem;
  color: var(--navy);
  padding: 6px 2px;
  border-bottom: 3px solid transparent;
}
nav.main-nav a:hover { border-bottom-color: var(--pink); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--navy); cursor: pointer; }

@media (max-width: 860px) {
  nav.main-nav { display: none; }
  /* z-index above .brand-badge (5) — the round logo is deliberately oversized
     and overflows below the header bar, so without this the open dropdown
     rendered underneath it and the logo covered the first menu link(s). */
  nav.main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); box-shadow: var(--shadow); padding: 16px 24px; z-index: 20; }
  nav.main-nav.open ul { flex-direction: column; gap: 14px; }
  .nav-toggle { display: block; }
}

/* ---- Hero (auto-slider) ---- */
.hero { position: relative; overflow: hidden; background: var(--cream); --hero-h: clamp(320px, 60vw, 560px); }
.hero-slider { position: relative; }
.hero-slides { display: flex; width: 100%; align-items: stretch; transition: transform 0.6s cubic-bezier(.65,0,.35,1); }
.hero-slide { flex: 0 0 100%; width: 100%; height: var(--hero-h); }
.hero-slide-brand {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 24px; text-align: center; overflow: hidden; box-sizing: border-box;
  background: radial-gradient(circle at 50% 0%, #FFF6E0 0%, var(--cream) 60%);
}
.hero-slide-brand img.hero-logo { max-width: clamp(80px, 13vw, 160px); margin: 0 auto clamp(6px, 1.2vw, 12px); flex: 0 1 auto; min-height: 0; }
.hero-slide-brand h1 { font-size: clamp(1.3rem, 3vw, 2.6rem); line-height: 1.2; margin: 0 0 0.35em; }
.hero-slide-brand p.lead { max-width: 620px; margin: 0 auto clamp(10px, 2vw, 28px); font-size: clamp(0.85rem, 1.4vw, 1.15rem); color: var(--ink); }
.hero-ctas { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; flex: 0 0 auto; }
.hero-badges { margin-top: clamp(10px, 2vw, 34px); display: flex; gap: 34px; justify-content: center; flex-wrap: wrap; font-family: 'Baloo 2', cursive; color: var(--navy); font-size: 0.95rem; flex: 0 0 auto; }
.hero-badges span { display: flex; align-items: center; gap: 8px; }
.hero-slide-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 600px) {
  .hero-badges { display: none; }
  .hero-slide-brand p.lead { display: none; }
  .hero-slide-brand .btn { padding: 9px 18px; font-size: 0.9rem; }
}
.hero-dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.hero-dot { width: 11px; height: 11px; border-radius: 999px; border: none; background: rgba(27,72,105,0.25); cursor: pointer; padding: 0; transition: background 0.2s ease, transform 0.2s ease; }
.hero-dot.active { background: var(--pink); transform: scale(1.25); }

/* ---- How it works ---- */
.how-section { padding: 56px 0; background: #FFFFFF; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.how-tile { background: var(--cream); border-radius: var(--radius); padding: 28px 22px; text-align: center; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.how-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.how-emoji { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.how-tile h3 { margin-bottom: 6px; }
.how-tile p { margin: 0; font-size: 0.92rem; opacity: 0.85; }

/* ---- Series sections ---- */
.series-section { padding: 56px 0; }
.series-section#gallery { background: var(--cream); }
.series-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.age-pill {
  display: inline-block;
  font-family: 'Baloo 2', cursive;
  background: var(--yellow);
  color: var(--navy);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.card-grid {
  display: grid;
  /* auto-fill (not auto-fit) so the column TRACK COUNT is set purely by the
     grid's own width, never by how many cards happen to be in it — with
     auto-fit, a group with only one book (e.g. Trailblazers) would have its
     single card stretch to fill the whole row. auto-fill keeps the same
     column width across every group at a given screen size, while still
     resizing responsively as the viewport changes. */
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  justify-content: start;
  gap: 28px;
}

.book-card {
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.book-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.book-card .cover-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.book-card img.cover { width: 100%; height: 100%; object-fit: cover; }
.status-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--pink); color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 999px;
}
.book-card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-card h3 { font-size: 1.15rem; margin-bottom: 0; }
.book-card p.blurb { font-size: 0.92rem; color: var(--ink); opacity: 0.85; margin: 0; flex: 1; }
.book-card .meta-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.price { font-family: 'Baloo 2', cursive; color: var(--navy); font-size: 1.05rem; }

/* ---- Gallery tabs + carousel ---- */
.gallery-tabs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.gallery-type-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.gallery-type-tabs:empty { margin-bottom: 0; }
.gallery-type-tab {
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.82rem;
  background: transparent; color: var(--navy); opacity: 0.65;
  border: none; border-bottom: 2px solid transparent;
  padding: 4px 10px; cursor: pointer; transition: opacity 0.15s ease, border-color 0.15s ease;
}
.gallery-type-tab:hover { opacity: 1; }
.gallery-type-tab.active { opacity: 1; border-bottom-color: var(--pink); color: var(--pink); }
.gallery-tab {
  font-family: 'Baloo 2', cursive; background: white; color: var(--navy);
  border: 2px solid rgba(27,72,105,0.15); border-radius: 999px;
  padding: 10px 20px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.gallery-tab:hover { transform: translateY(-2px); }
.gallery-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.gallery-tab-pill { font-family: 'Nunito', sans-serif; font-size: 0.72rem; opacity: 0.75; }

/* One continuous "stage" card holds the carousel, the book detail and the
   sample pages together, so the whole gallery reads as a single connected
   unit rather than three separate floating pieces. */
.gallery-stage {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF8EA 100%);
  border-radius: 32px;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 44px) clamp(28px, 4vw, 40px);
  box-shadow: var(--shadow);
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .gallery-stage { padding: 20px 10px 24px; border-radius: 24px; }
}

/* Arrows float over the wrap instead of sitting in the flex row beside it —
   on narrow screens two 44px flex-row arrows plus gaps were eating over 100px
   of the available width before the wrap even got a look-in, forcing the
   selected book down to an illegibly small size. Overlaying them costs
   nothing structurally and is the standard pattern for mobile carousels. */
.gallery-carousel { position: relative; margin-bottom: 6px; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.92); color: var(--navy); box-shadow: var(--shadow); cursor: pointer;
  font-size: 1.1rem; transition: transform 0.15s ease, background 0.15s ease; z-index: 60;
}
.carousel-arrow:hover { transform: translateY(-50%) scale(1.08); background: var(--pink); color: white; }
.carousel-arrow-left { left: -4px; }
.carousel-arrow-right { right: -4px; }
.carousel-track-wrap { position: relative; height: clamp(230px, 38vw, 360px); overflow: hidden; z-index: 0; }
.carousel-track { position: relative; width: 100%; height: 100%; }
@media (max-width: 560px) {
  .carousel-arrow { width: 36px; height: 36px; font-size: 0.95rem; }
  .carousel-arrow-left { left: 0; }
  .carousel-arrow-right { right: 0; }
}

/* Attractive backdrop that sits behind the selected book — like a spotlight
   platform, sized to track the selected cover (the wrap's height already
   tracks the current item size via JS) and layered under the carousel items. */
.carousel-spotlight {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  height: 92%; aspect-ratio: 1/1; border-radius: 30px; z-index: 1;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 58%),
    linear-gradient(160deg, #FFE7A8 0%, #FBC7DE 55%, #BFE3F7 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.85), var(--shadow-hover);
}
.carousel-item {
  position: absolute; top: 50%; left: 50%; width: var(--item-size, clamp(170px, 24vw, 280px));
  aspect-ratio: 1/1; border-radius: 20px; overflow: hidden;
  border: none; padding: 0; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.55s cubic-bezier(.65,0,.35,1), opacity 0.45s ease, box-shadow 0.3s ease, filter 0.3s ease;
  filter: saturate(0.8) brightness(0.94);
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-item.selected { box-shadow: var(--shadow-hover); filter: none; }
.carousel-item:not(.selected):hover { filter: none; }

.book-detail { max-width: 560px; margin: 20px auto 8px; text-align: center; }
.book-detail-title-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.book-detail-title-row h3 { margin: 0; }
.status-badge-static { display: inline-block; }
.book-detail .book-type { font-family: 'Baloo 2', cursive; color: var(--navy); opacity: 0.7; font-size: 0.9rem; margin: 4px 0 10px; }
.book-detail .blurb { margin: 0 0 8px; }

.sample-pages { max-width: 980px; margin: 22px auto 0; text-align: center; }
.sample-pages-title { font-size: 1.05rem; margin-bottom: 2px; }
.sample-pages-hint { font-size: 0.78rem; opacity: 0.65; margin: 0 0 14px; }
.sample-pages-track { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px 14px; justify-content: center; flex-wrap: wrap; }
.sample-pages-track .sample-thumb-btn {
  width: clamp(84px, 14vw, 120px); min-width: 0; flex: 0 0 auto; aspect-ratio: 1/1;
  padding: 0; border: 2px solid rgba(27,72,105,0.08); border-radius: 10px; background: white;
  box-shadow: var(--shadow); cursor: zoom-in; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sample-pages-track .sample-thumb-btn:hover,
.sample-pages-track .sample-thumb-btn:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.sample-pages-track .sample-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample-pages-placeholder { font-size: 0.9rem; opacity: 0.7; max-width: 480px; margin: 0 auto; }
.sample-pages .price { display: inline-block; margin-top: 18px; }

/* ---- Sample page lightbox ("Look Inside") ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
  background: rgba(27,72,105,0.88); padding: 24px; backdrop-filter: blur(2px);
}
.lightbox[hidden] { display: none; }
.lightbox-figure { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92vw; max-height: 92vh; }
.lightbox-img { max-width: min(88vw, 760px); max-height: 72vh; width: auto; height: auto; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); background: white; }
.lightbox-caption { color: white; font-family: 'Baloo 2', cursive; font-size: 1rem; text-align: center; opacity: 0.95; }
.lightbox-close, .lightbox-arrow {
  position: fixed; width: 48px; height: 48px; border-radius: 999px; border: none;
  background: white; color: var(--navy); box-shadow: var(--shadow); cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.lightbox-close:hover, .lightbox-arrow:hover { transform: scale(1.08); background: var(--pink); color: white; }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.08); }
@media (max-width: 640px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 10px; right: 10px; }
}

/* ---- Shop ---- */
.shop-section { padding: 56px 0; background: #FFFFFF; }
.shop-group { margin-bottom: 46px; }
.shop-group:last-child { margin-bottom: 0; }
.shop-group-head { margin-bottom: 20px; }
.shop-group-title { font-family: 'Baloo 2', cursive; color: var(--navy); margin-bottom: 4px; }
.shop-group-age { font-size: 0.92rem; color: var(--ink); opacity: 0.65; margin: 0; }

/* ---- Let Us Suggest (quiz) ---- */
.suggest-section { background: linear-gradient(120deg, var(--teal), var(--purple)); color: white; padding: 64px 0; }
.suggest-section h2, .suggest-section p { color: white; }
.suggest-section .series-head p { opacity: 0.95; }
.quiz-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; max-width: 720px; margin: 0 auto; color: var(--ink); }
.quiz-step h3 { text-align: center; margin-bottom: 18px; }
.quiz-step + .quiz-step { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(27,72,105,0.1); }
.quiz-options { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.quiz-option {
  font-family: 'Baloo 2', cursive; background: var(--cream); color: var(--navy);
  border: 2px solid transparent; border-radius: 999px; padding: 10px 22px; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.quiz-option:hover { transform: translateY(-2px); }
.quiz-option.active { border-color: var(--pink); background: white; }
.quiz-result { margin-top: 26px; padding-top: 24px; border-top: 1px solid rgba(27,72,105,0.1); }
.quiz-match { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.quiz-match img { width: 130px; height: 130px; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); flex: 0 0 auto; }
.quiz-match > div { flex: 1; min-width: 220px; }
.quiz-match p { margin: 8px 0 14px; }

/* ---- Contact ---- */
.contact-section { padding: 64px 0; background: var(--cream); }
.contact-form { max-width: 640px; margin: 0 auto; background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form label { font-family: 'Baloo 2', cursive; color: var(--navy); font-size: 0.9rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 16px; border-radius: 14px; border: 2px solid rgba(27,72,105,0.12);
  font-family: 'Nunito', sans-serif; font-size: 1rem; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--teal); }
.contact-form .btn { align-self: center; margin-top: 4px; }
.contact-note { text-align: center; font-size: 0.88rem; opacity: 0.75; margin: 4px 0 0; }
.hp-field { position: absolute; left: -9999px; }

/* Reused: shop signup form styling (was .signup-form) */
.signup-form { display: flex; gap: 12px; justify-content: center; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.signup-form input[type="email"] {
  flex: 1; min-width: 220px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 2px solid rgba(27,72,105,0.12);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}
.signup-note { margin-top: 14px; font-size: 0.85rem; opacity: 0.7; text-align: center; }

/* ---- Reveal-on-scroll animations ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-slides { transition: none; }
}

/* ---- Footer ---- */
footer.site-footer {
  background: var(--navy);
  color: white;
  padding: 46px 0 22px;
}
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 26px; }
.footer-grid img { height: 44px; margin-bottom: 10px; }
.footer-col h4 { font-family: 'Baloo 2', cursive; color: white; margin-bottom: 10px; font-size: 1rem; }
.footer-col a, .footer-col p { color: rgba(255,255,255,0.75); font-size: 0.9rem; display: block; margin-bottom: 6px; }
.footer-bottom { text-align: center; font-size: 0.82rem; color: rgba(255,255,255,0.6); border-top: 1px solid rgba(255,255,255,0.12); padding-top: 18px; }

section .container > .series-head h2, .about-section h2, .signup-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
