/* LeanEats legal + support pages. Mobile-first; system fonts only; no inline styles and nothing from another
   origin (the CSP in netlify.toml is default-src 'self').
   Colors: LeanEats/docs/DESIGN.md palette v0 (light = palette, dark = paletteDark) — change them here if the
   brand changes with the public name (D3). */

:root {
  color-scheme: light dark;
  --canvas: #f7f5f1;
  --surface: #ffffff;
  --hairline: #e4ded5;
  --ink: #1d1a16;
  --ink-2: #5e574e;
  --brand: #a43c00;
  --confirm-bg: #ffd65a;
  --confirm-ink: #3d2e00;
  --confirm-edge: #a87a00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #100f0d;
    --surface: #1c1a17;
    --hairline: #36322d;
    --ink: #f4f1ec;
    --ink-2: #bab2a7;
    --brand: #ff8d55;
    --confirm-edge: #ffd65a;
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

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

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

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

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 0.5rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
}

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

/* Header and footer */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  padding-block: 0.5rem;
}

.site-name {
  padding-block: 0.5rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header li a {
  display: inline-block;
  padding-block: 0.5rem;
}

.site-header [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  text-decoration-thickness: 2px;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  color: var(--ink-2);
  font-size: 0.875rem;
}

.site-footer .wrap {
  padding-block: 1.25rem 2.5rem;
}

.site-footer p {
  margin: 0;
}

/* Document */

main {
  padding-block: 1.5rem 3rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.875rem;
  letter-spacing: -0.01em;
}

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

h3 {
  margin: 1.75rem 0 0.375rem;
  font-size: 1.0625rem;
}

h2,
h3 {
  scroll-margin-top: 1rem;
}

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

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

main li + li {
  margin-top: 0.375rem;
}

strong {
  font-weight: 600;
}

.doc-dates {
  margin-bottom: 1.5rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

/* Every [CONFIRM: …] marker. They only exist in review builds: --release refuses to build while any remain. */
mark.confirm {
  padding: 0.05em 0.3em;
  border-radius: 4px;
  background: var(--confirm-bg);
  color: var(--confirm-ink);
  box-shadow: 0 0 0 1px var(--confirm-edge);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Contents */

.toc {
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
}

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

.toc ul {
  margin: 0;
  padding: 0 1rem 1rem;
  list-style: none;
}

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

/* Tables: on phones each row is a card and each cell carries its column name; from 40rem up, a normal table. */

.table-wrap {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.table-wrap table,
.table-wrap tbody,
.table-wrap tr,
.table-wrap td {
  display: block;
}

.table-wrap thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.table-wrap tr {
  padding: 0.25rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
}

.table-wrap tr + tr {
  margin-top: 0.75rem;
}

.table-wrap td {
  padding: 0.5rem 0;
}

.table-wrap td + td {
  border-top: 1px solid var(--hairline);
}

.table-wrap td::before {
  content: attr(data-label);
  content: attr(data-label) / "";
  display: block;
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Home page */

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

.doc-links {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.doc-links li + li {
  margin-top: 0;
}

.doc-links a {
  display: block;
  padding: 1rem 1.125rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.doc-title {
  display: block;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.doc-summary {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.doc-links a:hover .doc-title {
  text-decoration-thickness: 2px;
}

/* Wider screens */

@media (min-width: 40rem) {
  main {
    padding-block: 2.5rem 4rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .table-wrap table {
    display: table;
    width: 100%;
    border-collapse: collapse;
  }

  .table-wrap thead {
    position: static;
    display: table-header-group;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
  }

  .table-wrap tbody {
    display: table-row-group;
  }

  .table-wrap tr {
    display: table-row;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .table-wrap th,
  .table-wrap td {
    display: table-cell;
    padding: 0.625rem 1rem 0.625rem 0;
    border-bottom: 1px solid var(--hairline);
    text-align: left;
    vertical-align: top;
  }

  .table-wrap th {
    border-bottom-width: 2px;
    color: var(--ink-2);
    font-size: 0.8125rem;
    font-weight: 600;
  }

  .table-wrap td + td {
    border-top: 0;
  }

  .table-wrap td::before {
    content: none;
  }
}

@media print {
  .skip-link,
  .site-header nav,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
