/* The Life of (a boy called) Clive — site stylesheet
   Palette + type taken from the book cover: warm cream paper, hand-drawn
   brown ink, golden title lettering, wood crate tan, red wellington boots.
   Colour + font tokens come from source/global.json via the <style id="tokens">
   block; the fallbacks below keep this sheet standalone-viewable. */

:root {
  --paper: #FBF5E9;
  --paper-2: #F5E9D2;
  --paper-3: #EFDFC0;
  --ink: #3B2E26;
  --ink-soft: #6B5647;
  --gold: #F0B02E;
  --gold-dark: #D2901A;
  --wood: #B9793F;
  --wood-light: #DCA96B;
  --red: #D14A32;
  --denim: #7FA7C4;
  --grass: #93A96A;

  --font-heading: 'Baloo 2', 'Trebuchet MS', Verdana, sans-serif;
  --font-body: 'Nunito', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;

  --measure: 1160px;
  --radius: 18px;
  --shadow-soft: 0 10px 30px rgba(59, 46, 38, 0.12);
  --shadow-lift: 0 18px 42px rgba(59, 46, 38, 0.2);
}

/* ---------------------------------------------------------------- base --- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--wood); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .5em;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.container {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
  font-weight: 700; z-index: 999;
}
.skip-link:focus { left: 0; top: 0; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------- buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.6rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 4px 0 var(--ink);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }

.btn-primary { background: var(--red); color: #FFF6EE; }
.btn-primary:hover { background: #E15841; color: #FFF6EE; }

.btn-outline-light { background: var(--paper); color: var(--ink); }
.btn-outline-light:hover { background: var(--gold); color: var(--ink); }

.btn-ico { width: 1.05em; height: 1.05em; }

/* -------------------------------------------------------------- header --- */

/* This is a single-page book site with no navigation, so the shared site
   header is hidden. layout.mjs always renders it; hiding it here keeps the
   change scoped to this site rather than touching the shared shell. The page
   opens straight into the hero, which carries the title lockup. */
.site-header { display: none; }

/* --------------------------------------------------------------- bands --- */

/* Every block renders as <section class="blk bk-{id}"> with its background
   painted inline from the block's settings. The band owns vertical rhythm. */
.blk { padding: clamp(3.25rem, 7vw, 5.75rem) 0; }
.blk-inner > section { padding: 0; }

/* ---------------------------------------------------------------- hero --- */

.bk-hero { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }

/* The two hero children each carry their own .container, which would indent
   them twice. Constrain the row once here and let the children run full width
   inside it. */
.bk-hero > .blk-inner {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
  align-items: center;
}
.bk-hero .container { width: 100%; margin-inline: 0; }

/* Copy gets a little more room than the cover. */
.bk-hero > .blk-inner > .bk-hero-copy { flex: 1.15 1 300px; }
.bk-hero > .blk-inner > .bk-hero-cover { flex: .85 1 260px; }

.hero {
  position: relative;
  display: flex;
  align-items: center;
}
.hero .hero-image { display: none; }
.hero .container.hero-inner { width: 100%; padding: 0; }

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  margin-bottom: .35em;
  color: var(--ink);
  text-wrap: balance;
}
/* "(a boy called) Clive" — the gold line of the cover lockup. */
.hero h1 br + * { display: inline; }

.hero .hero-sub {
  font-family: var(--font-hand);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.25;
  color: var(--wood);
  margin-bottom: 1.5rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

/* Book cover — the cards element renders its "scene" variant (image, no
   caption) for a single image item. Strip the tile chrome and present the
   cover as a physical book, tilted and lifted off the page. */
.bk-hero-cover .scene-grid { display: block; }
.bk-hero-cover .scene-card {
  position: relative;
  margin: 0 auto;
  max-width: 420px;
  transform: rotate(-2.5deg);
  transition: transform 350ms ease;
}
.bk-hero-cover .scene-card:hover { transform: rotate(0deg) scale(1.02); }
.bk-hero-cover .scene-card h3 { display: none; }
.bk-hero-cover .scene-img {
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-lift);
  background: #fff;
}
.bk-hero-cover .scene-img img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

@media (max-width: 780px) {
  .bk-hero > .blk-inner { flex-direction: column; }
  .bk-hero > .blk-inner > .bk-hero-cover { order: -1; }
  .bk-hero-cover .scene-card { max-width: 300px; }
  .hero { min-height: 0 !important; }
  .hero .hero-copy { text-align: center; }
  .hero-ctas { justify-content: center; }
}

/* ------------------------------------------------------- content blocks --- */

.content .section-head { margin: 0; }
.content .section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: .5em;
  text-wrap: balance;
}
.content .section-head > p {
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.3;
  color: var(--wood);
  margin-bottom: 1.2em;
}
.content .section-head > div { font-size: 1.06rem; }
.content .section-head > div p { max-width: 68ch; }

.content-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.75rem;
}

/* The story band: book copy on the left, the inside-cover line art on the
   right. Same double-container fix as the hero. */
.bk-story > .blk-inner {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
  align-items: center;
}
.bk-story .container { width: 100%; margin-inline: 0; }
.bk-story > .blk-inner > .bk-story-el { flex: 1.25 1 320px; }
.bk-story > .blk-inner > .bk-story-art { flex: .75 1 260px; }

.bk-story-el .section-head { max-width: 62ch; }

/* The artwork is black line work on a white field. multiply drops the white
   into the cream page so it reads as printed on the paper, not pasted onto it. */
