/* ToddlerBites blog — shares the design tokens defined inline in index.html.
   Kept as a separate file because it is loaded by every post; duplicating it
   inline would add ~14KB to each page. */

:root {
  --coral: #FF6B35;
  --coral-dark: #E8512F;
  --coral-soft: #FFE4DA;
  --coral-tint: #FFF5EF;
  --cream: #FFF9F5;
  --peach: #FFD9C7;
  --ink: #1B1614;
  --ink-2: #3D3431;
  --gray-1: #6B5F5A;
  --gray-2: #B4A8A2;
  --gray-3: #E8DFD9;
  --border: #ECE0D7;
  --white: #FFFFFF;
  --green: #2E9D6B;
  --blue: #2C6ECB;
  --shadow-sm: 0 1px 2px rgba(27,22,20,0.04), 0 1px 2px rgba(27,22,20,0.04);
  --shadow-md: 0 4px 16px rgba(27,22,20,0.06);
  --shadow-lg: 0 24px 60px -16px rgba(255,107,53,0.18), 0 8px 24px rgba(27,22,20,0.06);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────── */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.logo img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }

nav.primary { display: flex; gap: 28px; }
nav.primary a {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--gray-1);
  text-decoration: none;
  transition: color 0.15s ease;
}
nav.primary a:hover { color: var(--coral); }
nav.primary a.active { color: var(--coral); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--coral); color: var(--white); box-shadow: 0 6px 18px -6px rgba(255,107,53,0.55); }
.btn-primary:hover { background: var(--coral-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--white); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--coral); color: var(--coral); }
.btn-lg { padding: 15px 30px; font-size: 1rem; }

/* ── Mobile nav ─────────────────────────────────────────── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 15px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--coral-tint);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:active { background: var(--coral-tint); }

/* ── Blog hub ───────────────────────────────────────────── */

.blog-hero { background: linear-gradient(180deg, var(--coral-tint) 0%, var(--white) 100%); padding: 64px 0 48px; }
.blog-hero h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 16px;
}
.blog-hero h1 .accent { color: var(--coral); }
.blog-hero p { font-size: 1.1rem; color: var(--gray-1); max-width: 620px; }

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 10px;
}

/* Featured post — large split, mirrors the Assembly/Codecademy pattern */
.featured {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 44px;
  align-items: center;
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}
.featured-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--coral-soft);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover { color: var(--coral); }
.featured p { color: var(--gray-1); font-size: 1.02rem; margin-bottom: 20px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--gray-1);
  flex-wrap: wrap;
}
.post-meta .dot { color: var(--gray-2); }

/* Category chips */
.chips { display: flex; gap: 10px; flex-wrap: wrap; padding: 36px 0 28px; }
.chip {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-1);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'Inter', sans-serif;
}
.chip:hover { border-color: var(--coral); color: var(--coral); }
.chip.active { background: var(--coral); border-color: var(--coral); color: var(--white); }

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 80px;
}
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-media { aspect-ratio: 16 / 10; background: var(--coral-tint); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.14rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--coral); }
.card p { font-size: 0.92rem; color: var(--gray-1); margin-bottom: 16px; flex: 1; }

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 9px;
}

/* ── Article ────────────────────────────────────────────── */

.article-head { padding: 48px 0 32px; border-bottom: 1px solid var(--border); }
.article-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.article-head h1 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 2.9rem);
  line-height: 1.11;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.article-standfirst { font-size: 1.14rem; color: var(--gray-1); margin-bottom: 22px; }

.breadcrumb { font-size: 0.85rem; color: var(--gray-1); margin-bottom: 18px; }
.breadcrumb a { color: var(--gray-1); text-decoration: none; }
.breadcrumb a:hover { color: var(--coral); }
.breadcrumb span { color: var(--gray-2); margin: 0 7px; }

article { padding: 40px 0 64px; }
article h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.62rem;
  letter-spacing: -0.02em;
  line-height: 1.22;
  margin: 44px 0 14px;
}
article h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.015em;
  margin: 30px 0 10px;
}
article p { margin-bottom: 18px; color: var(--ink-2); font-size: 1.04rem; }
article ul, article ol { margin: 0 0 20px 22px; color: var(--ink-2); font-size: 1.04rem; }
article li { margin-bottom: 9px; }
article a { color: var(--coral); text-decoration: underline; text-underline-offset: 2px; }
article a:hover { color: var(--coral-dark); }
article strong { font-weight: 650; color: var(--ink); }

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}
article th, article td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); }
article th { font-weight: 700; background: var(--coral-tint); font-family: 'Nunito', sans-serif; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Key answer — short quotable summary at the top of an article */
.key-answer {
  border: 1px solid var(--coral-soft);
  background: var(--coral-tint);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 0 0 32px;
}
.key-answer-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--coral-dark);
  margin-bottom: 8px;
}
.key-answer p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink);
  font-weight: 500;
}

