/* word2html documentation. No build step and no external resources. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --surface: #f2f0ec;
  --text: #24231f;
  --muted: #625f57;
  --border: #dcd8d0;
  --accent: #1f5f8b;
  --accent-soft: #e3eef5;
  --code-bg: #f2f0ec;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --danger: #a33a2c;
  --danger-soft: #f9e8e5;
  --ok: #2c6e49;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181a1c;
    --surface: #212427;
    --text: #e6e4df;
    --muted: #a5a29a;
    --border: #383c40;
    --accent: #7dbbe6;
    --accent-soft: #1e3140;
    --code-bg: #212427;
    --warn: #e6b65c;
    --warn-soft: #33290f;
    --danger: #ef9a8c;
    --danger-soft: #3a211d;
    --ok: #7fcfa0;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
}

.skip-link:focus {
  left: 0.5rem;
  z-index: 10;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 1.75rem 1.25rem;
  border-right: 1px solid var(--border);
}

.brand {
  display: block;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-version {
  display: block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li a {
  display: block;
  margin-bottom: 0.1rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
}

.sidebar li a:hover {
  background: var(--surface);
}

.sidebar li a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar .external {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

main {
  width: 100%;
  max-width: 50rem;
  padding: 2.5rem 3rem 3rem;
}

footer {
  max-width: 50rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
}

/* Text */

h1,
h2,
h3 {
  line-height: 1.25;
  scroll-margin-top: 1rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 2.1rem;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 1.45rem;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
}

.lede {
  margin-top: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

li {
  margin-bottom: 0.3rem;
}

dt {
  margin-top: 1rem;
  font-weight: 600;
}

dd {
  margin-left: 0;
}

/* Code */

code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--code-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: none;
  font-size: 0.85rem;
  overflow-wrap: normal;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}

th,
td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  border-bottom-width: 2px;
  white-space: nowrap;
}

/* Callouts */

.note,
.warning {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid;
  border-radius: 0 6px 6px 0;
}

.note {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.warning {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.note > :first-child,
.warning > :first-child {
  margin-top: 0;
}

.note > :last-child,
.warning > :last-child {
  margin-bottom: 0;
}

.tag-warn {
  color: var(--warn);
  font-weight: 600;
}

.tag-refuse {
  color: var(--danger);
  font-weight: 600;
}

.tag-ok {
  color: var(--ok);
  font-weight: 600;
}

/* Phones and small tablets */

@media (max-width: 52rem) {
  .layout {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 1rem 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand-version {
    margin-bottom: 0.75rem;
  }

  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .sidebar li a {
    margin: 0;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
  }

  .sidebar .external {
    margin-top: 0.25rem;
    padding-top: 0;
    border-top: 0;
  }

  main {
    padding: 1.5rem 16px 2rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}

@media print {
  .sidebar,
  .pager,
  .skip-link {
    display: none;
  }

  .layout {
    display: block;
  }
}
