/* GreenFlag - V1 styles.
   To restyle the site from the future mockup, change the variables below first. */
:root {
  --bg: #f7faf6;
  --surface: #ffffff;
  --text: #1f2a22;
  --muted: #5b6b60;
  --border: #dbe5dc;
  --brand: #2e9e5b;
  --brand-dark: #1f6e40;
  --good: #2e9e5b;
  --good-bg: #e5f5eb;
  --bad: #c2412d;
  --bad-bg: #fbe9e5;
  --finish: #8a6400;
  --finish-bg: #fbeec2;
  --check: #9a6a00;
  --check-bg: #fff3cd;
  --radius: 12px;
  --max: 820px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121814; --surface: #1b231d; --text: #e6efe8; --muted: #a3b3a7; --border: #2c392f;
    --brand: #4cc27d; --brand-dark: #7fdca4; --good: #4cc27d; --good-bg: #173222;
    --bad: #f0806c; --bad-bg: #3a1d18; --finish: #f3c95a; --finish-bg: #3a300f; --check: #f3c95a; --check-bg: #3a300f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 17px; overflow-wrap: break-word; }
.sources a { overflow-wrap: anywhere; }
a { color: var(--brand-dark); }
main { max-width: var(--max); margin: 0 auto; padding: 24px 16px 48px; }
h1 { line-height: 1.2; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.15rem; margin: 0 0 0.5em; }

.site-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.site-header nav { display: flex; gap: 16px; }
.site-header nav a { text-decoration: none; font-weight: 500; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 24px 16px; border-top: 1px solid var(--border); }

.hero p { color: var(--muted); font-size: 1.05rem; }
.group { margin-top: 32px; padding-left: 10px; border-left: 4px solid; }
.group-good { border-color: var(--good); }
.group-bad { border-color: var(--bad); }

.cards { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); border-top: 4px solid; }
.card-good a { border-top-color: var(--good); }
.card-bad a { border-top-color: var(--bad); }
.card a:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.card-number, .tile-number { color: var(--muted); font-size: 0.85rem; margin: 0; }
.card-title { font-weight: 700; }
.card-text { color: var(--muted); font-size: 0.9rem; }

.badge { display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: .02em; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-finish { background: var(--finish-bg); color: var(--finish); }
.card-finish a { border-top-color: var(--finish); }
.group { border-color: var(--brand); }
.group-extra { border-color: var(--muted); }
.legend .badge { margin-right: 4px; }
.check-note { font-size: 0.9rem; color: var(--muted); }

.board-text { margin: 16px 0; padding: 12px 16px; background: var(--surface); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; }
.tile-bad .board-text { border-left-color: var(--bad); }
.tile-finish .board-text { border-left-color: var(--finish); }
.intro { font-size: 1.1rem; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; }
.block ul, .block ol { padding-left: 1.2em; margin: 0; }
.block li + li { margin-top: 6px; }
.sources { font-size: 0.9rem; }
.related { list-style: none; padding-left: 0 !important; }

.check { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: var(--check-bg); color: var(--check); }
.hide-checks .check { display: none; }

/* Printable sheet (print.html) */
.print-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.print-card { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); break-inside: avoid; }
.print-card img { width: 110px; height: 110px; background: #fff; }
@media print {
  .site-header, .site-footer, .no-print { display: none; }
  body { background: #fff; color: #000; }
}
.hide-checks .check-note { display: none; }

/* Table of contents (home page) */
.toc-heading { margin-top: 28px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.toc-row + .toc-row { border-top: 1px solid var(--border); }
.toc-row a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-decoration: none; color: var(--text); }
.toc-row a:hover { background: var(--bg); }
.toc-num { flex: none; width: 2.6em; height: 2.6em; display: grid; place-items: center; border-radius: 8px; font-weight: 800; font-variant-numeric: tabular-nums; }
.toc-good .toc-num { background: var(--good-bg); color: var(--good); }
.toc-bad .toc-num { background: var(--bad-bg); color: var(--bad); }
.toc-finish .toc-num { background: var(--finish-bg); color: var(--finish); }
.toc-text { display: flex; flex-direction: column; min-width: 0; }
.toc-title { font-weight: 600; }
.toc-summary { font-size: 0.88rem; color: var(--muted); }
.toc-dots { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--border); align-self: center; }
.toc-effect { flex: none; font-size: 0.85rem; font-weight: 600; text-align: right; }
.toc-good .toc-effect { color: var(--good); }
.toc-bad .toc-effect { color: var(--bad); }
.toc-finish .toc-effect { color: var(--finish); }
@media (max-width: 600px) {
  .toc-row a { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: start; }
  .toc-num { grid-row: span 2; width: 2.4em; height: 2.4em; }
  .toc-dots { display: none; }
  .toc-effect { grid-column: 2; text-align: left; }
}

/* Home page */
.home { text-align: center; max-width: 560px; margin: 8vh auto 0; }
.home h1 { font-size: 2.6rem; margin: 8px 0 0; }
.home-tagline { font-size: 1.15rem; color: var(--muted); margin-top: 4px; }
.button { display: inline-block; margin: 20px 0 8px; padding: 14px 32px; border-radius: 999px; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.button:hover { background: var(--brand-dark); }
.home-links { font-size: 0.95rem; }

/* Tile navigation: sticky bottom bar, easy to reach with the thumb */
.tile-nav { position: sticky; bottom: 0; z-index: 10; display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 8px;
  max-width: var(--max); margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border); }
.tile-nav a { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 999px;
  text-decoration: none; font-weight: 700; border: 1px solid var(--border); color: var(--text); }
.tile-nav .tile-nav-contents { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Phone-first adjustments */
.site-header nav a { padding: 10px 2px; }
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 16px 14px 24px; }
  h1 { font-size: 1.7rem; }
  .site-header { padding: 6px 14px; gap: 4px; flex-wrap: nowrap; }
  .brand { font-size: 1.05rem; }
  .brand img { width: 24px; height: 24px; }
  .site-header nav { gap: 12px; font-size: 0.9rem; }
  .site-header { padding: 6px 12px; }
  .block { padding: 14px; margin: 12px 0; border-radius: 10px; }
  .intro { font-size: 1.02rem; }
  .board-text { padding: 10px 12px; }
  .badge { font-size: 0.78rem; }
  .home { margin-top: 4vh; }
  .home h1 { font-size: 2.2rem; }
  .home-logo { width: 72px; height: 72px; }
  .button { display: block; padding: 16px; }
  .toc-row a { padding: 12px; gap: 12px; min-height: 56px; }
  .site-footer { padding: 16px; font-size: 0.8rem; }
}
