/* Pocket Nutritionist website. Hand-written; the pages link it with a content hash
   (style.css?v=...), so after changing this file regenerate the pages (website/README.md). Colours
   are the app's: res/values/colors.xml (day) and res/values-night/colors.xml (night). */

:root {
  color-scheme: light dark;
  --bg: #EAF2F9;          /* background */
  --surface: #FFFFFF;     /* surface */
  --band: #2F6498;        /* primary_dark: white reads 6.2:1 on it (primary is 4.5:1) */
  --on-band: #FFFFFF;     /* text_on_primary */
  --text: #15233A;        /* text_primary */
  --muted: #42566E;       /* text_secondary */
  --link: #0B5A85;        /* kcal_text: deep azure, 7.5:1 on white */
  --rule: #C9D9E8;
  --note-bg: #FFF7E6;
  --note-edge: #B45309;   /* warning */
  --focus: #2F6498;       /* primary_dark: 5.5:1 on the background (accent is 2.9:1) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;        /* background (night) */
    --surface: #1E1E32;   /* card_background (night) */
    --band: #1A1A2E;      /* primary (night) */
    --on-band: #FFFFFF;
    --text: #FFFFFF;      /* text_primary (night) */
    --muted: #B8B8C7;     /* text_secondary (night) */
    --link: #D4AF37;      /* accent / text_gold (night) */
    --rule: #34344E;
    --note-bg: #2A2416;
    --note-edge: #D4AF37;
    --focus: #D4AF37;
  }
}

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

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

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

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

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

.site-header { background: var(--band); color: var(--on-band); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}
.brand { color: var(--on-band); font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-header nav a { color: var(--on-band); }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 2px; }
.site-header a:focus-visible { outline-color: var(--on-band); }

main { padding: 1.5rem 0 2.5rem; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.25rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.375rem; }
li > ul { margin-top: 0.375rem; }

.lead { font-size: 1.1875rem; }
.muted, .meta { color: var(--muted); }
.meta { font-size: 0.9375rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
}
.card > :last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; }

.note {
  background: var(--note-bg);
  border-left: 4px solid var(--note-edge);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
}
.note > :last-child { margin-bottom: 0; }

.legal h2 { scroll-margin-top: 1rem; }

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
  padding: 1.25rem 0 2rem;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}
.site-footer p { margin: 0 0 0.5rem; }

@media (min-width: 40rem) {
  h1 { font-size: 2rem; }
  main { padding-top: 2rem; }
}

@media print {
  .site-header nav, .skip, .site-footer ul { display: none; }
  .site-header { background: none; color: #000; }
  .brand { color: #000; }
  body { background: #fff; color: #000; }
}
