/* ------------------------------------------------------------------------
   FeResPost HTML manual: layout and readability.
   Loaded after manualHTML.css (generated by TeX4ht), so it overrides it.
   Copied into html_manual/ by "make html".  No effect on the PDF manual.
   ------------------------------------------------------------------------ */

:root {
  --frp-header-h: 3rem;
  --frp-sidebar-w: 20rem;
  --frp-text: #1d232a;
  --frp-muted: #5b6672;
  --frp-link: #1a5fb4;
  --frp-accent: #0b3d6b;
  --frp-border: #d9dee4;
  --frp-code-bg: #f5f7f9;
  --frp-panel: #ffffff;
  --frp-page: #eef1f4;
  --frp-current: #e3edf9;
  --frp-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
  --frp-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --frp-mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", "Liberation Mono", Menlo, monospace;
}

html { scroll-padding-top: calc(var(--frp-header-h) + 0.75rem); }

body {
  margin: 0;
  color: var(--frp-text);
  background: var(--frp-page) url("/INPUTS/test5.png");
  font-family: var(--frp-serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--frp-link); }
a:hover { text-decoration-thickness: 2px; }

/* ---- header ---------------------------------------------------------- */
.frp-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.9rem;
  min-height: var(--frp-header-h);
  padding: 0.35rem 1rem;
  box-sizing: border-box;
  background: var(--frp-accent);
  color: #fff;
  font-family: var(--frp-sans);
  font-size: 0.95rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.frp-header a { color: #fff; text-decoration: none; }
.frp-header a:hover { text-decoration: underline; }
.frp-brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.frp-version { opacity: .8; font-size: .85rem; }
.frp-pdf { border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 0 .45rem; }
#frp-search { margin-left: auto; min-width: 0; flex: 0 1 26rem; }
#frp-toc-toggle {
  display: none;
  font-size: 1.25rem; line-height: 1;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.6); border-radius: 4px;
  padding: .2rem .5rem; cursor: pointer;
}

/* Pagefind search box (only present after "make search") */
#frp-search .pagefind-ui { --pagefind-ui-scale: .75; --pagefind-ui-font: var(--frp-sans); }
#frp-search .pagefind-ui__form { position: relative; }
#frp-search .pagefind-ui__drawer {
  position: absolute; right: 0; left: auto; width: min(40rem, 92vw);
  max-height: 75vh; overflow: auto;
  background: #fff; color: var(--frp-text);
  border: 1px solid var(--frp-border); border-radius: 6px;
  padding: .5rem 1rem; box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
#frp-search .pagefind-ui__result-link { color: var(--frp-link) !important; }

/* ---- layout ------------------------------------------------------------ */
.frp-layout { display: flex; align-items: flex-start; }

#frp-sidebar {
  position: sticky; top: var(--frp-header-h);
  flex: 0 0 var(--frp-sidebar-w);
  width: var(--frp-sidebar-w);
  height: calc(100vh - var(--frp-header-h));
  overflow-y: auto; box-sizing: border-box;
  padding: .75rem .5rem 2rem .75rem;
  background: #f8f9fb;
  border-right: 1px solid var(--frp-border);
  font-family: var(--frp-sans);
  font-size: .85rem; line-height: 1.35;
}
#frp-sidebar:empty { display: none; }

#frp-main {
  flex: 1 1 auto; min-width: 0;
  max-width: 56rem;
  margin: 1rem auto 2rem;
  padding: 1rem 2.25rem 2rem;
  box-sizing: border-box;
  background: var(--frp-panel);
  border: 1px solid var(--frp-border);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow-wrap: break-word;   /* long identifiers and URLs on phones */
}

.frp-footer {
  padding: 1rem; text-align: center;
  font-family: var(--frp-sans); font-size: .85rem; color: var(--frp-muted);
}

/* ---- side table of contents ------------------------------------------- */
#frp-sidebar ul { list-style: none; margin: 0; padding: 0; }
#frp-sidebar ul ul { padding-left: .9rem; }
#frp-sidebar li { margin: 0; }
#frp-sidebar .frp-row { display: flex; align-items: flex-start; }
#frp-sidebar .frp-twisty {
  flex: 0 0 1.1rem; width: 1.1rem; height: 1.3rem;
  border: 0; padding: 0; background: none; cursor: pointer;
  color: var(--frp-muted); font-size: .7rem; line-height: 1.3rem;
}
#frp-sidebar .frp-twisty::before { content: "\25B8"; }
#frp-sidebar li.frp-open > .frp-row > .frp-twisty::before { content: "\25BE"; }
#frp-sidebar .frp-spacer { flex: 0 0 1.1rem; }
#frp-sidebar li > ul { display: none; }
#frp-sidebar li.frp-open > ul { display: block; }
#frp-sidebar a {
  display: block; flex: 1 1 auto;
  padding: .15rem .35rem; border-radius: 3px;
  color: var(--frp-text); text-decoration: none;
}
#frp-sidebar a:hover { background: #e9edf2; }
#frp-sidebar a .frp-num { color: var(--frp-muted); margin-right: .3em; }
#frp-sidebar .frp-level-0 > .frp-row { margin-top: .45rem; }
#frp-sidebar .frp-level-0 > .frp-row > a { font-weight: 700; color: var(--frp-accent); }
#frp-sidebar .frp-level-1 > .frp-row > a { font-weight: 600; }
#frp-sidebar a.frp-current { background: var(--frp-current); color: var(--frp-accent); font-weight: 700; }

