/* ============================================================
   Brigg — the web manual (brigg.no/hjelp, brigg.se/hjalp,
   brigg.dk/hjaelp, brigg.com/help). Sits on top of legal.css (top nav,
   doc-head, footer) and the tokens in colors_and_type.css — the design
   system's own expression: sand canvas, evergreen accent, hairline
   cards. Three columns on a wide screen (contents · page · on this
   page), two on a laptop, one on a phone with the contents behind a
   toggle. Pages come from docs/manual/ (src/manual.mjs).
   ============================================================ */

:root { --mn-side: 268px; --mn-toc: 208px; }
.mn .wrap.mn-grid {
  max-width: 1320px;
  display: grid;
  grid-template-columns: var(--mn-side) minmax(0, 1fr) var(--mn-toc);
  gap: clamp(28px, 3.4vw, 56px);
  align-items: start;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(56px, 7vw, 96px);
}
.mn-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Contents column ── */
.mn-side {
  position: sticky; top: calc(var(--nav-h) + 20px);
  max-height: calc(100vh - var(--nav-h) - 40px); overflow: auto;
  padding-right: 4px;
}
.mn-home {
  display: block; font-weight: 600; font-size: 15px; color: var(--ink);
  margin: 0 0 14px;
}
.mn-search { position: relative; margin: 0 0 18px; }
.mn-q {
  width: 100%; height: var(--control-h, 38px);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; padding: 0 12px;
}
.mn-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.mn-suggest {
  position: absolute; left: 0; right: 0; top: calc(var(--control-h, 38px) + 4px); z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop); padding: 4px; max-height: 60vh; overflow: auto;
}
.mn-suggest a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); }
.mn-suggest a:hover, .mn-suggest a:focus-visible { background: var(--hover); }
.mn-suggest strong { display: block; font-size: 14px; font-weight: 600; }
.mn-suggest span { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.mn-suggest .mn-empty { padding: 8px 10px; font-size: 13px; color: var(--ink-3); }

.mn-tree { list-style: none; margin: 0; padding: 0; }
.mn-tree .mn-tree { padding-left: 12px; margin: 2px 0 6px; border-left: 1px solid var(--line); }
.mn-tree a {
  display: block; padding: 5px 10px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-2); line-height: 1.35;
}
.mn-tree a:hover { background: var(--hover); color: var(--ink); }
.mn-tree > li > a { font-weight: 500; }
.mn-nav > .mn-tree > li { margin-bottom: 4px; }
.mn-nav > .mn-tree > li > a { font-weight: 600; color: var(--ink); }
.mn-tree li.is-current > a {
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600;
}
.mn-toggle { display: none; }

/* ── Page column ── */
.mn-main { min-width: 0; }
.mn-head { margin-bottom: clamp(24px, 3vw, 36px); }
.mn-head h1 { font-size: clamp(30px, 3.6vw, 44px); }
.mn-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-3); margin: 0 0 14px; }
.mn-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.mn-crumbs span:last-child { display: none; }

.mn-body { font-size: 16.5px; line-height: 1.65; color: var(--ink); }
.mn-body h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.012em;
  margin: 40px 0 12px; padding-top: 20px; border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
.mn-body h3 { font-size: 17px; font-weight: 600; margin: 26px 0 8px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.mn-body p { margin: 0 0 14px; }
.mn-body ul, .mn-body ol { margin: 0 0 16px; padding-left: 22px; }
.mn-body li { margin: 4px 0; }
.mn-body li > ul, .mn-body li > ol { margin: 4px 0 6px; }
.mn-body a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent-soft-line); }
.mn-body a:hover { text-decoration-color: currentColor; }
.mn-body strong { font-weight: 600; }
.mn-body code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.mn-body blockquote {
  margin: 0 0 18px; padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-md);
  color: var(--ink-2);
}
.mn-body blockquote p:last-child { margin: 0; }
.mn-body table { border-collapse: collapse; width: 100%; margin: 0 0 18px; font-size: 15px; }
.mn-body th, .mn-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.manual-shot { margin: 18px 0 24px; }
/* Shown at the size it was shot (width/height come from the PNG), never
   stretched; square-cornered, because the capture squares the element's own
   corners and a rounded frame would clip them again. */
