/* Whole Armour — shared styles for the lesson, archive, encouragement and happening pages.
   Palette: Iron / Steel / Bronze / Parchment. All text pairs checked ≥ 4.5:1 (WCAG AA) in both themes. */

/* Self-hosted fonts (Latin subsets, SIL OFL 1.1 — see /assets/fonts/README.txt). No font CDN at runtime. */
@font-face { font-family: 'Inter'; src: url('/assets/fonts/inter-latin-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/assets/fonts/source-serif-4-latin-var.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Source Serif 4'; src: url('/assets/fonts/source-serif-4-latin-var-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Source Serif 4', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --radius: 14px;
  --gap: clamp(16px, 4vw, 28px);
  color-scheme: light;
  /* light (Parchment) */
  --bg: #f4f1ea; --surface: #fffdf8; --text: #16181c; --muted: #4a4f58;
  --accent: #8a5a1c; --accent-bg: #8a5a1c; --on-accent: #ffffff;
  --border: #d9d3c7; --control: #6b6f78; --draft: #9a3412; --draft-bg: #fff1e6;
  --quote-bg: #efe9dc;
  /* header + footer, light: Parchment surface (AA checked against #fffdf8 / #efe9dc) */
  --hdr: #fffdf8; --hdr-text: #16181c; --hdr-border: #d9d3c7; --hdr-nav: #2b2f36; --hdr-nav-hover: #16181c;
  --hdr-hover-bg: rgba(22,24,28,.06); --hdr-current: #16181c; --hdr-mark: #8a5a1c; --hdr-focus: #8a5a1c;
  --hdr-toggle-border: #6b6f78;
  --ftr: #efe9dc; --ftr-text: #2b2f36; --ftr-brand: #16181c; --ftr-link: #7a4f17; --ftr-small: #4a4f58;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214; --surface: #1b1d22; --text: #f2efe8; --muted: #b6b9c1;
    --accent: #d4a259; --accent-bg: #d4a259; --on-accent: #111214;
    --border: #30343c; --control: #8b909a; --draft: #fb923c; --draft-bg: #2a1a0e;
    --quote-bg: #22252b;
    /* header + footer, dark: the original iron values (unchanged) */
    --hdr: #0e0e10; --hdr-text: #f2efe8; --hdr-border: rgba(255,255,255,.08); --hdr-nav: #d6d3cb; --hdr-nav-hover: #fff;
    --hdr-hover-bg: rgba(255,255,255,.08); --hdr-current: #fff; --hdr-mark: #d4a259; --hdr-focus: #d4a259;
    --hdr-toggle-border: rgba(255,255,255,.22);
    --ftr: #0e0e10; --ftr-text: #cfccc4; --ftr-brand: #f2efe8; --ftr-link: #e9c58f; --ftr-small: #a9a69e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #1b1d22; --text: #f2efe8; --muted: #b6b9c1;
  --accent: #d4a259; --accent-bg: #d4a259; --on-accent: #111214;
  --border: #30343c; --control: #8b909a; --draft: #fb923c; --draft-bg: #2a1a0e;
  --quote-bg: #22252b;
  /* header + footer, dark: the original iron values (unchanged) */
  --hdr: #0e0e10; --hdr-text: #f2efe8; --hdr-border: rgba(255,255,255,.08); --hdr-nav: #d6d3cb; --hdr-nav-hover: #fff;
  --hdr-hover-bg: rgba(255,255,255,.08); --hdr-current: #fff; --hdr-mark: #d4a259; --hdr-focus: #d4a259;
  --hdr-toggle-border: rgba(255,255,255,.22);
  --ftr: #0e0e10; --ftr-text: #cfccc4; --ftr-brand: #f2efe8; --ftr-link: #e9c58f; --ftr-small: #a9a69e;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p, ul, ol, dl, blockquote, address { margin: 0 0 1em; }
address { font-style: normal; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -200px; z-index: 1000; background: var(--accent-bg); color: var(--on-accent); padding: 10px 16px; border-radius: 999px; font-weight: 700; }
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ── header ── */
.preview-bar { background: var(--draft); color: #fff; text-align: center; font-size: .85rem; font-weight: 700; padding: 6px 12px; }
.site-hdr { background: var(--hdr); color: var(--hdr-text); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--hdr-border); }
.site-hdr__in { max-width: 1100px; margin: 0 auto; padding: 8px var(--gap); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { color: var(--hdr-text); text-decoration: none; font-weight: 900; letter-spacing: .06em; font-size: .95rem; white-space: nowrap; padding: 8px 0; }
.site-nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gap) * -1); padding: 0 var(--gap); }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0 0 4px; }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--hdr-nav); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.site-nav a:hover { color: var(--hdr-nav-hover); background: var(--hdr-hover-bg); }
.site-nav a[aria-current="page"] { color: var(--hdr-current); box-shadow: inset 0 -2px 0 var(--hdr-mark); border-radius: 0; }
.theme-toggle { margin-left: auto; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--hdr-toggle-border); background: transparent; color: var(--hdr-text); display: grid; place-items: center; cursor: pointer; }
.theme-toggle:hover { background: var(--hdr-hover-bg); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
:root .theme-toggle .i-sun { display: none; }
:root[data-theme-resolved="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme-resolved="dark"] .theme-toggle .i-moon { display: none; }
.theme-toggle:focus-visible, .site-nav a:focus-visible, .logo:focus-visible { outline-color: var(--hdr-focus); }
@media (min-width: 760px) {
  .site-nav { order: 0; flex-basis: auto; margin: 0 0 0 auto; padding: 0; overflow: visible; }
  .site-nav ul { padding: 0; }
  .theme-toggle { margin-left: 4px; }
}

/* ── layout ── */
.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: var(--gap); padding-top: clamp(20px, 4vw, 40px); }
.wrap--narrow { max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 4vw, 28px); margin-bottom: var(--gap); }
.page-title { font-size: clamp(1.9rem, 6vw, 2.8rem); font-weight: 900; letter-spacing: -.02em; text-transform: uppercase; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; margin: .25em 0 .75em; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .75em; }
.empty { text-align: center; color: var(--muted); }
.credit { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 24px; }

