/* booksite — light docs theme for the Wealth Manual site.
   Loaded AFTER each chapter's generated book.css so these rules win. Brand
   accent is the app's Material primary, shifted to its light-scheme tone. */
:root {
    --accent: #6750a4;          /* M3 light primary */
    --accent-weak: #ece6f6;
    --ink: #1c1b1f;
    --ink-dim: #49454f;
    --rule: #e3e0e8;
    --bg: #fbfaff;
    --maxw: 46rem;
}
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 18px/1.7 Georgia, "Iowan Old Style", "Times New Roman", serif;
    padding: 0 1.1rem 5rem;
}
body > * { max-width: var(--maxw); margin-inline: auto; }
/* the landing is a wide, full-bleed exception to the reading column */
body > main.landing { max-width: 66rem; }

/* Headings */
h1, h2, h3, h4,
.chapterHead, .sectionHead, .subsectionHead, .subsubsectionHead, .likechapterHead {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.25;
    color: var(--ink);
    margin: 2.2rem 0 0.6rem;
}
h1, .chapterHead, .likechapterHead { font-size: 2rem; }
h2, .sectionHead { font-size: 1.5rem; border-bottom: 2px solid var(--accent-weak); padding-bottom: .25rem; }
h3, .subsectionHead { font-size: 1.22rem; }
h4, .subsubsectionHead { font-size: 1.05rem; color: var(--ink-dim); }

p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Neutralize tex4ht's per-glyph font-size/family classes so prose is uniform. */
[class^="lmr"], [class^="lmm"], [class^="lmt"], [class^="lcm"], [class^="lat"],
[class^="lar"], [class^="lcy"], [class^="cmr"], [class^="cmtt"], [class^="cmmi"],
[class^="aeb"], [class^="aer"], [class^="aess"], [class^="ec-"] {
    font-size: inherit !important;
    font-family: inherit !important;
}
/* ulem underlines on description lead-in terms (\uwave/\uline/\dotuline) — pure CSS
   text-decoration (no images), tinted to the accent. */
