/* The Watch We Keep - one stylesheet, every page.
   Screen: the night watch, ten hours, The Vigil the default.
   Print: the paper prayer book, whatever the hour. */

/* --- the ten hours (The Vigil is :root; the default needs no JS) --- */
:root {
  --ground: #131a2b; --panel: #1c2438;
  --text: #f2ead8; --dim: #c9c0ab;
  --accent: #d9a05b; --hairline: rgba(217,160,91,0.45);
}
html[data-theme="lamplight"] {
  --ground: #211710; --panel: #2c2015;
  --text: #f4e9d3; --dim: #cdbfa4;
  --accent: #d8973f; --hairline: rgba(216,151,63,0.45);
}
html[data-theme="compline"] {
  --ground: #15171c; --panel: #1e2128;
  --text: #e8e6df; --dim: #b3b1a8;
  --accent: #9fb2c8; --hairline: rgba(159,178,200,0.4);
}
html[data-theme="gethsemane"] {
  --ground: #171d15; --panel: #212a1e;
  --text: #e9ead8; --dim: #b7bba3;
  --accent: #a8a04a; --hairline: rgba(168,160,74,0.45);
}
html[data-theme="the-table"] {
  --ground: #251811; --panel: #322218;
  --text: #f2e8da; --dim: #c9b9a6;
  --accent: #c46a4a; --hairline: rgba(196,106,74,0.45);
}
html[data-theme="advent"] {
  --ground: #1d1529; --panel: #281d38;
  --text: #efe8dc; --dim: #bfb6ab;
  --accent: #c9a227; --hairline: rgba(201,162,39,0.45);
}
html[data-theme="rubric"] {
  --ground: #f8f3e7; --panel: #efe7d3;
  --text: #26221c; --dim: #5a5347;
  --accent: #8e2f26; --hairline: rgba(142,47,38,0.5);
}
html[data-theme="vellum"] {
  --ground: #f1e6cf; --panel: #e7d9bb;
  --text: #3a2f22; --dim: #6e5f4b;
  --accent: #7a3020; --hairline: rgba(122,48,32,0.5);
}
html[data-theme="dawn"] {
  --ground: #f2ede3; --panel: #e9e1d2;
  --text: #33383f; --dim: #6a7078;
  --accent: #a5552f; --hairline: rgba(165,85,47,0.5);
}
html[data-theme="pascha"] {
  --ground: #faf7f0; --panel: #f1ece0;
  --text: #2b2a26; --dim: #66645c;
  --accent: #b08d2e; --hairline: rgba(176,141,46,0.5);
}

/* --- reader-set text size (progressive enhancement; regular = no attr) ---
   Everything is rem/em, so scaling the root scales the whole page and keeps
   the line measure constant. The default (browser 16px) needs no attribute. */
html[data-size="small"] { font-size: 90%; }
html[data-size="large"] { font-size: 120%; }

/* --- base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--ground);
  color: var(--text);
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.75;
}

/* --- masthead / nav (interior chrome) --- */
.masthead { text-align: center; padding: 2.2rem 1.25rem 0; }
.masthead a.home {
  text-decoration: none; color: var(--text);
  letter-spacing: 0.26em; text-transform: uppercase; font-size: 1.05rem;
}
.masthead svg { display: inline-block; vertical-align: -0.1em; margin-right: 0.6rem; }
.masthead svg path { fill: var(--text); }
.rule { max-width: 36em; margin: 1.2rem auto 0; border: 0; border-top: 1px solid var(--hairline); }
nav.top {
  text-align: center; padding: 0.9rem 1rem;
  font-size: 0.9rem; letter-spacing: 0.14em; text-transform: uppercase;
}
nav.top a { color: var(--accent); text-decoration: none; margin: 0 0.35rem; white-space: nowrap; }
nav.top a:hover { text-decoration: underline; }
nav.top .sep { color: var(--accent); margin: 0 0.35rem; }

