:root {
  --bg:        #F7F2E8;
  --surface:   #EFE7D6;
  --ink:      #3D2A0E;
  --ink-2:      #5C4524;
  --accent:          #7A5C12;
  --accent-2:     #b08f3e;
  --rubric:        #7A2020;
  --rule:          #C9B68A;
  --surface:      #F1E9D6;
  --surface:      #EDE3CC;
}

[data-theme="night"] {
  --bg:        #1A140A;
  --surface:   #120D06;
  --ink:      #E8DCC2;
  --ink-2:      #C4B493;
  --accent:          #c9a14a;
  --accent-2:     #b89038;
  --rubric:        #e8736e;
  --rule:          #5C4524;
  --surface:      #221810;
  --surface:      #2A1F12;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 20px;
  line-height: 1.7;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--rubric); color: var(--bg);
  padding: 0.75rem 1.25rem; z-index: 1000;
  font-family: 'Cinzel', serif; font-size: 0.9rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; outline: 3px solid var(--accent); }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Cinzel', serif; font-size: 0.85rem; letter-spacing: 0.08em;
}
.topbar a {
  color: var(--ink-2); text-decoration: none;
  text-transform: uppercase; transition: color 0.2s;
}
.topbar a:hover, .topbar a:focus { color: var(--accent); }
.topbar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.theme-toggle {
  background: transparent; border: 1px solid var(--rule);
  color: var(--ink-2); padding: 0.4rem 0.9rem;
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; border-radius: 2px; transition: all 0.2s;
}
.theme-toggle:hover, .theme-toggle:focus {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

.title-block {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.title-block::after {
  content: "✟"; position: absolute; bottom: -0.85rem; left: 50%;
  transform: translateX(-50%); background: var(--bg); color: var(--accent);
  padding: 0 0.75rem; font-size: 1.2rem;
}

.eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--rubric);
  margin-bottom: 1.4rem;
}

h1 {
  font-family: 'Cinzel', serif;
  font-weight: 600; font-size: 2.4rem;
  line-height: 1.2; color: var(--ink);
  margin-bottom: 1rem; letter-spacing: 0.01em;
}

.occasion {
  font-family: 'IM Fell English', serif;
  font-style: italic; font-size: 1.2rem;
  color: var(--ink-2); margin-bottom: 1.5rem;
}

.byline {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-2);
}

.byline .date {
  display: block; margin-top: 0.4rem;
  font-size: 0.72rem; color: var(--accent);
}

/* Propers card */
.propers {
  margin: 2rem 0 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
}
.propers h2 {
  font-family: 'Cinzel', serif;
  font-weight: 500; font-size: 0.85rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1rem 0;
  text-align: center;
  padding-bottom: 0; border: none;
}
.propers h2::after { display: none; }
.propers dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  font-size: 0.96rem;
}
.propers dt {
  font-family: 'Cinzel', serif;
  font-size: 0.74rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rubric);
  padding-top: 0.2rem;
}
.propers dd { color: var(--ink); font-style: italic; }
.propers .collect-text {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dotted var(--rule);
  font-style: italic;
  color: var(--ink-2);
  font-size: 0.97rem;
  line-height: 1.55;
}

/* Pastoral preface */
.preface {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0 3rem;
  font-style: italic;
  color: var(--ink-2);
  font-size: 1.04rem;
  line-height: 1.6;
}
.preface::before {
  content: "Pastoral Preface";
  display: block;
  font-family: 'Cinzel', serif;
  font-style: normal; font-size: 0.7rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.6rem;
}

/* Section headings */
h2 {
  font-family: 'Cinzel', serif;
  font-weight: 500; font-size: 1.32rem;
  color: var(--ink);
  margin: 3rem 0 1.4rem;
  letter-spacing: 0.02em;
  position: relative; padding-bottom: 0.5rem;
}
h2::after {
  content: ""; position: absolute; bottom: 0; left: 0;
  width: 3rem; height: 1px; background: var(--accent);
}

