/* Base */
body {
  margin: 0;
  font-family: 'PT Serif Caption', serif;
  background: #ffeccc;
  color: #222;
}

header {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 0.5rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* Top-level nav baseline */
nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1rem;
  padding: 0.5rem;
  background-color: #fff4e0;
}

nav a {
  text-decoration: none;
  color: #333;
}

/* ===== New sections for the updated layout ===== */

/* Characters hero */
.hero-characters {
  display: grid;
  place-items: center;
  padding: 2rem 1rem 0;
}
.hero-characters-img {
  width: clamp(240px, 50vw, 420px);
  max-width: 100%;
  animation: float 4s ease-in-out infinite;
}

/* About */
.about-series {
  max-width: 1000px;
  margin: 1.5rem auto 0;
  background-color: #fff4e0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
}
.about-series h2 {
  margin-top: 0;
}
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}

/* Books grid */
.books-section {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}
.books-section h2 {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 1.5rem;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
  gap: 1.5rem;
}
.book-card {
  background: #fff4e0;
  border: 1px solid #f0d8b7;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.book-cover-link { display: block; }
.book-cover {
  display: block;
  width: 100%;
  height: auto;
}
.book-meta {
  padding: 1rem;
  display: grid;
  gap: .5rem;
}
.book-title {
  margin: 0;
  font-size: 1.15rem;
}
.book-sub {
  margin: 0 0 .25rem;
  color: #444;
  font-size: .95rem;
}

/* Legacy pieces kept for continuity */
.order-button {
  background-color: coral;
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  display: inline-block;
  margin-top: 0.25rem;
  border-radius: 8px;
  font-weight: 700;
  border: 2px solid coral;
}
.order-button:hover { filter: brightness(1.05); }
.order-button--light {
  background: #fff;
  color: #333;
  border-color: #f0d8b7;
}
.order-button--outline {
  background: transparent;
  color: #333;
  border-color: #d6a16e;
}

/* Tagline */
.tagline-section {
  text-align: center;
  margin: 3rem 1rem 1.5rem;
}
.tagline {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
.separator {
  width: 80%;
  max-width: 1000px;
  margin: 0 auto;
  border: none;
  border-top: 2px solid #d6a16e;
}

/* Meet the Critters */
.meet-critters {
  text-align: center;
  padding: 3rem 1rem;
}
.meet-critters h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}
.critter-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.critter-card { text-align: center; }
.critter-name {
  font-size: 1rem;
  margin-top: 0.5rem;
  font-weight: bold;
  color: #333;
}
.critter {
  width: 110px;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.critter.hover-effect:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}
.shelly-wider { width: 140px; }

/* Footer */
footer.footer-colored {
  background: #fff4e0;
  text-align: center;
  padding: 2rem 1rem;
  font-weight: bold;
  font-size: 1rem;
  margin-top: 2rem;
}
footer a { color: #d67600; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
@keyframes wiggle {
  0% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(1deg); }
  50% { transform: translateY(2px) rotate(-1deg); }
  75% { transform: translateY(-2px) rotate(1deg); }
  100% { transform: translateY(0) rotate(0); }
}
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1s ease;
}
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .book-title { font-size: 1.05rem; }
  .book-sub { font-size: .9rem; }
}

/* Character Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.modal.hidden { display: none; }
.modal-content {
  background: #fff4e0;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  position: relative;
}
.modal-content img {
  width: 150px;
  margin-bottom: 1rem;
}
.modal-content h3 { margin-bottom: 0.5rem; font-size: 1.4rem; }
.modal-content p { font-size: 1rem; color: #333; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 1.5rem;
  color: #000;
  cursor: pointer;
}

/* === Click-to-open dropdown nav === */
.main-nav .nav-list{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: .75rem 1rem;
  background-color: #fff4e0;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}
.nav-item a,
.nav-button {
  font-family: 'PT Serif Caption', serif;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: #333;
  border: none;
  background: none;
  cursor: pointer;
  padding: .35rem .65rem;
  border-radius: 6px;
  display: inline-block;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.nav-item a:hover,
.nav-button:hover { background-color: #fff1da; color: #000; }
.nav-item--has-dropdown{ position: relative; }
.nav-button{ display: flex; align-items: center; gap: .35rem; }
.chevron{ font-size: .9rem; transform: translateY(-1px); }
.nav-dropdown{
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 230px;
  padding: .4rem;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #f0d8b7;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  display: none;
  z-index: 1000;
}
.nav-item--has-dropdown.open .nav-dropdown{ display: block; }
.nav-dropdown a{
  display: block;
  padding: .55rem .7rem;
  color: #333;
  border-radius: 8px;
}
.nav-dropdown a:hover{ background: #fff6ea; }
@media (max-width: 640px){
  .main-nav .nav-list{ gap: .5rem; padding: .6rem .7rem; }
}
.nav-button { display: inline-flex; align-items: center; gap: 0.3rem; }
.chevron { font-size: 0.8rem; transition: transform 0.3s ease; }
.nav-item--has-dropdown.open .chevron { transform: rotate(180deg); }

/* === Mobile accordion nav === */
.nav-toggle{
  display:none;
  align-items:center;
  gap:.5rem;
  border:1px solid #f0d8b7;
  background:#fff4e0;
  color:#333;
  padding:.5rem .75rem;
  border-radius:10px;
  font-family:'PT Serif Caption', serif;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 3px 8px rgba(0,0,0,.12);
}
.nav-toggle:focus{ outline:2px solid #d6a16e; outline-offset:2px; }
.nav-toggle-box{ display:inline-flex; flex-direction:column; gap:4px; }
.nav-toggle-bar{ width:20px; height:2px; background:#333; border-radius:2px; display:block; }
.nav-toggle-text{ font-size:1rem; }

@media (max-width: 820px){
  .main-nav{ display:flex; flex-direction:column; align-items:center; gap:.6rem; }
  .nav-toggle{ display:inline-flex; }
  .main-nav .nav-list{
    width:100%;
    max-width:700px;
    flex-direction:column;
    gap:.25rem;
    overflow:hidden;
    max-height:0;
    transition:max-height .35s ease;
    padding:.5rem .6rem;
  }
  .main-nav.open .nav-list{ max-height:1000px; }
  .nav-item a, .nav-button{
    width:100%; text-align:left; padding:.65rem .75rem; border-radius:8px;
  }
  .nav-dropdown{
    position:static; transform:none; min-width:unset;
    margin:.25rem 0 .35rem .5rem;
    box-shadow:none; display:none;
    border:1px solid #f0d8b7; border-radius:8px; background:#fff;
  }
  .nav-item--has-dropdown.open .nav-dropdown{ display:block; }
}

/* Rotate chevron when open */
.nav-item--has-dropdown.open .chevron{
  transform:rotate(180deg);
  transition:transform .25s ease;
}

/* Hide stray line under the mobile Menu button when collapsed */
@media (max-width: 820px){
  .main-nav .nav-list{ padding: 0 !important; }
  .main-nav.open .nav-list{ padding: .6rem .7rem !important; }
}

/* A11y helper */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}
