/* ToonMela - Kahaniyon Ka Mela | v2.0 */

:root {
    --bg: #FAF6F0;
    --bg-white: #FFFFFF;
    --bg-cream: #FFF9F0;
    --bg-highlight: #FDF3E7;
    --text: #2C2C2C;
    --text-light: #555;
    --text-muted: #888;
    --heading: #1A1A2E;
    --accent: #B7410E;
    --accent-dark: #8B2500;
    --accent-light: #F5E6DC;
    --gold: #D4A373;
    --border: #E8DFD0;
    --border-light: #F0EBE3;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --r: 4px;
    --r-lg: 8px;
    --font-h: 'Playfair Display', Georgia, serif;
    --font-b: 'Lora', Georgia, serif;
    --font-ui: 'Source Sans 3', 'Segoe UI', sans-serif;
    --max-w: 1200px;
    --read-w: 750px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-b); background: var(--bg); color: var(--text); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }
ul { list-style: none; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ---------- HEADER ---------- */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}
.logo {
    font-family: var(--font-h);
    font-size: 28px;
    font-weight: 700;
    color: var(--heading);
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.logo span { color: var(--accent); }
.logo small {
    display: block;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    padding: 8px 14px;
    border-radius: var(--r);
    transition: all 0.2s;
}
.nav a:hover, .nav a.active { color: var(--accent); background: var(--accent-light); }
.nav-search {
    background: none; border: none; cursor: pointer;
    padding: 8px 10px; color: var(--text-light); font-size: 18px;
}
.mobile-toggle {
    display: none; background: none; border: none; cursor: pointer;
    padding: 8px; flex-direction: column; gap: 5px;
}
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--text); transition: all 0.3s; }

