/* Weft documentation. Plain CSS, no build step. Colors follow the Weft preset:
   paper, ink, muted ink, hairline rules and a clay accent (darkened for text contrast). */

:root {
  --paper: #f3eee6;
  --surface: #eae3d8;
  --ink: #1f1c19;
  --muted: #6b635a;
  --rule: #d8cfc2;
  --clay: #a65e46;
  --link: #8e4b36;
  --note: #e6ece4;
  --warn: #f3e1d6;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sidebar: 16rem;
  --measure: 46rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10;
}

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

/* Header */

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 90rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.site-header__support {
  font-size: 0.9375rem;
  white-space: nowrap;
}

@media (max-width: 30rem) {
  .brand__sub {
    display: none;
  }
}

/* Layout */

.layout {
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.sidebar {
  display: none;
}

.mobile-nav {
  margin: 1rem 0 0;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.mobile-nav summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.mobile-nav nav {
  padding: 0 1rem 1rem;
}

.nav__group {
  margin: 1.25rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar ul,
.mobile-nav ul,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar a,
.mobile-nav a {
  display: block;
  padding: 0.3rem 0.5rem;
  margin-left: -0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  border-left: 2px solid transparent;
}

.sidebar a:hover,
.mobile-nav a:hover {
  text-decoration: underline;
}

.sidebar a[aria-current="page"],
.mobile-nav a[aria-current="page"] {
  border-left-color: var(--clay);
  font-weight: 600;
}

.main {
  min-width: 0;
  padding: 1.5rem 0 4rem;
}

.toc {
  border: 1px solid var(--rule);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.toc__title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.toc a {
  display: block;
  padding: 0.15rem 0;
  color: var(--ink);
}

@media (min-width: 60rem) {
  .layout {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    gap: 3rem;
  }

  .mobile-nav {
    display: none;
  }

  .sidebar {
    display: block;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    padding: 1rem 0 2rem;
  }

  .main {
    padding-top: 2.5rem;
  }
}

@media (min-width: 80rem) {
  .main--toc {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) 14rem;
    column-gap: 3rem;
    align-items: start;
  }

  .main--toc .toc {
    grid-column: 2;
    grid-row: 1 / span 2;
    position: sticky;
    top: 1.5rem;
    border: 0;
    border-left: 1px solid var(--rule);
    padding: 0 0 0 1rem;
  }

  .main--toc .prose,
  .main--toc .pager {
    grid-column: 1;
  }
}

/* Prose */

.prose {
  max-width: var(--measure);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  margin: 0 0 1rem;
}

.prose h2 {
  font-size: 1.875rem;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.prose h3 {
  font-size: 1.375rem;
  margin: 2rem 0 0.5rem;
}

.prose h4 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin: 1.5rem 0 0.25rem;
}

.prose .anchor {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8em;
  opacity: 0;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.prose .anchor:focus {
  opacity: 1;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose li {
  margin: 0.25rem 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.25rem 0 0.5rem;
}

.prose > p:first-of-type {
  font-size: 1.125rem;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}

.code {
  position: relative;
  margin: 0 0 1.25rem;
}

.code pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: var(--ink);
  color: #f3eee6;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
}

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

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  cursor: pointer;
}

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

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.45;
}

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

.prose th {
  font-weight: 600;
  border-bottom-color: var(--ink);
  white-space: nowrap;
}

.prose td code {
  white-space: nowrap;
}

.prose .checklist {
  list-style: none;
  padding-left: 0;
}

.prose .checklist li {
  padding-left: 1.5em;
  text-indent: -1.5em;
}

.prose .checklist .box {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.6em;
  vertical-align: -0.1em;
  border: 1.5px solid var(--muted);
}

.callout {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border-left: 3px solid var(--muted);
}

.callout p:last-child,
.callout ul:last-child,
.callout ol:last-child {
  margin-bottom: 0;
}

.callout--tip {
  background: var(--note);
  border-left-color: #4f6b4a;
}

.callout--warning,
.callout--important {
  background: var(--warn);
  border-left-color: var(--clay);
}

blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

.shot {
  margin: 1.5rem 0 2rem;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.shot img.shot--narrow {
  max-width: 22rem;
}

.shot figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

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

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  border: 1px solid var(--rule);
  padding: 0.05em 0.35em;
}

/* Pager and footer */

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

.pager a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
}

.pager span {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Forms (contact page) */

.form {
  display: grid;
  gap: 1.25rem;
  max-width: 36rem;
  margin: 1.5rem 0 2rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
}

.field .hint {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.field input,
.field textarea,
.field select {
  font: inherit;
  color: var(--ink);
  background: #fbf8f3;
  border: 1px solid #9a9087;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

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

.field input[type="file"] {
  padding: 0.5rem;
  background: transparent;
}

.button {
  justify-self: start;
  font: inherit;
  font-family: var(--serif);
  font-size: 1.125rem;
  background: var(--clay);
  color: #fff;
  border: 0;
  padding: 0.8rem 2rem;
  cursor: pointer;
}

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

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #9b2c1c;
  box-shadow: inset 0 0 0 1px #9b2c1c;
}

.field-error {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #9b2c1c;
}

/* Honeypot: off screen, out of the tab order and hidden from assistive technology. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status:empty {
  display: none;
}

.form-status {
  padding: 0.875rem 1.125rem;
  background: var(--surface);
  border-left: 3px solid var(--muted);
}

.form-status:focus {
  outline: none;
}

.form-status:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.form-status p:last-child {
  margin-bottom: 0;
}

.form-status h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-status--success {
  background: var(--note);
  border-left-color: #4f6b4a;
}

.form-status--error {
  background: var(--warn);
  border-left-color: #9b2c1c;
}

.button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* The function's no-JavaScript error page (heddle-site/lib/support.js). */
.error-page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

[hidden] {
  display: none !important;
}

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

@media print {
  .site-header,
  .sidebar,
  .mobile-nav,
  .toc,
  .pager,
  .copy-button {
    display: none !important;
  }

  .layout {
    display: block;
  }
}
