/*
Theme Name: Kahaani Kids
Theme URI: https://yoursite.com
Author: Your Name
Description: Kahaani Kids jaisi vibrant, colorful WordPress theme for kids stories, rhymes and cartoons. Fully editable via Customizer.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: kahaani-kids
Tags: kids, children, stories, cartoons, colorful, entertainment, fully-editable
*/

/* =============================================
   GOOGLE FONTS + VARIABLES
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700;800;900&display=swap');

:root {
  --primary:       #FF6B35;
  --secondary:     #FFD700;
  --accent-green:  #32CD32;
  --accent-purple: #9B59B6;
  --accent-pink:   #FF1493;
  --accent-blue:   #4169E1;
  --sky-top:       #87CEEB;
  --sky-bot:       #C8F0A0;
  --bg-page:       #FFF9E6;
  --text-dark:     #333333;
  --text-mid:      #555555;
  --text-light:    #888888;
  --border-r-sm:   10px;
  --border-r-md:   16px;
  --border-r-lg:   24px;
  --shadow-sm:     0 3px 12px rgba(0,0,0,0.10);
  --shadow-md:     0 6px 20px rgba(0,0,0,0.14);
  --shadow-yellow: 0 4px 14px rgba(255,215,0,0.45);
  --shadow-pink:   0 4px 14px rgba(255,20,147,0.45);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { width:100%; max-width:100%; overflow-x:hidden; }
body {
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-page);
  color: var(--text-dark);
}
img { max-width:100%; height:auto; display:block; }
a   { color: var(--primary); text-decoration:none; transition:color .2s; }
a:hover { color: var(--accent-purple); }
ul, ol { list-style: none; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Fredoka One', 'Comic Sans MS', cursive;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-dark);
}
h1 { font-size: clamp(26px, 4.5vw, 46px); }
h2 { font-size: clamp(20px, 3.5vw, 34px); }
h3 { font-size: clamp(16px, 2.5vw, 24px); }

/* =============================================
   LAYOUT
   ============================================= */