/* ---------- SEARCH OVERLAY ---------- */
.search-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); z-index: 200;
    align-items: flex-start; justify-content: center; padding-top: 120px;
}
.search-overlay.active { display: flex; }
.search-box {
    background: var(--bg-white); padding: 32px; border-radius: var(--r-lg);
    width: 90%; max-width: 560px; box-shadow: var(--shadow-lg);
}
.search-box form { display: flex; gap: 10px; }
.search-box input {
    flex: 1; font-family: var(--font-b); font-size: 17px;
    padding: 12px 18px; border: 2px solid var(--border);
    border-radius: var(--r); outline: none; transition: border 0.2s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box button {
    font-family: var(--font-ui); font-size: 15px; font-weight: 600;
    padding: 12px 24px; background: var(--accent); color: #fff;
    border: none; border-radius: var(--r); cursor: pointer; transition: background 0.2s;
}
.search-box button:hover { background: var(--accent-dark); }

/* ---------- HERO ---------- */
.hero {
    background: var(--bg-white); border-bottom: 1px solid var(--border);
    padding: 55px 0 45px; text-align: center;
}
.hero h1 {
    font-family: var(--font-h); font-size: 44px; font-weight: 700;
    color: var(--heading); margin-bottom: 10px; line-height: 1.15;
}
.hero p {
    font-size: 18px; color: var(--text-light);
    max-width: 580px; margin: 0 auto 32px; line-height: 1.6;
}
.age-selector { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.age-btn {
    font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    padding: 11px 22px; border: 2px solid var(--border); border-radius: 50px;
    background: var(--bg-white); color: var(--text); cursor: pointer;
    transition: all 0.25s; text-transform: uppercase; letter-spacing: 0.5px;
    text-decoration: none; display: inline-block;
}
.age-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.age-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.age-btn .age-range {
    display: block; font-size: 10px; font-weight: 400; opacity: 0.8; margin-top: 2px;
}

/* ---------- FEATURED STORY ---------- */
.featured { padding: 45px 0; }
.featured-card {
    display: grid; grid-template-columns: 1.2fr 1fr; gap: 0;
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md);
}
.featured-img { overflow: hidden; min-height: 340px; }
.featured-img img { width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: 36px 36px 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.badge {
    display: inline-block; font-family: var(--font-ui); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent);
    background: var(--accent-light); padding: 4px 12px; border-radius: 50px;
    margin-bottom: 14px; width: fit-content;
}
.featured-body h2 {
    font-family: var(--font-h); font-size: 28px; font-weight: 700;
    color: var(--heading); line-height: 1.3; margin-bottom: 14px;
}
.featured-body h2 a { color: inherit; }
.featured-body h2 a:hover { color: var(--accent); }
.featured-excerpt { font-size: 15px; color: var(--text-light); line-height: 1.7; margin-bottom: 20px; }
.meta {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    font-family: var(--font-ui); font-size: 13px; color: var(--text-muted);
}
.meta span { display: flex; align-items: center; gap: 4px; }

/* ---------- SECTION ---------- */
.section { padding: 45px 0; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px; border-bottom: 2px solid var(--border); padding-bottom: 14px;
}
.section-title { font-family: var(--font-h); font-size: 24px; font-weight: 700; color: var(--heading); }
.section-link {
    font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px;
}

/* ---------- STORY CARDS GRID ---------- */
.stories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-img { position: relative; overflow: hidden; aspect-ratio: 16/10; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card:hover .card-img img { transform: scale(1.03); }
.card-age {
    position: absolute; top: 10px; left: 10px;
    font-family: var(--font-ui); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 50px;
}
.card-body { padding: 18px; }
.card-cat {
    font-family: var(--font-ui); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; color: var(--accent);
    margin-bottom: 6px; display: block;
}
.card-body h3 { font-family: var(--font-h); font-size: 19px; font-weight: 600; color: var(--heading); line-height: 1.35; margin-bottom: 8px; }
.card-body h3 a { color: inherit; }
.card-body h3 a:hover { color: var(--accent); }
.card-excerpt { font-size: 14px; color: var(--text-light); line-height: 1.55; margin-bottom: 14px; }
.card-foot {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-ui); font-size: 12px; color: var(--text-muted);
    padding-top: 10px; border-top: 1px solid var(--border-light);
}

/* ---------- SINGLE STORY ---------- */
.single { padding: 35px 0 70px; }
.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 45px; align-items: start; }
.single-content { max-width: var(--read-w); }
.single-header { margin-bottom: 28px; }
.single-header h1 {
    font-family: var(--font-h); font-size: 36px; font-weight: 700;
    color: var(--heading); line-height: 1.25; margin-bottom: 18px;
}
.single-meta {
    display: flex; gap: 18px; flex-wrap: wrap;
    font-family: var(--font-ui); font-size: 14px; color: var(--text-muted);
    padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.single-meta a { color: var(--accent); }
.single-img { margin-bottom: 28px; border-radius: var(--r-lg); overflow: hidden; }
.single-img img { width: 100%; border-radius: var(--r-lg); }

.story-body { font-family: var(--font-b); font-size: 18px; line-height: 1.85; color: var(--text); }
.story-body p { margin-bottom: 1.4em; }
.story-body h2 { font-family: var(--font-h); font-size: 24px; font-weight: 700; color: var(--heading); margin: 1.8em 0 0.7em; }
.story-body h3 { font-family: var(--font-h); font-size: 20px; font-weight: 600; color: var(--heading); margin: 1.6em 0 0.5em; }
.story-body blockquote {
    border-left: 4px solid var(--accent); padding: 18px 22px; margin: 1.8em 0;
    background: var(--bg-highlight); border-radius: 0 var(--r) var(--r) 0;
    font-style: italic; color: var(--text-light);
}
.story-body strong { color: var(--heading); }
.story-body ul, .story-body ol { margin: 1em 0; padding-left: 1.5em; }
.story-body li { margin-bottom: 0.4em; list-style: disc; }
.story-body img { border-radius: var(--r); margin: 1.8em auto; }

/* Moral Box */
.moral-box {
    background: var(--bg-highlight); border: 2px solid var(--gold);
    border-radius: var(--r-lg); padding: 24px 28px; margin: 36px 0;
}
.moral-box h3 {
    font-family: var(--font-h); font-size: 18px; font-weight: 700;
    color: var(--accent); margin-bottom: 8px;
}
.moral-box p { font-size: 16px; line-height: 1.7; margin: 0; }

/* Share */
.share { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }
.share-title {
    font-family: var(--font-ui); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px;
}
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    padding: 9px 16px; border-radius: 50px; color: #fff;
    transition: opacity 0.2s; border: none; cursor: pointer; text-decoration: none;
}
.share-btn:hover { opacity: 0.85; color: #fff; }
.share-btn.wa { background: #25D366; }
.share-btn.fb { background: #1877F2; }
.share-btn.tw { background: #000; }
.share-btn.cp { background: var(--text-light); }

/* Related */
.related { margin-top: 50px; padding-top: 36px; border-top: 2px solid var(--border); }
.related h2 { font-family: var(--font-h); font-size: 22px; font-weight: 700; color: var(--heading); margin-bottom: 20px; }

/* ---------- SIDEBAR ---------- */
.sidebar { position: sticky; top: 80px; }
.widget {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 22px; margin-bottom: 22px;
}
.widget-title {
    font-family: var(--font-h); font-size: 17px; font-weight: 700;
    color: var(--heading); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--accent);
}
.sb-story { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.sb-story:last-child { border-bottom: none; }
.sb-story-img { width: 72px; height: 54px; border-radius: var(--r); overflow: hidden; flex-shrink: 0; }
.sb-story-img img { width: 100%; height: 100%; object-fit: cover; }
.sb-story-title { font-family: var(--font-h); font-size: 13px; font-weight: 600; color: var(--heading); line-height: 1.4; }
.sb-story-title a { color: inherit; }
.sb-story-title a:hover { color: var(--accent); }
.sb-story-date { font-family: var(--font-ui); font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.age-list li { margin-bottom: 6px; }
.age-list a {
    display: flex; align-items: center; justify-content: space-between;
    font-family: var(--font-ui); font-size: 14px; color: var(--text);
    padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--border-light); transition: all 0.2s;
}
.age-list a:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.age-count { font-size: 11px; background: var(--bg); padding: 2px 8px; border-radius: 50px; color: var(--text-muted); }

/* ---------- BREADCRUMBS ---------- */
.breadcrumbs {
    font-family: var(--font-ui); font-size: 13px; color: var(--text-muted); padding: 14px 0;
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 7px; color: var(--border); }

/* ---------- ARCHIVE / LISTING ---------- */
.archive-head { text-align: center; padding: 45px 0 25px; }
.archive-head h1 { font-family: var(--font-h); font-size: 34px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.archive-head p { font-size: 16px; color: var(--text-light); max-width: 480px; margin: 0 auto; }
.filter-bar { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 16px 0 36px; }
.filter-btn {
    font-family: var(--font-ui); font-size: 13px; font-weight: 600;
    padding: 8px 18px; border: 1px solid var(--border); border-radius: 50px;
    background: var(--bg-white); color: var(--text-light); cursor: pointer; transition: all 0.2s;
    text-decoration: none; display: inline-block;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 45px 0; }
.pagination a, .pagination span {
    font-family: var(--font-ui); font-size: 14px; font-weight: 600;
    padding: 9px 15px; border: 1px solid var(--border); border-radius: var(--r);
    color: var(--text-light); background: var(--bg-white); transition: all 0.2s;
}
.pagination a:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- PAGES ---------- */
.page { padding: 45px 0 70px; }
.page-head { text-align: center; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-family: var(--font-h); font-size: 36px; font-weight: 700; color: var(--heading); margin-bottom: 10px; }
.page-head p { font-size: 16px; color: var(--text-light); max-width: 560px; margin: 0 auto; }
.page-content { max-width: var(--read-w); margin: 0 auto; font-size: 17px; line-height: 1.8; }
.page-content p { margin-bottom: 1.3em; }
.page-content h2 { font-family: var(--font-h); font-size: 26px; font-weight: 700; color: var(--heading); margin: 1.8em 0 0.7em; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; margin: 45px 0; }
.about-text h2 { font-family: var(--font-h); font-size: 26px; font-weight: 700; color: var(--heading); margin-bottom: 14px; }
.about-text p { font-size: 15px; line-height: 1.7; color: var(--text-light); margin-bottom: 14px; }
.about-img img { border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 36px 0; }
.value-card {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 26px; text-align: center;
}
.value-card .icon { font-size: 34px; margin-bottom: 12px; }
.value-card h3 { font-family: var(--font-h); font-size: 17px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.value-card p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; margin: 36px 0; }
.contact-info h2 { font-family: var(--font-h); font-size: 22px; font-weight: 700; color: var(--heading); margin-bottom: 18px; }
.contact-item { margin-bottom: 18px; font-family: var(--font-ui); font-size: 15px; color: var(--text-light); }
.contact-item strong { color: var(--text); display: block; margin-bottom: 3px; }
.contact-form {
    background: var(--bg-white); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 28px;
}
.contact-form h2 { font-family: var(--font-h); font-size: 22px; font-weight: 700; color: var(--heading); margin-bottom: 20px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    font-family: var(--font-ui); font-size: 14px; font-weight: 600;
    color: var(--text); display: block; margin-bottom: 5px;
}
.form-group input, .form-group textarea {
    width: 100%; font-family: var(--font-b); font-size: 15px;
    padding: 11px 14px; border: 1px solid var(--border);
    border-radius: var(--r); background: var(--bg); outline: none; transition: border 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 130px; resize: vertical; }
.btn {
    font-family: var(--font-ui); font-size: 15px; font-weight: 600;
    padding: 11px 28px; background: var(--accent); color: #fff;
    border: none; border-radius: var(--r); cursor: pointer; transition: background 0.2s;
    display: inline-block; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); color: #fff; }

/* ---------- CTA ---------- */
.cta { background: var(--heading); padding: 55px 0; text-align: center; }
.cta h2 { font-family: var(--font-h); font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.cta p { font-family: var(--font-ui); font-size: 15px; color: #bbb; margin-bottom: 24px; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ---------- FOOTER ---------- */
.footer { background: var(--heading); color: #ccc; padding: 55px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.footer-brand .logo { color: #fff; margin-bottom: 14px; display: inline-block; }
.footer-brand .logo span { color: var(--gold); }
.footer-about { font-family: var(--font-ui); font-size: 13px; line-height: 1.7; color: #aaa; margin-bottom: 18px; }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border: 1px solid #444; border-radius: 50%;
    color: #ccc; font-size: 14px; font-family: var(--font-ui); font-weight: 700; transition: all 0.2s;
}
.footer-social a:hover { border-color: var(--gold); color: var(--gold); }
.footer-col h4 {
    font-family: var(--font-ui); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; color: #fff; margin-bottom: 18px;
}
.footer-col a { font-family: var(--font-ui); font-size: 13px; color: #aaa; display: block; margin-bottom: 9px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid #333; margin-top: 36px; padding: 18px 0;
    text-align: center; font-family: var(--font-ui); font-size: 12px; color: #666;
}

/* ---------- 404 ---------- */
.page-404 { text-align: center; padding: 90px 0; }
.page-404 h1 { font-family: var(--font-h); font-size: 80px; font-weight: 700; color: var(--border); margin-bottom: 12px; }
.page-404 h2 { font-family: var(--font-h); font-size: 26px; color: var(--heading); margin-bottom: 14px; }
.page-404 p { font-size: 15px; color: var(--text-light); margin-bottom: 28px; }

/* ---------- NO STORIES ---------- */
.no-stories { text-align: center; padding: 50px 20px; grid-column: 1/-1; font-size: 16px; color: var(--text-light); }

/* ---------- LOADING ---------- */
.loading { text-align: center; padding: 36px; grid-column: 1/-1; }
.spinner {
    display: inline-block; width: 32px; height: 32px;
    border: 3px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .stories-grid { grid-template-columns: repeat(2, 1fr); }
    .single-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .featured-card { grid-template-columns: 1fr; }
    .featured-img { min-height: 240px; }
    .featured-body { padding: 22px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .values-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .nav { display: none; }
    .nav.active {
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; right: 0; background: var(--bg-white);
        border-bottom: 1px solid var(--border); padding: 14px;
        box-shadow: var(--shadow-md);
    }
    .mobile-toggle { display: flex; }
    .hero h1 { font-size: 30px; }
    .hero p { font-size: 15px; }
    .hero { padding: 36px 0 32px; }
    .stories-grid { grid-template-columns: 1fr; gap: 18px; }
    .section-head { flex-direction: column; gap: 8px; text-align: center; }
    .single-header h1 { font-size: 26px; }
    .story-body { font-size: 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .age-selector { gap: 6px; }
    .age-btn { padding: 9px 14px; font-size: 11px; }
    .container { padding: 0 16px; }
    .archive-head h1, .page-head h1 { font-size: 26px; }
    .values-grid { grid-template-columns: 1fr; }
    .share-btns { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 24px; }
    .logo { font-size: 22px; }
    .page-404 h1 { font-size: 60px; }
}
