/*
  Funnel theme: one typeface, no decoration, two palettes.
    default            black and white (Leah Lange, Sophie Kingswell, Crumpled Pages)
    body.theme-soft    sky blue, navy and checkmark green (Deborah Hopkins' parenting books)
  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;
}

: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;
  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; }

* { 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; }
.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;
}

/* ---------- 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; }

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