/*
  Funnel theme: one typeface, no decoration, three palettes.
    default            black and white (Leah Lange, Sophie Kingswell, Crumpled Pages)
    body.theme-soft    sky blue, navy and checkmark green (Deborah Hopkins' parenting books)
    body.theme-bright  lilac, plum and sunny yellow, rounded serif headings (self-help and
                       workbook store brands; adds the Fraunces typeface, OFL)
  A page picks a palette with the class on <body>; nothing else changes.
  The same file is copied into every site (sites/<id>/assets/site.css) by `npm run sync-css`;
  edit templates/site/assets/site.css, then run it.
*/

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin-soft-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fafaf7;            /* page background */
  --fg: #1c1b19;            /* text */
  --muted: #6f6c66;         /* quiet text */
  --line: #e4e2dc;          /* hairlines */
  --rule: #1c1b19;          /* the strong rule above lists */
  --band-bg: #1c1b19;       /* header, hero, sale band, footer */
  --band-fg: #fafaf7;
  --band-muted: #a9a59c;
  --panel-bg: #fafaf7;      /* form and notice panels */
  --panel-border: #fafaf7;  /* panel edge inside the hero band */
  --field-bg: #ffffff;
  --btn-bg: #1c1b19;
  --btn-fg: #fafaf7;
  --btn-hover: #000000;
  --band-btn-bg: #fafaf7;   /* buttons sitting on the band */
  --band-btn-fg: #1c1b19;
  --check: #1c1b19;
  --radius: 0px;
  --signal: #b3261e;        /* form errors only */
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--font);    /* headings */
  --accent: var(--fg);       /* highlighted words in headings (<em>), bright theme */
  --cover-1: #1c1b19;        /* drawn covers on store pages */
  --cover-2: #6f6c66;
  --cover-3: #b9b5ab;
  --cover-fg: #fafaf7;
  color-scheme: light;
}

/* Soft palette, taken from the Potty Training Checklist cover: sky, navy, checkmark green */
body.theme-soft {
  --bg: #f6fafd;
  --fg: #1f3550;
  --muted: #50677d;
  --line: #d4e3ee;
  --rule: #1f3550;
  --band-bg: #d9ebf7;
  --band-fg: #1f3550;
  --band-muted: #48637c;
  --panel-bg: #ffffff;
  --panel-border: #ffffff;
  --field-bg: #ffffff;
  --btn-bg: #1f3550;
  --btn-fg: #ffffff;
  --btn-hover: #142740;
  --band-btn-bg: #1f3550;
  --band-btn-fg: #ffffff;
  --check: #3d8c68;
  --radius: 12px;
}
body.theme-soft h1 { letter-spacing: -0.028em; }

/* Bright palette for self-help and workbook store brands: lilac page, plum text, sunny
   yellow buttons with a plum outline and a hard offset shadow, rounded serif headings.
   Covers are drawn in plum, coral and gold so they stand out from the lilac. */
