/* Shared styles for every page under /blog/ — extracted so the CSS lives in exactly one place
   instead of being copy-pasted into every generated post (see scripts/build-blog.mjs). Loaded
   via <link>, not inlined, specifically so it's cacheable across posts instead of re-downloaded
   (and re-parsed) per page.

   Contains the generic page shell (reset, header, typography, footer) *and* the small set of
   reusable article widgets (game tiles, mode cards, post cards) — future posts should reach for
   these existing classes before inventing new ones; see POST_IDEAS.md.

   Not shared with tos.html/privacy.html — those are two stable, rarely-touched pages, not a
   growing set, so the duplication cost there is low; revisit only if that changes. */

:root {
  color-scheme: light dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background-color: #f8fafc;
  color: #0f172a;
  font-family:
    "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
}
html.dark body {
  background-color: #090d16;
  color: #f8fafc;
}
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}
a {
  /* #059669 (emerald-600) measured 3.60:1 against this page's #f8fafc background — under the
     4.5:1 WCAG AA minimum for normal text, confirmed by a real Lighthouse accessibility run.
     #047857 (emerald-700, one shade darker, same family) gives 5.24:1. Dark mode's #34d399
     below is unaffected (10.11:1 against #090d16 already) — this is a light-mode-only fix. */
  color: #047857;
}
html.dark a {
  color: #34d399;
}

/* Header + breadcrumb */
header.page {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.badge {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: #10b981;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}
header.page a.brand {
  text-decoration: none;
  color: inherit;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
}
nav.breadcrumb {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 1.25rem;
}
html.dark nav.breadcrumb {
  color: #94a3b8;
}
nav.breadcrumb a {
  text-decoration: none;
}
nav.breadcrumb a:hover {
  text-decoration: underline;
}

/* Typography */
h1 {
  font-family: "Outfit", sans-serif;
  font-weight: 900;
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
  line-height: 1.2;
}
.updated {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 2rem;
}
html.dark .updated {
  color: #94a3b8;
}
h2 {
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  margin: 2.25rem 0 0.75rem;
}
h3 {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin: 1.4rem 0 0.5rem;
}
p,
li {
  font-size: 0.96rem;
}
ul,
ol {
  padding-left: 1.25rem;
}
li + li {
  margin-top: 0.4rem;
}
.note {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  margin: 1.5rem 0;
}

/* Mini game tiles — illustrate color rules/worked examples without screenshots (which would go
   stale the moment the app's palette changes). Reuse these across posts rather than redefining. */
.row {
  display: flex;
  gap: 0.4rem;
  margin: 0.6rem 0;
}
.tile {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tile.correct {
  background: #10b981;
}
.tile.present {
  background: #f59e0b;
}
.tile.absent {
  background: #64748b;
}
html.dark .tile.absent {
  background: #334155;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 1rem 0;
}
@media (min-width: 520px) {
  .mode-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.mode-card {
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
}
.mode-card h3 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mode-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.6rem 0;
}
.legend-row .tile {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
}
.legend-row p {
  margin: 0;
  font-size: 0.9rem;
  color: #334155;
}

/* End-of-post call to action */
.cta {
  display: block;
  text-align: center;
  text-decoration: none;
  margin: 2.5rem 0 1rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(to right, #10b981, #0d9488);
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
}

/* Blog index only */
.intro {
  font-size: 0.98rem;
  color: #475569;
  margin: 0 0 2.25rem;
  max-width: 52ch;
}
html.dark .intro {
  color: #94a3b8;
}
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 1rem;
  padding: 1.25rem 1.4rem;
  background: rgba(255, 255, 255, 0.6);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}
html.dark .post-card {
  background: rgba(15, 23, 42, 0.4);
}
.post-card:hover {
  border-color: #10b981;
  transform: translateY(-1px);
}
.post-card time {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #10b981;
  margin-bottom: 0.35rem;
}
html.dark .post-card time {
  color: #34d399;
}
.post-card h2 {
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  color: #0f172a;
}
html.dark .post-card h2 {
  color: #f8fafc;
}
.post-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

/* All three "p" overrides grouped here, after every plain p-keyed rule above, so the whole
   file stays in non-decreasing specificity order — biome's noDescendingSpecificity checks
   across the whole sheet, not just adjacent rules. */
html.dark .mode-card p {
  color: #94a3b8;
}
html.dark .legend-row p {
  color: #cbd5e1;
}
html.dark .post-card p {
  color: #94a3b8;
}

.coming-soon {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: #64748b;
}
html.dark .coming-soon {
  color: #94a3b8;
}

/* Footer */
footer.page {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(100, 116, 139, 0.25);
  font-size: 0.85rem;
  color: #64748b;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
html.dark footer.page {
  color: #94a3b8;
}
