/* SPDX-License-Identifier: GPL-3.0-only */
/* Strata's book on HonKit's default theme, in the STRATA screen theme (firmware/src/sy_gfx.c): the ground, ink, label,
 * mid, line and vermilion; Space Mono for everything, as the panel's screen; dark always (as the panel's
 * screen). Only colours, type and spacing: the theme's layout (the side bar, the search, the page arrows) stays. */
@import url("https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap");

:root {
  --st-bg: #0b0b0b; --st-card: #131312; --st-raise: #1d1c1a; --st-line: #2c2a27; --st-ink: #f4f1ea;
  --st-lab: #bab7b1; --st-mid: #7a766e; --st-hot: #ff4d2e; --st-hot-ink: #0b0b0b;
  --st-mono: "Space Mono", ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  color-scheme: dark;
}

html, body, .book, .book .book-body, .book .book-body .body-inner, .book .book-body .page-wrapper {
  background: var(--st-bg) !important; color: var(--st-ink);
}
body, .book, .book .book-body .page-wrapper .page-inner section.normal, .book .book-summary, input, button {
  font-family: var(--st-mono) !important;
}

/* the side bar: the module list */
.book .book-summary { background: var(--st-card); border-right: 1px solid var(--st-line); }
.book .book-summary ul.summary li a, .book .book-summary ul.summary li span {
  color: var(--st-lab); font-size: 12.5px; letter-spacing: .02em; padding: 7px 15px;
}
.book .book-summary ul.summary li a:hover { color: var(--st-ink); background: var(--st-raise); text-decoration: none; }
.book .book-summary ul.summary li.active > a { color: var(--st-hot-ink); background: var(--st-hot); font-weight: 700; }
.book .book-summary ul.summary li.header {
  color: var(--st-mid); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700;
  padding: 18px 15px 6px;
}
.book .book-summary ul.summary li.divider { background: var(--st-line); }
.book .book-summary #book-search-input { background: var(--st-card); border-bottom: 1px solid var(--st-line); }
.book .book-summary #book-search-input input, .book .book-summary #book-search-input input:focus {
  background: var(--st-raise); color: var(--st-ink); border: 1px solid var(--st-line); border-radius: 0;
}
.book .book-summary ul.summary li a.gitbook-link, .book .book-summary ul.summary li.honkit-link { display: none; }