body.theme-bright {
  --bg: #f6effa;
  --fg: #2b1838;
  --muted: #5f4b6c;
  --line: #e2d2ec;
  --rule: #2b1838;
  --band-bg: #e3cdee;
  --band-fg: #2b1838;
  --band-muted: #5f4b6c;
  --panel-bg: #ffffff;
  --panel-border: #2b1838;
  --field-bg: #ffffff;
  --btn-bg: #ffd84a;
  --btn-fg: #2b1838;
  --btn-hover: #ffcd1f;
  --band-btn-bg: #ffd84a;
  --band-btn-fg: #2b1838;
  --check: #8a2bb0;
  --radius: 18px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --accent: #9b2fc4;
  --cover-1: #3b1f52;
  --cover-2: #e3655b;
  --cover-3: #f2b632;
  --cover-fg: #fff8ee;
}
body.theme-bright h1, body.theme-bright h2, body.theme-bright h3 {
  font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100;
}
body.theme-bright h1 { line-height: 1.02; }
body.theme-bright .site-header { background: var(--fg); color: #fff; }
body.theme-bright .site-header .brand { color: #fff; font-family: var(--display); font-size: 1.2rem; }
body.theme-bright .site-footer { background: var(--fg); color: #cdbcd8; }
body.theme-bright .site-footer a { color: #cdbcd8; }
body.theme-bright .btn {
  border: 2px solid var(--fg); border-radius: 999px; box-shadow: 4px 4px 0 var(--fg);
  font-weight: 700; transition: transform 0.12s, box-shadow 0.12s;
}
body.theme-bright .btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--fg); border-color: var(--fg); }
body.theme-bright .btn.secondary { background: #fff; color: var(--fg); }
body.theme-bright .buy .btn { border-color: var(--fg); }
body.theme-bright .card { border: 2px solid var(--fg); box-shadow: 6px 6px 0 var(--fg); }
body.theme-bright .checklist, body.theme-bright .inside { border-top-width: 2px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; display: flex; flex-direction: column; /* footer sits at the bottom of short pages */
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--font);
  font-feature-settings: "ss01";
}
body > main { flex: 1 0 auto; width: 100%; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 640; line-height: 1.05; margin: 0 0 0.45em; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); line-height: 0.98; letter-spacing: -0.035em; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- header: a band with the wordmark ---------- */
.site-header { background: var(--band-bg); color: var(--band-fg); padding: 22px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; }
.brand { color: var(--band-fg); text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }

/* Small line of context above a headline: sentence case, quiet */
.eyebrow { display: block; font-size: 0.95rem; color: var(--muted); margin-bottom: 18px; }
.lede { font-size: 1.15rem; line-height: 1.55; color: var(--muted); max-width: 34em; }

/* ---------- hero: full-width band ---------- */
.hero { background: var(--band-bg); color: var(--band-fg); padding: 72px 0 88px; }
.hero .eyebrow, .hero .lede { color: var(--band-muted); }
.hero h1 em { font-style: italic; font-weight: 700; }
body.theme-bright h1 em, body.theme-bright h2 em { font-style: normal; color: var(--accent); }
.hero-grid { display: grid; gap: 48px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.2fr 0.8fr; gap: 72px; } }

.hero-img { width: min(320px, 100%); margin-top: 40px; border-radius: var(--radius); }
@media (max-width: 899px) { .hero-img { width: min(170px, 46%); margin-top: 24px; } }

/* Drawn book cover, used until a real cover image is added */
.cover {
  width: 150px; aspect-ratio: 2 / 3; margin-top: 40px;
  background: var(--panel-bg); color: var(--fg); border-radius: var(--radius);
  padding: 18px 14px; display: flex; flex-direction: column; justify-content: space-between;
}
.cover .t { font-weight: 700; font-size: 0.95rem; line-height: 1.15; letter-spacing: -0.01em; }
.cover .a { font-size: 0.75rem; color: var(--muted); }
@media (max-width: 899px) { .cover { display: none; } }

/* ---------- the form panel: plain, no shadow ---------- */
.card { background: var(--panel-bg); color: var(--fg); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.hero .card { border-color: var(--panel-border); }
.card h2 { font-size: 1.6rem; margin-bottom: 0.3em; }
.card .sub { color: var(--muted); margin-bottom: 22px; }

form .field { margin-bottom: 16px; }
.lbl { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"] {
  width: 100%; font: inherit; color: var(--fg);
  height: 52px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.75); background: var(--field-bg);
}
input[type="text"]:focus, input[type="email"]:focus { border-color: var(--fg); outline: none; box-shadow: inset 0 0 0 1px var(--fg); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--muted); margin: 20px 0; line-height: 1.5; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--fg); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: 4px 0 18px; min-height: 65px; }

.btn {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font: 600 1.02rem var(--font); letter-spacing: -0.005em;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bg); border-radius: calc(var(--radius) * 0.75); padding: 17px 20px; cursor: pointer;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.secondary { background: transparent; color: var(--fg); }
.buy .btn { background: var(--band-btn-bg); color: var(--band-btn-fg); border-color: var(--band-btn-bg); }
.fine { font-size: 0.82rem; color: var(--muted); margin: 14px 0 0; }

.form-error {
  display: none; margin-bottom: 18px; padding: 10px 0 10px 14px;
  border-left: 3px solid var(--signal); color: var(--signal); font-size: 0.93rem;
}
.form-error.show { display: block; }

/* ---------- content sections ---------- */
.section { padding: 80px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { max-width: 18em; }

/* Three things inside: columns divided by rules, not boxes */
.inside { display: grid; grid-template-columns: 1fr; margin-top: 32px; border-top: 1px solid var(--rule); }
.inside > div { padding: 22px 0 26px; border-bottom: 1px solid var(--line); }
.inside p { color: var(--muted); margin: 0; }
@media (min-width: 760px) {
  .inside { grid-template-columns: repeat(3, 1fr); }
  .inside > div { padding: 24px 28px 0 0; border-bottom: 0; }
  .inside > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
}

/* Longer contents list: a ruled two-column list */
.checklist { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; column-gap: 48px; border-top: 1px solid var(--rule); }
@media (min-width: 760px) { .checklist { grid-template-columns: 1fr 1fr; } }
.checklist li { padding: 15px 0 15px 30px; border-bottom: 1px solid var(--line); position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 2px; top: 15px; font-weight: 700; color: var(--check); }

/* Direct ebook sale: a band */
.section#buy { background: var(--band-bg); color: var(--band-fg); border-top: 0; }
.section#buy .lede { color: var(--band-muted); }
.buy { display: grid; gap: 28px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 760px) { .buy { grid-template-columns: 1.4fr 1fr; } }
.buy .fine { color: var(--band-muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--band-bg); color: var(--band-muted); padding: 40px 0 56px; font-size: 0.88rem; }
.site-footer a { color: var(--band-muted); }

/* ---------- thank-you, download and error pages ---------- */
.notice { width: min(640px, 100% - 32px); margin: 0 auto; padding: 12vh 0 80px; }
.notice h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); }
.notice .card { margin-top: 28px; }
.notice .card h2 { font-size: 1.3rem; }
.notice button {
  font: 600 1rem var(--font); background: var(--btn-bg); color: var(--btn-fg);
  border: 0; border-radius: calc(var(--radius) * 0.75); padding: 14px 22px; cursor: pointer;
}