.uwave { text-decoration: underline wavy var(--accent); text-underline-offset: 3px; font-weight: 600; }
.uline { text-decoration: underline var(--accent); text-underline-offset: 3px; }
.dotuline { text-decoration: underline dotted var(--accent); text-underline-offset: 3px; }
.cmtt-10, code, tt, .verb { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

/* Acronyms — glossary links rewritten to <abbr title="expansion"> hover tooltips. */
abbr.acr { text-decoration: underline dotted var(--ink-dim); text-decoration-thickness: 1px;
           text-underline-offset: 2px; cursor: help; }

/* Math rendered as MathML (mathml mode). Let block equations scroll if wider than
   the reading column rather than overflow it. */
math { font-size: 1.03em; }
math[display="block"] { display: block; overflow-x: auto; max-width: 100%; margin: 1rem 0; }

/* Description / definition lists */
dl.description { margin: 1rem 0; }
dt.description { font-weight: 600; margin-top: .6rem; }
dd.description { margin: 0 0 .4rem 1.2rem; }

/* Figures rendered to SVG */
img, svg, object[type="image/svg+xml"] { max-width: 100%; height: auto; }
figure { margin: 1.4rem 0; text-align: center; }
.caption, figcaption { font-size: .9rem; color: var(--ink-dim); }
/* tex4ht's CSS inverts wealth* images under OS dark mode for its own dark theme;
   ours is always light, so that would turn the black math/figure SVGs white and
   make them vanish. Keep them as authored. */
@media (prefers-color-scheme: dark) {
    img[src^="wealth"] { filter: none !important; }
}

/* Tables (tabularray -> tex4ht). Let columns size to content and scroll the
   wrapper when a dense comparison table is wider than the reading column —
   forcing width:100% crushes narrow columns into one-letter-per-line. */
div.table, figure.float, .tabular { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; margin: 1.2rem 0; font-size: .94rem; width: auto; }
td, th { border: 1px solid var(--rule); padding: .35rem .6rem; text-align: left; vertical-align: top; }
thead th, .booktabs th { border-bottom: 2px solid var(--accent); }

/* Footnotes */
.footnotes { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: .8rem;
             font-size: .88rem; color: var(--ink-dim); }
.footnote-mark sup { color: var(--accent); }

/* tex4ht next/prev/up navigation bar */
.crosslinks { font-family: system-ui, sans-serif; font-size: .82rem; margin: 1rem 0; }
.crosslinks p { margin: 0; }
.crosslinks a { display: inline-block; padding: .15rem .45rem; background: var(--accent-weak);
                border-radius: .35rem; margin-right: .25rem; }
.crosslinks a:hover { text-decoration: none; background: #ddd3f2; }

/* In-page mini-TOC tex4ht drops under chapters/sections */
.sectionTOCS, .subsectionTOCS, .tableofcontents {
    background: #fff; border: 1px solid var(--rule); border-radius: .6rem;
    padding: .8rem 1rem; margin: 1.4rem 0; font-family: system-ui, sans-serif; font-size: .95rem;
}
.subsectionToc { font-weight: 600; }
.subsubsectionToc { display: inline-block; margin-left: 1.2rem; font-weight: 400; }

/* ============================ Landing page ============================ */
.landing { padding-top: 0; }
.landing a { text-decoration: none; }

/* Hero — a soft accent band with strong sans headline */
.hero {
    margin: 1.5rem 0 3rem;
    padding: 3.5rem clamp(1.25rem, 5vw, 3.5rem) 3rem;
    border-radius: 1.5rem;
    background:
        radial-gradient(120% 140% at 100% 0%, #efe7ff 0%, rgba(239,231,255,0) 55%),
        linear-gradient(160deg, #f5f1ff 0%, #fbfaff 60%);
    border: 1px solid var(--accent-weak);
}
.hero .kicker {
    font-family: system-ui, sans-serif; text-transform: uppercase;
    letter-spacing: .14em; font-size: .8rem; font-weight: 700;
    color: var(--accent); margin: 0 0 1rem;
}
.hero h1 {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08;
    letter-spacing: -.02em; margin: 0 0 1.1rem; max-width: 18ch;
}
.hero .tagline {
    font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.55;
    color: var(--ink-dim); max-width: 46ch; margin: 0 0 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta {
    font-family: system-ui, sans-serif; font-weight: 600; font-size: 1rem;
    padding: .7rem 1.4rem; border-radius: 2rem;
    background: var(--accent); color: #fff; border: 1px solid var(--accent);
    transition: transform .08s ease, box-shadow .15s ease;
}
.cta:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(103,80,164,.28); transform: translateY(-1px); }
.cta.ghost { background: transparent; color: var(--accent); }
.cta.ghost:hover { background: var(--accent-weak); box-shadow: none; }

/* Parts */
.part { margin-bottom: 2.8rem; }
.part-head {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem;
    margin: 0 0 1.1rem; padding-bottom: .55rem; border-bottom: 2px solid var(--accent-weak);
}
.part-label {
    font-family: system-ui, sans-serif; font-size: 1.4rem; font-weight: 700;
    letter-spacing: -.01em; color: var(--ink); border: 0; padding: 0; margin: 0;
}
.part-desc { font-size: .98rem; color: var(--ink-dim); margin: 0; }

/* Chapter grid */
.chapter-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .9rem;
}
.chapter-grid a {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .55rem .9rem;
    height: 100%; padding: 1rem 1.15rem;
    background: #fff; border: 1px solid var(--rule); border-radius: .9rem;
    transition: border-color .12s ease, box-shadow .15s ease, transform .08s ease;
}
.chapter-grid a:hover {
    text-decoration: none; border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(103,80,164,.12); transform: translateY(-2px);
}
.chapter-grid .cnum {
    font-family: system-ui, sans-serif; font-weight: 800; font-size: 1.05rem;
    color: var(--accent); font-variant-numeric: tabular-nums;
    grid-row: span 1; align-self: start;
}
.chapter-grid .ctitle {
    font-family: system-ui, sans-serif; font-weight: 600; font-size: 1.02rem;
    line-height: 1.25; color: var(--ink);
}
.chapter-grid .carrow { color: var(--accent); opacity: 0; transition: opacity .12s ease; font-size: 1.1rem; }
.chapter-grid a:hover .carrow { opacity: 1; }

/* Landing footer nav */
.landing-foot {
    display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
    padding-top: 2rem; border-top: 1px solid var(--rule);
    font-family: system-ui, sans-serif; font-size: .95rem;
}
.landing-foot a { color: var(--ink-dim); font-weight: 600; }
.landing-foot a:hover { color: var(--accent); }
