/* ============================================================
   docs.css: the legal and contact pages.

   Kept OUT of site.css deliberately. The landing page's stylesheet is edited
   often and by more than one pair of hands; these pages are long-form prose
   with different needs (a narrower measure, real tables, form controls), and
   putting them here means a change to one cannot break the other.

   Every colour below is a token from site.css. Nothing hardcodes a hex, so the
   contrast ratios documented there hold on these pages too.
   ============================================================ */

/* ---------------------------------------------------------- layout */

.doc {
  padding: var(--s-xl) 0 var(--s-xxl);
}

/* Prose wants a narrower column than the marketing grid. `--measure` is 34rem,
   which is right for a paragraph but too tight for a table, so the doc column
   is a little wider and the tables can breathe. */
.measure-doc {
  max-width: 46rem;
}

.doc h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-xs);
}

.doc h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: var(--s-xl) 0 var(--s-xs);
  padding-top: var(--s-md);
  border-top: 1px solid var(--line);
}

.doc h3 {
  font-size: 1.05rem;
  line-height: 1.3;
  margin: var(--s-lg) 0 var(--s-xxs);
  color: var(--ink);
}

.doc p,
.doc li {
  color: var(--ink-2);
  line-height: 1.62;
}

.doc p { margin: 0 0 var(--s-sm); }

.doc ul { margin: 0 0 var(--s-sm); padding-left: 1.15em; }
.doc li { margin-bottom: var(--s-xxs); }
.doc ul.tight li { margin-bottom: var(--s-xxs); }

.doc strong { color: var(--ink); font-weight: 650; }

.doc a {
  color: var(--accent-ink);
  text-underline-offset: 0.18em;
}
.doc a:hover { color: var(--ink); }

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.1em 0.36em;
}

.doc-meta {
  color: var(--ink-3);
  font-size: 0.92rem;
  margin: 0 0 var(--s-lg) !important;
}

/* ---------------------------------------------------------- breadcrumb */

.crumbs {
  font-size: 0.86rem;
  color: var(--ink-3);
  margin-bottom: var(--s-md);
}
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumbs span[aria-hidden] { padding: 0 0.35em; opacity: 0.6; }

/* ---------------------------------------------------------- callout */

.callout {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: var(--s-md) var(--s-md) calc(var(--s-md) - var(--s-sm));
  margin: 0 0 var(--s-lg);
}
.callout p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- tables */

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--s-md);
  font-size: 0.94rem;
}
.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-sm) var(--s-xs);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.data-table th { color: var(--ink); font-weight: 650; }

/* A table is the one thing on these pages that can exceed the column, so it
   scrolls inside its own box rather than making the whole page scroll
   sideways on a phone. */
@media (max-width: 34rem) {
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------------------------------------------------------- contact */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-md);
  margin: var(--s-lg) 0 var(--s-xl);
}

.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-md);
}
.contact-card h2 {
  border-top: 0;
  padding-top: 0;
  margin: 0 0 var(--s-xs);
  font-size: 1.02rem;
}
.contact-card p:last-child { margin-bottom: 0; }
.contact-card ul { margin-bottom: 0; }

.dim { color: var(--ink-3) !important; font-size: 0.92rem; }

/* ---------------------------------------------------------- form */

.form { margin: var(--s-md) 0 0; }

.field { margin-bottom: var(--s-md); }

.field label {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--s-xxs);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  /* 16px minimum, or iOS Safari zooms the page when the field is focused. */
  font-size: max(1rem, 16px);
  color: var(--ink);
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0.7em 0.8em;
}

.field textarea { resize: vertical; min-height: 8em; line-height: 1.55; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.privacy-bar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hint {
  color: var(--ink-3);
  font-size: 0.88rem;
  margin: var(--s-xxs) 0 0;
}

/* The honeypot. Off-screen rather than `display:none`, which a growing number
   of bots know to skip, and hidden from assistive technology so nobody is
   ever asked to fill in a trap. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: var(--s-sm);
  font-size: 0.95rem;
  min-height: 1.4em;
  color: var(--ink-2);
}
/* Never colour alone: the wording already says which it is, so someone who
   cannot distinguish the two still gets the message. */
.form-status.is-ok    { color: var(--ink); }
.form-status.is-error { color: var(--ember); }

button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------------------------------------------------------- privacy bar */

.privacy-bar {
  position: fixed;
  left: var(--s-md);
  right: var(--s-md);
  bottom: var(--s-md);
  /* Clear of the home indicator on a phone. */
  bottom: calc(var(--s-md) + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-sm);
  max-width: var(--page);
  margin: 0 auto;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  padding: var(--s-sm) var(--s-md);
}

.privacy-bar-text {
  flex: 1 1 20rem;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.5;
}
.privacy-bar-text a { color: var(--accent-ink); }

.privacy-bar-btn { flex: 0 0 auto; }

@media (prefers-reduced-motion: no-preference) {
  .privacy-bar { animation: privacy-rise 0.28s ease-out both; }
}
@keyframes privacy-rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------- utility */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
