/* Omar's World — one stylesheet for every page.
   The palette is taken from the books themselves: the cover's green title band (measured
   from the-big-show-kindle-cover.jpg: #6a9929), Book 1's sky, Book 2's blue mat, the red
   mittens and Omar's yellow shirt. Andika is the face the books are set in. */

:root {
  /* color tokens */
  --band: #6a9929;          /* the cover title band — identity, large type only */
  --band-deep: #3d5e14;     /* nav strip + green text on light (7.4:1 on white) */
  --sky: #e8f2fa;           /* page background, Book 1's sky lightened */
  --page: #ffffff;          /* cards: a book page */
  --ink: #1d2433;           /* body text */
  --ink-soft: #4a5263;      /* secondary text (7.6:1 on white) */
  --mat: #2c54b0;           /* links, secondary buttons — Book 2's mat */
  --mitten: #c2362a;        /* buy buttons — the red mittens (5.4:1 with white) */
  --sun: #f6c445;           /* stickers — Omar's yellow shirt */
  --cream: #fffbef;         /* text on the band, as on the covers */

  /* type */
  --display: "Andika", system-ui, sans-serif;
  --body: "Andika", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* spacing: 8px rhythm */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px;
  --radius: 20px;
  --press: cubic-bezier(.34, 1.56, .64, 1);   /* a little spring */
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* The tilted covers round to 1px wider than a phone screen. `overflow-x: clip` on
     BODY alone never stopped that — the scroll container is the root element, so the
     page really did slide 1px sideways at 375 and 390 px. Measured 2026-10-11 on the
     unchanged pages, so it predates the workbooks shelf. Clip at the root as well. */
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;   /* the tilted covers round to 1px wider than a phone screen; never scroll sideways */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mat); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--page); color: var(--ink); padding: var(--s1) var(--s2); border-radius: 10px;
}
.skip:focus { top: var(--s2); }

.wrap { width: min(100% - 2 * var(--s2), 1080px); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--s2), 680px); margin-inline: auto; }

/* ── the nav strip, above the band ─────────────────────────────── */
.topbar { background: var(--band-deep); }
.topbar nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2);
  padding-block: var(--s1);
}
.topbar .home {
  font: 700 1.2rem/1 var(--display); color: var(--cream); text-decoration: none;
  margin-right: auto; padding: 12px 0;
}
.topbar ul { display: flex; flex-wrap: wrap; gap: 0 var(--s1); margin: 0; padding: 0; list-style: none; }
.topbar ul a {
  display: inline-block; padding: 12px 10px; min-height: 44px;
  color: var(--cream); text-decoration: none; font-weight: 700; font-size: 1rem;
  border-radius: 10px;
}
.topbar ul a:hover { background: rgba(255, 251, 239, .12); }
.topbar ul a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.topbar :focus-visible { outline-color: var(--cream); }

/* ── THE BAND: every page opens the way the books do ───────────── */
.band {
  background: var(--band);
  color: var(--cream);
  padding-block: var(--s6) var(--s8);
  text-align: center;
}
.band h1 {
  font: 700 clamp(3rem, 13vw, 7.5rem)/.95 var(--display);
  margin: 0; letter-spacing: -.01em;
}
.band p {
  /* cream on the band is 3.27:1 — passes only as LARGE text, so this line stays bold and
     >= 1.2rem (19.2px bold counts as large under WCAG). Do not make it thinner or smaller. */
  font: 700 clamp(1.2rem, 3.6vw, 1.5rem)/1.4 var(--display);
  margin: var(--s2) auto 0; max-width: 32ch; color: var(--cream);
}
.band.has-shelf { padding-bottom: 150px; }   /* room for the covers to hang over the edge */

/* ── the shelf: covers standing on the band's bottom edge ──────── */
.shelf {
  display: grid; gap: var(--s6) var(--s4);
  grid-template-columns: 1fr;
  margin-top: -120px;             /* pulls the covers up across the band's edge */
  padding-bottom: var(--s6);
}
@media (min-width: 720px) { .shelf { grid-template-columns: 1fr 1fr; } }