/* ---- previous / up / next ---------------------------------------------- */
nav.crosslinks {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 0 0 1rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--frp-border);
  font-family: var(--frp-sans); font-size: .9rem;
}
nav.crosslinks-bottom { margin: 2rem 0 0; padding: .6rem 0 0; border-bottom: 0; border-top: 1px solid var(--frp-border); }
nav.crosslinks a {
  display: inline-block; padding: .2rem .6rem;
  border: 1px solid var(--frp-border); border-radius: 4px;
  text-decoration: none; background: #fafbfc;
}
nav.crosslinks a:hover { background: var(--frp-current); }

/* ---- text -------------------------------------------------------------- */
#frp-main h1, #frp-main h2, #frp-main h3, #frp-main h4, #frp-main h5 {
  font-family: var(--frp-sans); color: var(--frp-accent); line-height: 1.25;
}
#frp-main h2 { font-size: 1.7rem; }
#frp-main h3 { font-size: 1.45rem; }
#frp-main h4 { font-size: 1.25rem; }
#frp-main h5 { font-size: 1.1rem; }
#frp-main .titlemark { color: var(--frp-muted); margin-right: .35em; }
#frp-main p.indent { text-indent: 0; }

/* code: TeX4ht maps the Courier font to "'Nimbus Mono L', serif" */
[class^="pcr"], [class*=" pcr"], code, tt, kbd, samp { font-family: var(--frp-mono) !important; font-size: .92em; }
pre, pre.verbatim {
  font-family: var(--frp-mono); font-size: .85rem; line-height: 1.45;
  background: var(--frp-code-bg);
  border: 1px solid var(--frp-border); border-left: 3px solid var(--frp-accent);
  border-radius: 4px;
  padding: .75rem 1rem; margin: 1rem 0;
  overflow-x: auto; white-space: pre;
}

/* wide tables and equations scroll instead of widening the page */
div.tabular, div.longtable, div.centerline, div.equation {
  display: block; max-width: 100%; overflow-x: auto;
}
table.tabular { margin-left: auto; margin-right: auto; }
table.equation, table.equation-star { display: block; max-width: 100%; overflow-x: auto; }
table.equation > tbody, table.equation-star > tbody { display: table; width: 100%; }
/* numbered lists: TeX4ht uses a grid whose text column must be allowed to shrink */
dl.enumerate { grid-template-columns: 3ch minmax(0, 1fr); }
dd, dl.enumerate dd, dl.description dd { min-width: 0; }
table.tabular td, table.longtable td { padding: .15rem .45rem; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; }
math[display="block"] { display: block math; max-width: 100%; overflow-x: auto; overflow-y: hidden; }

/* figures */
#frp-main img { max-width: 100%; height: auto; }
div.figure, div.table { margin: 1.25rem 0; }
div.caption { font-size: .95rem; color: var(--frp-muted); text-align: center; }
hr.figure, hr.endfigure, hr.float, hr.endfloat { border: 0; border-top: 1px solid var(--frp-border); }

/* the top of the root page is the cover of the PDF: keep it compact */
.frp-root #frp-main div.center { text-align: center; }

/* ---- narrow screens ----------------------------------------------------- */
@media (max-width: 1100px) {
  #frp-toc-toggle { display: inline-block; }
  #frp-sidebar {
    position: fixed; left: 0; top: var(--frp-header-h); bottom: 0; z-index: 15;
    height: auto; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 2px 0 12px rgba(0,0,0,.2);
    max-width: 88vw;
  }
  body.frp-toc-open #frp-sidebar { transform: none; }
  #frp-main { margin: 0 auto; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  #frp-main { padding: .75rem 1rem 1.5rem; }
  .frp-version, .frp-home { display: none; }
  #frp-search { flex-basis: 100%; }
  .frp-header { flex-wrap: wrap; }
}

/* ---- print: content only ------------------------------------------------ */
@media print {
  .frp-header, #frp-sidebar, nav.crosslinks, .frp-footer { display: none !important; }
  body { background: #fff; }
  #frp-main { max-width: none; border: 0; box-shadow: none; margin: 0; padding: 0; }
}
