/* New releases: Book 3 "Rex and the Great Road Rescue" and the companion
   colouring book "WonderNest Heroes".
   Layers on top of assets/styles.css, assets/book1.css and assets/series.css -
   same tokens, same furniture (.home-section, .section-head, .pair-set), no new
   brand colours. All artwork is portrait 1200x1553 and is always shown whole. */

/* ---------- Shared ---------- */

.cover-img,
.release-gallery .pair-card img,
.release-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 1553;
  object-fit: contain;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}

.badge-live {
  border-style: solid;
  border-color: #b9e0c6;
  color: #2f7a4a;
}

.release-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 26px;
}

/* ---------- Homepage: compact new-releases band ---------- */

.new-releases {
  background: #fff;
  border-bottom: 1px solid #f0eadf;
}

.new-releases .home-section {
  padding-top: 46px;
  padding-bottom: 50px;
}

.new-releases-head {
  text-align: center;
  margin: 0 0 24px;
}

.new-releases-head h2 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.5px;
}

.new-releases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 940px;
  margin: 0 auto;
}

.release-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  background: var(--cream);
  border: 1px solid #f0e6d6;
  border-radius: var(--radius);
  padding: 16px 20px 16px 16px;
  box-shadow: var(--shadow-soft);
}

.release-card > a {
  display: block;
  border-radius: 10px;
}

.release-card .cover-img {
  border-radius: 10px;
  background: var(--sky);
  box-shadow: 0 8px 18px #173a6326;
}

.release-card .eyebrow {
  margin-bottom: 6px;
}

.release-card h3 {
  font-size: 21px;
  line-height: 1.15;
}

.release-card .release-sub {
  color: var(--muted);
  font-size: 14.5px;
  margin: 4px 0 0;
}

.release-card .release-actions {
  margin-top: 14px;
  gap: 10px 16px;
}

.release-card .button {
  padding: 10px 18px;
  font-size: 14px;
}

.release-card .text-link {
  font-size: 14.5px;
}

/* ---------- Homepage: Book 3 (available now) ---------- */

.book3-layout {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  text-align: left;
}

.book3 .book3-inner.book3-layout {
  max-width: 1040px;
}

.book3 .release-cover {
  margin: 0;
  padding: 10px;
  background: #ffffff10;
  border: 1px solid #ffffff24;
  border-radius: var(--radius);
  box-shadow: 0 30px 70px #06152a66;
}

.book3 .release-cover img {
  border-radius: 14px;
  background: #0d2340;
}

.book3 .badge-soon.badge-live {
  background: #ffffff14;
  border-color: #8fd3a680;
  color: #a7e8bd;
}

.book3-desc {
  color: #dbe8f3;
  font-size: 18px;
  margin: 20px 0 0;
  max-width: 48ch;
}

.book3-layout .book3-quote {
  margin: 28px 0 0;
  max-width: 32ch;
}

.book3-layout .book3-quote::before {
  margin: 0 0 18px;
}

.book3-layout .book3-quote::after {
  display: none;
}

.book3 .text-link {
  color: #fff;
}

.book3 .text-link span {
  color: var(--yellow);
}

/* ---------- Homepage: WonderNest Heroes ---------- */

.heroes {
  background: linear-gradient(170deg, #fff 0%, #fffaf0 60%, #fff6e6 100%);
  border-top: 1px solid #f0eadf;
}

.heroes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 56px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.heroes .release-cover {
  margin: 0;
}

.heroes .release-cover img {
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-lift);
  transform: rotate(1.4deg);
}

.heroes h2 {
  font-size: clamp(32px, 4.6vw, 50px);
  letter-spacing: -1px;
}

.heroes-subtitle {
  font-family: Fredoka, sans-serif;
  color: var(--orange);
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.3;
  margin: 12px 0 0;
}

.heroes-desc {
  color: #526776;
  font-size: 18px;
  margin: 18px 0 0;
  max-width: 50ch;
}

.heroes-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 16px 0 0;
}

/* ---------- Series: three story adventures + one companion ---------- */

.series-group-title {
  font-family: Fredoka, sans-serif;
  color: var(--navy);
  font-size: 20px;
  text-align: center;
  margin: 0 0 18px;
}

.series-group-title + .series-grid {
  margin-bottom: 44px;
}

.series-grid.series-grid-stories {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1060px;
}

.series-card.companion {
  flex-direction: row;
  align-items: center;
  gap: 26px;
  max-width: 760px;
  margin: 0 auto;
}

.series-card.companion .series-art {
  flex: 0 0 210px;
  margin: 0;
}

.series-card.companion .series-copy {
  display: flex;
  flex-direction: column;
}

