/* Widget Vocabulary legal pages. System fonts only: no scripts, no external requests.
   Colors are the app's tokens (ios/Packages/WVUI/.../ColorTokens.swift): Iris accent, light and dark. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f2f2f7;
  --text: #1c1c1e;
  --text-2: #6b6b70;
  --rule: #e5e5ea;
  --accent: #5b5bd6;
  --accent-soft: #efeffb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --text: #ffffff;
    --text-2: #a1a1a6;
    --rule: #38383a;
    --accent: #b1a9ff;
    --accent-soft: #161633;
  }
}

@media (prefers-contrast: more) {
  :root { --accent: #4b4bc4; --text-2: #48484d; }
}

@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --accent: #cfc9ff; --text-2: #c7c7cc; }
}

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

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

/* iPhone and iPad Safari: follow the reader's text size (Dynamic Type). */
@supports (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

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

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* Header and footer */

.top { border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; min-height: 3.25rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.brand img { width: 1.5rem; height: 1.5rem; flex: none; }

.bottom {
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
  color: var(--text-2);
  font-size: 0.875rem;
}
.bottom .wrap { padding-top: 1.25rem; padding-bottom: 2.5rem; }
.bottom nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.5rem; }
.bottom p { margin: 0.25rem 0; }

/* Text */

main { padding-top: 1.5rem; }

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0.25rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 2.25rem 0 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

h3 { font-size: 1.0625rem; line-height: 1.35; margin: 1.5rem 0 0.25rem; }

p, li { margin: 0.5rem 0; }
ul, ol { padding-left: 1.4rem; }
li > ul { margin: 0.25rem 0; }
strong { font-weight: 600; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--surface);
  border-radius: 0.25rem;
  padding: 0.05em 0.2em;
}

.meta { color: var(--text-2); font-size: 0.875rem; margin: 0 0 1.5rem; }
.why { color: var(--text-2); }

table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; margin: 0.75rem 0; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); padding: 0.5rem 0.375rem; }
th { font-weight: 600; }
th:first-child, td:first-child { padding-left: 0; }

.toc {
  background: var(--surface);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}
.toc summary { font-weight: 600; cursor: pointer; }
.toc ol { margin: 0.5rem 0 0.25rem; }
.toc li { margin: 0.2rem 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Landing page */

.app { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.5rem; }
.app img { width: 4rem; height: 4rem; flex: none; }
.app h1 { margin: 0; }
.lede { color: var(--text-2); margin: 0.25rem 0 0; }

.cards { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.cards li { margin: 0; }
.cards li + li { margin-top: 0.75rem; }
.cards a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.cards a::after { content: "\203A"; margin-left: auto; color: var(--text-2); font-size: 1.5rem; line-height: 1; }
.cards a:hover .title { color: var(--accent); }
.cards .title { display: block; font-weight: 600; }
.cards .sub { display: block; color: var(--text-2); font-size: 0.875rem; }

@media print {
  .top, .bottom nav, .toc { display: none; }
  a { color: inherit; }
}
