/* ═══════════════════════════════════════════════════════════════
   The Complete Guide to US Money Transmitter Licensing
   Author: Faisal Khan | faisalkhan.com
   Design: Clean, editorial, text-first
   ═══════════════════════════════════════════════════════════════ */

/* --- CSS Variables --- */
:root {
  --color-bg: #FAFAF8;
  --color-text: #1A1A1A;
  --color-heading: #0D0D0D;
  --color-accent: #1A3C5E;
  --color-accent-hover: #14304E;
  --color-muted: #6B6B6B;
  --color-border: #E0DDD8;
  --color-cta-bg: #1A3C5E;
  --color-cta-text: #FFFFFF;
  --color-cta-hover: #14304E;

  --font-size-base: 18px;
  --font-size-sm: 15px;
  --font-size-lg: 22px;
  --font-size-h1: clamp(2rem, 5vw, 3.5rem);
  --font-size-h2: clamp(1.4rem, 3vw, 2rem);
  --font-size-h3: 1.25rem;
  --line-height-body: 1.85;
  --line-height-head: 1.2;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Reading Progress Bar --- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* --- Site Header --- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 20px 48px;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-title {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  text-decoration: none;
}

.site-title:hover {
  color: var(--color-accent-hover);
}

/* --- Chapter Navigation Bar --- */
.chapter-nav {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chapter-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.chapter-nav a:hover {
  color: var(--color-accent);
}

.chapter-nav .nav-prev {
  text-align: left;
}

.chapter-nav .nav-next {
  text-align: right;
  margin-left: auto;
}

.chapter-nav .nav-spacer {
  flex: 1;
}

/* --- Content Container --- */
.content-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 48px;
}

/* --- Chapter Header Block --- */
.chapter-header {
  margin-top: 64px;
  margin-bottom: 48px;
}

.chapter-header .part-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 12px;
  display: block;
}

.chapter-header .chapter-number {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 8px;
  display: block;
}

.chapter-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: var(--color-heading);
  line-height: var(--line-height-head);
  margin-bottom: 0;
}

.chapter-header .title-rule {
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 24px 0 40px 0;
  border: none;
}

/* --- Body Text --- */
.chapter-body p {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  max-width: 780px;
  margin-bottom: 1.5em;
}

.chapter-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-heading);
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  line-height: var(--line-height-head);
}

.chapter-body h3 {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-heading);
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.chapter-body ul,
.chapter-body ol {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: var(--font-size-base);
  line-height: 1.7;
  padding-left: 1.5em;
  margin-bottom: 1.5em;
  max-width: 780px;
}

.chapter-body li {
  margin-bottom: 0.6em;
}

.chapter-body strong {
  font-weight: 600;
  color: var(--color-heading);
}

.chapter-body blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 20px;
  margin: 2em 0;
  color: var(--color-muted);
  font-style: italic;
}

/* --- Practitioner's Bottom Line Box --- */
.practitioner-box {
  background: #EEF2F7;
  border-left: 4px solid var(--color-accent);
  padding: 24px 28px;
  margin-top: 48px;
  margin-bottom: 48px;
  border-radius: 2px;
}

.practitioner-box .box-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 10px;
  display: block;
  font-weight: 500;
}

.practitioner-box p {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: 17px;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 0.8em;
}

.practitioner-box p:last-child {
  margin-bottom: 0;
}

/* --- CTA Section --- */
.cta-section {
  background: var(--color-cta-bg);
  padding: 64px 48px;
  text-align: center;
}

.cta-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-cta-text);
  margin-bottom: 16px;
  line-height: 1.3;
}

.cta-section p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.80);
  max-width: 600px;
  margin: 0 auto 32px auto;
  line-height: 1.6;
}

.cta-button {
  display: inline-block;
  background: #FFFFFF;
  color: var(--color-accent);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 14px 36px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}

.cta-button:hover {
  background: #F0F0F0;
}

/* --- Footer --- */
.site-footer {
  background: #111111;
  color: #AAAAAA;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  padding: 32px 48px;
  text-align: center;
}

.site-footer .footer-line-1 {
  margin-bottom: 10px;
}

.site-footer .footer-line-2 {
  font-size: 12px;
  color: #777777;
}

/* --- Index / TOC Page --- */
.hero {
  text-align: center;
  padding: 80px 48px 0;
  max-width: 780px;
  margin: 0 auto;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero .subtitle {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--color-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.hero .author-line {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0;
}

.hero-rule {
  width: 100%;
  max-width: 780px;
  height: 2px;
  background: var(--color-border);
  margin: 32px auto;
  border: none;
}

/* --- TOC Entries --- */
.toc {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 48px 64px;
}

.toc .part-heading {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-top: 48px;
  margin-bottom: 16px;
  font-weight: 500;
}

.toc-entry {
  display: flex;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  transition: all 0.15s ease;
}

.toc-entry:first-of-type {
  border-top: 1px solid var(--color-border);
}

.toc-entry:hover .toc-title {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toc-entry .toc-number {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--color-muted);
  min-width: 100px;
  flex-shrink: 0;
}

.toc-entry .toc-title {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: 18px;
  color: var(--color-text);
  transition: color 0.15s ease;
}

/* --- Internal Cross-Links --- */
.chapter-body a.internal-link {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.chapter-body a.internal-link:hover {
  color: var(--color-accent-hover);
  border-bottom-color: var(--color-accent);
}

/* --- Tables (for appendices) --- */
.chapter-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 16px;
}

.chapter-body th,
.chapter-body td {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.chapter-body th {
  background: #EEF2F7;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}

.chapter-body td {
  font-family: 'Source Serif 4', serif;
  line-height: 1.6;
}

.chapter-body pre {
  background: #F3F2EF;
  padding: 20px 24px;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
}

.chapter-body code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: 0.9em;
  background: #F3F2EF;
  padding: 2px 5px;
  border-radius: 2px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
  .site-header {
    padding: 16px 20px;
  }

  .content-wrap {
    padding: 0 20px;
  }

  .chapter-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .chapter-nav .nav-next {
    margin-left: 0;
    text-align: left;
  }

  .chapter-header {
    margin-top: 40px;
    margin-bottom: 32px;
  }

  .chapter-body p,
  .chapter-body ul,
  .chapter-body ol {
    font-size: 17px;
  }

  .hero {
    padding: 48px 20px 0;
  }

  .hero .subtitle {
    font-size: 18px;
  }

  .toc {
    padding: 0 20px 48px;
  }

  .toc-entry .toc-number {
    min-width: 80px;
    font-size: 12px;
  }

  .toc-entry .toc-title {
    font-size: 16px;
  }

  .cta-section {
    padding: 40px 24px;
  }

  .cta-section h2 {
    font-size: 24px;
  }

  .cta-section p {
    font-size: 15px;
  }

  .site-footer {
    padding: 24px 20px;
  }

  .practitioner-box {
    padding: 20px 22px;
  }

  .chapter-body table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
  }
}
