/* Loose Leaf Bible Study — palette and type pulled from the Light & Dark cover:
   navy sky, gold light, cream paper, crayon texture. Plain CSS, no build step. */

:root {
  --navy: #182038;
  --navy-deep: #0f1526;
  --gold: #f0c04a;
  --gold-deep: #c9931d;
  --gold-pale: #fff3c4;
  --cream: #fbf6e8;
  --paper: #fffdf7;
  --ink: #2a2a35;
  --muted: #5c5f70;
  --line: rgba(24, 32, 56, 0.14);

  --font-head: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --radius: 18px;
  --shadow: 0 10px 30px rgba(24, 32, 56, 0.16);
  --max: 42rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
/* Clip sideways overflow on both html and body. On iOS, overflow-x on body alone
   propagates to the viewport, which Safari still lets you pan; with html set too,
   body clips its own content and there's nothing left to pan. `clip` (iOS 16+)
   does it without turning body into a scroll container; `hidden` is the fallback. */
html, body { overflow-x: hidden; overflow-x: clip; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-variation-settings: "opsz" 72, "SOFT" 60, "WONK" 1;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 5.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }
a { color: var(--navy); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- sections ---------- */

.section { padding: 3rem 0; }
.section--tight { padding: 2rem 0; }

.section--burst {
  background: var(--gold-pale) url("/assets/burst-1600.webp") center / cover no-repeat;
}
.section--navy {
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(15, 21, 38, 0.55), rgba(15, 21, 38, 0.35)),
    var(--navy-deep) url("/assets/sky-1600.webp") center top / cover no-repeat;
}
.section--navy a:not(.btn) { color: var(--gold); }
.section--navy h1, .section--navy h2 { color: var(--gold-pale); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.75rem;
}
.hero .lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto 1.5rem;
}

.hero--book {
  padding-top: 2.5rem;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(15, 21, 38, 0.35) 0%, rgba(15, 21, 38, 0.85) 70%, var(--navy-deep) 100%),
    var(--navy-deep) url("/assets/curtain-800.webp") center 30% / cover no-repeat;
}
@media (min-width: 800px) {
  .hero--book { background-image:
    linear-gradient(180deg, rgba(15, 21, 38, 0.35) 0%, rgba(15, 21, 38, 0.85) 70%, var(--navy-deep) 100%),
    url("/assets/curtain-1600.webp"); }
}
.hero--book h1 {
  color: var(--gold-pale);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
  font-size: clamp(2.8rem, 11vw, 4.2rem);
}
.hero--book .lede { color: rgba(251, 246, 232, 0.88); }

/* ---------- cards ---------- */

.card {
  color: var(--ink); /* cards stay paper-colored even inside the navy section */
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
@media (min-width: 600px) { .card { padding: 2rem; } }

.card--note {
  background: var(--gold-pale);
  box-shadow: none;
  border: 2px dashed rgba(201, 147, 29, 0.45);
}

/* ---------- cover ---------- */

.cover {
  width: min(78vw, 22rem);
  margin: 0 auto 1.5rem;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: rotate(-2deg);
}
.cover--small {
  width: 9rem;
  margin: 0;
  box-shadow: 0 10px 24px rgba(24, 32, 56, 0.3);
  flex-shrink: 0;
}

/* home-page book card: cover beside text on wide screens, stacked on phones */
.book-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}
@media (min-width: 560px) {
  .book-card { flex-direction: row; text-align: left; }
}
.book-card p { margin-bottom: 0.75rem; }

/* ---------- form ---------- */

.form { display: grid; gap: 0.75rem; }
.form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form input {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;
  padding: 0.95rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.form textarea {
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  font: inherit;
  font-size: 1.0625rem;
  padding: 0.95rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
/* Forms with visible labels (request, contact), unlike the compact signup. */
.form--labelled label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-weight: 700; margin-bottom: -0.35rem; }
.form--labelled label small { font-weight: 600; color: var(--muted); }
.form .via { display: flex; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.form .via legend { font-weight: 700; margin-bottom: 0.5rem; }
.form .via label {
  flex: 1;
  position: static; width: auto; height: auto; overflow: visible; clip: auto;
  margin: 0;
  text-align: center;
  padding: 0.8rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}
.form .via input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.form .via label:has(input:checked) { border-color: var(--gold-deep); background: var(--gold-pale); }
.form .via label:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(240, 192, 74, 0.35); }
.form .via-email, .form .via-phone { display: grid; gap: 0.75rem; }
.form:has(.via input[value="phone"]:checked) .via-email,
.form:has(.via input[value="email"]:checked) .via-phone { display: none; }
.form .hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 4px rgba(240, 192, 74, 0.35);
}
.form .fine {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}
.form__status { margin: 0; font-weight: 700; }
.form__status[data-error-for]:not([data-state]) { display: none; }
.form__status[data-state="success"] { color: #2a6b3c; }
.form__status[data-state="error"] { color: #a4332c; }
.form[data-state="success"] input,
.form[data-state="success"] .btn { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  text-align: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: var(--navy);
  color: var(--gold-pale);
  box-shadow: 0 4px 0 var(--navy-deep);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--navy-deep); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.btn--gold {
  background: var(--gold);
  color: var(--navy-deep);
  box-shadow: 0 4px 0 var(--gold-deep);
}
.btn--gold:active { box-shadow: 0 2px 0 var(--gold-deep); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  box-shadow: inset 0 0 0 2px var(--navy);
}
.section--navy .btn--ghost { color: var(--gold-pale); box-shadow: inset 0 0 0 2px var(--gold-pale); }

/* A download that isn't available yet. Visibly a placeholder, not a broken link. */
.btn.is-placeholder {
  background: repeating-linear-gradient(135deg, #e9e4d6 0 10px, #f3efe3 10px 20px);
  color: var(--muted);
  box-shadow: inset 0 0 0 2px var(--line);
  cursor: not-allowed;
}
.btn.is-placeholder small { font-weight: 600; }

.btn-stack { display: grid; gap: 0.75rem; margin: 1.25rem 0; }

/* ---------- misc ---------- */

.inline-list { padding-left: 1.2rem; }
.inline-list li { margin-bottom: 0.35rem; }

/* about page: page-by-page walkthrough inside a card */
.walk h3 { margin-top: 1.75rem; color: var(--navy); }
.walk p:last-child { margin-bottom: 0; }

/* about page figures: annotated pages whose numbered markers are explained by a
   matching .callouts list in HTML */
.figure { margin: 1.25rem 0 1.75rem; }
.figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(24, 32, 56, 0.12);
}
.callouts { list-style: none; counter-reset: callout; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.callouts li { counter-increment: callout; position: relative; padding-left: 2.25rem; min-height: 1.7rem; }
.callouts li::before {
  content: counter(callout);
  position: absolute; left: 0; top: 0;
  width: 1.7rem; height: 1.7rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--navy); color: var(--gold); border: 2px solid var(--gold);
  font-weight: 800; font-size: 0.9rem; line-height: 1;
}

.quote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--gold);
  font-style: italic;
  color: var(--muted);
}
.quote cite { display: block; font-style: normal; font-weight: 700; margin-top: 0.4rem; color: var(--ink); }

.footer {
  padding: 2rem 0 3rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer a { color: inherit; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--navy-deep); padding: 0.5rem 1rem;
}
.skip:focus { left: 16px; z-index: 10; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