.book-card { text-align: center; }
.cover-link {
  display: block; position: relative; margin-inline: auto; max-width: 400px;
  border-radius: 8px; text-decoration: none;
  transition: transform .25s var(--press);
}
.cover-link img {
  border-radius: 8px; width: 100%; aspect-ratio: 1;
  box-shadow: 0 2px 0 rgba(29, 36, 51, .08), 0 14px 30px rgba(29, 36, 51, .22);
}
.book-card:nth-child(odd) .cover-link { transform: rotate(-1.5deg); }
.book-card:nth-child(even) .cover-link { transform: rotate(1.5deg); }
a.cover-link:hover, a.cover-link:focus-visible { transform: rotate(0) translateY(-6px); }

/* PORTRAIT COVERS (the Beautiful Words workbooks, 8.5 x 11). The story books are square,
   so .cover-link img forces aspect-ratio 1; these are 773 x 1000. The cover is capped
   NARROWER than a square one so the two shelves stand the same height on the page, and
   the cap is a max-width, never a fixed width — on a phone the cover is whatever the wrap
   gives it and nothing can push the page sideways. */
.book-card.portrait .cover-link { max-width: 330px; }
.book-card.portrait .cover-link img { aspect-ratio: 8.5 / 11; }

/* a shelf that does NOT hang off the band: the workbooks shelf, and any shelf after the
   first one on a page */
.shelf.standalone { margin-top: 0; }
.shelf-head { text-align: center; }
.shelf-head h2 { font: 700 clamp(1.6rem, 4.5vw, 2.2rem)/1.2 var(--display); margin: 0 0 var(--s1); }
.shelf-head p { color: var(--ink-soft); margin: 0 auto; max-width: 46ch; font-size: 1.05rem; }

.sticker {
  position: absolute; top: -14px; right: -10px; z-index: 1;
  background: var(--sun); color: var(--ink);
  font: 700 1rem/1 var(--display);
  padding: 12px 14px; border-radius: 999px; transform: rotate(8deg);
  box-shadow: 0 3px 0 rgba(29, 36, 51, .18);
}

.book-card h2 { font: 700 clamp(1.5rem, 4vw, 1.9rem)/1.2 var(--display); margin: var(--s3) 0 0; }
.book-card h2 a { color: var(--ink); text-decoration: none; }
.book-card h2 a:hover { text-decoration: underline; }
.meta { color: var(--ink-soft); margin: 4px 0 0; font-size: 1rem; }

/* ── buttons: soft and a little squishy ────────────────────────── */
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--s2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: 700 1.05rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  background: var(--mitten); color: #fff; border: 0;
  box-shadow: 0 4px 0 #8c2219;
  transition: transform .15s var(--press), box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #8c2219; }
