/*
 * "Warm & elegant church": TruBible's look since Nov 27 2026 (the owner chose mockup B of three: "I like this"; the
 * mockups are untracked/mockups/build.js, direction B). Cream paper, deep navy, a touch of gold, an elegant serif for
 * titles, round pill buttons, soft shadows.
 *
 * ONE file, the LAST stylesheet of every page, unlayered: it sets the design tokens (tokens.css's names, so every page's
 * own CSS follows) and the few shared parts whose look is not a token (buttons, fields, switches, cards, icon chips,
 * dialogs, titles, the sidebar's colours). Light on :root, Dark on [data-theme="dark"] (a navy night).
 * Never here: the slides (wpr-*), the presenter and /display, a church's own colours (app.js applyBranding sets
 * --primary / --brand inline on branded pages: inline wins), and Ethan.Bible's binding (tb-os.css keeps its own values,
 * which test/folioDesign.test.js compares with Ethan.Bible's; TruBible's sidebar colours are set here, on purpose).
 * Contrast (WCAG 2.2 AA): text tokens ≥ 4.5:1 on every surface of their theme; the gold used for text is #8a6a22.
 */

/* ---------- the palette ---------- */
:root {
  --navy: #1c2541; --navy-2: #141b33; --navy-3: #2e3a63;
  --gold: #c8a24a; --gold-ink: #8a6a22; --gold-soft: #f3ead8; --gold-line: #e3d8c3; --gold-light: #f0d68e;
  --cream: #faf6ef; --paper: #fffdf9;

  --bg: var(--paper); --bg-page: var(--cream); --bg-card: var(--paper); --bg-subtle: #f6efe3; --bg-hover: #f3ead8; --bg-active: #ecdfc6; --bg-elevated: var(--paper);
  --text: var(--navy); --text-secondary: #333c58; --text-muted: #5f6577; --text-light: #646a7a; --text-faint: #646a7a; --text-on-primary: #fff;
  --border: #ece4d6; --border-strong: #ddd0b6; --border-light: #f3ead8;

  --brand: var(--navy); --brand-hover: var(--navy-2); --brand-soft: var(--gold-soft); --brand-line: var(--gold-line); --on-brand: #fff; --brand-rgb: 28, 37, 65;
  --solid: var(--navy); --on-solid: #fff;
  --primary: var(--navy); --primary-dark: var(--navy-2); --primary-light: var(--navy-3); --primary-bg: var(--gold-soft); --primary-border: var(--gold-line); --primary-rgb: 28, 37, 65;
  --accent: var(--gold-ink); --accent-light: var(--gold); --accent-bg: var(--gold-soft); --accent-border: var(--gold-line); --accent-rgb: 200, 162, 74;
  --grad-brand: linear-gradient(var(--navy), var(--navy)); --grad-primary: linear-gradient(var(--navy), var(--navy));

  --shadow-xs: 0 1px 2px rgba(28, 37, 65, 0.05);
  --shadow-sm: 0 2px 6px -2px rgba(28, 37, 65, 0.08);
  --shadow: 0 8px 20px -12px rgba(28, 37, 65, 0.18);
  --shadow-md: 0 12px 30px -18px rgba(28, 37, 65, 0.25);
  --shadow-lg: 0 20px 44px -20px rgba(28, 37, 65, 0.32);
  --shadow-xl: 0 30px 70px -24px rgba(28, 37, 65, 0.38);
  --ring: 0 0 0 4px rgba(200, 162, 74, 0.32);
  --radius-xs: 10px; --radius-sm: 14px; --radius: 20px; --radius-lg: 22px; --radius-xl: 28px;
  --font-title: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
}
[data-theme="dark"] {
  --gold-ink: #e5c77a; --gold-soft: #2a2a28; --gold-line: #4a4232;
  --bg: #151b2e; --bg-page: #0e1322; --bg-card: #151b2e; --bg-subtle: #1a2138; --bg-hover: #212943; --bg-active: #2a3352; --bg-elevated: #1a2138;
  --text: #efe9dc; --text-secondary: #d6d0c3; --text-muted: #a9aebd; --text-light: #9ea4b5; --text-faint: #9ea4b5;
  --border: #263050; --border-strong: #323d63; --border-light: #1d2440;
  --brand: #e5c77a; --brand-hover: #f0d68e; --brand-soft: #2a2a28; --brand-line: #4a4232; --on-brand: #141b33; --brand-rgb: 229, 199, 122;
  --solid: #e5c77a; --on-solid: #141b33;
  --primary: #e5c77a; --primary-dark: #c8a24a; --primary-light: #f0d68e; --primary-bg: #2a2a28; --primary-border: #4a4232; --primary-rgb: 229, 199, 122;
  --accent: #e5c77a; --accent-bg: #2a2a28; --accent-border: #4a4232;
  --ring: 0 0 0 4px rgba(229, 199, 122, 0.3);
  --text-on-primary: #141b33; --grad-brand: linear-gradient(#e5c77a, #e5c77a); --grad-primary: linear-gradient(#e5c77a, #e5c77a);
}

/* ---------- titles: the elegant serif ---------- */
h1, .page-title, .host-card-title, .card-title, .hf-card-head h2, .tl-title, .modal h2, .settings-section h2 { font-family: var(--font-title); font-weight: 600; letter-spacing: -0.01em; }

