/*
Theme Name: Colorasaur
Theme URI: https://colorasaur.com
Author: Colorasaur
Description: A vibrant, kids-friendly coloring pages theme with bold colors and playful design
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: colorasaur
*/

/* =========================================
   CSS VARIABLES
   ========================================= */
:root {
  --primary:    #4F46E5;
  --primary-dark: #3730A3;
  --pink:       #FF3D9A;
  --yellow:     #FFD600;
  --green:      #00D26A;
  --blue:       #00B4FF;
  --orange:     #FF6B35;
  --white:      #FFFFFF;
  --off-white:  #F8F7FF;
  --dark:       #1A1040;
  --gray:       #6B7280;
  --light-gray: #F3F4F6;

  --font-display: 'Nunito', 'Comic Sans MS', cursive;
  --font-body:    'Nunito', sans-serif;

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  --shadow-card: 4px 4px 0px var(--primary);
  --shadow-pink: 4px 4px 0px var(--pink);
  --shadow-yellow: 4px 4px 0px var(--yellow);
  --shadow-green: 4px 4px 0px var(--green);

  --grid-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M 40 0 L 0 0 0 40' fill='none' stroke='%234F46E520' stroke-width='1'/%3E%3C/svg%3E");
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--off-white);
  background-image: var(--grid-bg);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* =========================================
   DECORATIVE FLOATING SHAPES
   ========================================= */
.deco-shape {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
}
.deco-shape:nth-child(2) { animation-delay: -2s; }
.deco-shape:nth-child(3) { animation-delay: -4s; }

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-12px) rotate(5deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50%       { transform: rotate(3deg); }
}

@keyframes pop {
  0%   { transform: scale(0.8); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =========================================
   TOP BAR
   ========================================= */
.top-bar {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.top-bar a { color: var(--yellow); text-decoration: underline; }

/* =========================================
   HEADER
   ========================================= */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 10000;
  box-shadow: 0 4px 0 rgba(79,70,229,0.08);
  /* needed so mega dropdown positions relative to header */
  overflow: visible;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.site-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2.5px solid var(--dark);
  box-shadow: 3px 3px 0 var(--dark);
  transition: transform 0.2s;
}
.site-logo:hover .logo-icon { transform: rotate(-5deg); }
.site-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.site-logo .logo-text span { color: var(--pink); }

/* Search */
.header-search {
  flex: 1;
  max-width: 480px;
}
.header-search form {
  display: flex;
  align-items: center;
  background: var(--light-gray);
  border: 2.5px solid var(--dark);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search form:focus-within {
  border-color: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}
.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  color: var(--dark);
}
.header-search button {
  padding: 10px 18px;
  background: var(--primary);
  border: none;
  cursor: pointer;
  color: var(--white);
  font-size: 1rem;
  transition: background 0.2s;
}
.header-search button:hover { background: var(--primary-dark); }

/* Nav */
.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.site-nav a:hover {
  background: var(--primary);
  color: var(--white);
}
.site-nav .nav-badge {
  display: inline-block;
  background: var(--pink);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
  animation: wiggle 2s ease-in-out infinite;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 2.5px solid var(--dark);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* =========================================
   HERO - HOMEPAGE
   ========================================= */
.site-hero {
  background: var(--primary);
  position: relative;
  overflow: hidden;
  padding: 64px 24px;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M 40 0 L 0 0 0 40' fill='none' stroke='%23ffffff15' stroke-width='1'/%3E%3C/svg%3E");
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-content { color: var(--white); }

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow);
  color: var(--dark);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  border: 2px solid var(--dark);
  margin-bottom: 16px;
  animation: pop 0.5s ease both;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  animation: slide-in 0.5s ease 0.1s both;
}
.hero-title .highlight {
  color: var(--yellow);
  position: relative;
  display: inline-block;
}

.hero-desc {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 28px;
  animation: slide-in 0.5s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: slide-in 0.5s ease 0.3s both;
}

/* Hero categories pills */
.hero-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  animation: slide-in 0.5s ease 0.4s both;
}
.hero-cat-pill {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.4);
  color: var(--white);
  padding: 7px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.hero-cat-pill:hover {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}

/* Hero visual - coloring preview cards */
.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  animation: slide-in 0.6s ease 0.2s both;
}
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 3px solid var(--dark);
  overflow: hidden;
  transition: transform 0.2s;
  box-shadow: 5px 5px 0 var(--dark);
}
.hero-card:hover { transform: translate(-3px, -3px); }
.hero-card:nth-child(1) { box-shadow: 5px 5px 0 var(--pink); }
.hero-card:nth-child(2) { box-shadow: 5px 5px 0 var(--yellow); margin-top: 24px; }
.hero-card:nth-child(3) { box-shadow: 5px 5px 0 var(--green); margin-top: -24px; }
.hero-card:nth-child(4) { box-shadow: 5px 5px 0 var(--blue); }