/* Body */
p { margin-bottom: 1.25rem; }
p + p { text-indent: 1.5em; }
h2 + p, blockquote + p, .preface + p, .pull-quote + p, .text-line + p { text-indent: 0; }

/* Drop cap */
.opening::first-letter {
  font-family: 'Cinzel', serif;
  font-weight: 600; float: left;
  font-size: 4.2rem; line-height: 0.85;
  padding: 0.4rem 0.6rem 0 0;
  color: var(--accent);
}

/* Scripture text-line (the lesson verse) */
.text-line {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.15rem;
  text-align: center;
  margin: 1.75rem auto 2.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: 580px;
  color: var(--ink);
  line-height: 1.5;
}
.text-line cite {
  display: block;
  font-family: 'Cinzel', serif;
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rubric);
  margin-top: 0.6rem;
}

/* Pull quote */
.pull-quote {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.32rem; line-height: 1.45;
  color: var(--accent);
  text-align: center;
  margin: 2.5rem auto;
  padding: 1.5rem 1rem;
  max-width: 580px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.pull-quote::before, .pull-quote::after {
  content: "✟"; position: absolute; left: 50%;
  transform: translateX(-50%); background: var(--bg);
  color: var(--accent); font-size: 0.9rem; padding: 0 0.5rem;
}
.pull-quote::before { top: -0.6rem; }
.pull-quote::after { bottom: -0.6rem; }

em, i { font-style: italic; }
strong, b { font-weight: 600; }

/* Final blessing */
.final-blessing {
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 1.75rem;
  text-align: center;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink);
  background: var(--surface);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  line-height: 1.55;
}
.final-blessing .amen {
  display: block;
  font-family: 'Cinzel', serif;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin-top: 0.85rem;
}

.cross-rule {
  text-align: center; margin: 2.5rem 0 1rem;
  color: var(--accent); font-size: 1rem;
  letter-spacing: 1.2em; padding-left: 1.2em;
}

.colophon {
  text-align: center;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-2);
  margin: 2rem auto 1rem;
  padding: 1rem 1.5rem;
  max-width: 480px;
  position: relative;
}

footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding-top: 2.5rem;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-2);
}
footer p { margin-bottom: 0.5rem; }
footer a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted var(--accent-2);
}
footer a:hover, footer a:focus { color: var(--rubric); border-bottom-color: var(--rubric); }
footer a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  main { padding: 2.5rem 1.25rem 4rem; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.18rem; }
  .pull-quote { font-size: 1.12rem; }
  .text-line { font-size: 1.05rem; }
  .topbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .topbar nav { font-size: 0.72rem; }
  .propers dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .propers dt { padding-top: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

@media print {
  body { background: white; color: black; font-size: 11pt; }
  .topbar, .skip-link, .theme-toggle, footer { display: none; }
  main { max-width: 100%; padding: 0; }
  h1, h2 { color: black; page-break-after: avoid; }
  .propers, .preface, .pull-quote, .text-line, .final-blessing {
    background: #f8f4ec;
    border-color: #888 !important;
    page-break-inside: avoid;
  }
  p { orphans: 3; widows: 3; }
  a { color: black; text-decoration: none; }
}

/* skip-link:begin */
.skip-link{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
.skip-link:focus{position:fixed;top:.75rem;left:.75rem;z-index:1000;width:auto;height:auto;margin:0;padding:.6rem 1rem;overflow:visible;clip:auto;clip-path:none;background:#2a1a08!important;color:#FAF5EB!important;font-family:'Cinzel',Georgia,serif;font-size:.8rem;letter-spacing:.08em;text-decoration:none;border-radius:3px;outline:2px solid #FAF5EB;outline-offset:-4px;box-shadow:0 0 0 2px #2a1a08,0 0 0 4px #FAF5EB}
/* skip-link:end */