/* ---------- buttons: round pills, navy, a gold-lined outline ---------- */
.btn { border-radius: 999px; }
.btn-primary, .btn-brand, .btn-accent, .btn-dawn { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 18px -10px rgba(28, 37, 65, 0.55); }
.btn-primary:hover, .btn-brand:hover, .btn-accent:hover, .btn-dawn:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-outline, .btn-secondary { background: transparent; border-color: #cdbf9f; color: var(--text); }
.btn-outline:hover, .btn-secondary:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--text); }
.btn-soft { background: var(--gold-soft); color: #5b4a22; }
.btn-soft:hover { background: #ecdfc6; color: #4a3c1b; }
[data-theme="dark"] .btn-outline, [data-theme="dark"] .btn-secondary { border-color: #4a4232; }
[data-theme="dark"] .btn-soft { color: var(--gold-ink); }

/* ---------- fields and switches ---------- */
.form-control { background: #fff; border-color: var(--gold-line); border-radius: var(--radius-sm); }
.form-control:hover { border-color: #cdbf9f; }
.form-control:focus { border-color: var(--gold); box-shadow: var(--ring); }
[data-theme="dark"] .form-control { background: var(--bg-subtle); }
.switch-track { background: var(--gold-line); }
.switch input:checked + .switch-track { background: var(--navy); }
[data-theme="dark"] .switch input:checked + .switch-track { background: var(--gold); }

/* ---------- surfaces ---------- */
.card { background: var(--bg-card); border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.icon-chip, .setting-icon, .hf-card-head .icon-chip { background: var(--gold-soft); color: var(--gold-ink); }
.modal { border-radius: 24px; background: var(--bg-card); }
.modal-overlay { background: rgba(20, 27, 51, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---------- the sidebar: navy, cream words, gold marks; the page you are on is a cream tab ---------- */
html.tbos-folio[class] {
  --fo-bind: #1c2541; --fo-ink: #f6f1e5; --fo-ink-2: #d4cdbd; --fo-ink-3: #a59f91;
  --fo-line: rgba(246, 241, 229, 0.1); --fo-hover: rgba(246, 241, 229, 0.07); --fo-here: rgba(246, 241, 229, 0.12); --fo-accent: #e5c77a;
}
html.tbos-folio[class][data-theme="dark"] { --fo-bind: #10162a; }
html.tbos-folio.tbos-desktop[class] .tbos-rail-item.is-front, html.tbos-folio.tbos-desktop[class] .tbos-rail-item[aria-current] { background: var(--cream); color: var(--navy); }
html.tbos-folio.tbos-desktop[class][data-theme="dark"] .tbos-rail-item.is-front, html.tbos-folio.tbos-desktop[class][data-theme="dark"] .tbos-rail-item[aria-current] { background: #e5c77a; color: #141b33; }
html.tbos-folio.tbos-desktop[class] .tbos-rail-item .fo-ico { color: #e5c77a; }
html.tbos-folio.tbos-desktop[class] .tbos-rail-item.is-front .fo-ico, html.tbos-folio.tbos-desktop[class] .tbos-rail-item[aria-current] .fo-ico { color: #8a6a22; }

/* ---------- the host page: the microphone is a navy disc with a gold mark and gold rings (mockup B) ---------- */
/* (only while ready: connecting, live, reconnecting and ended keep host.css's own colours) */
body[data-host-state="ready"] .golive-btn .status-ring { background: radial-gradient(circle at 30% 28%, #2e3a63, #1c2541 70%); box-shadow: 0 16px 36px -12px rgba(28, 37, 65, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
body[data-host-state="ready"] .golive-btn .status-ring .status-icon { color: var(--gold-light); }
.golive-halo::before { background: radial-gradient(circle, rgba(200, 162, 74, 0.22) 0%, rgba(200, 162, 74, 0) 70%); }
.golive-halo::after { border-color: rgba(200, 162, 74, 0.5); }
.golive-halo { box-shadow: 0 0 0 10px rgba(200, 162, 74, 0.07); }
[data-theme="dark"] body[data-host-state="ready"] .golive-btn .status-ring { background: radial-gradient(circle at 30% 28%, #f0d68e, #c8a24a 70%); }
[data-theme="dark"] body[data-host-state="ready"] .golive-btn .status-ring .status-icon { color: #141b33; }
.hq-opt[aria-checked="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--text); box-shadow: none; }
.state-chip { border-radius: 999px; }

/* ---------- Worship Studio (its --wp-* names follow the tokens above; the slides themselves are never styled here) ---------- */
:root { --dawn: var(--gold-ink); --dawn-ink: var(--gold-ink); --dawn-bg: var(--gold-soft); --dawn-border: var(--gold-line); }
body.wp { --wp-display: var(--font-title); --wp-radius: 20px; }
body.wp h1, body.wp .wp-h1, body.wp .wp-door h1 { font-family: var(--font-title); font-weight: 600; }

/* ---------- the home page: the promise in the serif (css/home-film.css styles the film's page) ---------- */
#hero-title { font-family: var(--font-title); font-weight: 600; letter-spacing: -0.02em; }
.h4-pill { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); }