.hero-card-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.hero-card-label {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--dark);
  border-top: 2px solid var(--dark);
}

/* Floating deco elements in hero */
.hero-deco {
  position: absolute;
  pointer-events: none;
  font-size: 2rem;
  animation: float 5s ease-in-out infinite;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2.5px solid var(--dark);
  text-decoration: none;
}
.btn:active { transform: translate(3px, 3px) !important; box-shadow: none !important; }

.btn-primary {
  background: var(--yellow);
  color: var(--dark);
  box-shadow: 4px 4px 0 var(--dark);
}
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--dark); }

.btn-white {
  background: var(--white);
  color: var(--primary);
  box-shadow: 4px 4px 0 rgba(255,255,255,0.4);
  border-color: var(--white);
}
.btn-white:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(255,255,255,0.4); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 3px 3px 0 var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); transform: translate(-2px,-2px); }

.btn-pink {
  background: var(--pink);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--dark);
}
.btn-pink:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--dark); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }

/* Download button special */
.btn-download {
  background: var(--green);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--dark);
  border-color: var(--dark);
  width: 100%;
  justify-content: center;
  font-size: 1rem;
}
.btn-download:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--dark); }

/* =========================================
   SECTION LAYOUT
   ========================================= */
.section {
  padding: 64px 24px;
}
.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--dark);
  line-height: 1.2;
}
.section-title .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pink);
  margin-left: 6px;
  vertical-align: middle;
}

/* Section label/badge */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow);
  color: var(--dark);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid var(--dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================
   CATEGORY CARDS (Homepage)
   ========================================= */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--white);
  border: 3px solid var(--dark);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: block;
}
.category-card:nth-child(1) { box-shadow: 5px 5px 0 var(--primary); }
.category-card:nth-child(2) { box-shadow: 5px 5px 0 var(--pink); }
.category-card:nth-child(3) { box-shadow: 5px 5px 0 var(--yellow); }
.category-card:nth-child(4) { box-shadow: 5px 5px 0 var(--green); }
.category-card:nth-child(5) { box-shadow: 5px 5px 0 var(--blue); }
.category-card:nth-child(6n) { box-shadow: 5px 5px 0 var(--orange); }

.category-card:hover { transform: translate(-3px, -3px); }
.category-card:hover:nth-child(1) { box-shadow: 8px 8px 0 var(--primary); }
.category-card:hover:nth-child(2) { box-shadow: 8px 8px 0 var(--pink); }
.category-card:hover:nth-child(3) { box-shadow: 8px 8px 0 var(--yellow); }
.category-card:hover:nth-child(4) { box-shadow: 8px 8px 0 var(--green); }
.category-card:hover:nth-child(5) { box-shadow: 8px 8px 0 var(--blue); }

.category-card .cat-emoji {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
  animation: float 4s ease-in-out infinite;
}
.category-card .cat-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--dark);
  margin-bottom: 4px;
}
.category-card .cat-count {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 600;
}

/* =========================================
   COLORING PAGE CARDS (Grid)
   ========================================= */
.coloring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.coloring-card {
  background: var(--white);
  border: 3px solid var(--dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  box-shadow: 4px 4px 0 var(--dark);
}
.coloring-card:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--primary); }

.coloring-card-thumb {
  aspect-ratio: 1;
  background: var(--light-gray);
  overflow: hidden;
  position: relative;
  border-bottom: 3px solid var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.coloring-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.coloring-card:hover .coloring-card-thumb img { transform: scale(1.05); }

.coloring-card-thumb .thumb-placeholder {
  font-size: 4rem;
  opacity: 0.3;
}

/* Difficulty badge on card */
.difficulty-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid var(--dark);
  text-transform: uppercase;
}
.difficulty-easy   { background: var(--green); color: var(--white); }
.difficulty-medium { background: var(--yellow); color: var(--dark); }
.difficulty-hard   { background: var(--pink); color: var(--white); }

/* Free badge */
.free-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--yellow);
  color: var(--dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid var(--dark);
  text-transform: uppercase;
}

.coloring-card-body { padding: 14px 16px; }
.coloring-card-title {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.coloring-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 600;
}
.coloring-card-meta .downloads { display: flex; align-items: center; gap: 4px; }

/* =========================================
   SINGLE COLORING PAGE
   ========================================= */
.single-coloring {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray); }

/* Image viewer */
.coloring-viewer {
  background: var(--white);
  border: 3px solid var(--dark);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 6px 6px 0 var(--primary);
}
.coloring-viewer-img {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--dark);
  padding: 24px;
}
.coloring-viewer-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.coloring-viewer-actions {
  padding: 20px;
  display: flex;
  gap: 12px;
}