/* --- reading measure --- */
main { max-width: 33em; margin: 0 auto; padding: 2.4rem 1.25rem 3rem; }
.reading-no {
  text-align: center; color: var(--accent);
  letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.9rem;
}
h1 { font-weight: normal; font-size: 1.9rem; text-align: center; margin: 0.4rem 0 2.2rem; color: var(--text); }
h2 {
  font-weight: normal; color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.95rem; margin: 2.6rem 0 1rem;
}
h3 { font-weight: normal; color: var(--text); font-size: 1.15rem; text-align: center; font-style: italic; margin: -1rem 0 1.8rem; }
.ref { font-weight: bold; margin-bottom: 0.6rem; }
blockquote { border-left: 2px solid var(--accent); padding-left: 1.1rem; margin: 0 0 1.4rem; }
blockquote p { margin: 0 0 1rem; }
blockquote p:last-child { margin-bottom: 0; }
p { margin: 0 0 1.4rem; }
main hr { border: 0; border-top: 1px solid var(--hairline); margin: 2rem 0; }

/* drop cap: readings' word for the week, and belief/essay openings */
.word p.first::first-letter, p.lead::first-letter {
  float: left; font-size: 3.2em; line-height: 0.84; padding: 0.05em 0.12em 0 0; color: var(--accent);
}
.attribution {
  margin-top: 2.6rem; padding-top: 1.1rem; border-top: 1px solid var(--hairline);
  font-style: italic; font-size: 0.9rem; color: var(--accent);
}

/* --- tables (the year / the course) --- */
table { border-collapse: collapse; width: 100%; margin: 0 0 1.6rem; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.35rem 0.6rem 0.35rem 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: normal; }
th:last-child, td:last-child { text-align: center; }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }

/* --- pager (readings) --- */
.pager {
  max-width: 33em; margin: 0 auto; padding: 0 1.25rem 2rem;
  display: flex; justify-content: space-between; font-size: 0.95rem;
}
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }

/* --- footer --- */
footer {
  max-width: 36em; margin: 0 auto; padding: 1.3rem 1.25rem 2.2rem;
  border-top: 1px solid var(--hairline); text-align: center;
  font-style: italic; font-size: 0.9rem; color: var(--dim);
}

/* --- doorways (front page + section index pages) --- */
.doors { margin: 2.4rem 0; }
.door {
  display: block; border: 1px solid var(--hairline);
  padding: 1.1rem 1.4rem; margin: 0 0 1rem;
  text-decoration: none; color: var(--text); background: var(--panel);
}
.door:hover { border-color: var(--accent); }
.door b { display: block; font-weight: normal; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 0.2rem; }
.door span { color: var(--dim); font-size: 0.95rem; }

/* --- front cover --- */
.horizon {
  height: 38vh; min-height: 220px; position: relative;
  background:
    radial-gradient(ellipse 140% 68% at 50% 102%,
      color-mix(in srgb, var(--accent) 34%, transparent) 0%,
      color-mix(in srgb, var(--accent) 16%, transparent) 34%,
      transparent 72%),
    var(--ground);
  border-bottom: 1px solid var(--hairline);
}
.star { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); }
.star path { fill: var(--text); }
main.cover h1 { letter-spacing: 0.22em; text-transform: uppercase; margin: 0; }
.tagline { text-align: center; font-style: italic; color: var(--dim); margin: 0.9rem 0 3rem; }
.maranatha { text-align: center; font-style: italic; color: var(--accent); margin-top: 3rem; }

/* --- the picker (hidden until JS reveals it) --- */
#theme-picker {
  max-width: 36em; margin: 0 auto; padding: 0.6rem 1.25rem 0.2rem;
  text-align: center; font-size: 0.82rem; color: var(--dim);
}
#theme-picker span.label { letter-spacing: 0.14em; text-transform: uppercase; margin-right: 0.4rem; }
#theme-picker button {
  background: none; border: 0; cursor: pointer; font: inherit;
  color: var(--accent); margin: 0 0.3rem; padding: 0.1rem 0;
}
#theme-picker button:hover { text-decoration: underline; }

/* --- print: the paper prayer book, whatever the hour or size --- */
@media print {
  html[data-size] { font-size: 100%; }
  body { background: #fff; color: #26221c; }
  nav.top, .pager, #theme-picker, .horizon { display: none; }
  .masthead a.home, h1, h3, .ref, blockquote, p, .door, td a, a { color: #26221c; }
  .reading-no, h2, .attribution, .word p.first::first-letter, p.lead::first-letter, .door b, .maranatha { color: #8e2f26; }
  blockquote { border-left-color: #8e2f26; }
  .rule, .attribution, footer, th, td, .door, main hr { border-color: #8e2f26; }
  footer { color: #5a5347; }
  .masthead svg path, .star path { fill: #8e2f26; }
  .tagline, .door span { color: #5a5347; }
  .door { background: #fff; }
}