/* Callouts */
.callout {
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 26px 0;
  border-left: 4px solid var(--coral);
  background: var(--coral-tint);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.callout.safety { border-left-color: #D64545; background: #FDF2F2; }
.callout.safety .callout-title { color: #B3312F; }
.callout.tip { border-left-color: var(--green); background: #F0FAF5; }
.callout.tip .callout-title { color: #1F7A50; }

/* In-article app CTA */
.app-cta {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--coral) 0%, #FF8A5C 100%);
  color: var(--white);
  padding: 32px;
  margin: 40px 0;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.app-cta h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.42rem;
  color: var(--white);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.app-cta p { color: rgba(255,255,255,0.94); margin-bottom: 20px; font-size: 1rem; }
.app-cta .btn { background: var(--white); color: var(--coral); font-weight: 700; }
.app-cta .btn:hover { background: var(--cream); }

/* Disclaimer */
.disclaimer {
  font-size: 0.88rem;
  color: var(--gray-1);
  border-top: 1px solid var(--border);
  padding-top: 22px;
  margin-top: 44px;
}

/* Related posts */
.related { background: var(--cream); padding: 56px 0; border-top: 1px solid var(--border); }
.related h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.related .grid { padding-bottom: 0; }

/* ── Quiz (picky eater test) ────────────────────────────── */

.quiz {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin: 32px 0;
  background: var(--white);
  box-shadow: var(--shadow-md);
}
.quiz-q { margin-bottom: 24px; }
.quiz-q:last-of-type { margin-bottom: 8px; }
.quiz-q p { font-weight: 600; margin-bottom: 12px; color: var(--ink); font-size: 1rem; }
.quiz-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-opt {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-1);
  cursor: pointer;
  transition: all 0.15s ease;
}
.quiz-opt:hover { border-color: var(--coral); color: var(--coral); }
.quiz-opt[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: var(--white); }
.quiz-result {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--coral-tint);
  display: none;
}
.quiz-result.show { display: block; }
.quiz-result h3 { font-family: 'Nunito', sans-serif; font-weight: 900; margin: 0 0 8px; font-size: 1.25rem; }
.quiz-progress { font-size: 0.85rem; color: var(--gray-1); margin-top: 16px; }

/* ── Footer ─────────────────────────────────────────────── */

footer { background: var(--ink); color: var(--gray-2); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-brand img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }
.footer-tagline { font-size: 0.92rem; max-width: 340px; line-height: 1.65; }
.footer-col h4 {
  font-family: 'Nunito', sans-serif;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--gray-2); text-decoration: none; font-size: 0.92rem; transition: color 0.15s ease; }
.footer-col a:hover { color: var(--coral); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.86rem;
}
.small-links { display: flex; gap: 8px; flex-wrap: wrap; }
.small-links a { color: var(--gray-2); text-decoration: none; }
.small-links a:hover { color: var(--coral); }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; gap: 26px; padding: 36px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  nav.primary { display: none; }
  .nav-toggle { display: flex; }
  .header-content { gap: 8px; }
}

@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 44px 0 32px; }
  article h2 { font-size: 1.42rem; }
  .app-cta { padding: 26px 20px; }
  .quiz { padding: 22px 18px; }
  .container { padding: 0 18px; }
  .article-wrap { padding: 0 18px; }

  /* Touch targets — 44px minimum (WCAG 2.2 target size) */
  .chip { padding: 13px 18px; font-size: 0.9rem; min-height: 44px; }
  .quiz-opt { padding: 13px 18px; min-height: 44px; }
  .btn { padding: 13px 20px; min-height: 44px; }
  .mobile-nav a { padding: 16px 18px; }

  /* Footer links are only ~18px tall by default — too small to tap reliably.
     Inline links inside prose are deliberately left alone: WCAG 2.2 exempts
     them from target size, and padding them would break line spacing. */
  .footer-col li { margin-bottom: 0; }
  .footer-col a { display: block; padding: 13px 0; }
  .small-links a { display: inline-block; padding: 13px 0; }

  /* Long unbroken strings (URLs, hyphenates) must not force a scrollbar */
  article p, article li, .key-answer p { overflow-wrap: break-word; }
}

@media (max-width: 380px) {
  .header-content { height: 60px; }
  .logo { font-size: 1rem; }
  .logo img { width: 28px; height: 28px; }
  header .btn-primary { padding: 10px 14px; font-size: 0.85rem; }
}