.btn:active { transform: translateY(3px) scale(.97); box-shadow: 0 1px 0 #8c2219; }
.btn.alt { background: var(--page); color: var(--mat); box-shadow: inset 0 0 0 2px var(--mat), 0 4px 0 #b9c7e6; }
.btn.alt:hover { box-shadow: inset 0 0 0 2px var(--mat), 0 6px 0 #b9c7e6; }
.btn.alt:active { box-shadow: inset 0 0 0 2px var(--mat), 0 1px 0 #b9c7e6; }
.btn.soon {
  background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 2px #c3cad6;
  cursor: default; font-weight: 400;
}
.btn.soon:hover, .btn.soon:active { transform: none; box-shadow: inset 0 0 0 2px #c3cad6; }

/* ── sections below the shelf ──────────────────────────────────── */
.section { padding-block: var(--s3); }
.section h2 { font: 700 clamp(1.6rem, 4.5vw, 2.2rem)/1.2 var(--display); margin: 0 0 var(--s2); }
.card {
  background: var(--page); border-radius: var(--radius);
  padding: clamp(var(--s3), 5vw, var(--s6));
  box-shadow: 0 2px 0 rgba(29, 36, 51, .05), 0 10px 30px rgba(29, 36, 51, .07);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.facts { display: grid; gap: var(--s2); grid-template-columns: 1fr; padding: 0; margin: var(--s3) 0 0; list-style: none; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts li { background: var(--sky); border-radius: 14px; padding: var(--s2) var(--s3); }
.facts b { display: block; font: 700 1.25rem/1.3 var(--display); color: var(--band-deep); }

/* the mailing list */
.signup { background: var(--mat); color: #fff; }
.signup h2 { color: #fff; }
.signup a { color: #fff; }
.signup p { max-width: 46ch; }

/* ── a single book page ────────────────────────────────────────── */
.book-hero { display: grid; gap: var(--s4); align-items: start; margin-top: -120px; }
@media (min-width: 820px) { .book-hero { grid-template-columns: 5fr 6fr; margin-top: -120px; } }
.book-hero .cover-link { transform: rotate(-1.5deg); max-width: 440px; }
.book-hero .card { margin-top: 0; }
@media (min-width: 820px) { .book-hero .card { margin-top: 150px; } }
.blurb-hook { font: 700 1.35rem/1.35 var(--display); }
.details { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s3); margin: var(--s3) 0; }
.details dt { font-weight: 700; }
.details dd { margin: 0; }
.book-hero .buttons { justify-content: flex-start; }

.prose { font-size: 1.15rem; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin-top: var(--s6); }

/* ── footer ────────────────────────────────────────────────────── */
footer { background: var(--band-deep); color: var(--cream); padding-block: var(--s4); margin-top: var(--s6); }
footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; justify-content: space-between; }
footer a { color: var(--cream); }
footer p { margin: 0; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .book-card .cover-link, .book-hero .cover-link { transform: none; }
}
.more { margin: var(--s3) 0 0; }
.card h2 { font: 700 clamp(1.4rem, 4vw, 1.8rem)/1.2 var(--display); margin: var(--s3) 0 var(--s1); }
.card ul { padding-left: 1.2em; }
.card li { margin-bottom: 6px; }

/* ── text pages (about, parents & teachers, activities) ────────── */
.band:not(.has-shelf) { padding-bottom: 88px; }
.page-body { margin-top: -48px; padding-bottom: var(--s6); }
.page-body .card + .card { margin-top: var(--s3); }
.prose h2:first-child { margin-top: 0; }
.idea { background: var(--sky); border-left: 6px solid var(--sun); border-radius: 12px; padding: var(--s2) var(--s3); margin: var(--s2) 0; }
.idea b { font-family: var(--display); }

/* the free printable card: a sunny edge so it stands out from the plain cards */
.printable { border-left: 8px solid var(--sun); }
.printable .buttons { justify-content: flex-start; }

/* a buy row inside a long card of prose: aligned with the text, not centered */
.buttons.buy { justify-content: flex-start; }

/* the sign-up form in the free printables card (added 2026-10-05, the MailerLite gate) */
.gate { margin-top: var(--s3); }
.gate > label:first-child { display: block; font-weight: 700; margin-bottom: var(--s1); }
.gate-row { display: flex; flex-wrap: wrap; gap: 12px; }
.gate input[type="email"] {
  flex: 1 1 260px; min-height: 48px; padding: 10px 16px;
  font: 400 1.05rem/1.2 var(--body); color: var(--ink);
  border: 2px solid #c3cad6; border-radius: 999px; background: var(--page);
}
.gate input[type="email"]:focus-visible { border-color: var(--mat); }
.gate-check { display: flex; gap: 10px; align-items: center; margin-bottom: var(--s2); font-size: 1rem; }
.gate-check input { width: 22px; height: 22px; accent-color: var(--band-deep); flex: none; }
.gate-small { color: var(--ink-soft); font-size: .95rem; margin: var(--s2) 0 0; max-width: 60ch; }
.gate-done { margin-top: var(--s3); padding: var(--s3); border-radius: 14px; background: #eef6e3; }
.gate-done h3 { margin: 0 0 var(--s1); font: 700 1.3rem/1.2 var(--display); color: var(--band-deep); }
.gate-done p { margin: 0 0 var(--s1); }
.gate-error { margin-top: var(--s2); color: var(--mitten); font-weight: 700; }
