/* E-reader styling for Meditations and Readings */
:root {
  --bg: #fbfaf7; --text: #222; --muted: #6b6b6b; --link: #8a2323;
  --rule: #ddd8cc; --panel: #fff; --panel-border: #d6d0c2; --accent: #8a2323; --accent-text: #fff;
  --fs: 112.5%;
  --font-body: Georgia, "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --gutter: 18px;
}
:root[data-theme="sepia"] {
  --bg: #f4ecd8; --text: #4a3828; --muted: #7d6a55; --link: #8a4b1f;
  --rule: #d8c9a8; --panel: #fbf5e6; --panel-border: #cdbb94; --accent: #8a4b1f; --accent-text: #fbf5e6;
}
:root[data-theme="dark"] {
  --bg: #15151a; --text: #d8d4ca; --muted: #9a968c; --link: #e6c675;
  --rule: #34343c; --panel: #1f1f26; --panel-border: #3d3d46; --accent: #e6c675; --accent-text: #15151a;
}
:root[data-font="sans"] { --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.7;
  transition: background .2s, color .2s;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px var(--gutter); background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: .8rem;
}
.bar nav a { text-decoration: none; margin-right: 14px; white-space: nowrap; }
.bar nav a:hover { text-decoration: underline; }
.gear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid transparent; border-radius: 50%;
  background: none; color: var(--text); cursor: pointer;
}
.gear:hover, .gear[aria-expanded="true"] { background: var(--panel); border-color: var(--panel-border); }
.gear:focus-visible, .seg button:focus-visible, .settings input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gear svg { width: 22px; height: 22px; }

/* settings panel */
.settings {
  position: absolute; right: var(--gutter); top: calc(100% + 6px);
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  background: var(--panel); color: var(--text);
  border: 1px solid var(--panel-border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 14px 16px 16px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.3;
}
.settings[hidden] { display: none; }
.settings h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.settings .group + .group { margin-top: 16px; }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; padding: 10px 6px; border: 1px solid var(--panel-border); border-radius: 8px;
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.seg button[data-v="serif"] { font-family: Georgia, serif; }
.seg button[data-v="sans"] { font-family: system-ui, Arial, sans-serif; }
.sizeRow { display: flex; align-items: center; gap: 10px; }
.sizeRow span { color: var(--muted); }
.sizeRow .s { font-size: 14px; } .sizeRow .l { font-size: 24px; }
.sizeRow input { flex: 1; min-width: 0; accent-color: var(--accent); height: 32px; }

/* reading column */
.page { max-width: 40rem; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.page h1 { font-size: 1.9rem; line-height: 1.2; margin: .6em 0 .4em; font-weight: bold; }
.page h2 { font-size: 1.3rem; line-height: 1.3; margin: 1.8em 0 .5em; }
.page h3 { font-size: 1.1rem; margin: 1.5em 0 .4em; }
.page p { margin: 0 0 1em; text-align: left; hyphens: auto; }
.page blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--rule); color: var(--muted); }
.page hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.lede { color: var(--muted); font-style: italic; margin-top: 0; }

/* table of contents */
.toc h2.season {
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin: 2.2em 0 .4em; padding-bottom: .35em; border-bottom: 1px solid var(--rule);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: .6em .2em; min-height: 44px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--rule);
}
.toc li a::after { content: "\203A"; color: var(--muted); font-size: 1.3em; line-height: 1; }
.toc li a:hover { color: var(--link); }
.toc .note { display: block; font-size: .8rem; color: var(--muted); }

/* day navigation, week list, sources */
.daylist { list-style: none; padding: 0; margin: 1em 0; }
.daylist li a { display: block; padding: .6em .2em; border-bottom: 1px solid var(--rule); text-decoration: none; min-height: 44px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 3em; padding-top: 1.2em; border-top: 1px solid var(--rule); font-size: .9rem; }
.pager a { max-width: 48%; }
.pager .next { margin-left: auto; text-align: right; }
.sources { list-style: none; padding: 0; margin: 1.5em 0; }
.sources li { padding: .7em 0; border-bottom: 1px solid var(--rule); }
.sources small { display: block; color: var(--muted); }
.foot { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }

@media (min-width: 720px) { :root { --gutter: 28px; } .page { padding-top: 40px; } .page h1 { font-size: 2.3rem; } }
@media print { .bar, .pager { display: none; } body { background: #fff; color: #000; } }

/* notices */
.notice { margin: 1.2em 0; padding: .9em 1.1em; border: 1px solid var(--accent); border-left-width: 5px; border-radius: 6px; background: var(--panel); }
.notice strong { display: block; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.notice p { margin: .4em 0 0; }
.support { margin-top: 2.5em; padding-top: 1em; border-top: 1px solid var(--rule); }
.support h2 { margin-top: .6em; }

/* top-bar quick links */
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.bar nav .navsep { margin: 0 14px 0 0; color: var(--muted); }

.sitefoot { margin: 3em 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

.page.wide { max-width: 1100px; }

/* Bible: chapters, verses, notes */
.argument { color: var(--muted); font-style: italic; margin: 0 0 1.2em; }
.argument p { margin: 0 0 .6em; }
.scripture { margin-top: 1em; }
.verse { scroll-margin-top: 4.5rem; padding: .05em .4em; margin: 0 -.4em; border-radius: 6px; }
.verse p { margin: 0 0 .25em; }
.verse:target { background: rgba(230, 198, 117, .28); box-shadow: -3px 0 0 var(--accent); }
.vn { font-size: .68em; font-weight: bold; vertical-align: super; line-height: 0; margin-right: .25em; color: var(--muted); text-decoration: none; }
.vn:hover, .vn:focus-visible { color: var(--link); text-decoration: underline; }
.note { font-size: .82em; line-height: 1.55; color: var(--muted); margin: .2em 0 .9em 1.1em; padding-left: .8em; border-left: 2px solid var(--rule); }
.note p { margin: 0 0 .4em; }
html[data-notes="off"] .note { display: none; }
.chip { font: inherit; font-size: .8rem; padding: .35em .8em; border: 1px solid var(--panel-border); border-radius: 999px; background: var(--panel); color: var(--text); cursor: pointer; }
.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr)); gap: .5rem; margin: 1em 0; }
.chgrid a { display: block; text-align: center; padding: .6em 0; min-height: 44px; border: 1px solid var(--rule); border-radius: 8px; text-decoration: none; background: var(--panel); }
.chgrid a:hover { border-color: var(--link); }

.page .chnav { margin: .5rem 0 1.4rem; font-size: 1rem; line-height: 1.8; hyphens: none; }
.chnav a { text-decoration: none; }
.chnav a:hover { text-decoration: underline; }
.chnav strong { color: var(--accent); }
.chhead { margin-top: 1.2em; }

/* Catechism: question headings */
.page h2.q { font-size: 1.15rem; margin: 2em 0 .5em; scroll-margin-top: 4.5rem; }
.page h2.q .qn { display: block; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .2em; }

/* scripture citations that link to the Bible */
a.scr { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
a.scr:hover, a.scr:focus-visible { color: var(--link); text-decoration-style: solid; }
