/* Web edition of the fuzzyclust book: the look of the fuzzyclust documentation
   (Raleway headings, IBM Plex, Pannon blue structure, Okabe-Ito accents). */
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@600;700;800;900&family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=IBM+Plex+Mono:wght@400;600&display=swap");

:root {
  --navy: #14304a; --brand: #285780; --ink: #1f2a36; --muted: #5b6876;
  --verm: #d55e00; --green: #009e73; --orange: #e69f00; --sky: #56b4e9;
  --line: #dde4ec; --paper: #f4f6f8; --wash: #eef3f8;
  --head: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: #fff; color: var(--ink); font-family: var(--serif); font-size: 17px; line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--verm); text-decoration: underline; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 10px 24px; background: var(--navy); color: #fff; font-family: var(--sans); }
.topbar .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.topbar .brand b { display: block; font: 800 16px/1.2 var(--head); }
.topbar .brand small { display: block; font-size: 12.5px; color: #9cc3e6; }
.toplinks { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14.5px; }
.toplinks a { color: #dce7f2; }
.toplinks a:hover { color: #fff; }
.toplinks a.hub { border: 1px solid rgba(255,255,255,.55); border-radius: 3px; padding: 0 8px; }

/* three-column layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 230px; gap: 40px; max-width: 1420px;
  margin: 0 auto; padding: 28px 24px 0; }
body.home .layout { grid-template-columns: 270px minmax(0, 1fr); }
aside.left, aside.right { position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 96px);
  overflow-y: auto; font-family: var(--sans); font-size: 14px; }
.toc-title { font: 700 12px/1 var(--head); letter-spacing: 1.2px; text-transform: uppercase; color: var(--verm);
  margin: 0 0 10px; }
.toc ol, .onpage ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: grid; grid-template-columns: 26px 1fr; padding: 5px 8px; border-radius: 6px; color: var(--ink);
  line-height: 1.35; }
.toc li a:hover { background: var(--wash); text-decoration: none; }
.toc li.current a { background: var(--wash); color: var(--brand); font-weight: 600; border-left: 3px solid var(--brand); }
.toc .num, .fulltoc .num { color: var(--brand); font-weight: 600; }
.onpage li a { display: block; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); color: var(--muted); line-height: 1.35; }
.onpage li a:hover { border-left-color: var(--brand); color: var(--brand); text-decoration: none; }

/* reading column */
main.content { max-width: 820px; min-width: 0; }
main.content p { margin: 0 0 0.9em; }
h1, h2, h3, h4, .chapterHead, .likechapterHead, .appendixHead, .sectionHead, .likesectionHead, .subsectionHead,
.likesubsectionHead, .subsubsectionHead { font-family: var(--head); color: var(--ink); line-height: 1.2; }
.chapterHead, .likechapterHead, .appendixHead { font-size: 34px; font-weight: 900; margin: 6px 0 22px; }
.chapterHead::after, .likechapterHead::after, .appendixHead::after { content: ""; display: block; width: 3.2rem; height: 3px;
  margin-top: 12px; background: var(--verm); }
.chapterHead .titlemark, .appendixHead .titlemark { display: block; font: 700 13px/1 var(--head); letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; }
.sectionHead, .likesectionHead { font-size: 25px; font-weight: 800; margin: 1.7em 0 0.6em; }
.subsectionHead, .likesubsectionHead { font-size: 20px; font-weight: 700; margin: 1.4em 0 0.5em; }
.subsubsectionHead { font-size: 17px; font-weight: 700; }
.titlemark { color: var(--brand); }
.paragraphHead, .likeparagraphHead { font-family: var(--head); font-weight: 700; }
code, .lstinline, tt, [class^="ec-lmtt"], [class*=" ec-lmtt"] { font-family: var(--mono); font-size: 0.86em; }
.lstlisting, pre { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; background: var(--paper);
  border-left: 3px solid #7fa3c5; padding: 10px 14px; overflow-x: auto; white-space: pre; border-radius: 0 6px 6px 0; }
.lstlisting .label { display: none; }

/* boxes as in the book */
div.box { margin: 1.3em 0; padding: 12px 18px; border-left: 3px solid var(--brand); background: var(--wash);
  border-radius: 0 8px 8px 0; font-family: var(--sans); font-size: 15.5px; }
div.box p:last-child { margin-bottom: 0; }
div.summarybox { border-left-color: var(--green); background: #eef8f4; }
div.hintbox { border-left-color: var(--orange); background: #fdf6e8; }
div.roadmap { border-left-color: var(--verm); background: var(--paper); font-size: 16px; }
div.apibox { border-left-color: #4a8fc4; background: #eff5fa; font-size: 15px; }
img.algobox { display: block; max-width: 100%; height: auto; margin: 1.4em auto; }

/* figures and tables */
figure { margin: 1.8em 0; text-align: center; }
figure img, img.exfig { max-width: 100%; height: auto; }
figcaption, .caption { margin-left: 0 !important; text-indent: 0 !important; padding: 0; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; text-align: left; color: var(--ink);
  margin-top: 8px; }
.caption .id { color: var(--brand); font-weight: 700; }
p.runbox { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: flex-start; margin: 8px 0 0;
  font-family: var(--sans); font-size: 13.5px; }
p.runbox a { padding: 5px 11px; border: 1.5px solid var(--line); border-radius: 7px; }
p.runbox a.colab { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
p.runbox a.colab:hover { background: var(--navy); text-decoration: none; }
table.tabular, table.longtable { border-collapse: collapse; margin: 1em auto; font-family: var(--sans); font-size: 14px; }
td, th { padding: 4px 10px; vertical-align: top; }
div.tabular, div.longtable { overflow-x: auto; }
math[display="block"] { margin: 0.8em 0; overflow-x: auto; overflow-y: hidden; }
table.equation, table.equation-star, table.align, table.align-star { width: 100%; }
.footnotes { font-size: 14px; border-top: 1px solid var(--line); margin-top: 2em; padding-top: 0.6em; }

/* previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 3em 0 2em; font-family: var(--sans); }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; }
.pager .next { text-align: right; }

/* title page */
.hero { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; margin: 10px 0 30px; }
.hero .cover { width: 260px; height: auto; box-shadow: 0 16px 36px -14px rgba(20, 48, 74, .55); }
.hero .kicker { font: 700 12.5px/1 var(--head); letter-spacing: 1.4px; text-transform: uppercase; color: var(--verm); }
.hero h1 { font: 900 38px/1.1 var(--head); margin: 8px 0 6px; }
.hero .sub { font: italic 20px/1.3 var(--serif); color: var(--brand); margin: 0 0 12px; }
.hero .author { font-family: var(--sans); color: var(--muted); }
.hero .lead { font-size: 17px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--sans); }
.buttons a { padding: 9px 15px; border: 1.5px solid var(--line); border-radius: 8px; font-weight: 600; font-size: 14.5px; }
.buttons a.main { background: var(--brand); border-color: var(--brand); color: #fff; }
.toc-head { font: 800 24px/1.2 var(--head); }
.fulltoc { list-style: none; padding: 0; columns: 2; column-gap: 32px; font-family: var(--sans); }
.fulltoc li { break-inside: avoid; padding: 4px 0; }
.fulltoc a { display: grid; grid-template-columns: 30px 1fr; color: var(--ink); }
.imprint { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

footer.foot { max-width: 1420px; margin: 40px auto 0; padding: 22px 24px 40px; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  aside.right { display: none; }
}
@media (max-width: 860px) {
  .layout, body.home .layout { grid-template-columns: 1fr; padding-top: 18px; }
  aside.left { position: static; max-height: none; order: 2; border-top: 1px solid var(--line); padding-top: 16px; }
  .toplinks { font-size: 13px; gap: 2px 12px; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .hero { grid-template-columns: 1fr; }
  .hero .cover { width: 200px; }
  .fulltoc { columns: 1; }
  body { font-size: 16.5px; }
  .chapterHead, .likechapterHead { font-size: 28px; }
}
