/* ==========================================================================
   "storybook" — The Color Rap Book (thecolorrapbook.com)

   Designed for a children's book by a kindergarten teacher: cream paper, big
   rounded corners, chunky sticker buttons, primary colours that take turns
   the way crayons do, and the collage art shown large and undimmed. Playful
   but grown-up — a children's publisher, not a daycare.

   Same block markup and behaviour script as every site on the CMS; none of
   the design. See render/theme.js for why a site gets its own stylesheet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --navy:    #1c2340;
  --navy-2:  #161c34;
  --cream:   #fffdf7;
  --butter:  #fff3cf;
  --sky:     #2a6fdb;
  --cherry:  #e63b2e;
  --sun:     #f7c948;
  --leaf:    #3aa66b;
  --grape:   #7a5af5;

  /* The names the shared markup and token layer already use. */
  --blue:        var(--sky);
  --blue-lit:    #7fb0ff;
  --red:         var(--cherry);
  --red-lit:     #ff7b6e;
  --blue-rgb:    42, 111, 219;
  --blue-lit-rgb: 127, 176, 255;
  --red-rgb:     230, 59, 46;
  --red-lit-rgb: 255, 123, 110;
  --ink:         var(--navy);
  --ink-2:       var(--navy-2);
  --ink-3:       #242c4f;
  --ink-4:       #2d365c;
  --paper:       var(--cream);
  --paper-2:     var(--butter);
  --paper-3:     #f5edd3;

  --text-dark:   var(--navy);
  --text-mid:    #565c74;
  --text-light:  rgba(255, 253, 247, 0.82);
  --text-faint:  rgba(255, 253, 247, 0.58);
  --rule-dark:   rgba(255, 253, 247, 0.16);
  --rule-light:  rgba(28, 35, 64, 0.14);
  --line:        var(--navy);

  --font-display: "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:    "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    var(--font-body);
  /* The book's own hand — see the @font-face note below for where it is used
     and, more importantly, where it is not. */
  --font-title:   "Morgan", "Fredoka", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --t-hero:  clamp(2.6rem, 1.4rem + 4.2vw, 5rem);
  --t-h1:    clamp(2.2rem, 1.4rem + 3vw, 4rem);
  --t-h2:    clamp(1.8rem, 1.3rem + 1.9vw, 2.8rem);
  --t-h3:    clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --t-h4:    1.0625rem;
  --t-body:  clamp(1.0625rem, 1rem + 0.2vw, 1.15rem);
  --t-lead:  clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  --t-small: 0.9rem;
  --t-label: 0.8rem;

  --gutter:    clamp(1.25rem, 4vw, 3rem);
  --measure:   1200px;
  --measure-narrow: 720px;
  --section-y: clamp(3.75rem, 8vw, 7rem);

  --radius:    14px;
  --radius-lg: 28px;
  --shadow-card: 6px 6px 0 var(--sun);
  --shadow-lift: 10px 10px 0 var(--sun);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 88px;
}
@media (max-width: 900px) { :root { --header-h: 70px; } }

/* --------------------------------------------------------------------------
   1b. Morgan — the book's own hand

   Drawn by Matt Smith's son and used inside The Color Rap Book, so the site
   is set in it too. Shipped from themes/storybook/assets/ by themeAssets()
   in render/theme.js; no other site loads it.

   ⚠ IT HOLDS 72 GLYPHS: A-Z a-z 0-9 space . , ' ! ?  — AND NOTHING ELSE.
   No hyphen, colon, ampersand, parentheses, slash, or the curly ’ that a
   CMS heading is typed with. A browser falls back PER CHARACTER, so
   "Teacher’s Packet" draws the apostrophe in Fredoka mid-word and
   "spelled R-E-D" draws every hyphen in it. That is why this face is on the
   big headings ONLY, where an occasional heavier mark reads as punctuation,
   and never on nav, buttons, chips, labels or numbers — those are short,
   small, and full of the punctuation it lacks.

   ⚠ ONE WEIGHT, DECLARED AS A RANGE. The file is a single hand-drawn
   weight; `font-weight: 400 700` claims the whole range so a heading asking
   for 600 gets these outlines rather than a browser-smeared faux bold, which
   on a thin hand font turns to mud.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Morgan";
  src: url("../fonts/morgan-bold.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  /* The heading is readable in Fredoka from the first paint and re-draws when
     Morgan arrives; a blank heading is worse than the fallback. */
  font-display: swap;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--sky); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
