/* ===== Color tokens ===== */

:root {
  --bg: #F9F6EF;
  --text: #2B1F10;
  --muted: #5C4A30;
  --accent: #C4A86A;
  --label: #8C7355;

  /* Content text — Crimson Pro serif, article body and all content headings */
  --font-content: 'Crimson Pro', Georgia, serif;
  --size-content: 1.125rem;
  --leading-content: 1.8;

  /* UI shell — fixed nav controls, article-nav, footer */
  --font-ui: system-ui, sans-serif;
  --size-ui: 0.85rem;
  --leading-ui: 1.4;

  /* Labels — dates, meta, breadcrumb, h2 section dividers, blockquote attribution */
  --font-label: system-ui, sans-serif;
  --size-label: 0.8rem;
  --leading-label: 1.3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #DDDBD4;
    --muted: #888880;
    --accent: #555550;
    --label: #666660;
  }
}

[data-theme="light"] {
  --bg: #F9F6EF;
  --text: #2B1F10;
  --muted: #5C4A30;
  --accent: #C4A86A;
  --label: #8C7355;
}

[data-theme="dark"] {
  --bg: #111111;
  --text: #DDDBD4;
  --muted: #888880;
  --accent: #555550;
  --label: #666660;
}

/* ===== Reset ===== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

/* ===== Base ===== */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-content);
  font-size: var(--size-content);
  line-height: var(--leading-content);
}

/* ===== Reading container ===== */

.reading-container {
  max-width: 75ch;
  margin-inline: auto;
  padding-inline: 1.25rem;
  padding-block: 3.5rem 2.5rem;
}

article {
  line-height: var(--leading-content);
}

article h1 {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.date {
  display: block;
  font-family: var(--font-label);
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2rem;
}


/* ===== Headings ===== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-content);
  font-weight: 400;
  color: var(--text);
}

h1 {
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  line-height: 1.2;
  margin-block: 0 0.25rem;
}

/* h2 is styled as a section-divider label, not a content heading */
h2 {
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--label);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.35rem;
  margin-block: 3rem 1.25rem;
}

/* h3 and h4 are local content headings */
article h3,
article h4 {
  display: block;
  width: fit-content;
  max-width: 100%;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--label);
  margin-block: 1.5rem 0.6rem;
  padding-bottom: 0.12rem;
  border-bottom: 1px solid var(--accent);
}

/* ===== Links ===== */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.7;
}

/* ===== Paragraphs ===== */

p {
  margin-block: 0 1.25rem;
}

/* ===== Subtitle ===== */

.subtitle {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  margin-block: 0.1rem 1.5rem;
}

/* Article page header */
.article-subtitle {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  margin-block: 0.1rem 0.35rem;
}

.article-description {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin-block: 0 1.5rem;
  max-width: 60ch;
}

/* Homepage and series card lists */
.card-subtitle {
  font-style: italic;
  color: var(--muted);
  font-size: 0.95rem;
  margin-block: 0.15rem 0.2rem;
}

.card-description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-block: 0;
}

/* ===== Date / meta ===== */

.date,
.meta {
  display: block;
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-style: normal;
  color: var(--muted);
  margin-block: 0.2rem 1.75rem;
}

/* ===== Table of Contents ===== */

.toc {
  border: 1px solid var(--accent);
  padding: 1rem 1.25rem 0.75rem;
  margin-block: 0 2rem;
  font-family: var(--font-label);
  font-size: var(--size-label);
}

.toc-label {
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--label);
  margin-block: 0 0.6rem;
}

.toc #TableOfContents ul {
  list-style: none;
  padding: 0;
  margin-block: 0;
}

.toc #TableOfContents > ul > li {
  margin-bottom: 0.35rem;
}

.toc #TableOfContents > ul > li > ul {
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.toc #TableOfContents > ul > li > ul > li {
  font-size: calc(var(--size-label) * 0.92);
  margin-bottom: 0.2rem;
  color: var(--muted);
}

.toc #TableOfContents a {
  text-decoration: none;
  color: var(--muted);
}

.toc #TableOfContents a:hover {
  color: var(--text);
  opacity: 1;
}

/* ===== Blockquotes ===== */

blockquote {
  border-left: 2px solid var(--accent);
  margin-inline: 0;
  padding-inline: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-block: 1rem;
}

blockquote strong {
  display: block;
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: 600;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label);
  margin-bottom: 0.2rem;
}

/* ===== HR ===== */

hr {
  border: none;
  border-top: 1px solid var(--accent);
  opacity: 0.35;
  margin-block: 2rem;
}

/* ===== Tables ===== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 1.5rem;
}

th, td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--accent);
}

thead th {
  border-bottom-color: var(--label);
}

/* ===== Article list (homepage) ===== */

ul {
  list-style: none;
  padding: 0;
  margin-block: 0 1rem;
}

li {
  margin-bottom: 1.75rem;
}

.description {
  font-size: 0.95rem;
  color: var(--muted);
  margin-block: 0.2rem 0;
}

/* ===== Nav ===== */

nav.article-nav {
  margin-top: 3rem;
  font-family: var(--font-ui);
  font-size: var(--size-ui);
}

nav.article-nav a {
  color: var(--muted);
}

.nav-series {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===== Footer ===== */

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--accent);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.65;
}

/* ===== Fixed Navigation Controls ===== */

.nav-controls {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  font-family: var(--font-ui);
  font-size: var(--size-ui);
  font-weight: 600;
}

.lang-switch a, 
.lang-switch span.active {
  padding: 0 0.5rem;
  text-decoration: none;
}

.lang-switch a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.lang-switch a:hover {
  color: var(--text);
}

.lang-switch span.active {
  color: var(--muted);
  opacity: 0.3;
  cursor: default;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  line-height: 0;
  display: flex;
  align-items: center;
}

#theme-toggle:hover {
  color: var(--text);
}

#theme-toggle svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.breadcrumb {
  margin: 0 0 1.25rem;
  font-family: var(--font-label);
  font-size: var(--size-label);
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  color: var(--muted);
}

.series-page h1 {
  margin-bottom: 1.25rem;
}

/* ===== Large-screen reading enhancements ===== */

@media (min-width: 640px) {
  :root {
    --size-content: 1.1875rem;
    --leading-content: 1.75;
  }

  .reading-container {
    max-width: 78ch;
    padding-inline: 1.5rem;
  }

  .nav-controls {
    gap: 1.25rem;
  }

  .nav-series {
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
  }

  blockquote {
    padding-inline: 1.25rem;
  }

  article h3,
  article h4 {
    font-size: 1.25rem;
  }

  .companion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
    margin-block: 0 1rem;
  }

  .companion-grid li {
    margin-bottom: 1rem;
  }
}

/* ===== Scripture note (between TOC and article body) ===== */

.scripture-note {
  font-family: var(--font-label);
  font-size: var(--size-label);
  color: var(--muted);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-block: 0.75rem;
  margin-block: 0 2rem;
  line-height: 1.6;
}

.scripture-note p {
  margin-block: 0 0.5rem;
}

.scripture-note p:last-child {
  margin-bottom: 0;
}

.scripture-note strong {
  font-family: var(--font-label);
  font-size: var(--size-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label);
}

/* ===== Scripture footer link (end of article) ===== */

.scripture-footer {
  font-family: var(--font-label);
  font-size: var(--size-label);
  color: var(--muted);
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--accent);
  opacity: 0.8;
}