/* Download-area additions injected by booksectionpdfs/patch-web.py */
:root{--secdl-accent:#1f4e79;--secdl-accent-ink:#173a5a;--secdl-full:#7a5a1f;}

/* Landing-page hero: full-measure book cover with download card beneath */
.landing-hero{display:flex;flex-direction:column;gap:1.6rem;
  max-width:var(--measure);margin:1.5rem 0 2.5rem;}
.landing-cover{display:block;width:100%;height:auto;
  border:1px solid #d9d9d9;border-radius:3px;box-shadow:0 4px 22px rgba(0,0,0,.17);}
/* Left-align the card (the hero is injected inside the LaTeXML title block,
   which is centred; override that so the heading matches the "Contents"
   heading below). */
.landing-hero,.landing-dl{text-align:left;}
.landing-dl{max-width:var(--measure);}
.landing-dl h2{margin:.1rem 0 .55rem;font-size:1.4rem;color:var(--secdl-accent-ink);}
.landing-dl p{margin:0 0 1.1rem;line-height:1.55;}
.landing-dl-btn{display:inline-block;background:var(--secdl-accent);color:#fff;
  text-decoration:none;padding:.62rem 1.15rem;border-radius:6px;font-weight:600;}
.landing-dl-btn:hover,.landing-dl-btn:focus{background:var(--secdl-accent-ink);}
/* Pointer back to the previous edition, directly under the download button.
   When this site takes over ruina.org/Book the old one moves aside to
   ruina.org/BookOLD, so readers arriving from stale external links need a way
   to it. Needs !important because ".landing-dl p" outranks a lone class. */
.landing-old{margin:.7rem 0 0!important;font-size:.9rem;}
.landing-old a{color:var(--secdl-accent);text-decoration:underline;
  font-weight:600;}
.landing-old a:hover,.landing-old a:focus{color:var(--secdl-accent-ink);}

/* Per-chapter "download by section" panel in the chapter's main content */
.chapdl{margin:1.25rem 0 1.9rem;padding:.9rem 1.15rem;background:#f7f9fb;
  border:1px solid #dbe3ea;border-left:4px solid var(--secdl-accent);
  border-radius:4px;}
.chapdl-h{margin:.05rem 0 .55rem;font-size:1.05rem;color:var(--secdl-accent-ink);}
.chapdl-list{list-style:none;margin:0;padding:0;}
.chapdl-list li{display:flex;flex-wrap:wrap;align-items:baseline;gap:.45rem;
  padding:.3rem 0;border-top:1px solid #e7edf2;}
.chapdl-list li:first-child{border-top:none;}
.chapdl-sec{flex:1 1 12rem;min-width:9rem;}
.chapdl-num{color:var(--secdl-accent-ink);font-weight:600;margin-right:.35rem;}
.chapdl-foot{margin:.7rem 0 0;font-size:.85em;}
.chapdl-foot a{color:var(--secdl-accent);}

/* Download buttons (shared by the panel) */
.secdl-btn{font-size:.78em;line-height:1.5;text-decoration:none;white-space:nowrap;
  padding:.04em .55em;border:1px solid var(--secdl-accent);border-radius:4px;
  color:var(--secdl-accent);background:#fff;font-weight:600;}
.secdl-btn:hover,.secdl-btn:focus{background:var(--secdl-accent);color:#fff;}
.secdl-full{border-color:var(--secdl-full);color:var(--secdl-full);}
.secdl-full:hover,.secdl-full:focus{background:var(--secdl-full);color:#fff;}

/* Landing-page table of contents, grouped into the book's three parts */
/* The "HTML version" heading and the build stamp head the contents block
   (they used to sit in the hero at .9rem/.8rem). The heading outranks
   "Contents", which is a subsection of it, so it takes the site's section size
   of 1.7rem against the 1.4rem below, with the same weight and ink as
   .rp-toc-h. The site sets one font family on body, so nothing else is needed
   to match the face. */
/* The rule divides the download area above from the HTML edition below. It is a
   border on the heading rather than an <hr>, so it needs no extra element and
   lands exactly on the measure column the heading already spans. The accent
   matches the Part dividers further down this same list, so the page has one
   rule colour rather than the greyer --rule used for body furniture. Double at
   5px, not 4: a browser splits the width into three, so 5px gives two crisp 2px
   lines where 4px collapses into something closer to one line with a shadow.
   The doubling also sets this major break apart from those 1px Part rules by
   kind rather than merely by weight. */
.rp-toc-note{margin:2.2rem 0 .15rem;max-width:var(--measure);font-size:1.7rem;
  font-weight:700;line-height:1.15;color:var(--secdl-accent-ink);
  border-top:5px double var(--secdl-accent);padding-top:1.7rem;}
.rp-toc-updated{margin:0;max-width:var(--measure);font-size:1rem;color:#6a6a6a;
  font-variant-numeric:tabular-nums;}
/* Two classes, so this beats the .rp-toc-h margin below whatever the order:
   "Contents" sits just under the stamp instead of 2.25rem away from it. */
.rp-toc-updated + .rp-toc-h{margin-top:1.15rem;}
.rp-toc-h{margin:2.25rem 0 .4rem;font-size:1.4rem;color:var(--secdl-accent-ink);}
.rp-toc{list-style:none;margin:0;padding:0;max-width:var(--measure);}
.rp-toc .rp-part{margin:1.5rem 0 .35rem;padding-bottom:.28rem;
  border-bottom:1px solid var(--secdl-accent);font-size:.72rem;
  letter-spacing:.09em;text-transform:uppercase;color:#5a5a5a;}
.rp-toc .rp-part:first-of-type{margin-top:.6rem;}
.rp-toc .rp-part .rp-part-num{color:var(--secdl-accent);font-weight:700;
  margin-right:.55em;}
.rp-toc li.ltx_tocentry{margin:0;}
.rp-toc li.ltx_tocentry a{display:block;text-decoration:none;
  color:var(--secdl-accent);padding:.2rem .45rem;border-radius:4px;
  line-height:1.35;}
.rp-toc li.ltx_tocentry a:hover,
.rp-toc li.ltx_tocentry a:focus{background:#eef3f8;}
.rp-toc .ltx_tag_ref{display:inline-block;min-width:1.9em;text-align:right;
  margin-right:.7em;color:var(--secdl-accent-ink);font-weight:600;
  font-variant-numeric:tabular-nums;}
/* Front/back matter (Front tables, Copyright, Back tables): no number,
   indent the title to line up with the numbered chapters, set apart in grey */
.rp-toc li.ltx_tocentry a[href^="Chx"]{color:#555;}
.rp-toc li.ltx_tocentry a[href^="Chx"] .ltx_ref_title{padding-left:2.6em;}

/* Landing page only: the hero + contents carry no margin notes, so drop the
   reserved right gutter and centre the measure-wide column on the page
   (chapter pages keep the asymmetric gutter set in web-edition.css). */
body.rp-landing .ltx_document{
  max-width:calc(var(--measure) + 4rem);
  padding-right:2rem;
}
body.rp-landing .landing-hero,
body.rp-landing .landing-dl,
body.rp-landing .rp-toc-note,
body.rp-landing .rp-toc-updated,
body.rp-landing .rp-toc{margin-left:auto;margin-right:auto;}

/* Link between the short contents (index.html) and detailed-contents.html */
.rp-toc-more{margin:.15rem 0 1rem;max-width:var(--measure);font-size:.92rem;}
.rp-toc-more a{color:var(--secdl-accent);text-decoration:none;font-weight:600;}
.rp-toc-more a:hover,.rp-toc-more a:focus{text-decoration:underline;}
body.rp-landing .rp-toc-more{margin-left:auto;margin-right:auto;}

/* Detailed contents: each chapter's section list, nested under its entry. The
   nested <li> deliberately does NOT carry ltx_tocentry, so the .rp-toc
   li.ltx_tocentry and a[href^="Chx"] rules above cannot leak into it. */
.rp-toc-detailed li.ltx_tocentry > a{font-weight:600;}
/* The chapter precis, lifted from the chapter page (chapterprecis). Indented to
   the section list and set in the same italic as on the chapter page itself, so it
   reads as the chapter's summary rather than as another link. */
.rp-toc-precis{margin:.15rem 0 .5rem;padding:0 .45rem 0 2.6em;
  font-style:italic;font-size:.9rem;line-height:1.5;color:#4a4a4a;
  max-width:none;}
.rp-toc-precis math{font-style:normal;}
.rp-toc-seclist{list-style:none;margin:.1rem 0 .85rem;padding:0 0 0 2.6em;}
.rp-toc-seclist li{margin:0;}
.rp-toc-seclist a{display:block;text-decoration:none;color:#3d5f80;
  padding:.16rem .45rem;border-radius:4px;line-height:1.4;font-size:.94rem;}
.rp-toc-seclist a:hover,.rp-toc-seclist a:focus{background:#eef3f8;}
.rp-toc-seclist .ltx_tag_ref{display:inline-block;min-width:2.9em;
  text-align:right;margin-right:.7em;color:var(--secdl-accent-ink);
  font-weight:600;font-variant-numeric:tabular-nums;}
.rp-toc-seclist .ltx_Math{font-size:.95em;}
