/* FoodieX legal pages — shared stylesheet.
   Self-contained: no framework, no CDN, no webfonts, no JS.
   Light/dark aware via prefers-color-scheme. Mobile-first. */

:root {
  --bg: #ffffff;
  --surface: #f7f8f7;
  --border: #e3e6e3;
  --text: #1a1d17;
  --muted: #5d635a;
  --accent: #2f7d4f;
  --accent-soft: #eaf4ee;
  --on-accent: #ffffff;
  --warn: #9a5b00;
  --warn-soft: #fff6e5;
  --warn-border: #f0d9a8;
  --radius: 12px;
  --maxw: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121410;
    --surface: #1a1d17;
    --border: #2c302a;
    --text: #edefea;
    --muted: #a3aa9c;
    --accent: #6fce97;
    --accent-soft: #1d2a22;
    --on-accent: #121410;
    --warn: #f2b755;
    --warn-soft: #2a2214;
    --warn-border: #4a3a1c;
  }
}

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

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

body {
  margin: 0;
  padding: 0 1rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
}

/* --- Brand --------------------------------------------------------------- */

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 2rem 0 0;
}

.brand .logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.brand .name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand .name span {
  color: var(--accent);
}

/* --- Page header --------------------------------------------------------- */

header.page {
  padding: 1rem 0 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.5rem;
}

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

.meta b {
  color: var(--text);
  font-weight: 600;
}

/* --- Headings ------------------------------------------------------------ */

h2 {
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.5rem;
  padding-top: 0.25rem;
  /* Keep deep-linked sections clear of the viewport edge when jumped to. */
  scroll-margin-top: 1rem;
}

h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.375rem;
  scroll-margin-top: 1rem;
}

/* --- Body content -------------------------------------------------------- */

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

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

li {
  margin-bottom: 0.4rem;
}

b,
strong {
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.small {
  font-size: 0.875em;
  color: var(--muted);
}

/* --- Boxes --------------------------------------------------------------- */

.box {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin: 0 0 1.25rem;
}

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

.box > :last-child,
.box p:last-child {
  margin-bottom: 0;
}

/* A table inside a box already has the box as its frame. */
.box .table-scroll {
  background: var(--bg);
}

/* --- Tables (scroll horizontally on phones instead of breaking layout) ---- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

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

th {
  background: var(--surface);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

/* --- Footer -------------------------------------------------------------- */

footer.page {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

footer.page nav {
  margin-bottom: 0.75rem;
}

footer.page nav a {
  display: inline-block;
  margin-right: 1.25rem;
}

/* --- Accessibility ------------------------------------------------------- */

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