/*
 * PlayQuest public pages (home, privacy, support). Static, no JS, no fonts or files from elsewhere.
 *
 * Colour tokens: the v2 values of docs/DESIGN-SYSTEM.md (the same as src/PlayQuest.Relay/wwwroot/css/app.css; updated 2026-11-30
 * together with the landing page, css/landing.css). --color-primary-button is the v2 --color-primary. Only the tokens these pages use are copied, with the same names and values. Rules below use var(--color-*) only. When app.css changes, update this block.
 * Palette and rules: docs/DESIGN-SYSTEM.md (v2 brand blue, flat fills only; semantic colours for meaning only).
 */

/* ---------- tokens (light, the default) ---------- */
:root {
  --color-background: #F3F6FB;
  --color-background-2: #E8EDF5;
  --color-surface: #FFFFFF;
  --color-primary-strong: #1E4BAF;
  --color-primary-button: #2F5FD0;
  --color-primary-hover: #2853BB;
  --color-primary-text: #FFFFFF;
  --color-text: #161B26;
  --color-text-secondary: #485266;
  --color-text-tertiary: #5B6578;
  --color-border: #DDE3EC;
  --color-divider: #E6EBF2;
  --color-warning-text: #8F4C00;
  --color-warning-soft: #FDF0DC;
  --color-focus: #1E4BAF;
  color-scheme: light;
}

/* ---------- tokens (dark, follows the system setting) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-background: #0F141D;
    --color-background-2: #2A3346;
    --color-surface: #1A2130;
    --color-primary-strong: #B7CCFF;
    --color-primary-button: #A9C3FF;
    --color-primary-hover: #BCD0FF;
    --color-primary-text: #0A2668;
    --color-text: #EDF1F8;
    --color-text-secondary: #BAC4D4;
    --color-text-tertiary: #9AA6B9;
    --color-border: #2C3546;
    --color-divider: #262F3F;
    --color-warning-text: #F5B451;
    --color-warning-soft: #3A2C12;
    --color-focus: #C3D5FF;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a { color: var(--color-primary-strong); text-underline-offset: 3px; }
a:hover { color: var(--color-primary-hover); }
a:focus-visible, .button:focus-visible, .table-wrap:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
a:focus-visible { border-radius: 4px; }

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.skip:focus { top: 8px; }

/* ---------- header and footer ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.site-header .inner, .site-footer .inner, main {
  max-width: 46rem;
  margin: 0 auto;
  padding-inline: 16px;
}
.site-header .inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 56px;
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 20px;
  color: var(--color-text);
  text-decoration: none;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  min-height: 44px;
  min-width: 44px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.site-nav a:hover { color: var(--color-text); text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: var(--color-primary-strong);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-tertiary);
  font-size: 14px;
}
.site-footer .inner { padding-block: 24px; }
.site-footer p { margin: 0 0 8px; }

/* ---------- content ---------- */
main { padding-block: 24px 0; }

h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 20px; line-height: 1.3; margin: 32px 0 8px; }
h3 { font-size: 17px; line-height: 1.35; margin: 20px 0 6px; }
p, ul, ol, dl { margin: 0 0 12px; }
ul, ol { padding-inline-start: 24px; }
li { margin-bottom: 6px; }

.lead { font-size: 18px; color: var(--color-text-secondary); }
.meta { color: var(--color-text-tertiary); font-size: 14px; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 16px;
  margin: 0 0 16px;
}
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child { margin-top: 0; }

.cards { display: grid; gap: 12px; margin: 16px 0; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards .card { margin: 0; }
.cards h2 { margin-top: 0; font-size: 17px; }

.button {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--color-primary-button);
  color: var(--color-primary-text);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--color-primary-hover); color: var(--color-primary-text); }

.toc {
  background: var(--color-background-2);
  border-radius: 12px;
  padding: 12px 16px;
}
.toc ol { margin: 0; }

/* Tap targets of at least 44px. A TOC link is a block, so its number stays on its first line. */
.site-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}
.toc li { margin: 0; }
.toc a { display: block; padding-block: 10px; min-height: 44px; }

/* Something the owner still has to fill in before publishing (meaning: attention). */
.todo {
  background: var(--color-warning-soft);
  color: var(--color-warning-text);
  border-radius: 8px;
  padding: 2px 6px;
  font-weight: 600;
}

/* Tables scroll inside their own box on narrow screens. */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  /* Break only words that cannot fit (the body rule breaks anywhere, which splits short words). */
  overflow-wrap: break-word;
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td {
  text-align: start;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-divider);
}
th { background: var(--color-background-2); color: var(--color-text); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

dt { font-weight: 600; margin-top: 12px; }
dd { margin: 0 0 8px; margin-inline-start: 0; color: var(--color-text-secondary); }

@media (max-width: 420px) {
  h1 { font-size: 24px; }
  .lead { font-size: 17px; }
  th, td { padding: 8px 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .button { transition: color 120ms cubic-bezier(.2, 0, 0, 1), background-color 120ms cubic-bezier(.2, 0, 0, 1); }
}
