:root {
  --bg: #f5f1e8;
  --paper: #ffffff;
  --ink: #1f2933;
  --muted: #5b6670;
  --accent: #6b4f2a;
  --accent-2: #9b7a4a;
  --line: #e7dcc8;
  --soft: #faf7f2;
  --highlight: #f1e8d8;
  --shadow: 0 14px 40px rgba(33, 37, 41, 0.08);
  --radius: 18px;
  --max: 1240px;
  --checkmark-green: #2e7d32;
  --color-torah: #6b4f2a;
  --color-history: #d48806;
  --color-wisdom: #096dd9;
  --color-prophets: #cf1322;
  --color-gospels: #d4b106;
  --color-acts: #389e0d;
  --color-epistles: #08979c;
  --color-revelation: #1d1d1d;
}

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

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(to bottom, rgba(245, 241, 232, 0.96), rgba(245, 241, 232, 0.98)),
    radial-gradient(circle at top left, #efe4d0 0%, transparent 40%),
    radial-gradient(circle at bottom right, #ede2cf 0%, transparent 35%);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
}

a { color: inherit; }
p, li { font-size: 1.03rem; overflow-wrap: break-word; }
ul { margin: 0 0 18px 0; padding-left: 24px; }
li { margin-bottom: 10px; }

/* Shared Header - pill navigation matching bottom nav */
.site-header {
  background: transparent;
  color: var(--ink);
  padding: 18px 20px 0;
}
.site-nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-block;
  background: #6b4f2a;
  color: #ffffff;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(33, 37, 41, 0.12);
}
.site-nav a:hover {
  background: #4f3a20;
  color: #ffffff;
  text-decoration: none;
}


.site-nav-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 36px;
}

.study-bottom-nav {
  margin-top: 0;
}

.wrapper {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 20px 70px;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 28px;
  align-items: stretch;
  background: linear-gradient(135deg, #4f3a20 0%, #7b5a33 55%, #9b7a4a 100%);
  color: #fff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.16), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255,255,255,0.08), transparent 28%);
  pointer-events: none;
}
.hero-content,
.hero-image-wrap { position: relative; z-index: 2; min-width: 0; }
.hero-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-image-card {
  width: 100%;
  max-width: 520px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 24px 44px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
}
.hero-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  max-width: 100%;
}
.hero h1,
h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hero p { margin: 0; font-size: clamp(0.95rem, 2vw, 1.15rem); max-width: 860px; opacity: 0.95; }
.subtitle { font-size: 1.08rem; max-width: 860px; color: rgba(255,255,255,0.92); margin: 0; }
.eyebrow {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.study-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 22px 0 0;
}
.meta-box {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: Arial, Helvetica, sans-serif;
}
.meta-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 5px;
}
.meta-value { font-size: 0.98rem; font-weight: 600; }

/* General Sections */
.section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 34px 30px;
  margin-bottom: 24px;
}
.section h2 {
  margin: 0 0 20px;
  font-size: clamp(1.3rem, 2.5vw, 1.55rem);
  color: var(--accent);
  line-height: 1.25;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
.section h3 {
  margin: 28px 0 10px;
  font-size: 1.08rem;
  color: #3f2f19;
}

/* Homepage Cards and Study Buttons */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
}
.card,
.study-row {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.card {
  transition: all 0.2s ease;
  padding: 20px;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  background: #f1e8d8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
}
.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.study-row {
  display: flex;
  align-items: center;
  padding: 5px 12px;
}
.study-btn {
  flex-grow: 1;
  display: block;
  text-align: center;
  padding: 12px 5px;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
}
.study-btn:hover { text-decoration: underline; }
.study-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--checkmark-green);
  margin-right: 10px;
  flex-shrink: 0;
}