/* chips, badges, buttons */
.chip { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; vertical-align: middle; }
.badge--accent { background: var(--accent-bg); color: var(--on-accent); }
.badge--draft { background: var(--draft-bg); color: var(--draft); border: 1px dashed var(--draft); letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--control); background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); }
.btn--primary:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn--ghost { border-color: transparent; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.share-msg { font-size: .9rem; color: var(--muted); }

/* sync status */
.sync { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: flex-end; font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
/* Narrow screens: always two lines, so the "Last synced" time arriving later never re-wraps the line and shifts the page (CLS). */
@media (max-width: 640px) { .sync { flex-direction: column; align-items: flex-end; gap: 2px; } }
.sync-warn { background: var(--draft-bg); color: var(--draft); border: 1px solid var(--draft); border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: .92rem; }

/* ── lesson ── */
.lesson-hero { border-top: 4px solid var(--accent); }
.lesson-kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; font-size: .9rem; color: var(--muted); }
.lesson-title { font-size: clamp(1.8rem, 6.4vw, 3rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.08; margin-bottom: 14px; }
.meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: .95rem; }
.meta-k { font-weight: 800; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text); margin-right: 4px; }
.big-idea { font-family: var(--serif); font-size: clamp(1.2rem, 3.6vw, 1.5rem); line-height: 1.4; margin: 6px 0 0; padding-left: 16px; border-left: 3px solid var(--accent); }
.this-week dl { display: grid; gap: 14px; margin: 0; }
.this-week dt { font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.this-week dd { margin: 2px 0 0; }
@media (min-width: 760px) { .this-week dl { grid-template-columns: 1fr 1.3fr 1.3fr; } }
.lesson-body { margin: 8px 0 var(--gap); }
.lsec { margin-bottom: clamp(26px, 5vw, 40px); }
.lsec h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.lsec ol, .lsec ul { padding-left: 1.4em; }
.lsec li { margin-bottom: .55em; }
.lsec--truths ol { list-style: none; padding: 0; counter-reset: t; }
.lsec--truths li { counter-increment: t; position: relative; padding: 14px 0 14px 54px; border-bottom: 1px solid var(--border); margin: 0; }
.lsec--truths li::before { content: counter(t); position: absolute; left: 0; top: 12px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; background: var(--accent-bg); color: var(--on-accent); }
.lsec--declaration blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.15rem, 3.4vw, 1.35rem); line-height: 1.5; font-style: italic; background: var(--quote-bg); border-radius: var(--radius); padding: 20px 22px; border-left: 4px solid var(--accent); }
.lsec--scripture h3 { font-family: var(--font); font-size: .95rem; letter-spacing: .02em; margin-top: 1.4em; color: var(--accent); }
.lsec--scripture p { font-family: var(--serif); font-size: 1.05rem; line-height: 1.7; }
.my-notes textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1.5px solid var(--control); border-radius: 10px; padding: 12px; resize: vertical; }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 700; margin: 8px 0 24px; }
.pager a { min-height: 44px; display: inline-flex; align-items: center; }