/* Sidebar */
.coloring-sidebar { display: flex; flex-direction: column; gap: 20px; }

.sidebar-card {
  background: var(--white);
  border: 3px solid var(--dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 4px 4px 0 var(--dark);
}
.sidebar-card h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Meta info */
.meta-list { display: flex; flex-direction: column; gap: 10px; }
.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}
.meta-item .meta-label { color: var(--gray); font-weight: 600; }
.meta-item .meta-value { font-weight: 800; color: var(--dark); }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  background: var(--light-gray);
  border: 2px solid var(--dark);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dark);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.tag-pill:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Related coloring pages */
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.related-card {
  border: 2px solid var(--dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.15s;
  display: block;
  box-shadow: 3px 3px 0 var(--dark);
}
.related-card:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--primary); }
.related-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--light-gray);
}
.related-card span {
  display: block;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-top: 2px solid var(--dark);
  color: var(--dark);
}

/* Page title on single */
.coloring-page-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 12px;
  line-height: 1.2;
}
.coloring-page-desc {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* =========================================
   TAXONOMY / ARCHIVE PAGE
   ========================================= */
.archive-header {
  background: var(--primary);
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}
.archive-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  color: var(--white);
}
.archive-header-inner .archive-label {
  background: var(--yellow);
  color: var(--dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 2px solid var(--dark);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.archive-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 8px;
}
.archive-desc {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 600px;
}

/* Sub-categories strip */
.subcats-strip {
  background: var(--white);
  border-bottom: 3px solid var(--dark);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subcats-strip::-webkit-scrollbar { display: none; }
.subcats-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 12px 0;
}
.subcat-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--dark);
  border: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.subcat-tab:hover,
.subcat-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Filters bar */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.filter-label { font-weight: 700; font-size: 0.9rem; color: var(--dark); }
.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid var(--dark);
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.filter-btn:hover,
.filter-btn.active { background: var(--dark); color: var(--white); }

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
  flex-wrap: wrap;
}
.page-num {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--dark);
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--dark);
}
.page-num:hover  { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-num.current { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* =========================================
   ADSENSE SLOTS
   ========================================= */
.ad-slot {
  background: var(--light-gray);
  border: 2px dashed var(--gray);
  border-radius: var(--radius-md);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 0.8rem;
  margin: 24px 0;
  overflow: hidden;
}
.ad-slot.ad-banner  { min-height: 90px; }
.ad-slot.ad-square  { min-height: 250px; }
.ad-slot.ad-sidebar { min-height: 300px; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--dark);
  color: var(--white);
  padding: 56px 24px 24px;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--pink), var(--yellow), var(--green), var(--blue));
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 12px;
  display: block;
}
.footer-brand .logo-text span { color: var(--pink); }
.footer-brand p { font-size: 0.88rem; opacity: 0.7; line-height: 1.7; margin-bottom: 20px; }

.footer-col h4 {
  font-weight: 800;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--yellow);
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: 0.88rem;
  opacity: 0.75;
  transition: opacity 0.15s, color 0.15s;
}
.footer-col a:hover { opacity: 1; color: var(--yellow); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  opacity: 0.6;
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================
   STATS STRIP (Homepage)
   ========================================= */
.stats-strip {
  background: var(--yellow);
  border-top: 3px solid var(--dark);
  border-bottom: 3px solid var(--dark);
  padding: 20px 24px;
  overflow: hidden;
}
.stats-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 24px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--dark);
  display: block;
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark);
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .single-coloring { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header-inner { gap: 16px; }
  .header-search { display: none; }
  .site-nav { display: none; }
  .site-nav.open { display: block; position: absolute; top: 72px; left: 0; right: 0; background: var(--white); border-bottom: 3px solid var(--primary); padding: 16px; }
  .site-nav.open ul { flex-direction: column; }
  .menu-toggle { display: block; margin-left: auto; }
  .footer-inner { grid-template-columns: 1fr; }
  .coloring-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .coloring-viewer-actions { flex-direction: column; }
}

/* =========================================
   UTILITY
   ========================================= */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* =========================================
   MEGA MENU — CLICK TRIGGERED
   ========================================= */
.mega-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.mega-trigger-btn:hover { background: var(--light-gray); }
.mega-trigger-btn.open { background: var(--primary); color: var(--white); border-color: var(--primary); }
.mega-chevron { width: 16px; height: 16px; transition: transform 0.25s ease; flex-shrink: 0; display: block; }
.mega-trigger-btn.open .mega-chevron { transform: rotate(180deg); }

