/* 7-Zip manual: mobile-first, light/dark, no dependencies. Copied to dist/assets/site.css. */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #1d2330;
  --muted: #5b6475;
  --line: #d9dde5;
  --panel: #f4f6fa;
  --link: #0b5fd9;
  --visited: #7a4b00;
  --accent: #c00000;
  --code-bg: #eef1f6;
  --measure: 72ch;
  --sidebar: 17rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171e;
    --fg: #e4e7ee;
    --muted: #9aa3b5;
    --line: #2c3240;
    --panel: #1b2029;
    --link: #7db3ff;
    --visited: #d9b06a;
    --accent: #ff8a8a;
    --code-bg: #20262f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--visited); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* Page frame: one column on phones, sidebar + content from 60rem */
.page { display: grid; grid-template-columns: minmax(0, 1fr); min-block-size: 100dvh; }
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.75rem max(1rem, env(safe-area-inset-left));
  background: var(--panel); border-block-end: 1px solid var(--line);
}
.site-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.site-title a { color: inherit; text-decoration: none; }
.doc-version { margin: 0; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.1rem 0.6rem; }
.search { margin-inline-start: auto; min-inline-size: min(100%, 18rem); }

.sidebar { padding: 0.75rem max(1rem, env(safe-area-inset-left)); border-block-end: 1px solid var(--line); }
.sidebar details { margin-block: 0.25rem; }
.sidebar summary { cursor: pointer; font-weight: 600; padding-block: 0.5rem; min-block-size: 2.75rem; display: flex; align-items: center; }
.sidebar ul { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.sidebar li a { display: block; padding-block: 0.5rem; padding-inline: 0.5rem; text-decoration: none; border-radius: 0.375rem; }
.sidebar li a:hover { background: var(--panel); text-decoration: underline; }
.sidebar [aria-current="page"] { background: var(--panel); font-weight: 600; }

main { padding: 1rem max(1rem, env(safe-area-inset-left)) 2rem; min-inline-size: 0; }
.doc { max-inline-size: var(--measure); }

/* Vendor document content (class names come from the 7-Zip docs) */
.doc h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.1rem); line-height: 1.2; margin-block: 0.25rem 1rem; }
.doc h2 { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem); margin-block: 2rem 0.5rem; line-height: 1.25; }
.doc h3 { font-size: 1.2rem; margin-block: 1.5rem 0.5rem; }
.doc h4 { font-size: 1.05rem; margin-block: 1.25rem 0.5rem; }
.doc p, .doc dd { margin-block: 0.6rem; }
.doc dd { margin-inline-start: 1.5rem; }
.doc dt { font-weight: 700; margin-block-start: 0.9rem; }
.doc ul, .doc ol { padding-inline-start: 1.6rem; }
.doc li { margin-block: 0.35rem; }
.doc ul ol, .doc ol ol { list-style-type: lower-alpha; }
.doc blockquote { margin-inline: 1.5rem; }
.doc code, .doc pre { font: 0.9em/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.doc pre {
  background: var(--code-bg); padding: 0.75rem 1rem; border-radius: 0.5rem;
  overflow-x: auto; max-inline-size: 100%;
}
.doc pre.example { color: var(--accent); }
.doc .filename { color: var(--accent); }
.doc a.parameter { text-decoration: none; }
.doc .footer { margin-block-start: 2rem; color: var(--muted); font-size: 0.85rem; text-align: center; }
.doc pre.plain { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tables scroll inside their own box instead of shrinking the whole page */
.table-scroll { overflow-x: auto; max-inline-size: 100%; margin-block: 0.75rem; }
.doc table { border-collapse: collapse; min-inline-size: 100%; }
.doc th, .doc td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: start; vertical-align: top; }
.doc th { background: var(--panel); }
.doc th.cc, .doc td.cc { text-align: center; vertical-align: middle; }

.ad { margin-block: 1rem; min-block-size: 3.5rem; max-inline-size: 100%; overflow: hidden; }
.ad-side { display: none; }
/* Same visibility as the legacy site: phones (< 40rem) show only the unit after the article. */
@media (max-width: 39.99rem) { .ad-top, .ad-bottom { display: none; } }

.site-footer p { margin: 0 0 0.5rem; max-inline-size: 80ch; }
.site-footer { padding: 1rem max(1rem, env(safe-area-inset-left)); color: var(--muted); font-size: 0.85rem; border-block-start: 1px solid var(--line); }

@media (min-width: 60rem) {
  .page {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-areas: "header header" "side main" "side footer";
    grid-template-rows: auto 1fr auto;
  }
  .site-header { grid-area: header; }
  .sidebar {
    grid-area: side; border-block-end: 0; border-inline-end: 1px solid var(--line);
    position: sticky; inset-block-start: 0; align-self: start;
    max-block-size: 100dvh; overflow-y: auto;
  }
  main { grid-area: main; padding-inline: clamp(1.5rem, 4vw, 3rem); }
  .site-footer { grid-area: footer; }
  .ad-side { display: block; }
}

@media print {
  .site-header, .sidebar, .ad, .site-footer { display: none; }
  .page { display: block; }
}
