/* ===== Critter Bright Books — colors taken from the frog logo ===== */
:root {
  --paper: #fefaef;      /* cream, matched to the artwork */
  --ink: #0a3041;        /* deep navy-teal text */
  --teal: #085a75;       /* logo ring + "Critter" */
  --green: #3f9414;      /* "Bright" */
  --green-soft: #dee5c3; /* sage, matched to the header art */
  --sun: #fdc526;        /* logo sun */
  --sun-soft: #fff4cc;
  --orange: #f28c1e;     /* frog feet */
  --sky-soft: #e0eff4;
  --muted: #3f5560;
  --line: #e4e6dc;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(10, 48, 65, 0.1);
  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--teal);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.site-header {
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.35rem;
}


.brand-logo { height: 64px; width: auto; margin: 6px 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 6px 12px;
  font: 600 1rem var(--font-head);
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.site-nav a:hover { background: var(--green-soft); }
.site-nav a[aria-current="page"] { background: var(--teal); color: #fff; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 2px solid var(--line);
    padding: 8px 16px 16px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font: 600 1.05rem var(--font-head);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--ink); }
.btn-primary { background: var(--sun); color: var(--ink); }
.btn-secondary { background: var(--paper); color: var(--ink); }

/* ===== Hero ===== */
.hero {
  display: flex;
  align-items: center;
  min-height: clamp(520px, 56.25vw, 820px); /* matches the art's 16:9 shape */
  padding: 72px 0;
  /* the art keeps a calm open clearing on the right for the logo */
  background: var(--green-soft) url("../images/art/hero.webp") center / cover no-repeat;
}
/* soft sage panel keeps the text readable over the leaves */
.hero-inner {
  background: rgba(222, 229, 195, 0.9);
  border-radius: 28px;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 40px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.hero-logo {
  width: 100%;
  max-width: clamp(220px, 22vw, 340px);
  height: auto;
  justify-self: center;
  translate: -2vw -1.5vw; /* sit in the centre of the art's clearing */
  filter: drop-shadow(0 10px 22px rgba(10, 48, 65, 0.22));
}
@media (max-width: 760px) {
  .hero {
    min-height: 0;
    padding: 40px 0 56px;
    /* fade the art a little so the text stays easy to read */
    background:
      linear-gradient(rgba(222, 229, 195, 0.6), rgba(222, 229, 195, 0.6)),
      var(--green-soft) url("../images/art/hero.webp") 85% center / cover no-repeat;
  }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-logo { max-width: 210px; order: -1; translate: none; }
}

/* Soft green band to set sections apart */
.tint { background-color: var(--green-soft); }

/* Animal stickers */
.sticker {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(10, 48, 65, 0.18));
  pointer-events: none;
}
.sticker.tilt-left { transform: rotate(-7deg); }
.sticker.tilt-right { transform: rotate(7deg); }

