/* Open Chronicles — online reading edition stylesheet (Direction A: Parchment & Rubric)
   Used by the book reading pages under /books/<work>/. Fonts via Google Fonts (site pattern). */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..700;1,400..700&family=Cormorant+Garamond:ital,wght@0,400..700;1,400..700&family=Source+Sans+3:wght@400;600&display=swap');

:root {
  --oc-parchment: #f6f0e4;
  --oc-parchment-deep: #ebe3d2;
  --oc-ink: #1f1a17;
  --oc-ink-soft: #3d3630;
  --oc-muted: #6b635a;
  --oc-rule: #c4b8a6;
  --oc-rubric: #6b2e2e;
  --oc-rubric-deep: #4a1f1f;
  --oc-white: #fffcf7;
  --oc-measure: 42rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--oc-parchment); color: var(--oc-ink);
  font-family: "EB Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.16rem; line-height: 1.6;
}

.book-header {
  background: var(--oc-white); border-bottom: 1px solid var(--oc-rule);
  padding: 0.6rem 1rem; font-family: "Source Sans 3", system-ui, sans-serif; font-size: 0.85rem;
}
.book-header .inner { max-width: var(--oc-measure); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.book-header a { color: var(--oc-rubric); text-decoration: none; }
.book-header a:hover { color: var(--oc-rubric-deep); text-decoration: underline; }
.book-header .badge { color: var(--oc-muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }

.book { max-width: var(--oc-measure); margin: 0 auto; padding: 2.5rem 1.2rem 4rem; }
.sheet { background: var(--oc-white); border: 1px solid var(--oc-rule); border-radius: 2px; padding: clamp(1.4rem, 5vw, 3.4rem); box-shadow: 0 1px 6px rgba(31,26,23,0.08); }

.title-block { text-align: center; margin: 1.5rem 0 3rem; }
.title-block .series { font-family: "Cormorant Garamond", serif; letter-spacing: 0.22em; text-transform: uppercase; color: var(--oc-muted); font-size: 0.85rem; margin-bottom: 2.2rem; }
.title-block .main-title { font-family: "Cormorant Garamond", serif; font-weight: 500; color: var(--oc-rubric-deep); font-size: clamp(1.9rem, 5.5vw, 2.7rem); line-height: 1.15; margin: 0 0 0.4rem; }
.edition--faithful .title-block .main-title { font-style: italic; }
.edition--reader .title-block .main-title { color: var(--oc-rubric); }
.title-block .subtitle { color: var(--oc-ink-soft); font-size: 1.1rem; margin: 0 0 1.2rem; }
.edition--faithful .title-block .subtitle { font-variant: small-caps; letter-spacing: 0.05em; }
.title-block .title-rule { width: 7rem; border: none; border-top: 1px solid var(--oc-rubric); margin: 0 auto 1.1rem; }
.title-block .author { font-family: "Cormorant Garamond", serif; font-size: 1.25rem; }
.title-block .edition-badge { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--oc-rubric); margin-top: 1.1rem; font-family: "Source Sans 3", system-ui, sans-serif; }

p { margin: 0 0 0.7em; }
em { font-style: italic; }
hr { border: none; border-top: 1px solid var(--oc-rule); margin: 2.2rem 20%; }

h2.chapter, .front-section h2, .back-matter h2, h2.contents-title {
  font-family: "Cormorant Garamond", serif; font-weight: 500; color: var(--oc-rubric-deep);
  font-size: 1.7rem; text-align: center; margin: 3rem 0 1.2rem; line-height: 1.2;
}
.edition--reader h2.chapter { color: var(--oc-rubric); }
h3.section, .back-matter h3 { font-family: "Cormorant Garamond", serif; color: var(--oc-rubric); font-size: 1.25rem; margin: 1.6em 0 0.4em; }

.folio { text-align: right; font-size: 0.75rem; color: var(--oc-rubric); font-variant: small-caps; letter-spacing: 0.08em; margin: 1.3em 0 0.4em; }
.folio::before { content: ""; display: inline-block; width: 3.5rem; border-top: 1px solid var(--oc-rule); vertical-align: middle; margin-right: 0.4rem; }
.folio a { color: inherit; text-decoration: none; }

.contents-note, .editorial-note { font-size: 0.85rem; color: var(--oc-muted); font-style: italic; }
.contents-note { text-align: center; margin: -0.4rem 0 1.6rem; }
.toc-line { display: flex; align-items: baseline; margin-bottom: 0.45em; }
.toc-title { }
.toc-title a { color: var(--oc-ink); text-decoration: none; }
.toc-title a:hover { color: var(--oc-rubric); }
.toc-leader { flex: 1; border-bottom: 1px dotted var(--oc-rule); margin: 0 0.4em 0.3em; min-width: 1.5em; }
.toc-loc { color: var(--oc-ink-soft); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.toc-section { font-variant: small-caps; letter-spacing: 0.08em; color: var(--oc-rubric); margin: 1.2em 0 0.5em; }

.colophon { font-size: 0.85rem; line-height: 1.5; color: var(--oc-ink-soft); border-top: 1px solid var(--oc-rule); margin-top: 3rem; padding-top: 1.4rem; }
.colophon h3 { font-family: "Cormorant Garamond", serif; color: var(--oc-rubric); margin: 1em 0 0.2em; font-size: 1rem; }
.colophon .colophon__title { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 1.1rem; color: var(--oc-rubric-deep); }
.colophon .colophon__series, .colophon .colophon__edition { letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.72rem; color: var(--oc-muted); }
.colophon ul { margin: 0.2em 0 0.6em 1.2em; padding: 0; }
.colophon .muted { color: var(--oc-muted); }
.license-block { font-size: 0.8rem; color: var(--oc-ink-soft); margin-top: 1.2rem; }

.back-matter { font-size: 0.95rem; }
.back-matter ul { margin: 0.4em 0 1em 1.3em; padding: 0; }
.back-matter li { margin-bottom: 0.4em; }
table { border-collapse: collapse; font-size: 0.85rem; margin: 1em 0; width: 100%; }
th { font-variant: small-caps; letter-spacing: 0.05em; color: var(--oc-rubric); text-align: left; border-bottom: 1px solid var(--oc-rule); padding: 0.2em 0.6em 0.2em 0; }
td { vertical-align: top; border-bottom: 1px solid var(--oc-parchment-deep); padding: 0.25em 0.6em 0.25em 0; }

.book-footer { text-align: center; font-family: "Source Sans 3", system-ui, sans-serif; font-size: 0.78rem; color: var(--oc-muted); padding: 0 1rem 3rem; }
.book-footer a { color: var(--oc-rubric); }
