:root {
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #23201c;
  --muted: #6b655c;
  --line: #e7e1d8;
  --accent: #3f5fb0;
  --accent-soft: #eef1fb;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.06), 0 14px 36px rgba(0,0,0,.09);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  padding: 3rem 1rem 5rem;
}
.wrap { max-width: 980px; margin: 0 auto; }

header.page { margin-bottom: 2.6rem; }
h1 {
  font-size: 2.4rem;
  line-height: 1.1;
  margin: 0 0 .6rem;
  letter-spacing: -0.02em;
}
.tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
  max-width: 60ch;
}

.category { margin: 2.8rem 0; }
.cat-head { margin-bottom: 1.1rem; }
h2 {
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cat-icon { font-size: 1.3rem; line-height: 1; }
.cat-desc { color: var(--muted); font-size: .92rem; margin: .3rem 0 0; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #d6ddf6;
}
.article-card h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.article-card .summary {
  margin: 0 0 .9rem;
  font-size: .9rem;
  color: var(--muted);
  flex: 1;
}
.article-card .date {
  margin: 0;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  font-weight: 650;
}

.empty {
  color: var(--muted);
  font-style: italic;
  font-size: .92rem;
  background: var(--accent-soft);
  border: 1px dashed #d6ddf6;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin: 0;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}

/* Back-link injected into article pages */
.kidshub-back {
  display: inline-block;
  margin: 0 0 1.4rem;
  font-size: .85rem;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: .35rem .85rem;
}
.kidshub-back:hover { border-color: var(--accent); }
