/* =========================================================
   WCF Site Styles (single stylesheet for all /wcf/* pages)
   Best practices: system font, fluid type, a11y, print, perf
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root{
  /* Widely-supported system font stack */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
             "Apple Color Emoji", "Segoe UI Emoji";

  /* Colors */
  --bg: #ffffff;
  --text: #161616;
  --muted: #5b5b5b;
  --border: rgba(0,0,0,.12);
  --card: #f6f7f9;
  --link: #0b57d0;

  /* Radius + shadow (subtle) */
  --radius-1: 12px;
  --radius-2: 14px;

  /* Layout */
  --maxw: 980px;

  /* Typography (fluid: responsive at every width) */
  --base: clamp(18px, 0.45vw + 16px, 20px);
  --small: clamp(15px, 0.25vw + 14px, 17px);
  --h1: clamp(30px, 2.1vw + 18px, 48px);
  --h2: clamp(22px, 1.2vw + 16px, 30px);

  /* Line length: keeps reading comfortable */
  --measure: 72ch;

  /* Spacing (fluid) */
  --pad-y: clamp(16px, 2.2vw, 36px);
  --pad-x: clamp(14px, 2vw, 28px);
  --gap-1: clamp(10px, 1.2vw, 16px);
  --gap-2: clamp(16px, 2vw, 26px);

  /* Focus */
  --focus: rgba(11,87,208,.35);
}

/* ---------- CSS Reset-ish (lightweight) ---------- */
*,
*::before,
*::after{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improve selection readability */
::selection{
  background: rgba(11,87,208,.18);
}

/* Images and media behave nicely if added later */
img, svg, video{
  max-width: 100%;
  height: auto;
}

/* ---------- Links + Focus ---------- */
a{
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

a:hover{
  text-decoration-thickness: 0.12em;
}

a:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Page Container ---------- */
.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
}

/* ---------- Top Navigation Bar ---------- */
.topbar{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;

  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-2);
  padding: 10px 12px;
  margin-bottom: var(--gap-2);
}

.brand{
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pager{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- Headings ---------- */
.chapter-title{
  margin: 0;
  font-size: var(--h1);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: var(--measure);
}

.chapter-sub{
  margin: 6px 0 0 0;
  font-size: var(--h2);
  font-weight: 650;
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- Main Content ---------- */
.content{
  margin-top: var(--gap-2);
}

.sections{
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--gap-1);
}

/* One numbered paragraph block */
.sec{
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  padding: clamp(12px, 1.5vw, 16px);
  background: #fff;
  max-width: var(--measure);
}

.sec strong.label{
  font-weight: 850;
  letter-spacing: 0.01em;
  margin-right: 8px;
  white-space: nowrap;
}

/* Footnote superscripts */
sup{
  font-size: 0.75em;
  line-height: 0;
  vertical-align: super;
  margin-left: 2px;
}

sup a{
  text-decoration: none;
  border-bottom: 1px solid rgba(11,87,208,.35);
}

/* ---------- Scripture Proofs ---------- */
.proofs{
  margin-top: clamp(20px, 2.4vw, 34px);
  border-top: 1px solid var(--border);
  padding-top: clamp(16px, 2vw, 26px);
}

.proofs h3{
  margin: 0 0 12px 0;
  font-size: var(--h2);
  line-height: 1.2;
  max-width: var(--measure);
}

.proof-hint{
  margin: 10px 0 14px 0;
  color: var(--muted);
  font-size: var(--small);
  max-width: var(--measure);
}

.proofs-list{
  display: grid;
  gap: 12px;
  max-width: var(--measure);
}

/* Collapsible proof card */
.proofcard{
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--card);
  overflow: hidden;
}

.proofcard summary{
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 780;
  line-height: 1.35;
  font-size: clamp(16px, 0.25vw + 15px, 18px);
}

.proofcard summary::-webkit-details-marker{ display: none; }

.proofcard summary:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 10px;
}

.proofcard[open] summary{
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.verses{
  padding: 12px 14px 14px 14px;
  display: grid;
  gap: 10px;
}

.v{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  padding: 10px 12px;

  font-size: clamp(16px, 0.35vw + 15px, 19px);
  line-height: 1.7;

  overflow-wrap: anywhere;
  word-break: normal;
}

.ref{
  display: block;
  font-weight: 850;
  margin-bottom: 6px;
}

.prooftag{
  font-weight: 900;
  margin-right: 8px;
  white-space: nowrap;
}

/* ---------- Bottom Navigation ---------- */
.footer-pager{
  margin-top: clamp(18px, 2.2vw, 30px);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;

  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-2);
  padding: 12px;
}

/* ---------- Reduced Motion (A11y) ---------- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; animation: none !important; }
}

/* =========================================================
   Breakpoint refinements (Bootstrap-ish)
   Keep clamp() for smooth scaling, but tune at key widths
   ========================================================= */

/* sm ≥ 576px */
@media (min-width: 576px){
  :root{
    --measure: 74ch;
  }
}

/* md ≥ 768px */
@media (min-width: 768px){
  :root{
    --measure: 76ch;
  }
}

/* lg ≥ 992px */
@media (min-width: 992px){
  .sec{ padding: 18px; }
  .v{ padding: 14px 16px; }
}

/* xl ≥ 1200px */
@media (min-width: 1200px){
  :root{
    --maxw: 1040px;
    --measure: 78ch;
  }
}

/* =========================================================
   Print styles: clean printing for chapters
   ========================================================= */
@media print{
  :root{
    --bg: #ffffff;
    --text: #000000;
    --muted: #000000;
    --card: #ffffff;
    --border: rgba(0,0,0,.25);
  }

  body{
    background: #fff;
    font-size: 12pt;
    line-height: 1.5;
  }

  .topbar, .footer-pager, .proof-hint{
    display: none !important;
  }

  a{
    color: #000;
    text-decoration: none;
  }

  .proofcard{
    break-inside: avoid;
  }

  details{
    /* Force details to print expanded in most browsers */
    display: block;
  }
  details > summary{
    display: none;
  }
}