.manual-shot img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); background: var(--surface);
}
/* Who or where a feature is for — `{admin}` / `{only:…}` in the page. */
.mn-pill {
  display: inline-block; vertical-align: 0.15em; margin-left: 6px;
  padding: 1px 8px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; line-height: 18px; letter-spacing: 0;
  white-space: nowrap;
}
.mn-pill-admin { background: var(--violet-bg); color: var(--violet-ink); }
.mn-pill-only { background: var(--blue-bg); color: var(--blue-ink); }
.manual-shot figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; }

.mn-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mn-card {
  display: block; height: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .15s, box-shadow .15s;
}
.mn-card:hover { border-color: var(--accent-soft-line); box-shadow: var(--shadow-sm); }
.mn-card strong { display: block; font-weight: 600; margin-bottom: 4px; }
.mn-card span { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.mn-section { margin: 0 0 clamp(28px, 4vw, 44px); }
.mn-section h2 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.mn-section h2 a:hover { color: var(--accent-ink); }
.mn-section-sum { color: var(--ink-3); margin: 0 0 14px; }

.mn-pager { display: flex; gap: 12px; margin-top: 40px; }
.mn-pager a {
  flex: 1 1 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); font-weight: 600; font-size: 15px;
}
.mn-pager a:hover { border-color: var(--accent-soft-line); }
.mn-pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em; }
.mn-next { text-align: right; margin-left: auto; }

.mn-results { margin: 0 0 32px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.mn-results h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.mn-results ol { list-style: none; margin: 0; padding: 0; }
.mn-results li + li { border-top: 1px solid var(--line); }
.mn-results a { display: block; padding: 10px 0; }
.mn-results strong { display: block; font-weight: 600; color: var(--accent-ink); }
.mn-results span { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.5; }

/* ── On this page ── */
.mn-toc { position: sticky; top: calc(var(--nav-h) + 20px); font-size: 13.5px; }
.mn-toc-title { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin: 0 0 10px; }
.mn-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.mn-toc a { display: block; padding: 4px 0 4px 12px; color: var(--ink-3); margin-left: -1px; border-left: 2px solid transparent; }
.mn-toc a:hover, .mn-toc a.is-active { color: var(--ink); border-left-color: var(--accent); }

/* ── Laptop: drop the on-this-page column ── */
@media (max-width: 1180px) {
  .mn .wrap.mn-grid { grid-template-columns: var(--mn-side) minmax(0, 1fr); }
  .mn-toc { display: none; }
}

/* ── Phone: one column, the contents behind a toggle ── */
@media (max-width: 820px) {
  .mn .wrap.mn-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-left: 16px; padding-right: 16px; }
  .mn-toggle {
    display: block; justify-self: start;
    height: 36px; padding: 0 14px; border-radius: var(--radius-full);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font: inherit; font-size: 14px; font-weight: 500;
  }
  /* The search stays on screen; only the contents wait behind the toggle. */
  .mn-side { position: static; max-height: none; }
  .mn-side .mn-home, .mn-side .mn-nav { display: none; }
  .mn.is-nav-open .mn-side .mn-home, .mn.is-nav-open .mn-side .mn-nav { display: block; }
  .mn-pager { flex-direction: column; }
  .mn-next { text-align: left; margin-left: 0; }
}

/* The shared top bar (legal.css) is sized for a single reading column;
   on a manual page it spans the three-column grid like the page does. */
body:has(.mn) .lnav .wrap { max-width: 1320px; }
@media (max-width: 820px) { body:has(.mn) .lnav .wrap { padding-left: 16px; padding-right: 16px; } }