h1, h2, h3, h4, .h-hero, .h1, .h2, .h3, .h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
  color: inherit;
  margin: 0 0 0.55em;
  text-wrap: balance;
}
/* The book's hand on the big headings only — see the @font-face note. Morgan
   has a smaller x-height and finer strokes than Fredoka, so it reads quieter
   at the same size; that is the intended effect at hero and section size and
   the reason it is kept off anything small. */
h1, h2, .h-hero, .h1, .h2 { font-family: var(--font-title); }
.h-hero { font-size: var(--t-hero); line-height: 1.02; }
.h1 { font-size: var(--t-h1); }
.h2 { font-size: var(--t-h2); }
.h3 { font-size: var(--t-h3); }
.h4 { font-size: var(--t-h4); }
h3 { font-size: var(--t-h3); }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 200; padding: 0.7rem 1rem; background: var(--navy); color: #fff; border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--measure-narrow); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.5); }
.section--tone  { background: var(--butter); }
.section--dark  { background: var(--navy); color: var(--text-light); }
.section--dark2 { background: var(--navy-2); color: var(--text-light); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4,
.section--dark2 h1, .section--dark2 h2, .section--dark2 h3, .section--dark2 h4 { color: #fff; }
.section--dark a, .section--dark2 a { color: #fff; }
.section--dark .rule-top, .section--dark2 .rule-top { border-color: var(--rule-dark); }

/* --------------------------------------------------------------------------
   4. Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin: 0 0 1rem;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.02em; color: var(--sky);
}
/* A crayon dot, a different colour each time it appears down a page. */
.eyebrow::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 999px; background: var(--cherry); flex: none; }
.section:nth-of-type(3n) .eyebrow::before { background: var(--sun); }
.section:nth-of-type(3n + 1) .eyebrow::before { background: var(--leaf); }
.section--dark .eyebrow, .section--dark2 .eyebrow { color: var(--sun); }

.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--text-mid); font-weight: 500; }
.lede { font-size: var(--t-lead); color: var(--text-mid); }
.section--dark .lead, .section--dark2 .lead { color: var(--text-light); }
.muted { color: var(--text-mid); }
.section--dark .muted, .section--dark2 .muted { color: var(--text-faint); }
.rule-top { border-top: 2px dashed var(--rule-light); padding-top: 1.5rem; }

/* --------------------------------------------------------------------------
   5. Buttons — stickers
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--cherry);
  --btn-fg: #fff;
  --btn-shadow: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.55rem;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 2px solid var(--navy);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--btn-shadow);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; text-align: center; overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background 0.15s var(--ease);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--btn-shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--btn-shadow); }
.btn--ghost { --btn-bg: #fff; --btn-fg: var(--navy); }
.btn--ink   { --btn-bg: var(--sun); --btn-fg: var(--navy); }
.section--dark .btn, .section--dark2 .btn { border-color: #fff; --btn-shadow: rgba(255,255,255,0.35); }
.section--dark .btn--ghost, .section--dark2 .btn--ghost { --btn-bg: transparent; --btn-fg: #fff; }
.btn--block { width: 100%; }
.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.95rem; box-shadow: 3px 3px 0 var(--btn-shadow); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem 1rem; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-display); font-weight: 500; color: var(--sky); text-decoration: none;
  background-image: linear-gradient(var(--sun), var(--sun)); background-repeat: no-repeat;
  background-size: 100% 0.45em; background-position: 0 88%;
  transition: background-size 0.2s var(--ease);
}
.link-arrow:hover { background-size: 100% 100%; color: var(--navy); border-radius: 4px; }
.link-arrow .chev { transition: transform 0.22s var(--ease); }
.link-arrow:hover .chev { transform: translateX(4px); }
.section--dark .link-arrow, .section--dark2 .link-arrow { color: #fff; background-image: linear-gradient(var(--grape), var(--grape)); }

/* --------------------------------------------------------------------------
   6. Announcement, header, nav
   -------------------------------------------------------------------------- */
.announce { background: var(--sun); color: var(--navy); font-weight: 700; font-size: 0.95rem; text-align: center; }
.announce--alert { background: var(--cherry); color: #fff; }
.announce__inner { padding-block: 0.6rem; }
.announce a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 2px; }

