/* Innovation Library — innovationlibrary.donbarger.com */

:root {
  --bg: #0f172a;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --c: #6366f1;                 /* active book accent; overridden per page via inline style */
  --maxw: 1180px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.14);
  --font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--surface-soft); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar + book nav ---------- */
.topbar { position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,.88); backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; letter-spacing: -.01em; flex-shrink: 0; }
.brand .mark { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; width: 26px; height: 26px; }
.brand .mark span { border-radius: 3px; }
.brand .mark span:nth-child(1){ background: #2563eb; }
.brand .mark span:nth-child(2){ background: #d97706; }
.brand .mark span:nth-child(3){ background: #059669; }
.brand .mark span:nth-child(4){ background: #6366f1; }
.brand b { font-size: 16px; }
.brand small { display:block; font-weight: 500; color: var(--ink-faint); font-size: 11px; letter-spacing: .02em; margin-top: -3px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a.home { text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.nav a.home:hover { color: var(--ink); background: var(--surface-soft); }
.booksmenu { position: relative; }
.booksmenu > button { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.booksmenu > button:hover { border-color: var(--line-strong); }
.booksmenu > button .chev { font-size: 11px; color: var(--ink-faint); }
.booksmenu .menu { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: none; }
.booksmenu.open .menu { display: block; }
.booksmenu .menu a { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; padding: 9px 10px; border-radius: 9px; }
.booksmenu .menu a:hover { background: var(--surface-soft); }
.booksmenu .menu a .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.booksmenu .menu a b { font-size: 14px; font-weight: 700; display: block; line-height: 1.25; }
.booksmenu .menu a span { font-size: 12px; color: var(--ink-faint); }
.booksmenu .menu a.active { background: var(--surface-soft); }
@media (max-width: 560px){ .brand small { display: none; } .booksmenu .menu { width: 280px; } }

/* ---------- Hero (landing) ---------- */
.hero { background: radial-gradient(1200px 420px at 82% -10%, rgba(99,102,241,.30), transparent 60%), radial-gradient(900px 420px at 0% 0%, rgba(5,150,105,.18), transparent 55%), linear-gradient(180deg, #0f172a, #111c33); color: #e2e8f0; padding: 72px 0 80px; }
.hero .eyebrow { color: #a5b4fc; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.hero h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(34px, 6vw, 58px); line-height: 1.04; margin: 14px 0 10px; letter-spacing: -.02em; color: #fff; }
.hero p { font-size: clamp(16px, 2.3vw, 20px); color: #cbd5e1; max-width: 760px; }
.hero .stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero .stats div b { font-family: var(--serif); font-size: 30px; color: #fff; display: block; line-height: 1; }
.hero .stats div span { font-size: 13px; color: var(--ink-faint); }

/* ---------- Section ---------- */
section { padding: 54px 0; }
.section-head { margin-bottom: 26px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(24px, 4vw, 34px); margin: 0 0 6px; letter-spacing: -.02em; }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 720px; }

/* ---------- Book grid (landing) ---------- */
.books { margin-top: -56px; }
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px){ .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .book-grid { grid-template-columns: 1fr; } }
.book-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.book-card .cover { aspect-ratio: 2/3; background: var(--surface-soft); overflow: hidden; }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; border-top: 4px solid var(--cc, var(--line)); }
.book-card .author { color: var(--ink-faint); font-size: 13px; font-weight: 600; }
.book-card h3 { font-family: var(--serif); font-size: 21px; margin: 4px 0 8px; letter-spacing: -.01em; line-height: 1.15; }
.book-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
.book-card .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.book-card .count { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; }
.book-card .go { font-weight: 700; font-size: 13.5px; color: var(--cc, var(--c)); }
.book-card .go::after { content: " →"; }

/* ---------- Book page header ---------- */
.bookhead { background: linear-gradient(180deg, #0f172a, #14213d); color: #e2e8f0; padding: 44px 0 48px; }
.bookhead .row { display: flex; gap: 30px; align-items: flex-start; }
.bookhead .cover { width: 184px; flex-shrink: 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); }
.bookhead .eyebrow { color: var(--ink-faint); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }
.bookhead h1 { font-family: var(--serif); font-size: clamp(28px, 5vw, 44px); margin: 8px 0 4px; color: #fff; letter-spacing: -.02em; line-height: 1.05; }
.bookhead .sub { color: #cbd5e1; font-size: 18px; font-style: italic; font-family: var(--serif); }
.bookhead .author { color: #e2e8f0; font-weight: 600; margin-top: 10px; }
.bookhead .summary { color: #cbd5e1; max-width: 640px; margin-top: 14px; }
.bookhead .back { display: inline-block; margin-bottom: 18px; color: var(--ink-faint); text-decoration: none; font-weight: 600; font-size: 14px; }
.bookhead .back:hover { color: #fff; }
.bookhead .buy { display: inline-block; margin-top: 18px; background: var(--c); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 9px; transition: filter .15s, transform .15s; }
.bookhead .buy:hover { filter: brightness(1.1); transform: translateY(-1px); }
@media (max-width: 620px){ .bookhead .row { flex-direction: column; } .bookhead .cover { width: 130px; } }

/* ---------- Chapter cards ---------- */
.chapters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px){ .chapters { grid-template-columns: 1fr; } }
.ch-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.ch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ch-card .num { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.ch-card h3 { font-family: var(--serif); font-size: 19px; margin: 5px 0 7px; letter-spacing: -.01em; }
.ch-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- "Get the Books" buy grid ---------- */
.buy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 720px){ .buy-grid { grid-template-columns: 1fr; } }
.buy-card { display: flex; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--line)); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.buy-card .cover { flex-shrink: 0; width: 92px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface-soft); box-shadow: var(--shadow); }
.buy-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.buy-card .body { display: flex; flex-direction: column; min-width: 0; }
.buy-card .author { color: var(--ink-faint); font-size: 12.5px; font-weight: 600; }
.buy-card h3 { font-family: var(--serif); font-size: 19px; margin: 3px 0 4px; line-height: 1.15; letter-spacing: -.01em; }
.buy-card h3 a { text-decoration: none; color: inherit; }
.buy-card h3 a:hover { color: var(--cc, var(--c)); }
.buy-card .sub { font-family: var(--serif); font-style: italic; color: var(--ink-soft); font-size: 14px; }
.buy-card .actions { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.buy-card .buy { background: var(--cc, var(--c)); color: #fff; text-decoration: none; font-weight: 700; font-size: 13.5px; padding: 8px 15px; border-radius: 8px; transition: filter .15s, transform .15s; }
.buy-card .buy:hover { filter: brightness(1.1); transform: translateY(-1px); }
.buy-card .read { color: var(--cc, var(--c)); font-weight: 700; font-size: 13px; text-decoration: none; }
.buy-card .read:hover { text-decoration: underline; }

/* ---------- Faith-based application card (book page) ---------- */
.apply-card { display: block; text-decoration: none; color: #e2e8f0; margin-top: 22px; padding: 26px 28px; border-radius: var(--radius); position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 90%, #0f172a), #14213d);
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
.apply-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.apply-card .badge { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px; }
.apply-card h3 { font-family: var(--serif); color: #fff; font-size: 24px; margin: 12px 0 8px; letter-spacing: -.01em; line-height: 1.15; }
.apply-card p { margin: 0 0 14px; color: #cbd5e1; max-width: 760px; }
.apply-card .go { font-weight: 800; font-size: 14px; color: #fff; }
.apply-card .go::after { content: " →"; }

/* ---------- Apply section (landing) ---------- */
.apply-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px){ .apply-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .apply-grid { grid-template-columns: 1fr; } }
.apply-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--line)); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.apply-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.apply-link .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.apply-link .t { flex: 1; min-width: 0; }
.apply-link .t b { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; }
.apply-link .t span { font-size: 12.5px; color: var(--ink-faint); }
.apply-link .go { font-weight: 800; font-size: 13px; color: var(--cc, var(--c)); flex-shrink: 0; }
.apply-link .go::after { content: " →"; }

/* ---------- Article (reader) ---------- */
.breadcrumb { padding: 26px 0 0; font-size: 14px; color: var(--ink-faint); }
.breadcrumb a { text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span { margin: 0 8px; opacity: .6; }
.article-head { padding: 16px 0 0; }
.article-head .num { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c); }
.article-head h1 { font-family: var(--serif); font-size: clamp(28px, 5vw, 44px); margin: 6px 0 2px; letter-spacing: -.02em; }
.article-head .bk { color: var(--ink-faint); font-weight: 600; font-size: 14px; }
.article-rule { height: 4px; width: 64px; border-radius: 999px; background: var(--c); margin: 16px 0 0; }

.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 52px); box-shadow: var(--shadow); margin: 26px 0 56px; font-size: 17px; }
.prose > h1:first-child { display: none; }
.prose h2 { font-family: var(--serif); font-size: 26px; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line); letter-spacing: -.01em; }
.prose h3 { font-size: 20px; margin: 24px 0 8px; }
.prose p { margin: 0 0 16px; color: #1f2937; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 7px; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 18px 0; padding: 14px 20px; border-left: 4px solid var(--c); background: var(--surface-soft); border-radius: 0 10px 10px 0; font-family: var(--serif); font-style: italic; font-size: 18px; color: #334155; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.prose code { background: var(--surface-soft); padding: 2px 6px; border-radius: 6px; font-size: 14px; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
.prose a { color: var(--c); }

.article-nav { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 60px; }
.article-nav a { flex: 1; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.article-nav a:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.article-nav a.next { text-align: right; }
.article-nav span { display: block; font-size: 12px; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.article-nav b { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.article-nav a.disabled { opacity: .35; pointer-events: none; }

.loading { color: var(--ink-faint); padding: 48px 0; text-align: center; }

/* ---------- Footer ---------- */
footer { background: var(--bg); color: #94a3b8; padding: 38px 0; font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; }
footer a { color: #cbd5e1; }
footer .src { max-width: 720px; font-size: 12.5px; line-height: 1.5; }