.container { max-width:1200px; margin:0 auto; padding:0 20px; width:100%; }
.section    { padding: 40px 0; }
.section-header { text-align:center; margin-bottom:28px; }
.section-header h2 { margin-bottom:6px; }
.section-header p  { color:var(--text-light); font-size:14px; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:12px 28px; border-radius:30px;
  font-family:'Fredoka One',cursive; font-size:15px;
  cursor:pointer; border:none;
  transition: transform .2s, box-shadow .2s;
  text-decoration:none;
}
.btn:hover { transform:translateY(-2px); }
.btn-pink   { background:var(--accent-pink);   color:#fff; box-shadow:var(--shadow-pink); }
.btn-pink:hover { background:#e0006e; color:#fff; }
.btn-yellow { background:var(--secondary);     color:#8B4500; box-shadow:var(--shadow-yellow); }
.btn-green  { background:var(--accent-green);  color:#fff; box-shadow:0 4px 14px rgba(50,205,50,.4); }
.btn-purple { background:var(--accent-purple); color:#fff; box-shadow:0 4px 14px rgba(155,89,182,.4); }
.btn-white  { background:#fff; color:var(--primary); border:2px solid var(--primary); }

/* =============================================
   HEADER
   ============================================= */
#site-header {
  position: sticky; top:0; z-index:1000;
  background: linear-gradient(135deg, var(--sky-top) 0%, #B8E4FF 50%, var(--sky-bot) 100%);
  border-bottom: 3px solid var(--secondary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.header-inner {
  display:flex; align-items:center; height:72px;
  padding:0 24px; max-width:1200px; margin:0 auto;
  gap: 16px;
}
.site-logo a { display:flex; align-items:center; gap:10px; text-decoration:none; }
.logo-bear  { font-size:42px; line-height:1; filter:drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }
.logo-text-wrap { font-family:'Fredoka One',cursive; line-height:1.1; }
.logo-main  { font-size:24px; }
.logo-main .k1 { color: #FF4500; }
.logo-main .k2 { color: #8B4513; }
.logo-tagline { font-size:12px; color:#558B2F; display:block; }
.header-search { flex:1; max-width:320px; position:relative; }
.header-search input {
  width:100%; padding:9px 44px 9px 18px;
  border-radius:25px; border:2px solid var(--secondary);
  font-size:14px; font-family:'Nunito',sans-serif;
  background:#fff; outline:none;
  transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { border-color: var(--accent-purple); box-shadow:0 0 0 3px rgba(155,89,182,.15); }
.header-search .s-icon { position:absolute; right:14px; top:50%; transform:translateY(-50%); font-size:18px; cursor:pointer; }
.parents-btn {
  background: linear-gradient(135deg, #9B59B6, #8E44AD);
  color:#fff; border:none; padding:9px 18px; border-radius:22px;
  font-family:'Fredoka One',cursive; font-size:13px; cursor:pointer;
  box-shadow:0 3px 10px rgba(155,89,182,0.4); white-space:nowrap;
  transition: transform .2s;
}
.parents-btn:hover { transform:scale(1.05); }
.menu-toggle { display:none; background:none; border:none; font-size:28px; cursor:pointer; color:var(--text-dark); }

/* =============================================
   CATEGORY BAR
   ============================================= */
.cat-bar {
  background: linear-gradient(90deg, #87CEEB, #B8F0C8);
  padding: 8px 24px;
  display:flex; gap:8px; align-items:center;
  flex-wrap:wrap;
  border-bottom: 2px solid rgba(255,255,255,0.6);
}
.cat-pill {
  padding:6px 18px; border-radius:20px;
  font-family:'Fredoka One',cursive; font-size:13px;
  cursor:pointer; transition:transform .15s, box-shadow .15s;
  white-space:nowrap;
}
.cat-pill:hover { transform:scale(1.08); box-shadow:var(--shadow-sm); }
.cp-yellow  { background:#FFD700; color:#8B4500; }
.cp-purple  { background:#DA70D6; color:#5B0A5B; }
.cp-red     { background:#FF6B6B; color:#7A0000; }
.cp-blue    { background:#4169E1; color:#fff;    }
.cp-green   { background:#32CD32; color:#1A5C00; }
.cp-orange  { background:#FF8C00; color:#5C2900; }
.cat-butterfly { margin-left:auto; font-size:22px; }

/* =============================================
   HERO SLIDER
   ============================================= */
.hero-slider-wrap { position:relative; margin:16px 20px; }
.hero-slider-section {
  position:relative; border-radius:22px; overflow:hidden;
  min-height:240px; box-shadow:var(--shadow-md);
}
.slider-wrapper { display:flex; transition:transform .6s cubic-bezier(.25,.46,.45,.94); will-change:transform; }
.slide {
  min-width:100%; min-height:240px;
  background-size:cover; background-position:center;
  display:flex; align-items:center; position:relative;
}
.slide-sky { position:absolute; top:0; left:0; right:0; height:55%; z-index:0; }
.slide-ground { position:absolute; bottom:0; left:0; right:0; height:45%; z-index:0; background:linear-gradient(180deg,#228B22,#32CD32); }
.slide-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.35); z-index:1; }
.slide-content { position:relative; z-index:2; padding:24px 32px; flex:1; }
.slide-badge {
  background:rgba(255,255,255,0.9); color:#FF4500;
  font-family:'Fredoka One',cursive; font-size:11px; font-weight:400;
  padding:3px 12px; border-radius:12px; display:inline-block; margin-bottom:8px;
}
.slide-title-area { font-family:'Fredoka One',cursive; }
.slide-line1 { color:#fff; font-size:13px; text-shadow:0 2px 4px rgba(0,0,0,.3); }
.slide-line2 { color:var(--secondary); font-size:clamp(22px,4vw,38px); text-shadow:0 3px 8px rgba(0,0,0,.3); line-height:1; }
.slide-line3 { color:#fff; font-size:13px; text-shadow:0 2px 4px rgba(0,0,0,.3); }
.slide-chars { position:absolute; right:24px; bottom:0; z-index:2; font-size:clamp(50px,8vw,90px); filter:drop-shadow(-4px 0 8px rgba(0,0,0,.2)); }
.slide-deco  { position:absolute; top:12px; right:130px; font-size:16px; animation:twinkle 2s infinite; z-index:2; }
@keyframes twinkle { 0%,100%{opacity:1} 50%{opacity:0.3} }
.slider-dots {
  position:absolute; bottom:12px; left:50%; transform:translateX(-50%);
  display:flex; gap:6px; z-index:10;
}
.s-dot { width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.45); border:2px solid rgba(255,255,255,.7); cursor:pointer; padding:0; transition:all .3s; }
.s-dot.active { background:#fff; width:22px; border-radius:4px; }
.slider-arrow {
  position:absolute; top:50%; transform:translateY(-50%); z-index:10;
  background:rgba(255,255,255,0.85); border:none; width:36px; height:36px;
  border-radius:50%; font-size:18px; cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-sm); transition:all .2s;
}
.slider-arrow:hover { transform:translateY(-50%) scale(1.1); background:#fff; }
.slider-prev { left:-14px; }
.slider-next { right:-14px; }
.slide-progress { position:absolute; bottom:0; left:0; right:0; height:4px; background:rgba(0,0,0,.2); z-index:3; }
.slide-progress-bar { height:100%; width:33%; background:var(--secondary); border-radius:2px; animation:progress-anim 4s linear infinite; }
@keyframes progress-anim { from{width:0%} to{width:100%} }

/* =============================================
   TRENDING STORIES
   ============================================= */
.trending-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap:14px;
}
.story-card {
  border-radius:var(--border-r-md); overflow:hidden;
  box-shadow:var(--shadow-sm); cursor:pointer;
  transition: transform .22s, box-shadow .22s;
  background:#fff;
}
.story-card:hover { transform:translateY(-6px); box-shadow:var(--shadow-md); }
.story-thumb {
  height:100px; display:flex; align-items:center; justify-content:center;
  font-size:44px; position:relative;
}
.story-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.story-badge {
  position:absolute; top:6px; left:6px;
  background:rgba(0,0,0,0.55); color:#fff;
  font-size:9px; font-weight:700; padding:2px 8px; border-radius:8px;
}
.story-info { padding:8px 10px; background:#fff; }
.story-name { font-weight:800; font-size:12px; color:var(--text-dark); margin-bottom:2px; }
.story-dur  { font-size:11px; color:var(--text-light); }
.story-play { position:absolute; bottom:6px; right:6px; background:rgba(255,255,255,0.9); width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; box-shadow:var(--shadow-sm); }
.grad-1 { background:linear-gradient(135deg,#228B22,#90EE90); }
.grad-2 { background:linear-gradient(135deg,#FF69B4,#DA70D6); }
.grad-3 { background:linear-gradient(135deg,#9B59B6,#C39BD3); }
.grad-4 { background:linear-gradient(135deg,#FF8C00,#FFD700); }
.grad-5 { background:linear-gradient(135deg,#4169E1,#87CEEB); }
.grad-6 { background:linear-gradient(135deg,#FF6B6B,#FF8E53); }

/* =============================================
   LEARN & GROW
   ============================================= */
.learn-section {
  background: linear-gradient(135deg,#E8F5E9,#F0F8E8);
  border-radius: var(--border-r-lg);
  padding: 20px;
  border: 2px solid #A5D6A7;
  margin: 0 0 24px;
}
.learn-section .learn-title { font-family:'Fredoka One',cursive; font-size:20px; color:#2E7D32; margin-bottom:4px; }
.learn-section .learn-sub   { font-size:13px; color:#558B2F; margin-bottom:14px; }
.moral-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap:10px;
}
.moral-card {
  border-radius:14px; overflow:hidden; cursor:pointer;
  transition: transform .2s; box-shadow:var(--shadow-sm);
}
.moral-card:hover { transform:scale(1.05); }
.moral-thumb { height:70px; display:flex; align-items:center; justify-content:center; font-size:32px; }
.moral-label { background:#fff; padding:6px 8px; font-size:12px; font-weight:800; color:#2E7D32; text-align:center; }

/* =============================================
   PARENTS ZONE BANNER
   ============================================= */
.parents-banner {
  background: linear-gradient(135deg,#9B59B6,#8E44AD);
  border-radius: var(--border-r-lg);
  padding: 24px 30px;
  display:flex; align-items:center; gap:24px;
  color:#fff; margin:0 0 24px; position:relative; overflow:hidden;
}
.parents-banner::after { content:'🌙'; position:absolute; right:30px; font-size:80px; opacity:.15; }
.parents-banner h3 { font-family:'Fredoka One',cursive; font-size:22px; color:#fff; margin-bottom:6px; }
.parents-banner p  { opacity:.88; font-size:14px; margin-bottom:16px; }

/* =============================================
   SEARCH BAR SECTION
   ============================================= */
.search-section {
  background: linear-gradient(135deg, var(--primary), #FF8E53);
  padding: 28px 20px; text-align:center;
}
.search-section h3 { color:#fff; font-family:'Fredoka One',cursive; font-size:22px; margin-bottom:14px; }
.search-bar-wrap {
  display:flex; max-width:540px; margin:0 auto;
  background:#fff; border-radius:30px; overflow:hidden;
  box-shadow:0 4px 16px rgba(0,0,0,.15);
}
.search-bar-wrap input {
  flex:1; border:none; padding:14px 20px; font-size:15px;
  font-family:'Nunito',sans-serif; outline:none;
}
.search-bar-wrap button {
  background:var(--secondary); border:none; padding:14px 22px;
  font-weight:800; font-size:15px; cursor:pointer;
  font-family:'Fredoka One',cursive; color:#8B4500;
  transition:background .2s;
}
.search-bar-wrap button:hover { background:#FFC107; }

/* =============================================
   FOOTER
   ============================================= */
#site-footer { background:#222; color:#aaa; }
.footer-top {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:28px; padding:44px 20px; max-width:1200px; margin:0 auto;
}
.footer-widget h4 { font-family:'Fredoka One',cursive; color:var(--secondary); font-size:18px; margin-bottom:12px; }
.footer-widget p, .footer-widget li { font-size:13px; color:#aaa; margin-bottom:7px; }
.footer-widget a { color:#aaa; transition:color .2s; }
.footer-widget a:hover { color:var(--primary); }
.footer-bottom {
  background:#111; text-align:center; padding:14px;
  font-size:12px; color:#555; border-top:1px solid #333;
  display:flex; align-items:center; justify-content:center; gap:20px; flex-wrap:wrap;
}
.footer-bottom a { color:#666; }
.kid-safe-badge { background:#4CAF50; color:#fff; padding:3px 12px; border-radius:12px; font-size:11px; font-weight:700; }
.footer-social { display:flex; gap:10px; font-size:20px; }

/* =============================================
   SIDEBAR & WIDGETS
   ============================================= */
.widget { background:#fff; border-radius:var(--border-r-md); padding:18px; margin-bottom:20px; box-shadow:var(--shadow-sm); }
.widget-title { font-family:'Fredoka One',cursive; font-size:18px; color:var(--primary); border-bottom:3px solid var(--secondary); padding-bottom:8px; margin-bottom:12px; }

/* =============================================
   BADGE
   ============================================= */
.badge-new { display:inline-block; background:var(--primary); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px; margin-left:6px; vertical-align:middle; }

/* =============================================
   MOBILE NAV
   ============================================= */
@media (max-width:768px) {
  .menu-toggle { display:block; }
  #primary-menu {
    display:none; position:absolute; top:72px; left:0; right:0;
    background:linear-gradient(135deg,#87CEEB,#B8E4FF);
    flex-direction:column; padding:12px 0; z-index:999;
    box-shadow:0 8px 24px rgba(0,0,0,.12);
  }
  #primary-menu.is-open { display:flex; }
  #primary-menu li a { display:block; text-align:center; padding:12px 20px; font-size:16px; color:var(--text-dark); font-weight:700; }
  .header-search { display:none; }
  .hero-chars { font-size:clamp(40px,10vw,70px); }
  .slide-content { padding:18px 20px; }
  .parents-banner { flex-direction:column; text-align:center; }
  .parents-banner::after { display:none; }
  .trending-grid { grid-template-columns:repeat(2,1fr); }
  .moral-grid    { grid-template-columns:repeat(2,1fr); }
  .footer-bottom { flex-direction:column; gap:10px; }
}
@media (max-width:480px) {
  .cat-bar { gap:5px; padding:8px 12px; }
  .cat-pill { padding:5px 12px; font-size:12px; }
  .slide-line2 { font-size:22px; }
  .hero-chars { display:none; }
}