/* Table of Contents */
.toc {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 26px 20px;
  margin-bottom: 28px;
}
.toc h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.3rem;
  color: var(--accent);
  border: none;
  padding: 0;
}
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 18px;
}
.toc a,
.toc-grid a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: all 0.2s ease;
  font-size: 0.98rem;
  line-height: 1.35;
}
.toc a:hover,
.toc-grid a:hover {
  background: var(--highlight);
  border-color: #d5c2a0;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Study-Specific Content */
.scripture {
  background: linear-gradient(180deg, #fbf8f2 0%, #f7f0e5 100%);
  border-left: 6px solid var(--accent-2);
  border-radius: 16px;
  padding: 22px;
  margin-top: 10px;
}
.scripture-label,
.overview-label {
  display: inline-block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(107, 79, 42, 0.08);
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 14px;
}
.scripture-block {
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(155, 122, 74, 0.18);
  padding-bottom: 14px;
}
.scripture-block:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }
.scripture-block h3 { margin: 0 0 10px; color: var(--accent); font-size: 1rem; text-transform: uppercase; }

.overview-box,
.summary-box,
.claim-box,
.prayer-box,
.question-box,
.question-section {
  border-radius: 18px;
  padding: 24px 22px;
  margin-top: 12px;
}
.overview-box {
  background: linear-gradient(180deg, #fbf8f2 0%, #f7f0e5 100%);
  border: 1px solid #e6d7bc;
  border-left: 6px solid var(--accent-2);
}
.summary-box { background: #faf7f1; border: 1px solid #e7dcc8; }
.claim-box { background: linear-gradient(180deg, #f3ebde 0%, #efe3d0 100%); border: 1px solid #dcc7a0; }
.prayer-box { background: linear-gradient(180deg, #fcfaf6 0%, #f7f2e9 100%); border: 1px solid #e7dcc8; font-style: italic; }
.question-box,
.question-section { background: #faf7f1; border: 1px solid #e7dcc8; text-align: center; box-shadow: var(--shadow); }
.question-box a,
.question-section a { color: var(--accent); font-weight: 700; }
.emphasis { color: var(--accent); font-weight: 700; }

/* Study Outline Page */
.testament-header {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, #3e2f1c 0%, #4f3a20 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  margin-top: 60px;
}
.testament-header h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.01em; }
.testament-header p { font-size: 1.1rem; opacity: 0.9; max-width: 800px; margin: 0 auto; }
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: -25px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}
.stat-pill {
  background: var(--paper);
  padding: 10px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  font-weight: bold;
  font-size: 0.9rem;
  color: var(--accent);
}
.phase-section { margin-bottom: 60px; }
.phase-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}
.phase-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.phase-line { flex-grow: 1; height: 2px; background: var(--line); }
.book-card {
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  overflow: hidden;
}
.book-header {
  padding: 20px 30px;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.book-header h3 { margin: 0; font-size: 1.4rem; color: var(--accent); }
.study-count {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
}
.study-list {
  padding: 25px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}
.study-item {
  display: flex;
  gap: 12px;
  font-size: 1rem;
  padding: 8px;
  border-radius: 8px;
}
.study-num { font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: var(--accent-2); min-width: 30px; }
.study-title { color: var(--ink); }
.sub-phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.sub-card {
  background: var(--paper);
  padding: 25px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
}
.sub-card h4 { margin: 0 0 10px; color: var(--accent); }
.sub-card p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* Shared Footer */
.site-footer,
.footer,
.footer-note {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}
.site-footer {
  background: #15100a;
  color: #ffffff;
  margin-top: 0;
  padding: 24px 20px;
}
.site-footer p { margin: 0; font-size: 0.95rem; }
.footer,
.footer-note { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }


/* Understanding the Study search */
.term-search-section {
  background: linear-gradient(180deg, #ffffff 0%, #faf7f1 100%);
}
.term-search-label {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 8px;
}
.term-search-input {
  display: block;
  width: 100%;
  max-width: 520px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  padding: 12px 16px;
  box-shadow: inset 0 1px 2px rgba(33, 37, 41, 0.05);
}
.term-search-input:focus {
  outline: 3px solid rgba(155, 122, 74, 0.24);
  border-color: var(--accent-2);
}
.term-search-status,
.term-search-no-results {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  margin: 12px 0 0;
  color: var(--muted);
}
.term-search-no-results {
  color: #7b3f19;
  font-weight: 700;
}
.term-search-results {
  margin-top: 18px;
}
.term-search-results-heading {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent);
}
.term-search-results-list {
  margin: 0;
  padding-left: 1.35rem;
}
.term-search-result-item {
  margin: 0 0 12px;
  padding-left: 0.2rem;
}
.term-search-result-item::marker {
  color: var(--accent);
}
.term-search-result-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(33, 37, 41, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.term-search-result-link:hover,
.term-search-result-link:focus {
  background: var(--highlight);
  border-color: #d5c2a0;
  transform: translateY(-1px);
}
.term-search-result-title,
.term-search-result-section,
.term-search-result-excerpt {
  display: block;
}
.term-search-result-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.term-search-result-section {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.term-search-result-excerpt {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.section h3 {
  scroll-margin-top: 110px;
}
mark.term-match-highlight,
.term-match-highlight {
  background-color: #fff200 !important;
  color: inherit;
  border-radius: 2px;
  padding: 0 0.08em;
  box-shadow: 0 0 0 2px #fff200;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 40px 20px; }
  .hero-image-wrap { order: -1; }
  .hero-image-card { max-width: 100%; }
}

@media (max-width: 768px) {
  .study-list { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; align-items: center; gap: 10px; }
}

@media (max-width: 700px) {
  .site-header { padding: 14px 14px 0; }
  .site-nav { justify-content: center; gap: 10px; }
  .site-nav a { font-size: 0.86rem; padding: 9px 13px; }
  .wrapper { padding: 18px 14px 50px; }
  .hero { padding: 24px 20px; border-radius: 20px; margin-bottom: 20px; }
  .toc,
  .section { padding: 24px 20px; border-radius: 18px; }
  .toc-grid,
  .grid { grid-template-columns: 1fr; }
  h1,
  .hero h1 { font-size: 2rem; }
  .section h2 { font-size: 1.35rem; }
  p, li { font-size: 1rem; }
  .study-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .study-row { padding: 4px 10px; }
  .study-btn { font-size: 0.88rem; padding: 10px 4px; }
  .site-nav-bottom,
  .study-bottom-nav { padding: 0 14px 30px; }
}

@media (max-width: 380px) {
  .wrapper { padding: 14px 10px 32px; }
  .hero { padding: 18px 12px; border-radius: 12px; }
  .study-grid { grid-template-columns: 1fr; }
  .study-row { padding: 6px 12px; }
  .study-btn { font-size: 0.92rem; padding: 10px 6px; text-align: left; }
}


/* Clickable completed studies in the outline */
.study-link {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.study-link:hover {
  background: var(--highlight);
  border-color: #d5c2a0;
  transform: translateY(-1px);
}

/* Ask a Question page */
.question-form-section h2 {
  margin-bottom: 12px;
}

.question-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding: 13px 14px;
  box-shadow: inset 0 1px 2px rgba(33, 37, 41, 0.04);
}

.form-field textarea {
  resize: vertical;
  min-height: 190px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 3px solid rgba(155, 122, 74, 0.22);
  border-color: var(--accent-2);
}

.form-field-narrow {
  max-width: 520px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: -2px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
}

.form-check input {
  flex: 0 0 auto;
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.form-check label {
  font-size: 0.96rem;
  line-height: 1.45;
}

.website-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.form-submit {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 13px 20px;
  box-shadow: 0 8px 22px rgba(33, 37, 41, 0.14);
}

.form-submit:hover,
.form-submit:focus {
  background: #4f3a20;
}

.form-message {
  border-radius: 16px;
  font-family: Arial, Helvetica, sans-serif;
  margin: 16px 0;
  padding: 14px 16px;
}

.form-message ul {
  margin: 10px 0 0;
}

.form-success {
  background: #eef8ef;
  border: 1px solid #b9dfbd;
  color: #245d2a;
}

.form-error {
  background: #fff3f0;
  border: 1px solid #efc2b8;
  color: #7c2d1f;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-submit {
    width: 100%;
    justify-self: stretch;
  }
}