.topbar { display: none; }

.header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: box-shadow 0.25s var(--ease);
}
/* A crayon rule under the header: four colours, always. */
.header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: linear-gradient(90deg, var(--sky) 0 25%, var(--cherry) 25% 50%, var(--sun) 50% 75%, var(--leaf) 75% 100%);
}
.header.is-stuck { box-shadow: 0 10px 30px -20px rgba(28, 35, 64, 0.35); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--header-h); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 56px; width: auto; transition: height 0.25s var(--ease); }
.header.is-stuck .brand img { height: 48px; }
@media (max-width: 900px) { .brand img, .header.is-stuck .brand img { height: 42px; } }

.nav { display: flex; align-items: center; }
.nav__list { display: flex; align-items: center; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: block; position: relative;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500;
  color: var(--navy); text-decoration: none; white-space: nowrap;
  border-radius: 999px;
  background-image: linear-gradient(var(--sun), var(--sun)); background-repeat: no-repeat;
  background-size: 0 0.5em; background-position: 0.9rem 70%;
  transition: background-size 0.22s var(--ease), color 0.15s var(--ease);
}
.nav__link:hover { background-size: calc(100% - 1.8rem) 0.5em; }
.nav__link[aria-current="page"] { background-size: calc(100% - 1.8rem) 0.5em; }
.nav__link::after { content: none; }