/* Dropdown — JS sets top dynamically */
.mega-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    top: 0; /* overridden by JS */
    background: var(--off-white);
    background-image: var(--grid-bg);
    background-size: 40px 40px;
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--dark);
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    pointer-events: none; /* only when closed */
}
.mega-dropdown.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s;
    pointer-events: all !important;
}
.mega-dropdown-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    max-height: 65vh;
}

/* Left */
.mega-left { background: #ffffff; border-right: 3px solid var(--dark); display: flex; flex-direction: column; overflow-y: auto; }
.mega-left-title { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray); padding: 14px 20px 10px; border-bottom: 2px solid rgba(0,0,0,0.07); }
.mega-cat-list { flex: 1; padding: 6px 0; }
.mega-cat-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 20px;
    background: none; border: none; border-left: 3px solid transparent;
    font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
    color: var(--dark); cursor: pointer; text-align: left;
    transition: background 0.12s, border-color 0.12s;
}
.mega-cat-btn:hover { background: rgba(79,70,229,0.07); border-left-color: var(--primary); }
.mega-cat-btn.active { background: var(--primary); color: var(--white); border-left-color: var(--primary-dark); }
.mega-cat-emoji { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }
.mega-cat-arrow { width: 13px; height: 13px; margin-left: auto; flex-shrink: 0; opacity: 0.35; display: block; }
.mega-cat-btn.active .mega-cat-arrow { opacity: 1; }
.mega-all-link { display: flex; align-items: center; gap: 8px; padding: 13px 20px; font-weight: 800; font-size: 0.84rem; color: var(--primary); border-top: 2px solid rgba(0,0,0,0.07); transition: background 0.12s; text-decoration: none; }
.mega-all-link:hover { background: rgba(79,70,229,0.07); }

/* Right */
.mega-right { padding: 24px 32px; overflow-y: auto; background: var(--off-white); background-image: var(--grid-bg); position: relative; z-index: 1; }
.mega-panel { display: none; animation: megaIn 0.15s ease; }
.mega-panel.active { display: block; }
@keyframes megaIn { from { opacity:0; transform:translateX(6px); } to { opacity:1; transform:translateX(0); } }
.mega-panel-header { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 2px solid var(--light-gray); }
.mega-panel-emoji { font-size: 2rem; line-height: 1; }
.mega-panel-title { font-weight: 900; font-size: 1rem; color: var(--dark); }
.mega-panel-count { font-size: 0.78rem; color: var(--gray); font-weight: 600; margin-top: 3px; }
.mega-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.mega-panel-grid li { list-style: none; }
.mega-panel-grid a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 13px; border-radius: var(--radius-md);
    border: 2px solid var(--dark); background: var(--white);
    font-family: var(--font-body); font-weight: 700; font-size: 0.83rem;
    color: var(--dark); box-shadow: 2px 2px 0 var(--dark);
    transition: all 0.12s ease; text-decoration: none; gap: 6px;
}
.mega-panel-grid a:hover { background: var(--primary); color: var(--white); border-color: var(--primary); box-shadow: 3px 3px 0 var(--primary-dark); transform: translate(-1px,-1px); }
.mega-sub-count { font-size: 0.69rem; background: var(--light-gray); color: var(--gray); padding: 2px 7px; border-radius: 20px; font-weight: 700; flex-shrink: 0; transition: background 0.12s, color 0.12s; }
.mega-panel-grid a:hover .mega-sub-count { background: rgba(255,255,255,0.22); color: var(--white); }

/* Overlay — handled by JS only */
.mega-overlay { display: none !important; }

/* Favorites heart nav icon */
.nav-fav-item { margin-left: 4px; }
.nav-fav-link {
    display: flex !important;
    align-items: center;
    gap: 4px;
    padding: 8px 12px !important;
    position: relative;
    border-radius: var(--radius-md);
    transition: background 0.15s;
}
.nav-fav-link:hover { background: #fee2e2 !important; color: var(--pink) !important; }
.heart-icon {
    width: 22px;
    height: 22px;
    color: var(--dark);
    transition: color 0.15s, fill 0.15s;
    display: block;
}
.nav-fav-link:hover .heart-icon { color: var(--pink); fill: var(--pink); }
.nav-fav-link .fav-nav-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
}

/* Fav button repositioned: top-LEFT on cards */
.coloring-card-thumb .fav-btn,
.fav-btn {
    top: 10px;
    left: 10px;
    right: auto;
}

/* Fav button on single page viewer — top left of image */
.fav-btn-viewer {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    z-index: 10;
    box-shadow: 3px 3px 0 var(--dark);
}

/* Active tag pill in sidebar */
.tag-pill.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* You may also like section label */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--yellow);
    color: var(--dark);
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    border: 2px solid var(--dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
