@charset "UTF-8";
/**
 * Full Skin — 009-coloring
 * Theme: Rainbow pastel magic — rose pink + soft purple on pure white
 * Personality: Magical, creative, joyful — dreamy kids art platform
 */

/* ═══ Google Fonts: Quicksand ═══ */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

/* ═══ Base Overrides ═══ */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::selection { background: #fbcfe8; color: #9d174d; }
::-moz-selection { background: #fbcfe8; color: #9d174d; }

*:focus-visible {
  outline: 3px solid var(--site-primary, #ec4899);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #fdf4ff; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ec4899 0%, #8b5cf6 100%);
  border-radius: 5px;
  border: 2px solid #fdf4ff;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #db2777 0%, #7c3aed 100%);
}
html { scrollbar-color: #ec4899 #fdf4ff; }

/* ═══ Body Background — dreamy gradient ═══ */
body {
  background: var(--gradient-surface, linear-gradient(160deg, #fdf4ff 0%, #ffffff 40%, #fff0f6 100%));
  background-attachment: fixed;
  color: var(--site-text, #1a0a2e);
  font-family: var(--font-body);
}

/* ═══ Hero — Rainbow pastel magic ═══ */

.hero {
  background: var(--gradient-hero, linear-gradient(160deg, #fff0f6 0%, #fdf4ff 40%, #f5f0ff 100%));
  border-bottom: none;
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Rainbow ribbon at the top of hero */
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--gradient-rainbow, linear-gradient(90deg, #f472b6 0%, #c084fc 25%, #818cf8 50%, #34d399 75%, #fbbf24 100%));
  pointer-events: none;
}

/* Decorative soft blob — top right */
.hero::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(236,72,153,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Second decorative blob — bottom left (injected via JS or pseudo on .hero .subtitle via sibling) */
.hero-blob-bottom {
  position: absolute;
  bottom: -50px; left: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--site-primary-dark, #9d174d);
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--site-text-light, #4b5563);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  padding: 1.25rem 1.75rem;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid var(--site-primary-border, #fbcfe8);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default);
  min-width: 130px;
}

.stat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 4px 16px rgba(236,72,153,0.12));
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--site-primary, #ec4899);
  font-family: var(--font-heading);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--site-text-muted, #6b7280);
  margin-top: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* ═══ Page Header (list/detail) ═══ */

.page-header {
  background: var(--gradient-card-pink, linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%));
  border-bottom: 1px solid var(--site-primary-border, #fbcfe8);
  padding: 2.5rem 2.5rem 2rem;
  position: relative;
  overflow: hidden;
}

/* Rainbow top ribbon on page headers too */
.page-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-rainbow);
  pointer-events: none;
}

.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--site-primary-dark, #9d174d);
  line-height: 1.25;
  font-family: var(--font-heading);
  position: relative;
  z-index: 1;
}

.page-header .subtitle {
  color: var(--site-text-light, #4b5563);
  font-size: 1rem;
  margin-top: 0.4rem;
  position: relative;
  z-index: 1;
}

/* ═══ Breadcrumb ═══ */

.breadcrumb {
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--site-text-muted, #6b7280);
}

.breadcrumb a { color: var(--site-primary, #ec4899); text-decoration: none; }
.breadcrumb a:hover { color: var(--site-primary-hover, #db2777); text-decoration: underline; }
.breadcrumb li:not(:last-child)::after { content: '›'; color: #d1d5db; font-weight: 600; margin-left: 0.3rem; }
.breadcrumb li:last-child { color: var(--site-text, #1a0a2e); font-weight: 600; }

/* ═══ Set Switcher ═══ */

.set-switcher {
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.set-switcher-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--site-text, #1a0a2e);
  font-family: var(--font-heading);
}

.set-btn {
  background: white;
  border: 2px solid var(--site-border, #f3e8ff);
  border-radius: var(--radius-button, 9999px);
  color: var(--site-text, #1a0a2e);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-default);
  font-family: var(--font-heading);
}

.set-btn:hover {
  border-color: var(--site-primary, #ec4899);
  background: var(--site-primary-light, #fdf2f8);
  color: var(--site-primary-dark, #9d174d);
}

.set-btn.active {
  background: var(--gradient-brand, linear-gradient(135deg, #ec4899, #8b5cf6));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* ═══ Buttons — Pill shape, rose pink ═══ */

.btn {
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-button, 9999px);
  background: white;
  color: var(--site-text, #1a0a2e);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-default),
              box-shadow var(--dur-fast) var(--ease-default),
              background var(--dur-fast) var(--ease-default);
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
}

.btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-sm);
  transition-duration: 80ms;
}

.btn:focus-visible {
  outline: 3px solid var(--site-primary, #ec4899);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
  border-color: transparent;
  min-height: 44px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
  box-shadow: 0 6px 24px rgba(236,72,153,0.35);
}

.btn-primary:active { background: var(--site-primary-dark, #9d174d); }

/* Print button — special treatment: prominent, clean */
.btn-print,
[data-action="print"],
.btn[href*="print"] {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border-color: transparent;
  min-height: 44px;
  box-shadow: 0 4px 16px rgba(139,92,246,0.25);
}

.btn-print:hover,
[data-action="print"]:hover,
.btn[href*="print"]:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 8px 28px rgba(139,92,246,0.40);
  transform: translateY(-3px);
}

.btn-success, .btn-answers {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border-color: transparent;
  min-height: 44px;
}

.btn-success:hover, .btn-answers:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 6px 24px rgba(139,92,246,0.30);
}

.btn-check {
  background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  color: white;
  border-color: transparent;
  min-height: 44px;
}

.btn-check:hover {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  box-shadow: 0 6px 24px rgba(236,72,153,0.30);
}

/* ═══ Intro Section ═══ */

.intro, .intro-section {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  margin: 1rem 0;
}

.intro h3, .intro-section h3 { font-weight: 700; color: var(--site-primary-dark, #9d174d); font-family: var(--font-heading); }
.intro p, .intro-section p { color: var(--site-text-light, #4b5563); line-height: 1.7; }
.intro strong, .intro-section strong { color: var(--site-primary-dark, #9d174d); }

/* ═══ Body Content ═══ */

.body-content {
  background: white;
  border-radius: 0 0 16px 16px;
  border: 1px solid var(--site-border, #f3e8ff);
  border-top: none;
}

.problems-grid { border-top: 2px solid var(--site-border, #f3e8ff); }

.problem {
  border-bottom: 1px solid #faf5ff;
  font-size: 1.125rem;
  color: var(--site-text, #1a0a2e);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.problem:hover { transform: translateX(2px); }

/* Problem number badge */
.problem .num {
  background: var(--site-primary-light, #fdf2f8);
  color: var(--site-primary, #ec4899);
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Answer badge */
.problem .answer {
  background: #f5f0ff;
  color: var(--site-accent-dark, #5b21b6);
  font-weight: 700;
  border-radius: 10px;
}

/* ═══ Variant Chip ═══ */

.variant-chip {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-chip, 9999px);
  color: var(--site-primary-dark, #9d174d);
  background: var(--site-primary-light, #fdf2f8);
  border: 1px solid var(--site-primary-border, #fbcfe8);
}

/* ═══ Category Cards — Pastel gradient tiles ═══ */

.section-header { margin: 2.5rem 0 1.25rem; }

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--site-text, #1a0a2e);
  font-family: var(--font-heading);
}

.section-header h2::after {
  content: '';
  display: block;
  width: 52px;
  height: 4px;
  margin-top: 0.5rem;
  background: var(--gradient-brand);
  border-radius: 2px;
}

.section-header p { color: var(--site-text-muted, #6b7280); margin-top: 0.3rem; }

.categories-section { padding: 0; }

/* Categories grid — 3 columns, auto-reflow */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.category-card {
  display: block;
  padding: 2rem;
  background: var(--gradient-card-pink);
  border: 1.5px solid var(--site-primary-border, #fbcfe8);
  border-radius: var(--radius-card, 20px);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default),
              border-color var(--dur-normal) var(--ease-default);
  animation: fadeInUp 400ms var(--ease-default) both;
}

/* Rainbow underline animation */
.category-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 4px;
  background: var(--gradient-rainbow);
  border-radius: 0 0 20px 20px;
  transition: left 300ms var(--ease-default), right 300ms var(--ease-default);
}

.category-card:hover::after { left: 0; right: 0; }

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--site-primary, #ec4899);
}

/* Per-index pastel gradient cycling */
.category-card:nth-child(6n+1) { background: var(--gradient-card-pink); }
.category-card:nth-child(6n+2) { background: var(--gradient-card-purple); border-color: var(--site-border-dark, #e9d5ff); }
.category-card:nth-child(6n+3) { background: var(--gradient-card-blue); border-color: #bfdbfe; }
.category-card:nth-child(6n+4) { background: var(--gradient-card-mint); border-color: #bbf7d0; }
.category-card:nth-child(6n+5) { background: var(--gradient-card-yellow); border-color: #fef08a; }
.category-card:nth-child(6n+6) { background: var(--gradient-card-peach); border-color: #fed7aa; }

.category-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  line-height: 1;
}

.category-card h3 {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--site-text, #1a0a2e);
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
}

.category-card p {
  font-size: 0.88rem;
  color: var(--site-text-muted, #6b7280);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.category-meta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--site-primary, #ec4899);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid rgba(236,72,153,0.12);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ═══ Subcategory Cards ═══ */

.subcategories-section { margin: 2rem 0; }

.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.subcategory-card {
  display: block;
  padding: 1.5rem;
  background: white;
  border: 1.5px solid var(--site-border, #f3e8ff);
  border-top: 4px solid var(--site-primary, #ec4899);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default),
              border-top-color var(--dur-normal) var(--ease-default);
  animation: fadeInUp 400ms var(--ease-default) both;
}

.subcategory-card:hover {
  border-top-color: var(--site-accent, #8b5cf6);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.subcategory-card h3 {
  font-weight: 700;
  font-size: 1rem;
  color: var(--site-text, #1a0a2e);
  font-family: var(--font-heading);
  margin: 0 0 0.4rem;
}

.subcategory-card p {
  font-size: 0.85rem;
  color: var(--site-text-muted, #6b7280);
  margin: 0;
  line-height: 1.5;
}

.subcategory-arrow {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--site-primary, #ec4899);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap var(--dur-fast) var(--ease-default);
}

.subcategory-card:hover .subcategory-arrow { gap: 0.6rem; }

.difficulty-icon { font-size: 1.3rem; }

/* ═══ Worksheet / Coloring Page Cards ═══ */

.worksheets-section, .coloring-pages-section { margin: 2rem 0; }

.worksheets-grid,
.coloring-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.worksheet-card,
.coloring-page-card {
  display: block;
  background: white;
  border: 2px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default),
              border-color var(--dur-normal) var(--ease-default);
  animation: fadeInUp 400ms var(--ease-default) both;
}

.worksheet-card:hover,
.coloring-page-card:hover {
  border-color: var(--site-primary, #ec4899);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.worksheet-number,
.page-number {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--site-primary, #ec4899);
  font-family: var(--font-heading);
}

.worksheet-problems,
.page-count {
  font-size: 0.78rem;
  color: var(--site-text-muted, #6b7280);
}

/* Coloring image preview — elegant framed thumbnails */
.coloring-card {
  background: white;
  border: 2px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-normal) var(--ease-default),
              box-shadow var(--dur-normal) var(--ease-default),
              border-color var(--dur-normal) var(--ease-default);
}

.coloring-card:hover {
  border-color: var(--site-primary, #ec4899);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.coloring-preview {
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #fdf4ff;
}

.coloring-placeholder {
  background: linear-gradient(135deg, rgba(236,72,153,0.06), rgba(139,92,246,0.06));
  border: 2px dashed var(--site-primary-border, #fbcfe8);
  border-radius: 14px;
}

/* ═══ Content Toggle ═══ */

.body-content--collapsible {
  margin: 1.25rem 0;
  border: 1px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  overflow: hidden;
}

.content-toggle { border: none; }

.content-toggle summary {
  padding: 0.9rem 1.25rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--site-primary-dark, #9d174d);
  cursor: pointer;
  background: var(--site-primary-light, #fdf2f8);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-default);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
}

.content-toggle summary::-webkit-details-marker { display: none; }

.content-toggle summary::after {
  content: '⌄';
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--site-primary, #ec4899);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: rgba(236,72,153,0.1);
  border-radius: 50%;
  transition: transform 200ms ease;
}

.content-toggle[open] summary::after { transform: rotate(180deg); }
.content-toggle summary:hover { background: var(--site-primary-border, #fbcfe8); }
.content-toggle[open] summary { border-bottom-color: var(--site-border, #f3e8ff); }
.content-toggle-panel { padding: 1.25rem 1.5rem; }

.content-toggle-panel h2 { font-size: 1.2rem; font-weight: 700; color: var(--site-primary-dark, #9d174d); font-family: var(--font-heading); margin: 1rem 0 0.5rem; }
.content-toggle-panel h3 { font-size: 1.05rem; font-weight: 600; color: var(--site-text, #1a0a2e); font-family: var(--font-heading); margin: 0.75rem 0 0.4rem; }
.content-toggle-panel p { line-height: 1.7; color: var(--site-text-light, #4b5563); margin: 0.4rem 0; }
.content-toggle-panel ul, .content-toggle-panel ol { padding-left: 1.25rem; margin: 0.5rem 0; color: var(--site-text-light, #4b5563); }
.content-toggle-panel li { margin: 0.3rem 0; line-height: 1.6; }
.content-toggle-panel strong { color: var(--site-primary-dark, #9d174d); }

/* ═══ Score Panel ═══ */

.score-panel {
  display: none;
  background: white;
  border: 1px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  transition: all var(--dur-normal) var(--ease-default);
}

.score-panel.score-visible {
  display: block;
  animation: scoreSlide 300ms ease-out;
}

@keyframes scoreSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.score-inner { position: relative; display: flex; align-items: center; gap: 1rem; }
.score-icon { font-size: 1.5rem; line-height: 1; }
.score-detail { font-size: 1rem; font-weight: 600; color: var(--site-text, #1a0a2e); font-family: var(--font-heading); }
.score-pct { font-size: 1.6rem; font-weight: 700; color: var(--site-primary, #ec4899); font-family: var(--font-heading); }

/* ═══ Interactive Answer Input ═══ */

.answer-input {
  border: 2px solid var(--site-border, #f3e8ff);
  border-radius: 8px;
  background: white;
  color: var(--site-text, #1a0a2e);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.answer-input:focus {
  border-color: var(--site-primary, #ec4899);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.12);
}

.problem.is-correct .answer-input { border-color: var(--site-accent, #8b5cf6); background: #faf5ff; color: var(--site-accent-dark, #5b21b6); }
.problem.is-wrong .answer-input { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.problem.is-empty .answer-input { border-color: #f472b6; background: var(--site-primary-light, #fdf2f8); }
.problem.is-correct { border-left-color: var(--site-accent, #8b5cf6) !important; }
.problem.is-wrong { border-left-color: #ef4444 !important; }

/* ═══ Score Retry Button ═══ */

.score-retry {
  background: var(--site-primary-light, #fdf2f8);
  color: var(--site-primary, #ec4899);
  border: 2px solid var(--site-primary-border, #fbcfe8);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-default);
}

.score-retry:hover {
  background: var(--gradient-brand);
  color: white;
  border-color: transparent;
}

/* ═══ Content Section ═══ */

.content-section { padding: 1.5rem; margin: 1rem 0; }
.content-section h2 { font-family: var(--font-heading); color: var(--site-primary-dark, #9d174d); font-weight: 700; margin-bottom: 0.75rem; }
.content-section h3 { color: var(--site-text, #1a0a2e); font-weight: 600; font-family: var(--font-heading); }
.content-section p { line-height: 1.7; color: var(--site-text-light, #4b5563); }

/* ═══ Page Navigation ═══ */

.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-button, 9999px);
  color: var(--site-primary, #ec4899);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  transition: background var(--dur-fast) var(--ease-default),
              transform var(--dur-fast) var(--ease-default);
}

.btn-nav:hover {
  background: var(--site-primary-light, #fdf2f8);
  transform: translateY(-1px);
}

.btn-nav.disabled { color: #d1d5db; cursor: not-allowed; }
.btn-nav.disabled:hover { background: transparent; transform: none; }

/* ═══ SEO Components ═══ */

.seo-components {
  margin: 3rem 0;
  border-top: 1px solid var(--site-border, #f3e8ff);
  padding-top: 2.5rem;
}

.seo-components--primary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.seo-components--secondary { margin-top: 1rem; }

.seo-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.seo-block {
  background: white;
  border: 1px solid var(--site-border, #f3e8ff);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-normal) var(--ease-default),
              transform var(--dur-normal) var(--ease-default);
  animation: fadeInUp 400ms var(--ease-default) both;
}

.seo-block:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-md);
}

.seo-card {
  background: white;
  border-color: var(--site-border, #f3e8ff);
  border-top: none;
}

.seo-card::before { background: var(--site-primary, #ec4899); }
.seo-card:hover { box-shadow: 0 0 0 3px rgba(236,72,153,0.12); }

/* Card band accent colors per content type */
.seo-card.features::before  { background: #ec4899; }
.seo-card.benefits::before  { background: #8b5cf6; }
.seo-card.faq::before       { background: #6d28d9; }
.seo-card.tips::before      { background: #f472b6; }
.seo-card.steps::before     { background: #a855f7; }
.seo-card.tutorial::before  { background: #8b5cf6; }
.seo-card.examples::before  { background: #06b6d4; }
.seo-card.use-cases::before { background: #ec4899; }
.seo-card.common-mistakes::before { background: #ef4444; }
.seo-card.practice::before  { background: #f97316; }
.seo-card.requirements::before { background: #6366f1; }
.seo-card.resources::before { background: #14b8a6; }
.seo-card.next-steps::before { background: #db2777; }
.seo-card.summary::before   { background: #64748b; }
.seo-card.related::before   { background: #c084fc; }

.seo-components--secondary .seo-block { background: var(--site-primary-light, #fdf2f8); }

.seo-block.tutorial     { border-left: 3px solid #ec4899; }
.seo-block.examples     { border-left: 3px solid #8b5cf6; }
.seo-block.use-cases    { border-left: 3px solid #f472b6; }
.seo-block.common-mistakes { border-left: 3px solid #ef4444; }
.seo-block.practice     { border-left: 3px solid #f97316; }
.seo-block.requirements { border-left: 3px solid #6366f1; }
.seo-block.resources    { border-left: 3px solid #14b8a6; }
.seo-block.next-steps   { border-left: 3px solid #db2777; }
.seo-block.summary      { border-left: 3px solid #64748b; }
.seo-block.related      { border-left: 3px solid #c084fc; }

.seo-block h2 { font-size: 1.1rem; font-weight: 700; color: var(--site-primary-dark, #9d174d); margin: 0 0 0.6rem; font-family: var(--font-heading); }
.seo-block h3 { font-size: 0.95rem; font-weight: 600; color: var(--site-text, #1a0a2e); font-family: var(--font-heading); margin: 0.6rem 0 0.4rem; }
.seo-block h4 { font-size: 0.9rem; font-weight: 600; color: var(--site-text-muted, #6b7280); margin: 0.5rem 0 0.3rem; }
.seo-block p  { font-size: 0.9rem; line-height: 1.65; color: var(--site-text-light, #4b5563); margin: 0.35rem 0; }
.seo-block ul, .seo-block ol { padding-left: 1.2rem; margin: 0.4rem 0; }
.seo-block li { font-size: 0.9rem; line-height: 1.55; color: var(--site-text-light, #4b5563); margin: 0.25rem 0; }
.seo-block strong { color: var(--site-primary-dark, #9d174d); }
.seo-block a { color: var(--site-primary, #ec4899); text-decoration: none; }
.seo-block a:hover { text-decoration: underline; color: var(--site-primary-hover, #db2777); }

/* FAQ details */
.seo-block details { border-bottom: 1px solid var(--site-border, #f3e8ff); padding: 0.5rem 0; }
.seo-block details:last-child { border-bottom: none; }
.seo-block details summary { font-weight: 600; font-size: 0.9rem; cursor: pointer; list-style: none; color: var(--site-primary-dark, #9d174d); font-family: var(--font-heading); }
.seo-block details summary::-webkit-details-marker { display: none; }
.seo-block details summary::before { content: "▸"; margin-right: 0.4rem; color: var(--site-primary, #ec4899); display: inline-block; transition: transform 150ms ease; }
.seo-block details[open] summary::before { transform: rotate(90deg); }
.seo-block details p { padding: 0.3rem 0 0.3rem 1rem; color: var(--site-text-light, #4b5563); font-size: 0.88rem; }

/* ═══ Animation Keyframes ═══ */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { animation: fadeIn 300ms ease-out; }
.slide-up { animation: slideUp 300ms ease-out; }

/* Staggered card animation delays */
.category-card:nth-child(1),
.subcategory-card:nth-child(1),
.worksheet-card:nth-child(1),
.seo-block:nth-child(1) { animation-delay: 0ms; }

.category-card:nth-child(2),
.subcategory-card:nth-child(2),
.worksheet-card:nth-child(2),
.seo-block:nth-child(2) { animation-delay: 60ms; }

.category-card:nth-child(3),
.subcategory-card:nth-child(3),
.worksheet-card:nth-child(3),
.seo-block:nth-child(3) { animation-delay: 120ms; }

.category-card:nth-child(4),
.subcategory-card:nth-child(4),
.worksheet-card:nth-child(4),
.seo-block:nth-child(4) { animation-delay: 180ms; }

.category-card:nth-child(5),
.subcategory-card:nth-child(5),
.worksheet-card:nth-child(5),
.seo-block:nth-child(5) { animation-delay: 240ms; }

.category-card:nth-child(n+6),
.subcategory-card:nth-child(n+6),
.worksheet-card:nth-child(n+6),
.seo-block:nth-child(n+6) { animation-delay: 300ms; }

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero .subtitle { max-width: 100%; font-size: 1rem; }
  .hero-stats { gap: 1rem; }
  .stat-number { font-size: 1.4rem; }
  .hero::after { display: none; }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .subcategories-grid {
    grid-template-columns: 1fr;
  }
  .worksheets-grid,
  .coloring-pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
  .seo-components--primary { grid-template-columns: 1fr; }
  .seo-more-grid { grid-template-columns: 1fr; }
  .page-navigation { flex-wrap: wrap; justify-content: center; }
  .btn-nav { width: 100%; text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { flex-direction: column; gap: 0.75rem; align-items: center; }
  .stat-item { width: 100%; max-width: 200px; }
  .categories-grid { grid-template-columns: 1fr; }
}

/* ═══ Dark Mode — soft dark, preserving dreamy feel ═══ */

@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(160deg, #150a20 0%, #0f0a1a 50%, #1a0a20 100%);
    background-attachment: fixed;
    color: #f0e6ff;
  }

  .hero {
    background: linear-gradient(160deg, #200a2e 0%, #150a20 50%, #1a0010 100%);
    border-bottom: none;
  }

  .hero h1 { color: #f9a8d4; }
  .hero .subtitle { color: #d8b4fe; }

  .page-header {
    background: linear-gradient(135deg, #200a2e 0%, #150a20 100%);
    border-bottom-color: rgba(236,72,153,0.25);
  }

  .page-header h1 { color: #f9a8d4; }
  .page-header .subtitle { color: #d8b4fe; }

  .breadcrumb { }
  .breadcrumb ol { color: #a78bfa; }
  .breadcrumb a { color: #f9a8d4; }
  .breadcrumb li:last-child { color: #f0e6ff; }

  .stat-item {
    background: rgba(30,10,50,0.7);
    border-color: rgba(236,72,153,0.2);
  }
  .stat-number { color: #f9a8d4; }
  .stat-label  { color: #a78bfa; }

  .category-card,
  .subcategory-card,
  .worksheet-card,
  .coloring-page-card,
  .coloring-card {
    background: rgba(25,10,40,0.9);
    border-color: rgba(236,72,153,0.2);
    color: #f0e6ff;
  }
  /* Override nth-child gradient backgrounds for dark mode */
  .category-card:nth-child(6n+1),
  .category-card:nth-child(6n+2),
  .category-card:nth-child(6n+3),
  .category-card:nth-child(6n+4),
  .category-card:nth-child(6n+5),
  .category-card:nth-child(6n+6) {
    background: rgba(25,10,40,0.9);
    border-color: rgba(236,72,153,0.2);
  }

  .category-card:hover,
  .subcategory-card:hover,
  .worksheet-card:hover,
  .coloring-page-card:hover,
  .coloring-card:hover {
    background: rgba(40,10,60,0.95);
    border-color: rgba(236,72,153,0.4);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  }

  .category-card h3,
  .subcategory-card h3,
  .worksheet-card h3 { color: #f0e6ff; }
  .category-card p,
  .subcategory-card p  { color: #a78bfa; }
  .category-meta { color: #f9a8d4; border-top-color: rgba(236,72,153,0.2); }
  .subcategory-arrow { color: #f9a8d4; }
  .worksheet-number, .page-number { color: #f9a8d4; }
  .worksheet-problems, .page-count { color: #a78bfa; }

  .section-header h2 { color: #f0e6ff; }
  .section-header p  { color: #a78bfa; }

  .body-content { background: rgba(20,8,35,0.95); border-color: rgba(236,72,153,0.2); }
  .problem { color: #f0e6ff; border-bottom-color: rgba(236,72,153,0.1); }
  .problem .num { background: rgba(236,72,153,0.1); color: #f9a8d4; }
  .problem .answer { background: rgba(139,92,246,0.15); color: #c4b5fd; }

  .set-switcher { background: rgba(25,10,40,0.9); border-color: rgba(236,72,153,0.2); }
  .set-btn { background: rgba(25,10,40,0.9); border-color: rgba(236,72,153,0.2); color: #f0e6ff; }
  .set-btn:hover { background: rgba(40,10,60,0.95); border-color: #ec4899; }
  .set-btn.active { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: white; border-color: transparent; }

  .btn { background: rgba(25,10,40,0.9); color: #f0e6ff; box-shadow: 0 1px 3px rgba(0,0,0,0.4); }

  .intro, .intro-section {
    background: linear-gradient(135deg, rgba(40,10,60,0.9) 0%, rgba(25,10,40,0.9) 100%);
    border-color: rgba(236,72,153,0.2);
  }
  .intro h3, .intro-section h3 { color: #f9a8d4; }
  .intro p, .intro-section p   { color: #d8b4fe; }

  .content-toggle summary { background: rgba(35,10,55,0.9); color: #f9a8d4; }
  .content-toggle summary::after { background: rgba(236,72,153,0.15); color: #f9a8d4; }
  .content-toggle summary:hover { background: rgba(50,15,75,0.9); }
  .content-toggle-panel { background: rgba(20,8,35,0.95); }
  .content-toggle-panel h2 { color: #f9a8d4; }
  .content-toggle-panel h3 { color: #d8b4fe; }
  .content-toggle-panel p  { color: #c4b5fd; }
  .content-toggle-panel strong { color: #f9a8d4; }

  .score-panel { background: rgba(25,10,40,0.9); border-color: rgba(236,72,153,0.2); }
  .score-detail { color: #f0e6ff; }
  .score-pct    { color: #f9a8d4; }

  .content-section { background: rgba(20,8,35,0.95); }
  .content-section h2 { color: #f9a8d4; }
  .content-section h3 { color: #d8b4fe; }
  .content-section p  { color: #c4b5fd; }

  .seo-block {
    background: rgba(25,10,40,0.9);
    border-color: rgba(236,72,153,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  }
  .seo-block:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.55); }
  .seo-components--secondary .seo-block { background: rgba(20,8,35,0.95); }
  .seo-block h2 { color: #f9a8d4; }
  .seo-block h3 { color: #d8b4fe; }
  .seo-block h4 { color: #a78bfa; }
  .seo-block p, .seo-block li { color: #c4b5fd; }
  .seo-block strong { color: #f9a8d4; }
  .seo-block a  { color: #f9a8d4; }
  .seo-block details { border-bottom-color: rgba(236,72,153,0.15); }
  .seo-block details summary { color: #f9a8d4; }
  .seo-block details p { color: #a78bfa; }

  .page-navigation {
    background: rgba(25,10,40,0.8);
    border-color: rgba(236,72,153,0.2);
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  }
  .btn-nav { color: #f9a8d4; }
  .btn-nav:hover { background: rgba(50,15,75,0.8); }

  .answer-input {
    background: rgba(20,8,35,0.9);
    border-color: rgba(236,72,153,0.2);
    color: #f0e6ff;
  }
  .answer-input:focus { border-color: #ec4899; box-shadow: 0 0 0 3px rgba(236,72,153,0.2); }

  .variant-chip { background: rgba(236,72,153,0.12); color: #f9a8d4; border-color: rgba(236,72,153,0.3); }

  ::selection { background: rgba(236,72,153,0.3); color: #fff; }
  ::-moz-selection { background: rgba(236,72,153,0.3); color: #fff; }
  ::-webkit-scrollbar-track { background: #0f0a1a; }
  ::-webkit-scrollbar-thumb { border-color: #0f0a1a; }
}

/* ═══ Print Styles ═══ */

@media print {
  body { background: #fff !important; color: #000 !important; }
  * { box-shadow: none !important; text-shadow: none !important; }

  .hero::before,
  .hero::after,
  .page-header::before { display: none !important; }

  .hero {
    background: #fff !important;
    border-bottom: 2px solid #ec4899 !important;
    padding: 1.5rem !important;
  }

  .hero h1 { color: #9d174d !important; }

  .category-card,
  .subcategory-card,
  .worksheet-card,
  .seo-block {
    animation: none !important;
    box-shadow: none !important;
    break-inside: avoid;
    background: #fff !important;
    border-color: #fbcfe8 !important;
  }

  /* Preserve nth-child pastel backgrounds in print for visual delight */
  .category-card::after { display: none !important; }

  .page-navigation,
  .set-switcher,
  .score-retry { display: none !important; }

  .stat-item { background: #fff !important; border: 1pt solid #fbcfe8 !important; }
  .btn { box-shadow: none !important; }
  .section-header h2::after { background: #ec4899 !important; }

  .seo-components { border-top: 1pt solid #fbcfe8 !important; }
  .seo-block { border: 1pt solid #fbcfe8 !important; border-radius: 0 !important; }
}