.nav__item--has-menu { position: relative; }
.nav__toggle { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: 0; font: inherit; cursor: pointer; }
.nav__toggle .chev { transition: transform 0.2s var(--ease); }
.nav__item--has-menu.is-open .nav__toggle .chev { transform: rotate(180deg); }
.nav__menu {
  position: absolute; top: calc(100% + 0.6rem); left: 0; min-width: 260px;
  list-style: none; margin: 0; padding: 0.5rem;
  background: #fff; border: 2px solid var(--navy); border-radius: 18px; box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
.nav__item--has-menu.is-open .nav__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav__menu li { margin: 0; }
.nav__menu a { display: block; padding: 0.6rem 0.9rem; border-radius: 12px; color: var(--navy); text-decoration: none; font-weight: 600; }
.nav__menu a:hover { background: var(--butter); }

.header__cta { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.burger { display: none; width: 46px; height: 46px; padding: 0; background: #fff; border: 2px solid var(--navy); border-radius: 999px; cursor: pointer; place-items: center; box-shadow: 3px 3px 0 var(--sun); }
.burger span { display: block; width: 20px; height: 2.5px; margin: 4px auto; background: var(--navy); border-radius: 2px; transition: transform 0.24s var(--ease), opacity 0.18s var(--ease); }
body.nav-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.nav-open .burger span:nth-child(2) { opacity: 0; }
body.nav-open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (max-width: 1080px) { .nav, .header__cta .btn { display: none; } .burger { display: grid; } }

.drawer {
  position: fixed; inset: 0; z-index: 95;
  background: var(--butter);
  padding: calc(var(--header-h) + 1.5rem) var(--gutter) 2rem;
  overflow-y: auto;
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.32s var(--ease), visibility 0.32s;
}
body.nav-open .drawer { transform: translateX(0); visibility: visible; }
.drawer__list { list-style: none; margin: 0 0 2rem; padding: 0; }
.drawer__list a {
  display: flex; align-items: baseline; gap: 0.9rem;
  padding: 0.95rem 0;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  color: var(--navy); text-decoration: none;
  border-bottom: 2px dashed var(--rule-light);
}
.drawer__list a .num { font-size: 0.85rem; font-weight: 600; color: var(--cherry); }
.drawer__list .sub a { font-size: 1.1rem; font-weight: 500; padding-left: 2.4rem; }

.callbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: none; background: #fff; border-top: 2px solid var(--navy); padding-bottom: env(safe-area-inset-bottom); }
.callbar a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.95rem 0.5rem; font-family: var(--font-display); font-weight: 500; color: var(--navy); text-decoration: none; }
.callbar a.is-primary { background: var(--cherry); color: #fff; }
.callbar svg { width: 17px; height: 17px; fill: currentColor; }
@media (max-width: 700px) { .callbar { display: flex; } }

/* --------------------------------------------------------------------------
   7. Hero — a picture-book spread: the art full width, the words on a card
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex; align-items: flex-end;
  min-height: clamp(560px, 84vh, 880px);
  background: var(--butter);
  color: var(--navy);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero__media::after { content: none; }
.hero__inner { position: relative; z-index: 1; width: 100%; padding-block: clamp(2rem, 6vw, 4.5rem); }
.hero__copy {
  max-width: 40rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--cream);
  border: 3px solid var(--navy);
  border-radius: var(--radius-lg);
  box-shadow: 10px 10px 0 var(--sun);
}
.hero .eyebrow { color: var(--cherry); }
.hero .h-hero { margin-bottom: 1rem; color: var(--navy); }
.hero__title-line { display: block; }
/* The highlighted line gets a crayon stroke underneath it. */
.hero__title-line em {
  font-style: normal; color: var(--cherry);
  background-image: linear-gradient(transparent 0 68%, rgba(247, 201, 72, 0.9) 68% 96%, transparent 96%);
  background-repeat: no-repeat;
}
.hero .lead { color: var(--text-mid); margin-bottom: 1.6rem; max-width: 34rem; }
@media (max-width: 700px) {
  .hero { min-height: 0; align-items: stretch; }
  .hero__media { position: relative; aspect-ratio: 4 / 3; }
  .hero { display: block; }
  .hero__inner { padding-block: 0 2.5rem; margin-top: -2.5rem; }
  .hero__copy { max-width: none; box-shadow: 6px 6px 0 var(--sun); }
}

/* Page header: the art as a banner across the top, the heading below it. */
.pagehero { position: relative; display: flex; flex-direction: column-reverse; background: var(--cream); }
.pagehero__inner { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem); }
.pagehero .h1 { max-width: 20ch; }
.pagehero .lead { max-width: 42rem; margin-top: 0.75rem; }
.pagehero__media { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); margin-bottom: clamp(1rem, 3vw, 2rem); }
.pagehero__media img { width: 100%; height: clamp(180px, 30vw, 400px); object-fit: cover; border-radius: var(--radius-lg); border: 3px solid var(--navy); box-shadow: 8px 8px 0 var(--sun); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0 0 1.25rem; padding: 0; font-family: var(--font-display); font-size: 0.95rem; font-weight: 500; color: var(--text-mid); }
.crumbs li { margin: 0; }
.crumbs a { color: var(--sky); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs li + li::before { content: "→"; margin-right: 0.5rem; color: var(--cherry); }

/* --------------------------------------------------------------------------
   8. Figures, logo strip, section heads
   -------------------------------------------------------------------------- */
.statband { background: var(--cream); padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.statband__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(0.9rem, 2vw, 1.5rem); }
.stat {
  padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem); text-align: center;
  border: 2px solid var(--navy); border-radius: var(--radius-lg);
  background: #fff; color: var(--navy);
}
.stat:nth-child(4n + 1) { background: var(--sky); color: #fff; box-shadow: 6px 6px 0 var(--navy); }
.stat:nth-child(4n + 2) { background: var(--sun); box-shadow: 6px 6px 0 var(--navy); }
.stat:nth-child(4n + 3) { background: var(--cherry); color: #fff; box-shadow: 6px 6px 0 var(--navy); }
.stat:nth-child(4n + 4) { background: var(--leaf); color: #fff; box-shadow: 6px 6px 0 var(--navy); }
/* A figure that NAMES a colour is painted that colour — "R-E-D · Red, red,
   red" sat on a blue card until this existed, because the rotation above
   goes by position and position cannot read. Written with the element class
   as well (.stat.stat--red) to match the specificity of the :nth-child rules
   it overrides, and placed after them. */
.stat.stat--blue   { background: var(--sky);    color: #fff;        box-shadow: 6px 6px 0 var(--navy); }
.stat.stat--yellow { background: var(--sun);    color: var(--navy); box-shadow: 6px 6px 0 var(--navy); }
.stat.stat--red    { background: var(--cherry); color: #fff;        box-shadow: 6px 6px 0 var(--navy); }
.stat.stat--green  { background: var(--leaf);   color: #fff;        box-shadow: 6px 6px 0 var(--navy); }
.stat__num { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1; }
.stat__num .unit { opacity: 0.8; }
.statband--labels .stat__num { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.stat__label { display: block; margin-top: 0.55rem; font-size: 0.92rem; font-weight: 600; opacity: 0.9; }
@media (max-width: 780px) { .statband__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.brandstrip { background: var(--cream); padding-block: clamp(2rem, 4vw, 3rem); }
.brandstrip__label { text-align: center; font-family: var(--font-display); font-size: 1rem; font-weight: 500; color: var(--text-mid); margin-bottom: 1.25rem; }
.brandstrip img { margin-inline: auto; max-width: min(360px, 100%); max-height: 220px; width: auto; }

.sechead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.5rem 2.5rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.sechead__text { max-width: 44rem; }
.sechead .lead { margin-top: 0.75rem; }
@media (max-width: 760px) { .sechead { grid-template-columns: 1fr; align-items: start; } }

/* --------------------------------------------------------------------------
   9. Cards, capability list
   -------------------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: clamp(1.5rem, 2.6vw, 2.5rem); }
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--navy); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 6px 6px 0 var(--sun);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.card:nth-child(3n + 2) { box-shadow: 6px 6px 0 var(--sky); }
.card:nth-child(3n) { box-shadow: 6px 6px 0 var(--cherry); }
a.card:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--sun); }
a.card:nth-child(3n + 2):hover { box-shadow: 10px 10px 0 var(--sky); }
a.card:nth-child(3n):hover { box-shadow: 10px 10px 0 var(--cherry); }
.card__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--butter); border-bottom: 2px solid var(--navy); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__tag {
  position: absolute; left: 0.9rem; top: 0.9rem;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  background: var(--cream); color: var(--navy); border: 2px solid var(--navy);
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 500;
}
.card__body { display: flex; flex-direction: column; flex: 1; gap: 0.6rem; padding: clamp(1.25rem, 2vw, 1.75rem); }
.card__body .h3 { margin-bottom: 0.1rem; }
.card__body p { margin: 0; color: var(--text-mid); font-size: 0.98rem; }
.card__body .link-arrow { margin-top: auto; padding-top: 0.75rem; align-self: flex-start; }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: clamp(1.5rem, 2.6vw, 2.5rem); }
.spec { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.1rem 1rem; align-items: start; }
.spec__num {
  grid-row: 1 / span 2;
  display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 999px;
  background: var(--sky); color: #fff; border: 2px solid var(--navy);
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
}
.spec:nth-child(3n + 2) .spec__num { background: var(--cherry); }
.spec:nth-child(3n) .spec__num { background: var(--sun); color: var(--navy); }
.spec__title { font-size: var(--t-h3); margin: 0.35rem 0 0.3rem; }
.spec__body { margin: 0; color: var(--text-mid); font-size: 0.98rem; }
.section--dark .spec__body, .section--dark2 .spec__body { color: var(--text-faint); }

/* --------------------------------------------------------------------------
   10. Photo beside text
   -------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: clamp(2rem, 5vw, 5.5rem); }
.split--flip .split__media { order: 2; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } .split--flip .split__media { order: 0; } }
.split__media { position: relative; overflow: visible; }
.split__media img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius-lg); border: 3px solid var(--navy);
  box-shadow: 10px 10px 0 var(--sun);
  transform: rotate(-1.2deg);
}
.split--flip .split__media img { transform: rotate(1.2deg); box-shadow: -10px 10px 0 var(--sky); }
.framed::before, .framed::after { content: none; }
.section--dark .split__media img { border-color: #fff; }

.checklist { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.checklist li { position: relative; padding-left: 2.2rem; margin-bottom: 0.7rem; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.15em; width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--leaf); border: 2px solid var(--navy); }
.checklist li::after { content: ""; position: absolute; left: 0.45rem; top: 0.5em; width: 0.55rem; height: 0.3rem; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   11. Steps, gallery, lightbox, team
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); counter-reset: step; }
.step {
  position: relative; counter-increment: step;
  padding: 3.4rem 1.5rem 1.5rem;
  background: #fff; border: 2px solid var(--navy); border-radius: var(--radius-lg);
}
.step::before {
  content: counter(step);
  position: absolute; left: 1.25rem; top: -1rem;
  display: grid; place-items: center;
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  background: var(--sun); color: var(--navy); border: 2px solid var(--navy);
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 600;
}
.step:nth-child(4n + 2)::before { background: var(--sky); color: #fff; }
.step:nth-child(4n + 3)::before { background: var(--cherry); color: #fff; }
.step:nth-child(4n + 4)::before { background: var(--leaf); color: #fff; }
.step h3 { font-size: var(--t-h3); margin-bottom: 0.4rem; }
.step p { margin: 0; color: var(--text-mid); font-size: 0.98rem; }
/* Inline points beside a photo share the markup but not the card. */
.split .steps .step { padding: 0 0 0 3.2rem; background: transparent; border: 0; border-radius: 0; }
.split .steps .step::before { left: 0; top: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filter { padding: 0.5rem 1.1rem; border-radius: 999px; cursor: pointer; background: #fff; border: 2px solid var(--navy); color: var(--navy); font: inherit; font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; }
.filter[aria-pressed="true"] { background: var(--navy); color: #fff; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: clamp(1rem, 1.8vw, 1.5rem); }
.shot { position: relative; display: block; padding: 0; background: var(--butter); border: 2px solid var(--navy); border-radius: 20px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.shot--tall { grid-row: span 2; aspect-ratio: 2 / 3; }
@media (max-width: 620px) { .shot--tall { grid-row: span 1; aspect-ratio: 4 / 3; } }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot__cap { position: absolute; inset: auto 0 0 0; padding: 0.7rem 1rem; background: var(--cream); border-top: 2px solid var(--navy); color: var(--navy); font-family: var(--font-display); font-size: 0.95rem; font-weight: 500; text-align: left; }
.shot.is-hidden { display: none; }

.lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); background: rgba(28, 35, 64, 0.94); opacity: 0; visibility: hidden; transition: opacity 0.24s var(--ease), visibility 0.24s; }
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 18px; border: 3px solid #fff; }
.lightbox__cap { margin-top: 1rem; color: #fff; font-family: var(--font-display); font-size: 1rem; text-align: center; }
.lightbox__close, .lightbox__nav { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; background: #fff; border: 2px solid var(--navy); color: var(--navy); }
.lightbox__close { top: clamp(0.75rem, 2vw, 1.5rem); right: clamp(0.75rem, 2vw, 1.5rem); font-size: 1.4rem; line-height: 1; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.lightbox__nav--next { right: clamp(0.5rem, 2vw, 1.5rem); }
.lightbox__nav svg { width: 22px; height: 22px; fill: currentColor; }

.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 2rem; }
.member__photo { aspect-ratio: 1; border-radius: 999px; overflow: hidden; border: 3px solid var(--navy); background: var(--butter); margin-bottom: 1rem; max-width: 220px; box-shadow: 6px 6px 0 var(--sun); }
.member__photo img { width: 100%; height: 100%; object-fit: cover; }
.member__name { font-size: var(--t-h3); margin-bottom: 0.15rem; }
.member__role { margin: 0; color: var(--text-mid); }

/* --------------------------------------------------------------------------
   12. Contact and forms
   -------------------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }
.infolist { list-style: none; margin: 0; padding: 0; }
.infolist li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 0.9rem; padding: 1rem 0; border-bottom: 2px dashed var(--rule-light); }
.infolist svg { width: 2.6rem; height: 2.6rem; padding: 0.6rem; border-radius: 999px; background: var(--butter); border: 2px solid var(--navy); fill: var(--navy); }
.infolist .label { font-family: var(--font-display); font-size: 0.95rem; font-weight: 500; color: var(--sky); margin-bottom: 0.1rem; }
.infolist .value { font-size: 1.05rem; overflow-wrap: anywhere; }

.form { background: #fff; border: 3px solid var(--navy); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.5rem); box-shadow: 10px 10px 0 var(--sun); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.4rem; font-family: var(--font-display); font-size: 1rem; font-weight: 500; color: var(--navy); }
.field .req { color: var(--cherry); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem 1rem;
  font: inherit; font-size: 1rem; color: inherit;
  background: var(--cream); border: 2px solid var(--rule-light); border-radius: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 4px 4px 0 var(--sun); }
.field textarea { min-height: 140px; resize: vertical; }
.field select { appearance: none; cursor: pointer; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field__error { display: none; margin-top: 0.35rem; font-size: 0.875rem; font-weight: 700; color: var(--cherry); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--cherry); }
.field.has-error .field__error { display: block; }
.field--check label { display: flex; align-items: flex-start; gap: 0.7rem; font-family: var(--font-body); font-weight: 600; cursor: pointer; }
.field--check input[type="checkbox"] { width: 1.2rem; height: 1.2rem; flex: none; margin-top: 0.2rem; padding: 0; accent-color: var(--sky); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; }
.form__note { margin-top: 1rem; font-size: 0.9rem; color: var(--text-mid); }
.form__status { display: none; margin-bottom: 1.25rem; padding: 0.9rem 1.1rem; border-radius: 14px; background: var(--butter); border: 2px solid var(--navy); font-size: 0.95rem; }
.form__status.is-visible { display: block; }
.map { border: 3px solid var(--navy); width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); }

/* --------------------------------------------------------------------------
   13. Call to action — a butter-yellow panel
   -------------------------------------------------------------------------- */
.cta { position: relative; background: var(--cream); }
.cta__media { display: none; }
.cta__inner {
  position: relative; z-index: 1;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem);
  background: var(--butter); color: var(--navy);
  border: 3px solid var(--navy); border-radius: var(--radius-lg);
  box-shadow: 12px 12px 0 var(--sky);
  text-align: center;
}
.cta__inner .eyebrow { justify-content: center; color: var(--cherry); }
.cta__inner .h1 { max-width: 18ch; margin-inline: auto; }
.cta__inner .lead { max-width: 38rem; margin: 0 auto 1.75rem; }
.cta__inner .btn-row { justify-content: center; }

/* --------------------------------------------------------------------------
   14. Footer — navy, with a crayon rule on top
   -------------------------------------------------------------------------- */
.footer { position: relative; background: var(--navy); color: var(--text-light); }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, var(--sky) 0 25%, var(--cherry) 25% 50%, var(--sun) 50% 75%, var(--leaf) 75% 100%); }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.5rem; padding-block: clamp(3rem, 6vw, 4.5rem) 2.5rem; }
@media (max-width: 960px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand img { height: 60px; width: auto; margin-bottom: 1rem; }
.footer__brand p { color: var(--text-faint); font-size: 0.95rem; max-width: 30rem; }
.footer h4 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; color: var(--sun); margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.55rem; font-size: 0.98rem; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
.footer__social { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 2px solid rgba(255,255,255,0.3); color: #fff; }
.footer__social a:hover { background: var(--sun); border-color: var(--sun); color: var(--navy); }
.footer__social svg { width: 17px; height: 17px; fill: currentColor; }
.footer__bar { border-top: 1px solid var(--rule-dark); padding-block: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.875rem; color: var(--text-faint); }
.footer__badges { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer__badges img { height: 48px; width: auto; border-radius: 999px; }


/* The maker's credit: the footer bar's own colour at 60%, one step down in
   size, no underline until hover. It should read as part of the copyright
   line, not as a second thing competing with it. */
.footer a.footer__credit {
  color: inherit;
  font-size: 0.9em;
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 0.15s var(--ease);
}
.footer a.footer__credit::before {
  content: "·";
  margin: 0 0.45rem;
  opacity: 0.6;
}
.footer a.footer__credit:hover { opacity: 1; text-decoration: underline; }

/* --------------------------------------------------------------------------
   15. Motion, 404
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: var(--section-y); }

/* --------------------------------------------------------------------------
   Calendar of dates

   ⚠ A BLOCK STYLED IN ONE STYLESHEET ONLY IS A TRAP. Each site's sheet
   REPLACES this one rather than extending it, so a calendar added to a site
   whose sheet has never heard of it renders as an unstyled list and nothing
   anywhere errors — the silent-degradation shape this project keeps
   relearning. Every sheet carries these rules; only the design differs.

   Written against tokens every sheet defines, so it lands sanely wherever it
   is pasted and can then be tuned to the site.
   -------------------------------------------------------------------------- */
.cal { display: grid; gap: clamp(1.75rem, 3vw, 2.75rem); }
.cal__month-name {
  font-family: var(--font-display); font-size: var(--t-h3);
  color: var(--ink); margin: 0 0 0.6rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule-light);
}
.section--dark .cal__month-name, .section--dark2 .cal__month-name {
  color: #fff; border-bottom-color: var(--rule-dark);
}
.cal__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.cal__night {
  display: grid; align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 clamp(0.85rem, 2vw, 1.4rem);
  padding: 0.7rem 0.9rem 0.7rem 0.7rem;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--rule-light);
  border-left: 3px solid var(--blue);
}
.section--dark .cal__night, .section--dark2 .cal__night {
  background: rgba(255, 255, 255, 0.06); border-color: var(--rule-dark);
}

.cal__date {
  display: grid; justify-items: center; align-content: center;
  width: 3.1rem; height: 3.1rem; border-radius: var(--radius-lg);
  background: var(--paper-2); color: var(--ink); line-height: 1;
}
.cal__dow { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.cal__day { font-family: var(--font-display); font-size: 1.35rem; }
.section--dark .cal__date, .section--dark2 .cal__date { background: rgba(255,255,255,0.12); color: #fff; }

.cal__body { display: grid; gap: 0.1rem; min-width: 0; }
.cal__title { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-dark); }
.section--dark .cal__title, .section--dark2 .cal__title { color: #fff; }
.cal__place, .cal__note { font-size: var(--t-small); color: var(--text-mid); }
.section--dark .cal__place, .section--dark .cal__note,
.section--dark2 .cal__place, .section--dark2 .cal__note { color: var(--text-faint); }
.cal__note { font-style: italic; }

.cal__status {
  font-size: var(--t-label); letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; white-space: nowrap;
  padding: 0.3rem 0.65rem; border-radius: 999px;
  background: var(--paper-2); color: var(--text-mid);
}

.cal__night--open .cal__status { background: var(--blue); color: #fff; }
.cal__night--booked { border-left-color: var(--paper-3); }
.cal__night--booked .cal__date { background: var(--paper-3); }

/* Past: kept, because it is the proof the dates happen — but quiet, and it
   never says "open". The word itself is swapped by the renderer and the
   script; this only makes it look like history. */
.cal__night--past { border-left-color: var(--rule-light); opacity: 0.62; }
.cal__night--past .cal__date { background: var(--paper-2); color: var(--text-mid); }
.cal__night--past .cal__status { background: transparent; color: var(--text-mid); box-shadow: inset 0 0 0 1px var(--rule-light); }

.cal__empty { color: var(--text-mid); font-size: var(--t-lead); margin: 0; }

@media (max-width: 600px) {
  .cal__night { grid-template-columns: auto minmax(0, 1fr); row-gap: 0.5rem; }
  .cal__status { grid-column: 2; justify-self: start; }
}

/* --------------------------------------------------------------------------
   Quotes — the testimonials block

   ⚠ EVERY SHEET CARRIES THESE, because a site's stylesheet REPLACES this one
   rather than extending it: a block styled in one place renders as unstyled
   paragraphs everywhere else and nothing errors. Same rule as the calendar.

   ⚠ AND .split--bare / .hero--bare BELONG WITH THEM. The renderer now omits
   the media column when a block has no photograph — it used to emit an empty
   <img>, which browsers draw as a broken-image box — and without these rules
   the copy sits in a half-width column beside nothing.
   -------------------------------------------------------------------------- */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: clamp(1.25rem, 2.5vw, 2rem); }
.quote { margin: 0; background: #fff; border: 1px solid var(--rule-light); border-left: 3px solid var(--blue); border-radius: var(--radius-lg); padding: clamp(1.4rem, 3vw, 2rem); display: flex; flex-direction: column; }
.section--dark .quote, .section--dark2 .quote { background: rgba(255,255,255,0.06); border-color: var(--rule-dark); }
.quote__text { margin: 0 0 1.1rem; line-height: 1.65; color: var(--text-dark); }
.section--dark .quote__text, .section--dark2 .quote__text { color: #fff; }
.quote__by { margin-top: auto; font-family: var(--font-display); font-weight: 600; font-size: var(--t-small); color: var(--text-dark); }
.section--dark .quote__by, .section--dark2 .quote__by { color: #fff; }
.quote__detail { display: block; font-weight: 400; color: var(--text-mid); letter-spacing: 0.04em; text-transform: uppercase; font-size: var(--t-label); margin-top: 0.3rem; }
.section--dark .quote__detail, .section--dark2 .quote__detail { color: var(--text-faint); }
.quotes__source { margin: 1.5rem 0 0; font-size: var(--t-small); color: var(--text-mid); }
.section--dark .quotes__source, .section--dark2 .quotes__source { color: var(--text-faint); }

.split--bare { grid-template-columns: minmax(0, 1fr); max-width: 78ch; }
.hero--bare .hero__copy { position: relative; }
