/* ==========================================================================
   Foundations Library (FL) — fl-education.css
   Book 2: What Does the Bible Say About Education?
   ========================================================================== */
body {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.06rem, 2.5vw, 1.16rem);
  line-height: 1.78;
  text-align: left;
}

.fl-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 32px;
  padding: 28px 20px 64px;
}

/* Wide Desktop (>= 1201px and taller than 500px): Collapsible Side-by-Side TOC */
@media (min-width: 1201px) and (min-height: 501px) {
  body.toc-collapsed .fl-layout {
    grid-template-columns: 1fr;
  }
  body.toc-collapsed .fl-sidebar {
    display: none;
  }
  body.toc-collapsed .fl-main {
    margin: 0 auto;
  }
}

.fl-sidebar {
  position: sticky;
  top: calc(var(--fl-topbar-height, 76px) + 12px);
  align-self: start;
  max-height: calc(100vh - var(--fl-topbar-height, 76px) - 24px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.fl-sidebar h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.fl-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.fl-toc-list li { margin-bottom: 6px; }
.fl-toc-part { margin-top: 12px; font-weight: 700; color: var(--crimson); }
.fl-toc-lab { padding-left: 10px; font-size: 12.5px; }
.fl-toc-list a,
.fl-toc-list a:link {
  color: var(--accent);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.fl-toc-list a:visited {
  color: var(--link-visited);
}

.fl-toc-list a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.fl-toc-list a:active {
  color: var(--link-active);
}

/* Compact / Tablet / Mobile / Landscape Phone (<= 1200px OR max-height: 500px):
   Off-Canvas Slide-Out Left TOC Drawer */
@media (max-width: 1200px), (max-height: 500px) {
  .fl-layout {
    grid-template-columns: 1fr;
    padding: 18px 14px 64px;
  }
  .fl-sidebar {
    position: fixed;
    top: var(--fl-topbar-height, 64px);
    left: -340px;
    width: 300px;
    max-width: 86vw;
    height: calc(100vh - var(--fl-topbar-height, 64px));
    height: calc(100dvh - var(--fl-topbar-height, 64px));
    max-height: none;
    z-index: 1000;
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.18);
    transition: left 0.25s ease;
  }
  body.toc-open .fl-sidebar {
    left: 0;
  }
}

.fl-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 42px 48px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

h1, h2, h3, h4 {
  text-align: left;
  color: var(--accent);
  line-height: 1.32;
  margin-top: 1.4em;
  margin-bottom: 0.5em;
}

.fl-hero-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 28px;
}
.fl-hero-header h1 { margin-top: 0; font-size: clamp(1.45rem, 3.8vw, 1.88rem); color: var(--text); }
.fl-hero-subtitle { font-size: clamp(1.02rem, 2.5vw, 1.18rem); color: var(--muted); font-weight: 400; margin: 8px 0 12px; }
.fl-hero-meta { font-size: 14px; color: var(--muted); }

/* Chapter 8 & Book-Wide Category Lead vs Sub-Point Visual Hierarchy (Zero Extra Indent) */
.fl-list {
  padding-left: 1.35rem;
}
.fl-list li {
  margin-bottom: 0.65rem;
}
.fl-list li.fl-list-lead {
  list-style: none;
  margin-left: -1.35rem;
  margin-top: 1.35rem;
  margin-bottom: 0.45rem;
  padding: 5px 10px 5px 12px;
  background: var(--accent-bg);
  border-left: 4px solid var(--crimson);
  border-radius: 0 4px 4px 0;
  color: var(--crimson);
  font-size: 1.03em;
  line-height: 1.4;
}
.fl-list li.fl-list-lead:first-child {
  margin-top: 0.35rem;
}

.fl-scripture-link,
.fl-scripture-link:link {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(122, 32, 32, 0.45);
  text-underline-offset: 3px;
}

.fl-scripture-link:visited {
  color: var(--link-visited);
  text-decoration-color: rgba(92, 67, 50, 0.45);
}

.fl-scripture-link:hover {
  color: var(--link-hover);
  text-decoration-color: var(--gold);
}

.fl-scripture-link:active {
  color: var(--link-active);
}

.fl-part-banner {
  background: var(--accent-bg);
  border-left: 5px solid var(--accent);
  padding: 20px 24px;
  border-radius: 4px;
  margin: 36px 0 24px;
}
.fl-part-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 3px;
  text-transform: uppercase;
}

.fl-baton-callout {
  background: #fff8eb;
  border: 2px solid #d97706;
  border-radius: 6px;
  padding: 20px 24px;
  margin: 20px 0 28px;
}

.fl-chart-card, .fl-calculator-card {
  background: #faf8f5;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin: 26px 0;
}
.fl-svg-chart { width: 100%; height: auto; display: block; }
.fl-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.fl-calc-field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.fl-calc-input {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid #b5ab99;
  border-radius: 4px;
}
.fl-calc-print-line { display: none; }
.fl-bar-row { margin-bottom: 12px; }
.fl-bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.fl-bar-track { height: 22px; background: var(--border); border-radius: 4px; overflow: hidden; }
.fl-bar-fill { height: 100%; transition: width 0.25s ease; }
.fl-bar-secular { background: var(--crimson); }
.fl-bar-biblical { background: var(--accent); }
.fl-calc-verdict { font-size: 14.5px; font-weight: 700; margin-top: 10px; color: var(--text); }

