:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg2: #101827;
  --card: rgba(15, 23, 42, 0.88);
  --card2: rgba(255,255,255,0.055);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --line: rgba(148, 163, 184, 0.24);
  --accent: #62d2a2;
  --gold: #d7a64a;
}

.faith-page {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 8%, rgba(98,210,162,0.18), transparent 28rem),
    radial-gradient(circle at 85% 0%, rgba(215,166,74,0.13), transparent 26rem),
    linear-gradient(135deg, var(--bg), var(--bg2) 55%, #05070b);
}

.faith-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.faith-topbar,
.faith-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--soft);
}

.faith-brand {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.faith-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faith-nav a,
.faith-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255,255,255,0.045);
}

.faith-nav a:hover,
.faith-footer a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

.faith-hero,
.faith-content,
.faith-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 30px;
  box-shadow: 0 28px 90px rgba(0,0,0,0.42);
}

.faith-hero {
  padding: clamp(26px, 5vw, 56px);
  margin-bottom: 18px;
}

.faith-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.faith-content {
  padding: clamp(24px, 5vw, 54px);
  overflow-wrap: anywhere;
}

.faith-content,
.faith-content p,
.faith-content li,
.faith-content td,
.faith-content th,
.faith-content div {
  color: var(--muted);
  line-height: 1.72;
}

.faith-content h1,
.faith-content h2,
.faith-content h3,
.faith-content h4 {
  color: var(--text);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.faith-content h1 {
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  margin-top: 0;
}

.faith-content h2 {
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  margin-top: 2rem;
}

.faith-content a {
  color: var(--accent);
  font-weight: 800;
}

.faith-content img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.faith-content table {
  max-width: 100%;
  border-collapse: collapse;
}

.faith-content blockquote {
  border-left: 4px solid var(--accent);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--soft);
}

.eyebrow,
.card-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 900;
  font-size: 0.78rem;
}

.faith-hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  margin: 12px 0 16px;
}

.faith-hero p {
  color: var(--muted);
  line-height: 1.75;
  max-width: 760px;
  font-size: 1.08rem;
}

.faith-sidebar {
  position: sticky;
  top: 18px;
}

.faith-card {
  padding: 18px;
  margin-bottom: 14px;
}

.faith-card h2,
.faith-card h3 {
  margin-top: 0;
  color: var(--text);
}

.faith-card p {
  color: var(--muted);
  line-height: 1.65;
}

.faith-list {
  display: grid;
  gap: 8px;
}

.faith-list a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  font-weight: 750;
}

.faith-list a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.075);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.related-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card2);
  padding: 18px;
  text-decoration: none;
}

.related-card strong {
  display: block;
  color: var(--text);
  margin: 8px 0;
}

.related-card span,
.related-card p {
  color: var(--soft);
}

@media (max-width: 860px) {
  .faith-layout {
    grid-template-columns: 1fr;
  }

  .faith-sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  .faith-shell {
    width: min(100% - 22px, 1080px);
  }

  .faith-hero,
  .faith-content,
  .faith-card {
    border-radius: 22px;
    padding: 22px;
  }
}

/* Desktop readability pass: wider articles, less cramped tables/charts */
@media (min-width: 1100px) {
  .faith-shell {
    width: min(1480px, calc(100% - 48px));
  }

  .faith-layout {
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 24px;
  }

  .faith-content {
    padding: clamp(34px, 4vw, 68px);
  }

  .faith-hero {
    padding: clamp(34px, 4vw, 68px);
  }

  .faith-content p,
  .faith-content li {
    max-width: 92ch;
  }

  .faith-content h1,
  .faith-content h2,
  .faith-content h3,
  .faith-content h4 {
    max-width: 1000px;
  }
}

/* Let larger tables/charts breathe instead of being smashed into a skinny column */
.faith-content table {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  table-layout: auto;
}

.faith-content th,
.faith-content td {
  padding: 0.75rem 0.85rem;
  vertical-align: top;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.faith-content th {
  color: var(--text) !important;
  background: rgba(255,255,255,0.075);
}

.faith-content td {
  background: rgba(255,255,255,0.035);
}

/* On desktop, allow article tables to use more horizontal space naturally */
@media (min-width: 900px) {
  .faith-content table {
    min-width: 760px;
  }
}

/* On smaller screens, tables should scroll instead of destroying the layout */
@media (max-width: 899px) {
  .faith-content table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .faith-content th,
  .faith-content td {
    min-width: 180px;
  }
}

/* Images/diagrams inside articles */
.faith-content img,
.faith-content svg,
.faith-content canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* Make the sidebar useful but not visually bossy */
.faith-sidebar .faith-card {
  padding: 14px;
}

.faith-sidebar .faith-list a {
  padding: 8px 10px;
  font-size: 0.94rem;
}

/* Numbered faith topic layout */
.numbered-faith-list {
  counter-reset: faith-topic;
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 1.15rem;
}

.numbered-faith-list > li {
  counter-increment: faith-topic;
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 22px;
  background: rgba(255,255,255,0.045);
  padding: 1.25rem 1.25rem 1.25rem 4.25rem;
}

.numbered-faith-list > li::before {
  content: counter(faith-topic);
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #d6ffeb);
  color: #07110d;
  font-weight: 900;
}

.numbered-faith-list h3 {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.numbered-faith-list p:last-child {
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .numbered-faith-list > li {
    padding: 1rem;
  }

  .numbered-faith-list > li::before {
    position: static;
    margin-bottom: 0.75rem;
  }
}