/* ---------- Books page ---------- */

.books-group-title {
  max-width: 1060px;
  margin: 0 auto;
  padding: 64px 32px 0;
  text-align: center;
}

.books-group-title + .books-grid {
  padding-top: 26px;
  padding-bottom: 40px;
}

.book-card .release-actions {
  margin-top: 16px;
}

.book-card .release-actions .text-link {
  font-size: 15px;
}

.companion-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 26px 32px 90px;
}

.book-card.book-card-wide {
  display: grid;
  grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
}

.book-card.book-card-wide .mini-cover.real-cover {
  height: 100%;
  padding: 18px;
  display: grid;
  place-items: center;
}

.book-card.book-card-wide .card-copy {
  padding: 26px 30px;
}

.book-card .book-sub {
  font-family: Fredoka, sans-serif;
  color: var(--orange) !important;
  font-size: 18px;
  margin: 6px 0 0;
}

.books-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 26px auto 0;
}

.books-jump a {
  background: #fff;
  border: 1px solid #cde7f2;
  border-radius: 100px;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
}

.books-jump a:hover {
  border-color: var(--orange);
}

/* ---------- Galleries (colour / black-and-white pairs) ---------- */

.release-gallery {
  scroll-margin-top: 20px;
}

.release-gallery.gallery-book3 {
  background: var(--cream);
  border-top: 1px solid #f0eadf;
}

.release-gallery.gallery-heroes {
  background: #fff;
  border-top: 1px solid #f0eadf;
}

.release-gallery .section-head .eyebrow {
  margin-bottom: 10px;
}

.release-gallery .pair-set:last-of-type {
  margin-bottom: 0;
}

.release-gallery .pair-card img {
  border-radius: 14px;
}

.gallery-book3 .pair-card img {
  background: #f3f5f7;
}

.gallery-heroes .pair-card img {
  background: #fff;
}

.pairs-heroes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 40px;
  max-width: 1076px;
  margin: 0 auto;
}

.pairs-heroes .pair-set {
  margin: 0;
}

.pairs-heroes .pair-grid {
  gap: 16px;
}

.pairs-heroes .pair-card {
  padding: 10px;
}

.pairs-heroes .pair-label {
  font-size: 15px;
}

.gallery-cta {
  text-align: center;
  margin: 48px 0 0;
}

/* Enlarge links + lightbox */

.zoom-link {
  display: block;
  position: relative;
  border-radius: 14px;
  cursor: zoom-in;
}

.zoom-link::after {
  content: "\2922";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffffe6;
  color: var(--navy);
  font-size: 17px;
  box-shadow: 0 4px 10px #173a6326;
  opacity: .85;
}

.zoom-link:hover::after,
.zoom-link:focus-visible::after {
  opacity: 1;
}

.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 900px);
  max-height: 94vh;
}

.lightbox::backdrop {
  background: #102a48e6;
}

.lightbox-inner {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(94vw - 28px);
  max-height: calc(94vh - 80px);
  aspect-ratio: 1200 / 1553;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
}

.lightbox-caption {
  font-family: Fredoka, sans-serif;
  color: var(--navy);
  text-align: center;
  margin: 10px 40px 0;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font: 700 24px/1 "DM Sans", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 14px #06152a55;
}

/* ---------- Responsive ---------- */

@media (max-width: 1004px) {
  .series-grid.series-grid-stories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pairs-heroes {
    grid-template-columns: 1fr;
    max-width: 900px;
  }
  .pairs-heroes .pair-grid {
    gap: 30px;
  }
}

@media (max-width: 860px) {
  .new-releases-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .book3-layout,
  .heroes-layout {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .book3 .release-cover,
  .heroes .release-cover {
    max-width: 340px;
    margin: 0 auto;
  }
  .book3-desc,
  .heroes-desc,
  .book3-layout .book3-quote {
    margin-left: auto;
    margin-right: auto;
  }
  .book3-layout .book3-quote::before {
    margin: 0 auto 18px;
  }
  .release-actions,
  .heroes .max-traits {
    justify-content: center;
  }
  .release-card .release-actions {
    justify-content: flex-start;
  }
  .book-card.book-card-wide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .series-grid.series-grid-stories {
    grid-template-columns: 1fr;
  }
  .series-card.companion {
    flex-direction: column;
    align-items: stretch;
  }
  .series-card.companion .series-art {
    flex: none;
    margin-bottom: 20px;
  }
  .release-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
  }
  .books-group-title {
    padding: 48px 25px 0;
  }
  .companion-wrap {
    padding: 20px 25px 70px;
  }
  .heroes .release-cover img {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .release-gallery {
    scroll-margin-top: 0;
  }
}