.fl-lab-card {
  background: var(--lab-bg);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 34px 0;
}
.fl-lab-badge {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 3px;
  text-transform: uppercase;
}
.fl-lab-response-block { margin: 16px 0; }
.fl-response-label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.fl-textarea, .fl-sig-input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #b8ae9c;
  border-radius: 4px;
  background: #fff;
}
.fl-print-blank-line { display: none; }

@media (max-width: 1100px), (max-height: 500px) {
  body {
    font-size: clamp(1.06rem, 2.5vw, 1.16rem);
    line-height: 1.75;
  }
  .fl-layout {
    padding: 12px 10px 68px;
  }
  .fl-main {
    padding: 20px 15px;
    border-radius: 6px;
  }
  h2 { font-size: 1.32rem; }
  h3 { font-size: 1.14rem; }
  .fl-part-banner,
  .fl-baton-callout,
  .fl-lab-card,
  .fl-chart-card,
  .fl-calculator-card {
    padding: 16px 14px;
  }
  .fl-calc-grid { grid-template-columns: 1fr; }
}

@page { size: letter; margin: 1.0in; }
@media print {
  body {
    font-size: 11.5pt;
    line-height: 1.55;
    text-align: left !important;
  }
  .fl-sidebar,
  .fl-lab-actions,
  .fl-calc-desc,
  .fl-calc-results {
    display: none !important;
  }
  .fl-layout { display: block !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  .fl-main { border: none !important; padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
  h1, h2, h3, h4 { text-align: left !important; color: #000 !important; page-break-after: avoid; break-after: avoid; }
  .fl-page-break-before { page-break-before: always; break-before: page; }

  .fl-list li.fl-list-lead {
    background: transparent !important;
    color: #000 !important;
    border-left: 2pt solid #000 !important;
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Keep Cards, Charts, Calculators & Signature Blocks From Splitting Mid-Page */
  .fl-chart-card,
  .fl-calculator-card,
  .fl-baton-callout,
  .fl-part-banner,
  .fl-lab-response-block {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Single-Lab & All-8-Labs Print Modes */
  body.fl-print-single-lab .fl-intro-card,
  body.fl-print-single-lab .fl-part-section,
  body.fl-print-single-lab .fl-chapter-article > :not(.fl-lab-target-active),
  body.fl-print-single-lab .print-qr {
    display: none !important;
  }
  body.fl-print-all-labs .fl-intro-card,
  body.fl-print-all-labs .fl-part-section,
  body.fl-print-all-labs .fl-chapter-article > :not(.fl-lab-card) {
    display: none !important;
  }
  body.fl-print-single-lab .fl-chapter-article,
  body.fl-print-all-labs .fl-chapter-article {
    page-break-before: auto !important;
    break-before: auto !important;
  }

  /* Blank Lines When Empty vs. Clean Box When Pre-Filled */
  .fl-persist-input.fl-is-empty { display: none !important; }
  .fl-persist-input.fl-is-empty + .fl-print-blank-line,
  .fl-persist-input.fl-is-empty + .fl-calc-print-line {
    display: block !important;
    color: #000;
    margin-top: 6pt;
    line-height: 2.0;
  }
  .fl-persist-input:not(.fl-is-empty) {
    border: 1px solid #444 !important;
    background: #fff !important;
    color: #000 !important;
  }

  /* Remove Underlines From Scripture Citations & External Links in Print */
  .fl-scripture-link,
  .fl-ext-link {
    color: #000 !important;
    text-decoration: none !important;
    font-weight: 700;
  }

  /* Chapter 8 Section 5: Hide 45+ Raw URLs/Handles & Show Scannable QR Directory Card */
  #ch-8-sec-5 > p,
  #ch-8-sec-5 > ul {
    display: none !important;
  }
  .fl-ch8-print-card {
    display: flex !important;
    align-items: center;
    gap: 16pt;
    padding: 12pt 14pt;
    border: 1.5pt solid #000;
    border-radius: 6pt;
    margin-top: 8pt;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .fl-ch8-print-card img {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
  }

  /* Lab #2 Paper Worksheet Formula Box */
  .fl-calc-print-worksheet {
    display: block !important;
    margin-top: 12pt;
    padding-top: 10pt;
    border-top: 1pt dashed #444;
    font-size: 10.5pt;
    line-height: 1.85;
  }
}

/* Sprint 4: Monochrome Inline SVG Social Links */
.fl-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: rgba(120, 110, 95, 0.08);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.fl-social-link:hover,
.fl-social-link:focus-visible {
  background: rgba(120, 110, 95, 0.18);
  text-decoration: underline;
}
.fl-social-icon {
  width: 0.92em;
  height: 0.92em;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.12em;
}
@media print {
  .fl-social-link {
    background: transparent !important;
    padding: 0 !important;
    gap: 0.2em !important;
  }
  .fl-social-icon {
    width: 9pt !important;
    height: 9pt !important;
  }
}
/* End Sprint 4 Social Links */
