/*
  Nappa theme documentation. One stylesheet, no build step, no external font.
  Mobile first (390 px), then wider screens. Text contrast is at least 4.5:1
  in light and dark modes; field borders and focus rings at least 3:1.
*/

:root {
  color-scheme: light dark;
  --bg: #fdfcfa;
  --fg: #1f1b17;
  --muted: #57514b;
  --surface: #f3efe8;
  --border: #ddd5c9;
  --field: #7a7168;
  --link: #8a3b1f;
  --focus: #1a56db;
  --note: #f3efe8;
  --warn: #fbefe2;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 16px;
  --measure: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171513;
    --fg: #f2eee8;
    --muted: #bdb5aa;
    --surface: #24211e;
    --border: #3b3631;
    --field: #958b80;
    --link: #f2a582;
    --focus: #8ab4ff;
    --note: #24211e;
    --warn: #2e2620;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 1.875rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1875rem;
}

h4 {
  font-size: 1rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.25rem;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-block: 0.75rem;
}

.brand {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  margin-right: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand span {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9375rem;
}

.search-form {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.search-form input {
  flex: 1;
  min-width: 0;
}

/* Mobile menu: a <details> element, so it opens without JavaScript. */

.menu-mobile {
  width: 100%;
}

.menu-mobile > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--field);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.menu-mobile > summary::-webkit-details-marker {
  display: none;
}

.menu-mobile > summary::after {
  content: "+";
  margin-left: 0.5rem;
  font-weight: 400;
}

.menu-mobile[open] > summary::after {
  content: "\2212";
}

.menu-mobile .nav-list {
  margin-top: 0.75rem;
}

/* Navigation list (mobile menu and desktop sidebar) */

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

.nav-list li + li {
  margin-top: 0;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--surface);
  text-decoration: underline;
}

.nav-list a[aria-current="page"] {
  background: var(--surface);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--link);
}

.sidebar {
  display: none;
}

/* Main column */

.layout {
  padding-block: 1.5rem 3rem;
}

main {
  min-width: 0;
  max-width: var(--measure);
}

.lead {
  font-size: 1.125rem;
  color: var(--muted);
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.toc {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
}

.toc ol {
  margin: 0;
}

.toc a {
  display: inline-block;
  padding-block: 0.15rem;
}

.path {
  font-size: 0.9375rem;
  color: var(--muted);
}

.path strong {
  color: var(--fg);
}

.note,
.warning {
  border-left: 4px solid var(--link);
  background: var(--note);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1rem;
}

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

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

/* Settings lists: label, then explanation. Reflows on any width. */

.settings {
  border-top: 1px solid var(--border);
}

.settings dt {
  font-weight: 700;
  padding-top: 0.75rem;
}

.settings dt .opts {
  display: block;
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--muted);
}

.settings dd {
  margin: 0.25rem 0 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.settings dd p:last-child {
  margin-bottom: 0;
}

.limits {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Tables scroll inside their own box on small screens. */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  margin: 0;
  font-size: 0.9375rem;
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 0.75rem;
}

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

thead th {
  background: var(--surface);
}

/* Cards on the home page */

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.cards li + li {
  margin-top: 0;
}

.cards a {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  height: 100%;
}

.cards a:hover {
  border-color: var(--field);
  background: var(--surface);
}

.cards strong {
  display: block;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cards span {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* FAQ */

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.75rem 0;
  min-height: 44px;
}

.faq details > div {
  padding-bottom: 0.75rem;
}

/* Forms */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field {
  margin-bottom: 1.25rem;
}

.hint {
  display: block;
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input,
textarea,
button,
select {
  font: inherit;
  color: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--field);
  border-radius: var(--radius);
}

textarea {
  min-height: 10rem;
  resize: vertical;
}

input[type="file"] {
  display: block;
  max-width: 100%;
  padding: 0.5rem 0;
}

.required {
  font-weight: 400;
  color: var(--muted);
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover,
button:hover {
  opacity: 0.9;
}

/* Previous and next links */

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pager a {
  display: inline-flex;
  flex-direction: column;
  min-height: 44px;
  text-decoration: none;
}

.pager a span {
  font-size: 0.875rem;
  color: var(--muted);
}

.pager a strong {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

/* Search results */

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

.results li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.results li + li {
  margin-top: 0;
}

.results p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem 2rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 0.5rem;
}

/* Wider screens */

@media (min-width: 48rem) {
  h1 {
    font-size: 2.25rem;
  }

  .search-form {
    width: auto;
  }

  .search-form input {
    width: 16rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  :root {
    --gutter: 32px;
  }

  .menu-mobile {
    display: none;
  }

  .layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }

  .sidebar {
    display: block;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media print {
  .site-header form,
  .menu-mobile,
  .sidebar,
  .pager,
  .skip-link {
    display: none;
  }

  a {
    color: inherit;
  }
}

/* Support form: file inputs grouped in a fieldset. */

fieldset.files {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.25rem;
  margin: 0 0 1.25rem;
}

fieldset.files legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

fieldset.files label {
  font-weight: 400;
  margin-top: 0.5rem;
}

.search-form--page {
  margin-bottom: 1rem;
}

/* Link styled as a button (support page: opens the contact form). */
a.button {
  display: inline-block;
  min-height: 44px;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius);
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

a.button:hover {
  background: var(--link);
}

a.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
