﻿/* ================================================================
   The Architecture of Intent — Custom Theme
   Adaptive across all mdBook themes: Light · Rust · Coal · Navy · Ayu
   ================================================================ */

/* ---- Per-theme accent palette ---- */

.light {
  --accent:         #1d4ed8;
  --accent-border:  rgba(29, 78, 216, 0.30);
  --bq-bg:          #eff6ff;
  --bq-border:      #1d4ed8;
  --th-bg:          #1e3a5f;
  --td-stripe:      #f8fafc;
  --rule:           rgba(0, 0, 0, 0.10);
}

.rust {
  --accent:         #b45309;
  --accent-border:  rgba(180, 83, 9, 0.30);
  --bq-bg:          #fff7ed;
  --bq-border:      #b45309;
  --th-bg:          #7c2d12;
  --td-stripe:      rgba(180, 83, 9, 0.05);
  --rule:           rgba(92, 64, 55, 0.13);
}

.coal {
  --accent:         #60a5fa;
  --accent-border:  rgba(96, 165, 250, 0.28);
  --bq-bg:          rgba(96, 165, 250, 0.07);
  --bq-border:      #60a5fa;
  --th-bg:          #1e3554;
  --td-stripe:      rgba(255, 255, 255, 0.03);
  --rule:           rgba(255, 255, 255, 0.08);
}

.navy {
  --accent:         #38bdf8;
  --accent-border:  rgba(56, 189, 248, 0.28);
  --bq-bg:          rgba(56, 189, 248, 0.07);
  --bq-border:      #38bdf8;
  --th-bg:          #0c3060;
  --td-stripe:      rgba(255, 255, 255, 0.03);
  --rule:           rgba(255, 255, 255, 0.08);
}

.ayu {
  --accent:         #f59e0b;
  --accent-border:  rgba(245, 158, 11, 0.35);
  --bq-bg:          rgba(245, 158, 11, 0.08);
  --bq-border:      #f59e0b;
  --th-bg:          #1a1200;
  --td-stripe:      rgba(255, 255, 255, 0.03);
  --rule:           rgba(255, 255, 255, 0.07);
}

/* ---- Cover page ---- */

.content img[alt="The Architecture of Intent"] {
  display: block;
  width: 100%;
  margin: -2rem -2.5rem 0;
  max-width: calc(100% + 5rem);
  border-radius: 0;
  box-shadow: 0 6px 48px rgba(0, 0, 0, 0.6);
}

/* ---- Base font size override ---- */

html, body {
  font-size: 19px !important;
}

/* mdBook overrides font-size on the inner page wrapper — force it here too */
.content,
.page,
#content,
.chapter {
  font-size: 19px !important;
}

.content p,
.content li,
.content dt,
.content dd {
  font-size: 1rem !important;
  line-height: 1.85;
}

.content main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 3rem 6rem;
  line-height: 1.85;
}

/* ---- Headings ---- */

h1 {
  font-size: 2.1rem !important;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.4em;
  margin-top: 0.4em;
  margin-bottom: 0.2em;
  letter-spacing: -0.015em;
}

h2 {
  margin-top: 3em;
  margin-bottom: 0.7em;
  font-size: 0.7rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--accent-border);
}

h3 {
  font-size: 1.18rem !important;
  font-weight: 600;
  margin-top: 2.2em;
  margin-bottom: 0.45em;
}

h4 {
  font-size: 1rem !important;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.35em;
}

/* ---- "Therefore" blockquote ---- */

blockquote {
  background: var(--bq-bg);
  border-left: 4px solid var(--bq-border);
  border-radius: 0 8px 8px 0;
  padding: 1.2em 1.8em;
  margin: 1.8em 0;
  font-style: normal;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-size: 1.05rem;
}

blockquote p {
  margin: 0;
  line-height: 1.8;
}

blockquote strong {
  color: var(--accent);
}

/* ---- Tables ---- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.8em 0;
  font-size: 0.95rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

thead th {
  background: var(--th-bg);
  color: #fff;
  padding: 0.75em 1.2em;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  padding: 0.65em 1.2em;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background: var(--td-stripe);
}

/* ---- Horizontal rules ---- */

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 3em 0;
}

/* ---- Inline code ---- */

code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.88em;
  padding: 0.18em 0.45em;
  border-radius: 4px;
}

/* ---- Code blocks ---- */

pre {
  border-radius: 10px !important;
  padding: 1.3em 1.6em !important;
  font-size: 0.88em !important;
  line-height: 1.7 !important;
}

pre > code {
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: inherit;
}

/* ---- Sidebar: active chapter indicator ---- */

.sidebar .chapter li.chapter-item.active > a,
.sidebar .chapter li.chapter-item > a.active {
  border-left: 3px solid var(--accent);
  padding-left: calc(var(--chapter-line-height, 1em) - 3px);
  font-weight: 600;
}
