:root {
  --site-ink: #19343a;
  --site-muted: #526a6d;
  --site-deep: #173f47;
  --site-teal: #126f75;
  --site-gold: #bd844a;
  --site-line: #dbe7e5;
  --site-paper: #fffefa;
  --site-background: #f3f7f4;
  color-scheme: light;
}

@media screen {
  :root[data-site-theme="dark"] {
    --site-ink: #e5eee9;
    --site-muted: #b0c2bc;
    --site-deep: #e5eee9;
    --site-teal: #8ad3c7;
    --site-gold: #e3b883;
    --site-line: #35504d;
    --site-paper: #192a2b;
    --site-background: #101c1d;
    --site-button: #285957;
    --site-button-hover: #326c67;
    --theme-ink: var(--site-ink);
    --theme-muted: var(--site-muted);
    --theme-accent: var(--site-gold);
    --theme-link: #8ad3c7;
    --theme-line: var(--site-line);
    --theme-surface: var(--site-paper);
    --theme-raised: #223637;
    --theme-warm: #33372f;
    --theme-page-background: var(--site-background);
    color-scheme: dark;
  }

  :root[data-site-theme="dark"] body.modern-site {
    background: radial-gradient(circle at 85% 0, #1c3633, transparent 34rem), var(--site-background) !important;
  }

  :root[data-site-theme="dark"] .site-header {
    border-color: var(--site-line);
    background: rgb(16 28 29 / 96%);
  }

  :root[data-site-theme="dark"] body.modern-site .modern-main :is(font[color], [style*="color"]),
  :root[data-site-theme="dark"] body.modern-site .modern-main [bgcolor] {
    color: inherit !important;
  }

  :root[data-site-theme="dark"] body.modern-site .modern-main :is([bgcolor], [style*="background-color"]) {
    background-color: var(--site-paper) !important;
  }

  :root[data-site-theme="dark"] body.modern-site .search-panel {
    background: var(--site-paper);
  }

  :root[data-site-theme="dark"] body.modern-site .search-results p {
    color: var(--site-muted);
  }

  :root[data-site-theme="dark"] body.modern-site .search-results li {
    border-color: var(--site-line);
  }

  :root[data-site-theme="dark"] body.modern-site :is(input, textarea)::placeholder {
    color: var(--site-muted);
    opacity: 1;
  }

  :root[data-site-theme="dark"] .about-timeline li::before {
    box-shadow: 0 0 0 6px var(--theme-raised);
  }
}

html {
  scroll-behavior: smooth;
}

body.modern-site {
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0;
  background: var(--theme-page-background, radial-gradient(circle at 85% 0, #e8f3ee, transparent 34rem), var(--site-background)) !important;
  color: var(--site-ink) !important;
  font: 1rem/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body.modern-site *,
body.modern-site *::before,
body.modern-site *::after {
  box-sizing: border-box;
}

body.modern-site a {
  color: var(--theme-link, #075e73);
  text-underline-offset: 0.18em;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

body.modern-site a:hover {
  color: var(--theme-accent, #a45f2d);
}

body.modern-site :focus-visible {
  outline: 3px solid var(--site-gold);
  outline-offset: 3px;
}

.site-skip-link {
  position: fixed;
  z-index: 400;
  top: -5rem;
  left: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
  background: var(--site-button, var(--site-deep));
  color: white !important;
}

.site-skip-link:focus {
  top: 0;
}

.site-reading-progress {
  position: absolute;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  background: var(--site-gold);
  transition: width 100ms linear;
}

.site-header {
  position: sticky;
  z-index: 200;
  top: 0;
  border-bottom: 1px solid rgb(25 67 69 / 10%);
  background: rgb(255 254 250 / 94%);
  box-shadow: 0 8px 28px rgb(18 55 58 / 6%);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
  width: min(100% - 2rem, 1400px);
  min-height: 78px;
  margin: auto;
}

.site-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.7rem;
  max-width: 320px;
  color: var(--site-deep) !important;
  text-decoration: none;
}

.site-brand img {
  width: 44px;
  height: 44px;
  border: 2px solid var(--theme-line, #f5e9d6);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 25%;
}

.site-brand strong,
.site-brand small {
  display: block;
}

.site-brand strong {
  font: 700 1.04rem/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.site-brand small {
  margin-top: 0.12rem;
  color: var(--site-muted);
  font: 600 0.66rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modern-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
}

.modern-nav a {
  display: block;
  padding: 0.52rem 0.65rem;
  border-radius: 9px;
  color: var(--site-deep) !important;
  font-size: 0.87rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.modern-nav a:hover,
.modern-nav a[aria-current="page"] {
  background: var(--theme-raised, #e3f0ec);
  color: var(--theme-ink, #0b6669) !important;
}

.site-header [hidden] {
  display: none !important;
}

.site-about {
  position: relative;
}

.site-about summary {
  min-height: 44px;
  padding: 0.52rem 0.65rem;
  border-radius: 9px;
  color: var(--site-deep);
  font-size: 0.87rem;
  font-weight: 650;
  cursor: pointer;
}

.site-about summary:hover,
.site-about[open] > summary,
.site-about[data-current="true"] > summary {
  background: var(--theme-raised, #e3f0ec);
}

.site-about-links {
  position: absolute;
  right: 0;
  z-index: 1;
  min-width: 230px;
  padding: 0.5rem;
  border: 1px solid var(--site-line);
  border-radius: 12px;
  background: var(--site-paper);
  box-shadow: 0 12px 32px rgb(18 55 58 / 14%);
}

.site-header-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: min(220px, 17vw);
  margin: 0;
}

.site-header-search input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--theme-line, #c7dad6);
  border-radius: 9px;
  background: var(--theme-surface, white);
  color: var(--site-ink);
  font: inherit;
  font-size: 0.86rem;
}

.site-header-search button,
.site-menu-toggle,
.site-media-toolbar button,
.site-preview-button,
.site-modal-close,
.site-top-button {
  border: 0;
  cursor: pointer;
  font: 650 0.85rem/1.2 system-ui, sans-serif;
}

.site-header-search button {
  padding: 0.62rem 0.8rem;
  border-radius: 9px;
  background: var(--site-button, var(--site-deep));
  color: white;
}

.site-header-search button:hover,
.site-preview-button:hover,
.site-media-toolbar button:hover {
  background: #0a5d65;
  color: white;
}

.site-menu-toggle {
  display: none;
  margin-left: auto;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--site-line);
  border-radius: 10px;
  background: var(--theme-surface, white);
  color: var(--site-deep);
}

.site-theme-toggle {
  display: inline-flex;
  order: 4;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 88px;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--site-line);
  border-radius: 99px;
  background: var(--site-paper);
  color: var(--site-deep);
  font: 700 0.8rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.site-theme-toggle:hover {
  border-color: var(--site-gold);
}

.site-theme-toggle svg {
  flex-shrink: 0;
}

.site-theme-moon,
[data-site-theme="dark"] .site-theme-sun {
  display: none;
}

[data-site-theme="dark"] .site-theme-moon {
  display: block;
}

.site-page-intro {
  width: min(100% - 2rem, 1300px);
  margin: clamp(1.6rem, 4vw, 3.4rem) auto 1.35rem;
  animation: site-enter 500ms ease both;
}

.site-page-intro p {
  margin: 0 0 0.35rem;
  color: var(--site-teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.site-page-intro h1 {
  max-width: 1000px;
  margin: 0;
  color: var(--site-deep);
  font: 700 clamp(1.8rem, 3.4vw, 3.2rem)/1.15 Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
}

.site-page-intro span {
  display: block;
  width: 76px;
  height: 4px;
  margin-top: 1.05rem;
  border-radius: 10px;
  background: var(--theme-warm, linear-gradient(90deg, var(--site-gold), #e1c299));
}

body.modern-site .modern-main {
  width: min(100% - 2rem, 920px);
  margin: 0 auto 3.5rem;
  padding: clamp(1.3rem, 4vw, 3.3rem);
  border: 1px solid var(--site-line);
  border-radius: 20px;
  background: var(--site-paper);
  box-shadow: 0 22px 65px rgb(22 62 64 / 8%);
  animation: site-enter 620ms ease both;
}


body.modern-site .modern-main.is-home {
  width: min(100% - 2rem, 1300px);
}

body.modern-site .modern-main font {
  font-family: inherit;
}

body.modern-site .modern-main p {
  margin-top: 0.8rem;
  margin-bottom: 1.15rem;
}

body.modern-site .modern-main h2,
body.modern-site .modern-main h3,
body.modern-site .modern-main h4 {
  color: var(--site-deep);
  line-height: 1.25;
}

body.modern-site .modern-main h2 {
  margin-top: 1.8em;
  font: 700 clamp(1.45rem, 2.4vw, 2rem)/1.25 Georgia, "Times New Roman", serif;
}

body.modern-site .modern-main h3 {
  margin-top: 1.55em;
  font-size: 1.23rem;
}

body.modern-site .modern-main li {
  margin-bottom: 0.42rem;
}

body.modern-site .modern-main img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

body.modern-site .modern-main iframe,
body.modern-site .modern-main video {
  max-width: 100%;
}

body.modern-site .modern-main hr {
  height: 1px;
  margin: 1.6rem 0;
  border: 0;
  background: var(--site-line);
}

body.modern-site .modern-main blockquote {
  margin: 1.35rem 0;
  padding: 0.8rem 1.2rem;
  border-left: 4px solid var(--site-gold);
  border-radius: 0 10px 10px 0;
  background: var(--theme-raised, #f8f5ee);
}

.scripture-reference {
  color: var(--site-muted, #526a6d);
  font-size: 0.9em;
  font-style: normal;
  font-weight: 600;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
}

.scripture-reference--block {
  display: block;
  margin-top: 0.55rem;
}

body.modern-site .modern-main fieldset {
  min-width: 0;
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--theme-line, #c9ddda);
  border-radius: 14px;
  background: var(--theme-raised, #f8fcf9);
}

body.modern-site .modern-main legend {
  padding: 0 0.5rem;
  color: var(--site-deep);
  font-weight: 700;
}

body.modern-site .modern-main input,
body.modern-site .modern-main button,
body.modern-site .modern-main select {
  font: inherit;
}

body.modern-site .modern-main table {
  max-width: 100%;
}

.site-page-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--site-line);
  border-radius: 16px;
  background: var(--theme-raised, linear-gradient(135deg, #f9fcf8, #edf5ef));
  box-shadow: 0 10px 28px rgb(18 55 58 / 6%);
}

.site-page-navigation__eyebrow {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--site-teal);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-page-navigation__shortcuts {
  font-size: 0.85rem;
}

.site-page-navigation__shortcuts a + a::before {
  display: inline-block;
  margin: 0 0.55rem;
  color: var(--theme-muted, #92aaa5);
  content: "/";
}

.site-page-navigation__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

body.modern-site .site-page-navigation__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 108px;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--theme-line, #bdd4cf);
  border-radius: 11px;
  background: var(--theme-surface, white);
  color: var(--site-deep);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 4px 12px rgb(18 55 58 / 5%);
}

body.modern-site .site-page-navigation__link.is-next {
  border-color: var(--site-deep);
  background: var(--site-button, var(--site-deep));
  color: white;
}

body.modern-site .site-page-navigation__link:hover {
  transform: translateY(-2px);
  border-color: var(--site-teal);
  color: var(--site-teal);
  box-shadow: 0 8px 18px rgb(18 55 58 / 12%);
}

body.modern-site .site-page-navigation__link.is-next:hover {
  background: var(--site-button-hover, var(--site-teal));
  color: white;
}

body.modern-site .modern-main > table:first-of-type {
  width: 100%;
  margin-bottom: 1.2rem;
  border: 1px solid var(--theme-line, #d7e4dc);
  border-radius: 12px;
  background: var(--theme-raised, #eaf3ed);
  overflow: hidden;
}

body.modern-site .modern-main > table:first-of-type td {
  padding: 0.9rem !important;
  background: var(--theme-raised, #eaf3ed) !important;
  color: var(--site-deep);
}

body.modern-site .modern-main > table:not(:first-of-type) {
  display: block;
  width: 100%;
  overflow-x: auto;
}

body.modern-site .archive-content > center:first-child {
  display: block;
  margin: 0 0 1.2rem;
  color: var(--site-deep);
}

body.modern-site .archive-content > center:first-child font:first-child {
  color: var(--site-deep) !important;
  font: 700 clamp(1.7rem, 3vw, 2.8rem)/1.16 Georgia, "Times New Roman", serif !important;
}

body.modern-site .archive-content table td {
  vertical-align: top;
}

.site-media-card {
  width: min(100%, 500px);
  margin: 0.4rem 0 1.2rem;
  padding: 0.9rem;
  border: 1px solid var(--theme-line, #d5e5df);
  border-radius: 13px;
  background: var(--theme-raised, linear-gradient(145deg, #fbfefa, #eff7f3));
  box-shadow: 0 6px 18px rgb(21 68 64 / 5%);
}

.site-media-title {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--site-deep);
  font-size: 0.88rem;
  font-weight: 750;
}

.site-media-card audio {
  display: block;
  width: 100%;
  height: 42px;
}

.site-media-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.65rem;
}

.site-media-toolbar button,
.site-media-toolbar select,
.site-media-toolbar a,
.site-preview-button {
  display: inline-block;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--theme-line, #c7dbd5);
  border-radius: 7px;
  background: var(--theme-surface, white);
  color: var(--site-deep) !important;
  font: 650 0.75rem/1.2 system-ui, sans-serif;
  text-decoration: none;
}

.site-media-toolbar select {
  cursor: pointer;
}

.site-preview-button {
  margin: 0.12rem 0.35rem;
  cursor: pointer;
}

.site-modal {
  width: min(960px, calc(100% - 1.5rem));
  max-height: min(92vh, 1000px);
  padding: 0;
  border: 1px solid var(--theme-line, #c8dcda);
  border-radius: 16px;
  background: var(--theme-surface, white);
  box-shadow: 0 24px 90px rgb(10 35 38 / 35%);
}

.site-modal::backdrop {
  background: rgb(8 30 37 / 72%);
  backdrop-filter: blur(4px);
}

.site-modal-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--theme-raised, #f3f8f5);
}

.site-modal-bar strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--site-deep);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-modal-bar a {
  font-size: 0.82rem;
}

.site-modal-close {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--site-button, var(--site-deep));
  color: white;
}

.site-modal iframe {
  display: block;
  width: 100%;
  height: min(75vh, 800px);
  border: 0;
  background: var(--theme-surface, white);
}

.site-modal.is-video iframe {
  height: auto;
  aspect-ratio: 16 / 9;
  background: #0c1720;
}

.site-top-button {
  position: fixed;
  z-index: 190;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--site-button, var(--site-deep));
  color: white;
  box-shadow: 0 8px 25px rgb(14 52 56 / 25%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.site-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-footer {
  width: min(100% - 2rem, 1300px);
  margin: 2rem auto 0;
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--theme-line, #ccdeda);
  color: var(--site-muted);
  font-size: 0.82rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem 2rem;
}

.site-footer p {
  margin: 0;
}

body.modern-site .search-page {
  width: min(100% - 2rem, 900px);
  max-width: none;
  margin: 2rem auto 3rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: 18px;
  background: var(--theme-surface, white);
  box-shadow: 0 18px 50px rgb(22 62 64 / 8%);
}

body.modern-site .search-panel {
  padding: 0;
  box-shadow: none;
}

body.modern-site .search-panel h1 {
  color: var(--site-deep);
  font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.2 Georgia, "Times New Roman", serif;
}

body.modern-site .search-form input {
  border-color: var(--theme-line, #bdd4cf);
}

body.modern-site .search-form button {
  background: var(--site-button, var(--site-deep));
}

body.modern-site .search-form button:hover {
  background: #0a5d65;
}

@keyframes site-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  .site-header-search {
    display: none;
  }
}

@media (max-width: 1040px) {
  .site-header-inner {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem 0;
  }

  .site-brand {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  .site-brand span {
    min-width: 0;
  }

  .site-brand img {
    flex-shrink: 0;
  }

  .site-theme-toggle {
    order: 1;
  }

  .site-menu-toggle {
    display: block;
    order: 2;
    flex-shrink: 0;
    min-height: 44px;
    margin-left: 0;
  }

  .modern-nav {
    display: flex;
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
    margin: 0;
    padding: 0.4rem 0 0.2rem;
    border-top: 1px solid var(--site-line);
  }

  .site-header.is-enhanced:not(.is-open) .modern-nav {
    display: none;
  }

  .site-about {
    width: 100%;
  }

  .site-about-links {
    position: static;
    width: 100%;
    margin-top: 0.4rem;
    box-shadow: none;
  }

  .modern-nav .site-about-links a {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .site-theme-toggle {
    min-width: 44px;
    width: 44px;
    padding: 0;
  }

  .site-theme-label {
    display: none;
  }

  .site-brand small {
    letter-spacing: 0.03em;
  }
}

@media (max-width: 600px) {
  .site-page-navigation {
    padding: 1rem;
  }

  .site-page-navigation__context,
  .site-page-navigation__actions {
    width: 100%;
  }

  body.modern-site .site-page-navigation__link {
    flex: 1 1 0;
    min-width: 0;
    gap: 0.4rem;
    padding: 0.65rem 0.45rem;
  }

  .site-brand strong {
    font-size: 0.9rem;
  }

  .site-brand small {
    font-size: 0.59rem;
  }

  .site-brand img {
    width: 38px;
    height: 38px;
  }

  .modern-nav a {
    width: calc(50% - 0.2rem);
  }

  body.modern-site .modern-main,
  body.modern-site .search-page {
    width: min(100% - 1rem, 100%);
    border-radius: 13px;
  }

  body.modern-site .modern-main {
    overflow-wrap: anywhere;
  }

  body.modern-site .modern-main table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
  }

  .site-modal-bar {
    flex-wrap: wrap;
  }

  .site-modal-bar strong {
    flex-basis: 100%;
  }
}

@media (max-width: 360px) {
  .site-header-inner {
    gap: 0.45rem;
  }

  .site-brand {
    flex: 1 1 0;
    min-width: 0;
    gap: 0.45rem;
  }

  .site-brand span {
    min-width: 0;
  }

  .site-brand img {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }

  .site-brand strong {
    font-size: 0.78rem;
  }

  .site-brand small {
    display: none;
  }

  .site-menu-toggle {
    flex: 0 0 auto;
    padding: 0.5rem 0.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body.modern-site *,
  body.modern-site *::before,
  body.modern-site *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .scripture-reference {
    color: #263b3d;
  }

  body.modern-site {
    background: var(--theme-surface, white) !important;
  }

  .site-header,
  .site-footer,
  .site-top-button,
  .site-preview-button,
  .site-media-toolbar {
    display: none !important;
  }

  body.modern-site .modern-main {
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}
