/* The Tau Square textbook on white paper: reader.html pages and the free
   sample chapter (book-preview.js). Chapter HTML comes from Word via
   scripts/book-import.mjs: headings, paragraphs, lists, tables, pictures.
   bookPrepare() in book-layout.js marks one-cell tables (stories, Pro Tips,
   summaries) as .box and wraps each picture with its caption in a <figure>.
   Blocks only ever take a top margin, so page breaks measure cleanly. */

.book { font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif; color: #202124; font-size: var(--book-size, 17px);
        line-height: 1.7; font-weight: 400; overflow-wrap: break-word; text-align: left; }
.book * { margin-bottom: 0; }
.book > * { margin-top: .9em; }
.book > :first-child { margin-top: 0; }
.book td p, .book th p, .book li p, .book blockquote p { margin-top: 0; }
.book > p + p { margin-top: .75em; }
.book h2, .book h3, .book h4 { color: #111418; line-height: 1.3; }
.book h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 1.45em; }
.book > h2 { margin-top: 1.3em; }
.book h3 { font-family: 'Inter', Arial, sans-serif; font-weight: 600; font-size: 1.02em; letter-spacing: -.005em; }
.book > h3 { margin-top: 1.2em; }
.book h4 { font-family: 'Inter', Arial, sans-serif; font-weight: 600; font-size: .94em; }
.book > h4 { margin-top: 1.1em; }
.book > h2 + *, .book > h3 + *, .book > h4 + * { margin-top: .5em; }
.book strong, .book b { font-weight: 700; color: #111418; }
.book em, .book i { font-style: italic; }
.book u { text-decoration-color: #C8A96B; text-underline-offset: 2px; }
.book a { color: #7a5c1f; text-decoration: underline; text-decoration-color: rgba(200,169,107,.7); text-underline-offset: 2px; }
.book ul, .book ol { padding-left: 1.4em; margin-top: 0; }
.book > ul, .book > ol { margin-top: .6em; }
.book ul { list-style: disc; }
.book ol { list-style: decimal; }
.book li { margin-top: 0; padding-left: .15em; }
.book li + li { margin-top: .3em; }
.book li > ul, .book li > ol { margin-top: .3em; }
.book li::marker { color: #9a7a3a; }
.book li.pg-b { list-style: none; }                           /* the rest of a list item carried to the next page */
.book hr { border: 0; border-top: 1px solid #e3ded2; }
.book code, .book pre { font-family: 'JetBrains Mono', Consolas, monospace; font-size: .86em; }
.book pre { white-space: pre-wrap; background: #f6f3ec; padding: .7em .9em; }
.book blockquote { border-left: 3px solid #C8A96B; padding: .1em 0 .1em 1em; color: #3c4043; font-style: italic; }

/* Pictures and their captions */
.book figure { margin-left: 0; margin-right: 0; text-align: center; }
.book > figure { margin-top: 1.2em; }
.book img { display: block; max-width: 100%; max-height: var(--img-max, 640px); width: auto; height: auto; margin: 0 auto; }
.book p img { margin-top: .4em; }
.book figcaption { font-family: 'Inter', Arial, sans-serif; font-size: .74em; line-height: 1.5; color: #5f6368; margin-top: .7em; padding: 0 1.5em; }
.book figure + * { margin-top: 1.2em; }

/* Tables */
.book table { width: 100%; border-collapse: collapse; font-family: 'Inter', Arial, sans-serif; font-size: .8em; line-height: 1.55; }
.book > table { margin-top: 1.1em; }
.book th, .book td { border: 1px solid #e0dccf; padding: .6em .8em; vertical-align: top; text-align: left; }
.book th { background: #f6f3ec; font-weight: 600; color: #111418; }
.book td p + p, .book th p + p { margin-top: .45em; }
.book td ul, .book td ol { margin-top: .35em; }
.book table + * { margin-top: 1.1em; }

/* Boxes: true stories, Pro Tips, warnings, chapter summaries */
.book table.box { font-family: inherit; font-size: .94em; line-height: 1.65; }
.book table.box td { background: #faf6ec; border: 0; border-left: 3px solid #C8A96B; padding: 1em 1.25em; }
.book table.box td > p:first-child > strong:first-child,
.book table.box td > p:first-child > b:first-child { display: inline-block; font-family: 'Inter', Arial, sans-serif; font-size: .74em;
        letter-spacing: .12em; text-transform: uppercase; color: #7a5c1f; line-height: 1.5; }
.book table.box.pg-a td { padding-bottom: .6em; }
.book table.box.pg-b td { padding-top: .6em; }

/* Chapter opening and close */
.book .ch-open { padding-top: .6em; }
.book .ch-kicker { display: block; font-family: 'Inter', Arial, sans-serif; font-size: .68em; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #9a7a3a; }
.book .ch-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 2.15em; line-height: 1.15; color: #111418; margin-top: .3em; }
.book .ch-rule { width: 3.2em; height: 2px; background: #C8A96B; margin-top: 1.1em; }
.book .ch-open + * { margin-top: 1.8em; }
.book .ch-end { text-align: center; color: #C8A96B; font-family: 'Playfair Display', Georgia, serif; font-size: 1.1em; letter-spacing: .3em; margin-top: 2em; }
.book .ch-licence { font-family: 'Inter', Arial, sans-serif; font-size: .68em; line-height: 1.6; color: #80868b; border-top: 1px solid #e8eaed; padding-top: .9em; margin-top: 1.6em; }