/* Book pages: a small sticker in the top-right corner */
.with-sticker { position: relative; }
.with-sticker > .sticker { top: 24px; right: clamp(8px, 3vw, 48px); width: clamp(84px, 11vw, 140px); }
@media (min-width: 821px) {
  .book-info { padding-right: clamp(0px, 9vw, 140px); }
}
@media (max-width: 820px) {
  .with-sticker > .sticker { top: 12px; width: 72px; }
}
.hero p { font-size: 1.2rem; color: var(--muted); margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head p { color: var(--muted); margin: 0; }

/* Category cards on home page */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.category-card {
  position: relative;
  display: block;
  padding: 28px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.category-card:hover { transform: translateY(-4px); box-shadow: 0 6px 0 var(--ink); }
.category-card p { margin: 0 0 16px; color: var(--muted); }
.category-card h3 { padding-right: 72px; }
.category-card .sticker { top: -50px; right: -12px; width: 96px; }
.category-grid { padding-top: 28px; row-gap: 48px; }
.category-card .go { font-weight: 800; }
.category-card { background: var(--paper); border-top-width: 8px; }
.category-card.books { border-top-color: var(--green); }
.category-card.coloring { border-top-color: var(--teal); }
.category-card.activity { border-top-color: var(--sun); }

.about { background: var(--paper); }
.about .container { position: relative; padding-right: clamp(16px, 22vw, 260px); }
.about .sticker { right: 16px; top: 50%; translate: 0 -50%; width: clamp(90px, 15vw, 180px); }
.about p { max-width: 680px; color: var(--muted); }

/* ===== Page header for category pages ===== */
.page-head {
  position: relative;
  overflow: hidden;
  padding: 64px 0 56px;
  border-bottom: 6px solid var(--green);
}
.page-head p { color: var(--muted); margin: 0; max-width: 560px; }
.page-head .container { position: relative; padding-right: clamp(110px, 22vw, 280px); }
.page-head .sticker { right: 16px; top: 50%; translate: 0 -50%; width: clamp(96px, 16vw, 190px); }
.page-head.books { border-bottom-color: var(--green); }
.page-head.coloring { border-bottom-color: var(--teal); }
.page-head.activity { border-bottom-color: var(--sun); }

/* ===== Book cover grid ===== */
.book-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px;
}
.book-tile {
  position: relative;
  text-decoration: none;
  display: block;
}
/* "Coming soon" tag sitting on the cover's bottom edge */
.book-tile .cover-wrap { position: relative; }
.soon-ribbon {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: -14px;
  translate: -50% 0;
  white-space: nowrap;
  padding: 5px 16px;
  background: var(--orange);
  color: #fff;
  font: 600 0.9rem var(--font-head);
  letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(10, 48, 65, 0.25);
}
.book-tile:hover .soon-ribbon { transform: translateY(-6px); transition: transform 0.2s ease; }
.book-tile .cover-wrap + h3 { margin-top: 24px; }
.soon-note {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--sun-soft);
  border: 2px dashed var(--orange);
  font-weight: 700;
}
.book-tile img {
  width: 100%;
  height: auto; /* keep each cover's own shape */
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--line);
}
.book-tile:hover img,
.book-tile:focus-visible img {
  transform: translateY(-6px) rotate(-1.5deg);
  box-shadow: 0 14px 28px rgba(26, 26, 26, 0.16);
}
.book-tile h3 { margin: 14px 0 2px; font-size: 1.1rem; }

.empty-note { color: var(--muted); }

/* ===== Book detail page ===== */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.book-detail {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
@media (max-width: 820px) {
  .book-detail { grid-template-columns: 1fr; gap: 32px; }
}

.gallery-main {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--line);
  cursor: zoom-in;
  padding: 0;
  border: 0;
  width: 100%;
}
.gallery-main img { width: 100%; height: auto; background: #fff; }

/* Gray arrows over the big picture (and in the enlarged view) */
.gallery-stage { position: relative; }
.gallery-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(55, 55, 55, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7), 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.gallery-arrow:hover,
.gallery-arrow:focus-visible { background: rgba(40, 40, 40, 0.88); }
.gallery-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }

.gallery-thumbs[hidden] { display: none; }
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.thumb {
  padding: 0;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
}
.thumb img { width: 100%; height: auto; }
.thumb[aria-pressed="true"] { border-color: var(--orange); }
.thumb:hover { border-color: var(--green); }
.thumb-label {
  display: block;
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
  margin-top: 4px;
}

.book-info .author { margin: -4px 0 16px; font-weight: 700; color: var(--muted); }
.book-info .blurb { font-size: 1.1rem; margin: 0 0 24px; }
.book-info .highlights-title { font-size: 1.15rem; margin: 0 0 10px; }
.book-info .highlights { margin: 0 0 28px; padding-left: 1.25em; }
.book-info .highlights li { margin-bottom: 6px; }
.book-info .highlights li::marker { color: var(--green); }

/* ===== Lightbox ===== */
.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 720px);
  max-height: 92vh;
}
.lightbox::backdrop { background: rgba(26, 26, 26, 0.75); }
.lightbox img { max-height: calc(92vh - 72px); /* leaves room for the Close button */ width: auto; margin: 0 auto; border-radius: 10px; background: #fff; }
.lightbox-close {
  display: block;
  margin: 10px auto 0;
  background: var(--paper);
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  margin-top: min(33.5vw, 720px); /* room for the jungle strip */
  background: var(--teal);
  padding: 28px 0 32px;
  color: var(--paper);
  font-size: 0.95rem;
}
/* Jungle foliage growing up from the footer */
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 2px);
  height: min(33.5vw, 720px); /* the art's own 3:1 shape */
  /* anchored to the top so the treetops and butterfly never get cut off;
     on very wide screens any extra is trimmed from the leaves at the bottom */
  background: url("../images/art/footer-jungle.webp") center top / cover no-repeat;
  pointer-events: none;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.site-footer nav a { margin-right: 16px; text-decoration: none; font-weight: 700; }
.site-footer nav a:hover { text-decoration: underline; }