/* ── archive ── */
.filters { display: grid; gap: 12px; margin: 20px 0 8px; }
@media (min-width: 640px) { .filters { grid-template-columns: 2fr 1fr; } }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.field input, .field select { width: 100%; min-height: 46px; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--control); border-radius: 10px; padding: 0 12px; }
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-item h2 { font-size: 1.3rem; margin: 6px 0; }
.lesson-item h2 a { color: var(--text); text-decoration: none; }
.lesson-item h2 a:hover { color: var(--accent); text-decoration: underline; }
.lesson-item p:last-child { margin: 0; }

/* ── encouragement ── */
.verse { margin: 0 0 var(--gap); }
.verse blockquote { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(1.25rem, 4vw, 1.6rem); line-height: 1.45; }
.verse figcaption { font-weight: 800; color: var(--accent); }
.devotional p { font-size: 1.1rem; }

/* ── happening ── */
.next-date { font-size: clamp(1.3rem, 4.5vw, 1.7rem); font-weight: 900; margin-bottom: 6px; }

/* ── footer ── */
.site-ftr { background: var(--ftr); color: var(--ftr-text); margin-top: auto; }
.site-ftr__in { max-width: 1100px; margin: 0 auto; padding: 28px var(--gap) 36px; font-size: .92rem; }
.site-ftr a, .site-ftr .linkish { color: var(--ftr-link); }
.site-ftr__brand { color: var(--ftr-brand); }
.site-ftr__links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.site-ftr__links a, .site-ftr__links .linkish { display: inline-flex; align-items: center; min-height: 44px; }
.site-ftr__small { color: var(--ftr-small); font-size: .82rem; margin: 8px 0 0; }
.to-top { position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--accent-bg); color: var(--on-accent); text-decoration: none; font-weight: 900; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ── print: the lesson only ── */
@media print {
  .site-hdr, .site-ftr, .to-top, .actions, .sync, .sync-warn, .pager, .skip, .preview-bar, .my-notes .hint, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; font-size: 11.5pt; }
  .card { border: 0; padding: 0; }
  .lsec--truths li::before { border: 1px solid #000; background: #fff; color: #000; }
  .my-notes textarea { border: 1px solid #999; min-height: 3cm; }
  a { color: #000; }
}
.vn { font-family: var(--font); font-size: .68em; font-weight: 700; color: var(--accent); margin-right: 3px; }

/* Phone nav: a soft fade on the right edge while more links are hidden (class set by site.js). */
.site-nav.has-more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
/* The nav row scrolls, which clips anything drawn outside it: draw the focus ring inside the link. */
.site-nav a:focus-visible { outline: 3px solid var(--hdr-focus); outline-offset: -3px; border-radius: 999px; }
