@charset "UTF-8";
@import "literata.css";

body {
    max-width: 47rem;
    margin-left: clamp(1rem, calc(100vw - 47rem), 4rem);
    margin-right: auto;
    padding-left: 2rem;
    padding-top: 1rem;
    padding-bottom: 25vh;
    font-family: var(--body-font-family, system-ui, sans-serif);
    font-size: 1.0625rem;   /* was 1rem; practical typography web: 15–25 px */
    line-height: 1.35;      /* practical typography: 120–145 % of point size */
    background-color: #ffffff;
    color: #111;
    hyphens: auto;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    font-variant-ligatures: common-ligatures;
    font-variant-numeric: var(--body-font-variant-numeric, normal);
}

#content {
    max-width: 30rem;
}

p {
    margin-top: 0;
    margin-bottom: 0.9em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: system-ui, sans-serif;
}

h1 {
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: 1.7rem;
    line-height: 1.2;
}

h2 {
    font-weight: 400;
    margin-top: 3rem;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
    line-height: 1.2;
    color: #005a9c;
    position: relative;
}

h3 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1.2;
    color: #005a9c;
    position: relative;
}

h4, h5, h6 {
    font-weight: 400;
    color: #005a9c;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-variant-numeric: lining-nums;
}

a.anchor {
    position: absolute;
    left: -0.9em;
    opacity: 0.5;
    font-size: 0.85em;
    font-weight: normal;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

a.anchor::before {
    content: "§";
}

a.anchor:hover {
    opacity: 1;
}

img {
    max-width: 100%;
    height: auto;
}

code {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: 0.9375em;
    background-color: #f0f0e8;
    padding: 0.1em 0.3em;
    border-radius: 2px;
}

pre {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: 0.9375em;
    line-height: 1.5;
    background-color: #f0f0e8;
    border-left: 3px solid #005a9c;
    padding: 0.75em 1em;
    overflow-x: auto;
    margin: 1.2em 0;
    hyphens: none;
}

pre > code {
    background: none;
    padding: 0;
    font-size: 1em;
    border-radius: 0;
}

ul, ol {
    padding-left: 1.5em;
    margin: 0.9em 0;
}

li + li {
    margin-top: 0.4em;
}

li > ul, li > ol {
    margin: 0.3em 0;
}

li > p {
    margin: 0.5em 0 0.5em 0;
}

ul.bibliography {
    list-style: none;
    padding-left: 0;
    margin: 1em 0;
}

ul.bibliography li {
    padding-left: 2.5em;
    text-indent: -2.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
}


#toc-cb {
    position: fixed;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

#toc-cb:focus-visible + #toc-label {
    outline: 4px solid #005a9c;
    outline-offset: -4px;
    display: none;
}

#toc-label {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    display: flex;
    align-items: center;
    padding: 0 clamp(3rem, calc(100vw - 45rem), 6rem);
    background: #ffffff;
    border-top: 2px solid #005a9c;
    cursor: pointer;
    z-index: 100;
    font-size: 0.875rem;
    font-weight: bold;
    color: #005a9c;
}

#toc-label::after {
    content: " ▴";
    margin-left: 0.3em;
}

#toc-cb:checked + #toc-label::after {
    content: " ▾";
}

nav#toc {
    position: fixed;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    z-index: 99;
    background: #ffffff;
    border-top: 2px solid #005a9c;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

#toc-cb:checked ~ header nav#toc {
    max-height: 60vh;
    overflow-y: auto;
}

#toc-title {
    display: none;
}

nav#toc > ol.toc-list {
    list-style: none;
    padding: 0.75rem clamp(3rem, calc(100vw - 45rem), 6rem) 1.5rem;
    margin: 0;
}

nav#toc .toc-list {
    list-style: none;
    margin: 0;
}

nav#toc .toc-list.level-2 {
    padding: 0 0 0 1.5em;
}

nav#toc .toc-list a {
    display: block;
    padding: 0.15rem 0;
    color: #111;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.6;
}

nav#toc .toc-list a:hover {
    color: #005a9c;
}

section[id], h2[id], h3[id], h4[id] {
    scroll-margin-bottom: 3rem;
}

dt {
    font-weight: bold;
    margin-top: 0.5em;
}

dd {
    margin: 0 0 0.5em 2em;
}

/* Search bar — positioned in the fixed footer bar on the right */
#search-wrap {
    position: fixed;
    bottom: 0;
    right: clamp(3rem, calc(100vw - 45rem), 6rem);
    height: 2.5rem;
    display: flex;
    align-items: center;
    z-index: 101;
}

#search-input {
    height: 1.5rem;
    border: 1px solid #aaa;
    border-radius: 3px;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fff;
    color: #111;
    width: 10rem;
    outline: none;
    transition: width 0.2s, border-color 0.15s;
    /* suppress browser built-in clear button */
    -webkit-appearance: none;
}

#search-input:focus {
    border-color: #005a9c;
    box-shadow: 0 0 0 2px rgba(0, 90, 156, 0.15);
    width: 14rem;
}

/* Search results dropdown */
#search-output {
    position: fixed;
    bottom: 2.5rem;
    right: clamp(3rem, calc(100vw - 45rem), 6rem);
    background: #fff;
    border: 1px solid #005a9c;
    border-bottom: 2px solid #005a9c;
    max-height: 60vh;
    overflow-y: auto;
    min-width: 22rem;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.08);
    z-index: 200;
}

.search-message {
    font-size: 0.78rem;
    color: #555;
    font-style: italic;
    margin: 0;
    padding: 0.4rem 0.75rem;
    background: #f8f8f4;
    border-bottom: 1px solid #e0e0d8;
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result {
    border-bottom: 1px solid #eee;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result a {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #111;
}

.search-result:hover {
    background: #f0f0e8;
}

.search-result-title {
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
    color: #005a9c;
}

.search-result-excerpt {
    display: block;
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.15rem;
    line-height: 1.4;
}

.search-result-excerpt + .search-result-excerpt {
    margin-top: 0.1rem;
}

mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 0.1em;
    font-weight: bold;
}

/* Admonition blocks (html5s backend)
   HTML: <aside|section class="admonition-block note|tip|warning|caution|important">
           <h6 class="block-title label-only"><span class="title-label">Note: </span></h6>
           <p>…</p>
         </aside|section>
*/
.admonition-block {
    border-left: 3px solid;
    padding: 0.75em 1em;
    margin: 1.2em 0;
}

.admonition-block h6.block-title {
    font-size: 0.75em;
    font-weight: bold;
    font-feature-settings: var(--admonition-title-font-feature-settings, normal);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.5em 0;
    line-height: 1.2;
    position: static;
}

.admonition-block > p:last-child,
.admonition-block > div:last-child > p:last-child {
    margin-bottom: 0;
}

.admonition-block.note {
    border-left-color: #005a9c;
    background-color: #f0f4fa;
}
.admonition-block.note h6.block-title {
    color: #005a9c;
}

.admonition-block.tip {
    border-left-color: #1a7f4a;
    background-color: #f0f7f2;
}
.admonition-block.tip h6.block-title {
    color: #1a7f4a;
}

.admonition-block.warning {
    border-left-color: #bf6900;
    background-color: #fdf6e8;
}
.admonition-block.warning h6.block-title {
    color: #bf6900;
}

.admonition-block.caution {
    border-left-color: #bf3400;
    background-color: #fdf2ec;
}
.admonition-block.caution h6.block-title {
    color: #bf3400;
}

.admonition-block.important {
    border-left-color: #bf0000;
    background-color: #fdf0f0;
}

.admonition-block.important h6.block-title {
    color: #bf0000;
}