.bk-story-art .scene-grid { display: block; }
.bk-story-art .scene-card { margin: 0; }
.bk-story-art .scene-card h3 { display: none; }
.bk-story-art .scene-img img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@media (max-width: 780px) {
  .bk-story > .blk-inner { flex-direction: column; }
  .bk-story-art { max-width: 420px; margin-inline: auto; }
}

/* ----------------------------------------------------------- adventures --- */

/* The cards element renders its "why" variant (no images) as a text grid. */
.bk-adventures-head .section-head { text-align: center; }
.bk-adventures-head .section-head > p { margin-bottom: 0; }
.bk-adventures-head .section-head > div p { margin-inline: auto; }

.why .why-inner { padding: 0; }
.why-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .why-grid { grid-template-columns: repeat(4, 1fr); } }

.why-grid li {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-soft);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
/* A gentle scrapbook tilt, alternating down the row. */
.why-grid li:nth-child(odd) { transform: rotate(-1.1deg); }
.why-grid li:nth-child(even) { transform: rotate(1deg); }
.why-grid li:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.why-grid h3 {
  font-family: var(--font-hand);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: .25em;
}
.why-grid p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- wonder --- */

/* Gold band carrying the back-cover hook. */
.bk-wonder .section-head { text-align: center; max-width: 60ch; margin-inline: auto; }
.bk-wonder .section-head h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
}
.bk-wonder .section-head > div p { margin-inline: auto; }
.bk-wonder .section-head > div strong {
  display: inline-block;
  margin-top: .4em;
  font-family: var(--font-heading);
  font-size: 1.35rem;
}
.bk-wonder .content-ctas { justify-content: center; }
.bk-wonder .btn-primary { border-color: var(--ink); }

/* --------------------------------------------------------------- praise --- */

/* The reviews element ships its own dark-surface CSS, so this band is dark.
   These overrides only warm it up to the book's palette. */
.bk-praise { color: var(--paper); }
.bk-praise .section-head { text-align: center; }
.bk-praise .section-head h2 { color: var(--paper); }
.bk-praise .section-head > p { color: var(--gold); margin-bottom: 0; }

/* The reviews element is built as an infinite marquee. Three short endorsements
   read better held still, so the strip is pinned into a static centred row:
   the loop's duplicate set is aria-hidden, which makes it safe to drop.
   NOTE: the element injects its own <style> AFTER this sheet's <link>, so every
   override below is qualified with .reviews to out-specify `.reviews .x`. */
.reviews.bk-praise-el .reviews-frame {
  border: 0;
  overflow: visible;
}
.reviews.bk-praise-el .reviews-frame::after { display: none; }
.reviews.bk-praise-el .reviews-strip {
  width: 100%;
  padding: 0;
  transform: none !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}
.reviews.bk-praise-el .review-card[aria-hidden="true"] { display: none; }

.reviews.bk-praise-el .review-card {
  flex: 1 1 280px;
  width: auto;
  max-width: 360px;
  background: rgba(255, 246, 238, 0.06);
  border: 2px solid rgba(240, 176, 46, 0.28);
  border-radius: var(--radius);
}
.reviews.bk-praise-el .review-author {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold);
  white-space: normal;
}
.reviews.bk-praise-el .review-stars { color: var(--gold); }
.reviews.bk-praise-el .review-text {
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.35;
  color: var(--paper);
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
/* The author's joke "corrections" on the back cover. */
.reviews.bk-praise-el .review-text s {
  color: rgba(251, 245, 233, 0.5);
  text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------------ buy --- */

.bk-buy .section-head { text-align: center; }
.bk-buy .section-head > p { margin-bottom: 0; }

.bk-buy-el .content-ctas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 940px;
  margin-inline: auto;
  margin-top: 2rem;
}
@media (min-width: 720px) {
  .bk-buy-el .content-ctas { grid-template-columns: repeat(2, 1fr); }
}
.bk-buy-el .content-ctas .btn { width: 100%; }

/* A retailer link with no URL yet still renders; make that obvious in-page
   rather than shipping a silently dead button. */
.bk-buy-el .content-ctas .btn[href=""] {
  background: var(--paper-2);
  color: var(--ink-soft);
  border-style: dashed;
  box-shadow: none;
  pointer-events: none;
}
.bk-buy-el .content-ctas .btn[href=""]::after {
  content: ' (link coming soon)';
  font-size: .8em;
  opacity: .8;
}

/* -------------------------------------------------------------- footer --- */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--ink);
  padding: clamp(2.5rem, 5vw, 4rem) 0 0;
}

.footer-grid {
  display: grid;
  gap: 2.25rem;
  grid-template-columns: 1fr;
  padding-bottom: 2.5rem;
}
@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}

.footer-brand-icon { width: 72px; height: 72px; }
.footer-brand {
  font-size: 1.5rem;
  color: var(--gold);
  margin: .6rem 0 .4rem;
}
/* The shared footer hardcodes an "Order Online" button; this site lists its
   retailers in the "Where to buy" column instead. */
.footer-cta { display: none; }

.site-footer h4 {
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: .7rem;
}
.footer-list { display: grid; gap: .45rem; }
.footer-list a {
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
}
.footer-list a:hover { color: var(--gold); text-decoration: underline; }
/* Retailer links awaiting a URL. */
.footer-list a[href=""] { opacity: .45; pointer-events: none; }

.footer-bottom {
  border-top: 2px solid rgba(251, 245, 233, 0.18);
  padding: 1.25rem 0 1.5rem;
}
.footer-bottom p {
  margin: 0;
  font-size: .92rem;
  color: rgba(251, 245, 233, 0.7);
}

/* ------------------------------------------------------------- motion --- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .why-grid li:nth-child(odd),
  .why-grid li:nth-child(even),
  .bk-hero-cover .scene-card { transform: none; }
}
