/* ==========================================================================
   stokkeland.net/jts - site styles
   Night-blue header/footer, steel sides, white reading column.
   One accent: the "saber" line under the header.
   ========================================================================== */

:root {
  --night: #16233d;       /* header + footer */
  --night-2: #22345a;     /* footer links hover, borders on dark */
  --steel: #dde4ee;       /* page sides */
  --paper: #ffffff;       /* content */
  --ink: #1e2635;         /* body text */
  --muted: #5a6477;
  --rule: #d6dce6;
  --link: #135fa6;
  --link-hover: #0b3f72;
  --saber: #43b0ff;       /* accent line */
  --code-bg: #f2f5f9;

  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Saira Semi Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --col: 860px;
  --pad: clamp(1.1rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--steel);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
}

.wrap { width: 100%; max-width: var(--col); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Header ---------- */
.site-header {
  background: var(--night);
  color: #fff;
  position: relative;
  padding-block: 1.4rem;
}
.site-header::after {           /* the saber */
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--saber);
  box-shadow: 0 0 10px 1px rgba(67, 176, 255, .65);
}
.site-header a { color: inherit; text-decoration: none; }
.site-header p { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 1.1rem; }
.brand-photo {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, .85);
  flex: none;
}
.brand-name {
  font: 600 clamp(1.35rem, 3.4vw, 2rem)/1.15 var(--font-head);
  letter-spacing: .01em;
}
.brand:hover .brand-name { color: #d7ecff; }

/* ---------- Main content ---------- */
.site-main { flex: 1; display: flex; }
.layout { flex: 1; display: flex; width: 100%; max-width: var(--col); margin: 0 auto; }
.content {
  background: var(--paper);
  padding: 2.5rem var(--pad) 3.5rem;
  flex: 1;
  min-width: 0;
  border-inline: 1px solid var(--rule);
}
.content > :first-child { margin-top: 0; }
.content > :last-child { margin-bottom: 0; }
.content::after { content: ""; display: block; clear: both; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  color: var(--night);
  margin: 2rem 0 .7rem;
}
h1 { font-size: 2.25rem; font-weight: 700; margin-top: 0; }
h2 { font-size: 1.65rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rule); display: flow-root; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5, h6 { font-size: 1rem; }

p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: .25rem; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--saber); outline-offset: 2px; border-radius: 2px; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

blockquote {
  margin-left: 0;
  padding: .2rem 0 .2rem 1.1rem;
  border-left: 4px solid var(--saber);
  color: var(--muted);
}
blockquote > :last-child { margin-bottom: 0; }

code, kbd, samp { font-family: var(--font-mono); font-size: .9em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: .9rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
}

table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--rule); padding: .45rem .7rem; text-align: left; vertical-align: top; }
th { background: #eef2f7; font-weight: 600; }

/* Links to uploaded files get a small document mark.
   Turn it off for one link: [text](url){.noicon}  or  <a class="noicon" ...> */
a[href*="tsobjects/files/"]:not(.noicon)::before {
  content: "";
  display: inline-block;
  width: .75em; height: .95em;
  margin-right: .3em;
  vertical-align: -.1em;
  border: 1.5px solid currentColor;
  border-radius: 1px 5px 1px 1px;
}

/* ---------- Images (classes inserted by the editor) ---------- */
img { max-width: 100%; height: auto; }
.img { margin: 0 0 1.1rem; }
.img img { display: block; width: 100%; border-radius: 3px; }
.img figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }
.img-small  { width: 240px; max-width: 100%; }
.img-medium { width: 420px; max-width: 100%; }
.img-large  { width: 100%; }
.img-left   { float: left;  margin: .3rem 1.5rem 1rem 0; }
.img-right  { float: right; margin: .3rem 0 1rem 1.5rem; }
.img-center { margin-left: auto; margin-right: auto; text-align: center; }
.img-center img { margin: 0 auto; }
.img-left.img-large, .img-right.img-large { float: none; margin-inline: 0; }
.clear { clear: both; }
@media (max-width: 560px) {
  .img-left, .img-right { float: none; margin: 0 auto 1.1rem; }
}

.small { font-size: .9rem; }

/* ---------- Side menu (tsobjects/pages/menu.*) ----------
   Hidden on narrow screens; above the breakpoint the page widens so the
   header, content and footer stay aligned, and the menu sticks while scrolling.
   Change 901px in both places below to move the breakpoint. */
.side-menu { display: none; }

@media (min-width: 901px) {
  body.has-menu { --col: 1150px; }
  body.has-menu .layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 1.5rem; }
  .side-menu { display: block; padding-block: 2.5rem; }
  .side-menu-inner {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--night);
    border-radius: 3px;
    padding: 1.1rem 1.2rem 1.2rem;
    font-size: .95rem;
    line-height: 1.5;
  }
}
.side-menu-inner > :first-child { margin-top: 0; }
.side-menu-inner > :last-child { margin-bottom: 0; }
.side-menu h2, .side-menu h3, .side-menu h4 {
  font-size: 1.05rem;
  border: 0;
  padding: 0;
  margin: 1.3rem 0 .45rem;
}
.side-menu p { margin: 0 0 .8rem; }
.side-menu ul { list-style: none; padding: 0; margin: 0 0 .8rem; }
.side-menu li + li { margin-top: 0; }
.side-menu li a, .side-menu li > span { display: block; padding: .28rem .55rem; border-radius: 3px; text-decoration: none; }
.side-menu li a:hover { background: #eef3f9; }
.side-menu li.current > span { color: var(--night); font-weight: 600; background: #e6f3ff; box-shadow: inset 3px 0 0 var(--saber); }
.side-menu li:not(.extra) + li.extra { border-top: 1px solid var(--rule); margin-top: .4rem; padding-top: .4rem; }
.side-menu .toc-l0 a { font-weight: 600; }
.side-menu .toc-l1 a { padding-left: 1.3rem; }
.side-menu .toc-l2 a { padding-left: 2.1rem; font-size: .92em; }
.side-menu .toc-l0:not(:first-child) { margin-top: .35rem; }
.side-menu img { border-radius: 3px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--night);
  color: #c9d3e3;
  padding-block: 1.6rem 2rem;
  font-size: .95rem;
  border-top: 3px solid var(--night-2);
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--saber); text-decoration: underline; }
.site-footer p { margin: .6rem 0 0; }
.page-links { line-height: 1.9; }
.page-links .current { color: var(--saber); font-weight: 600; }
.page-links .sep { color: #6c7d9b; }

/* ---------- Utility ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; background: #fff; color: var(--night); padding: .5rem .8rem; }

.preview-bar {
  background: #ffe28a; color: #3d2f00;
  text-align: center; font: 600 .9rem/1 var(--font-body);
  padding: .5rem;
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand-photo { width: 64px; height: 64px; }
  .content { border-inline: 0; padding-block: 1.8rem 2.5rem; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer { background: none; color: #000; }
  .site-header::after, .page-links, .skip-link { display: none; }
  .content { border: 0; }
}