/* the top line, as the screen's: the page's name, the controls */
.book .book-header { background: var(--st-bg); border-bottom: 1px solid var(--st-line); color: var(--st-lab); }
.book .book-header h1 { color: var(--st-lab); font-family: var(--st-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; }
.book .book-header h1 a, .book .book-header h1 a:hover { color: var(--st-lab); }
.book .book-header .btn { color: var(--st-mid); }
.book .book-header .btn:hover { color: var(--st-hot); background: transparent; }

/* the page */
.book .book-body .page-wrapper .page-inner { max-width: 820px; padding: 18px 24px 64px; }
.markdown-section { color: var(--st-ink); font-size: 14px; line-height: 1.7; }
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4 {
  font-family: var(--st-mono); color: var(--st-ink); font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.markdown-section h1 { font-size: 24px; letter-spacing: .16em; border-bottom: 2px solid var(--st-hot); padding-bottom: 8px; }
.markdown-section h2 { font-size: 16px; border-bottom: 1px solid var(--st-line); padding-bottom: 6px; margin-top: 2.2em; }
.markdown-section h3 { font-size: 13px; color: var(--st-ink); }
.markdown-section h4 { font-size: 12px; color: var(--st-lab); }
.markdown-section a { color: var(--st-hot); text-decoration: none; border-bottom: 1px solid transparent; }
.markdown-section a:hover { border-bottom-color: var(--st-hot); }
.markdown-section strong { color: var(--st-ink); }
.markdown-section em { color: var(--st-lab); }
.markdown-section hr { background: var(--st-line); height: 1px; }
.markdown-section code {
  font-family: var(--st-mono); background: var(--st-raise); color: var(--st-ink); border-radius: 0; padding: .1em .35em;
}
.markdown-section pre { background: var(--st-card); border: 1px solid var(--st-line); border-radius: 0; }
.markdown-section pre > code { background: transparent; color: var(--st-ink); }
.markdown-section blockquote {
  color: var(--st-ink); border-left: 3px solid var(--st-hot); background: var(--st-card); padding: 10px 16px;
}
.markdown-section blockquote p { margin: 0; }
.markdown-section table { display: table; width: 100%; border-collapse: collapse; font-size: 12.5px; }
.markdown-section table tr { background: transparent; border-top: 1px solid var(--st-line); }
.markdown-section table tr:nth-child(2n) { background: var(--st-card); }
.markdown-section table th { color: var(--st-lab); text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
  background: var(--st-raise); border: 1px solid var(--st-line); }
.markdown-section table td { border: 1px solid var(--st-line); }
.markdown-section kbd {
  font-family: var(--st-mono); font-size: 11px; font-weight: 700; color: var(--st-ink); background: var(--st-raise);
  border: 1px solid var(--st-mid); border-bottom-width: 2px; border-radius: 2px; padding: 1px 5px; box-shadow: none;
}
.markdown-section img { max-width: 100%; border: 1px solid var(--st-line); image-rendering: pixelated; }

/* the page arrows */
.book .book-body .navigation { color: var(--st-mid); }
.book .book-body .navigation:hover { color: var(--st-hot); }

/* the search's results */
.book .book-body .page-wrapper .page-inner section.search-results { color: var(--st-ink); }
.book .book-body .search-results .search-results-item h3 a { color: var(--st-hot); }

/* ------------------------------------------------------------------ layout: the width used, side by side ---- */
/* the page up to 1200 px; a screenshot at half size (240 px) floated beside its text, cleared at each heading; tables
 * as wide as they need beside it; two tables side by side after <div class="cols"></div> (or inside a
 * <div class="cols"> of HTML); feature cards in <div class="cards">. One column under 700 px. */
.book .book-body .page-wrapper .page-inner { max-width: 1200px; padding-left: 72px; padding-right: 72px; }   /* (room for the page arrows) */
.markdown-section h1, .markdown-section h2, .markdown-section h3 { clear: both; }
.markdown-section img {
  float: right; width: 240px; height: auto; margin: 4px 0 14px 22px;
}
.markdown-section table { width: auto; max-width: 100%; }
.markdown-section table td, .markdown-section table th { padding: 5px 10px; vertical-align: top; }
.markdown-section div.cols:empty { display: none; }
.markdown-section div.cols:empty + table, .markdown-section div.cols:empty + table + table {
  display: inline-table; width: calc(50% - 20px); vertical-align: top; margin: 0 0 16px 0;
}
.markdown-section div.cols:empty + table { margin-right: 18px; }
.markdown-section div.cols:not(:empty) {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; margin-bottom: 16px;
}
.markdown-section div.cols:not(:empty) > table { width: 100%; margin: 0; }
.markdown-section .cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0 22px;
}
.markdown-section .card {
  background: var(--st-card); border: 1px solid var(--st-line); padding: 12px 14px 10px; display: flex;
  flex-direction: column; gap: 6px; min-width: 0;
}
.markdown-section .card:hover { border-color: var(--st-mid); }
.markdown-section .card h3 { margin: 0; font-size: 12px; color: var(--st-ink); }
.markdown-section .card p { margin: 0; font-size: 12.5px; line-height: 1.55; }
.markdown-section .card ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.6; }
.markdown-section .card .more { margin-top: auto; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.markdown-section ol, .markdown-section ul { padding-left: 2.4em; }

@media (max-width: 700px) {
  .book .book-body .page-wrapper .page-inner { padding-left: 16px; padding-right: 16px; }
  .markdown-section img { float: none; display: block; margin: 8px auto 14px; }
  .markdown-section div.cols:empty + table, .markdown-section div.cols:empty + table + table {
    display: table; width: 100%; margin-right: 0;
  }
  .markdown-section div.cols:not(:empty) { grid-template-columns: 1fr; }
  .markdown-section table { display: block; overflow-x: auto; }
}

/* Strata's logo atop the contents (fix_links.mjs puts it in) */
.book .book-summary .st-brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px 10px; color: var(--st-ink);
  font-weight: 700; font-size: 18px; letter-spacing: .2em; text-decoration: none; }
.book .book-summary .st-brand:hover { color: var(--st-hot); text-decoration: none; }