/* download buttons (thank-you and order pages) and store prices */
.downloads { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.price { font-size: 1.15rem; margin: 0 0 6px; }
.price strong { font-size: 2rem; letter-spacing: -0.02em; }
.muted { color: var(--muted); }

/* ---------- home page: book list ---------- */
.book-list { list-style: none; padding: 0; margin: 40px 0 0; border-top: 1px solid var(--rule); }
.book-list a { display: block; padding: 24px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.book-list strong { display: block; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 640; letter-spacing: -0.02em; }
.book-list span { color: var(--muted); }
.book-list a:hover strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------- store pages: bundle layout ---------- */
.kicker { display: block; font-size: 0.95rem; font-weight: 600; color: var(--check); margin-bottom: 10px; }
.pitch-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.pitch-points li { padding-left: 28px; position: relative; }
.pitch-points li::before { content: "✓"; position: absolute; left: 2px; font-weight: 700; color: var(--check); }

/* Drawn covers: a fanned stack in the hero, one per book further down */
.stack { display: flex; margin: 40px 0 8px; max-width: 420px; padding-left: 12px; }
.stack .book { flex: 1 1 0; min-width: 0; margin-left: -12px; box-shadow: 0 0 0 2px var(--fg); }
.stack .book:nth-child(1) { transform: rotate(-6deg); }
.stack .book:nth-child(2) { transform: translateY(-14px); z-index: 2; }
.stack .book:nth-child(3) { transform: rotate(6deg); }
@media (max-width: 480px) { .stack .book { padding: 12px 10px; } .stack .book .t { font-size: 0.95rem; } }
.mobile-only { margin-top: 28px; }
@media (min-width: 900px) { .mobile-only { display: none; } }
.book {
  aspect-ratio: 2 / 3; border-radius: calc(var(--radius) * 0.5); padding: 18px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--cover-1); color: var(--cover-fg);
}
.book.c2 { background: var(--cover-2); }
.book.c3 { background: var(--cover-3); color: var(--cover-1); }
.book .t { font-family: var(--display); font-weight: 650; font-size: 1.15rem; line-height: 1.1; font-variation-settings: "SOFT" 100; }
.book .a { font-size: 0.72rem; opacity: 0.85; }
.book .tag { align-self: flex-start; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--cover-fg); color: var(--cover-1); }

/* "Sound familiar?": a short, plain list of what readers are dealing with */
.feel { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; max-width: 40em; }
.feel li { background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }

/* One row per book in the bundle */
.books { display: grid; gap: 56px; margin-top: 40px; }
.book-row { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
.book-row .book { width: 160px; box-shadow: 0 0 0 2px var(--fg); }
@media (min-width: 760px) {
  .book-row { grid-template-columns: 200px 1fr; gap: 48px; }
  .book-row:nth-child(even) { grid-template-columns: 1fr 200px; }
  .book-row:nth-child(even) .book { order: 2; }
}
.book-row h3 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.book-row p { color: var(--muted); max-width: 36em; }
.book-row .checklist { margin-top: 18px; grid-template-columns: 1fr; }

.bonus { margin-top: 56px; padding: 28px; border-radius: var(--radius); background: var(--band-bg); border: 2px dashed var(--fg); }
.bonus h3 { margin-bottom: 6px; }
.bonus p { margin: 0; }
.feel + .lede { margin-top: 24px; }

/* Price recap */
.recap { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) { .recap { grid-template-columns: 1.3fr 1fr; } }
.recap table { width: 100%; border-collapse: collapse; }
.recap td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.recap td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.recap tr.total td { font-weight: 700; border-bottom: 0; font-size: 1.1rem; }

/* Questions: native disclosure, no script */
.faq { margin-top: 28px; display: grid; gap: 12px; max-width: 44em; }
.faq details { background: var(--panel-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
body.theme-bright .faq details { border: 2px solid var(--fg); }
.faq summary { cursor: pointer; font-weight: 650; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); margin: 0 0 18px; }

.center { text-align: center; }
.center h2, .center .lede { margin-inline: auto; }
.cta-end { max-width: 420px; margin: 28px auto 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
