export interface BlogSection {
  heading?: string;
  paragraphs?: string[];
  list?: { label?: string; text: string }[];
  callout?: { emoji: string; text: string };
  table?: { headers: string[]; rows: string[][] };
}

export interface BlogPost {
  slug: string;
  title: string;
  excerpt: string;
  date: string;
  author: string;
  category: string;
  categoryColor: string;
  readTime: string;
  emoji: string;
  sections: BlogSection[];
}

export const POSTS: BlogPost[] = [
  {
    slug: "baby-feed-cycle-by-age",
    title: "Baby Feed Cycle by Age: A Complete Guide for Indian Parents",
    excerpt:
      "From colostrum in the first hour to family meals at twelve months — a stage-by-stage breakdown of what, when, and how much to feed your baby in the first year.",
    date: "2026-05-15",
    author: "Tia Team",
    category: "Feeding",
    categoryColor: "bg-amber-100 text-amber-700",
    readTime: "7 min read",
    emoji: "🍼",
    sections: [
      {
        paragraphs: [
          "Feeding a newborn is one of the most frequent tasks you'll perform as a new parent — and one of the most confusing. Every baby is different, and advice can vary wildly between your paediatrician, your mother-in-law, and the internet. This guide cuts through the noise with a clear, age-by-age breakdown based on IAP (Indian Academy of Pediatrics) recommendations.",
        ],
      },
      {
        heading: "0–4 Weeks: Demand Feeding Around the Clock",
        paragraphs: [
          "Newborns have stomachs roughly the size of a marble. They can hold only a few millilitres at a time, which is exactly why they feed so frequently — 8 to 12 times in 24 hours is completely normal.",
          "Breast milk is the gold standard. The IAP strongly recommends exclusive breastfeeding for the first six months. In the first few days, your body produces colostrum — a thick, yellowish fluid packed with antibodies. It's low in volume but high in everything your baby needs right now.",
        ],
        callout: {
          emoji: "📌",
          text: "Tip: Wake your baby to feed if more than 4 hours have passed in the first two weeks. After that, feed on demand.",
        },
        list: [
          { label: "Frequency", text: "Every 2–3 hours (8–12 feeds/day)" },
          { label: "Duration", text: "10–20 minutes per breast" },
          { label: "Signs of hunger", text: "Rooting, sucking fist, turning head side-to-side" },
          { label: "Signs of fullness", text: "Releasing the nipple, relaxed hands, sleepy" },
        ],
      },
      {
        heading: "1–3 Months: Settling into a Rhythm",
        paragraphs: [
          "By six weeks, most babies start stretching their feeds slightly — you might see 3–4 hour gaps during the day. Night feeds are still very much on the table; expecting a full night's sleep at this age is unrealistic.",
          "If you're formula feeding, your baby will typically take 90–120 ml per feed, about 6–8 times a day. Always follow the formula preparation instructions exactly — over- or under-diluting causes real harm.",
        ],
        list: [
          { label: "Breast milk", text: "On demand, roughly every 3 hours" },
          { label: "Formula", text: "90–120 ml, 6–8 times/day" },
          { label: "Night feeds", text: "Still expected — 1 to 3 per night is normal" },
        ],
      },
      {
        heading: "4–6 Months: The Solid-Food Window Opens",
        paragraphs: [
          "The IAP recommends starting complementary foods at exactly 6 months — not earlier. Some babies show interest slightly before, but introducing solids too early increases the risk of allergies, digestive issues, and a reduction in breast milk supply.",
          "Signs your baby is ready: can sit with support, shows interest in your food, has lost the tongue-thrust reflex that pushes food back out.",
        ],
        callout: {
          emoji: "⚠️",
          text: "Do NOT start solids before 6 months. Contrary to popular belief in India, rice water, dal water, or diluted cow's milk are not appropriate first foods and can cause nutritional deficiencies.",
        },
        list: [
          { label: "Milk feeds", text: "Breast milk / formula remains primary nutrition" },
          { label: "Start solids at 6m", text: "Begin with single-ingredient purées — rice, moong dal, banana, sweet potato" },
          { label: "Frequency", text: "1 meal/day alongside regular milk feeds" },
          { label: "Texture", text: "Smooth purée, no lumps, no salt, no sugar, no honey" },
        ],
      },
      {
        heading: "6–9 Months: Building Food Variety",
        paragraphs: [
          "Now the real exploration begins. Introduce one new food every 3–4 days so you can spot allergic reactions. Offer vegetables before fruit — early exposure to bitter tastes builds acceptance for a wider range of foods.",
          "Move from purées to mashed textures. Khichdi, suji halwa (without sugar), soft-cooked vegetables, and curd are excellent first Indian foods. Avoid salt, sugar, honey, and whole cow's milk as a drink (though it's fine in cooking).",
        ],
        list: [
          { label: "Meals", text: "2–3 times/day + breast milk / formula" },
          { label: "Portion", text: "2–4 tablespoons per meal, increasing gradually" },
          { label: "Texture", text: "Mashed, soft lumps" },
          { label: "Good first foods", text: "Khichdi, ragi porridge, soft dal, banana, curd" },
        ],
      },
      {
        heading: "9–12 Months: Approaching Family Food",
        paragraphs: [
          "By nine months, many babies can manage soft finger foods and are curious about what's on your plate. Encourage self-feeding — yes, it's messy, but it builds motor skills and a healthy relationship with food.",
          "Breast milk or formula continues alongside 3 meals and 1–2 snacks. The goal is not to replace milk yet, but to steadily increase the variety and texture of solids. By twelve months, your baby should be eating a modified version of most family foods — just without the salt, spice, and whole nuts.",
        ],
        list: [
          { label: "Meals", text: "3 meals + 1–2 snacks" },
          { label: "Milk", text: "Breast milk or follow-on formula, 3–4 times/day" },
          { label: "Finger foods", text: "Soft chapati pieces, banana chunks, steamed carrot, paneer cubes" },
          { label: "Avoid", text: "Honey, whole nuts, added salt, added sugar, cow's milk as a drink" },
        ],
      },
      {
        heading: "How Tia Helps You Track All of This",
        paragraphs: [
          "Logging every feed manually in a notebook is exhausting. Tia's Quick Log lets you record a feed in under three seconds — tap the type, confirm the time, done. Over days and weeks, Tia shows you patterns: when hunger peaks, how night feeding is trending, whether solid intake is growing.",
          "And if you ever have a question — \"Is three feeds at night normal at 8 months?\" or \"My baby rejected every vegetable I tried, what do I do?\" — Ask Tia is there. It answers parenting and feeding questions thoughtfully, and will always tell you when something needs a real paediatrician instead of an app.",
        ],
        callout: {
          emoji: "🌸",
          text: "Join Tia's early access — free during this period — and start building your baby's complete feeding history today.",
        },
      },
    ],
  },
  {
    slug: "baby-health-warning-signs-first-year",
    title: "Your Baby's Health in Year One: Signs That Need Immediate Attention",
    excerpt:
      "What's normal newborn behaviour, what's a watch-and-wait situation, and what needs a call to the paediatrician right now — a parent's guide to the first twelve months.",
    date: "2026-05-08",
    author: "Tia Team",
    category: "Health",
    categoryColor: "bg-rose-100 text-rose-700",
    readTime: "8 min read",
    emoji: "🩺",
    sections: [
      {
        paragraphs: [
          "Nothing creates anxiety quite like a sick infant — especially in the first weeks when everything feels fragile and uncertain. This guide is not a replacement for your paediatrician. It's a map: the kind of knowledge that helps you stay calm, act quickly when it counts, and avoid unnecessary panic the rest of the time.",
          "The IAP recommends a schedule of well-baby visits in the first year. Make sure you attend all of them — they're not just for vaccinations. Your paediatrician uses these visits to track growth, development, and to answer the questions that pile up between appointments.",
        ],
      },
      {
        heading: "Fever: The Most Common Alarm",
        paragraphs: [
          "A fever is not a disease — it's a sign that your baby's immune system is working. But the response to fever depends entirely on how old your baby is.",
        ],
        table: {
          headers: ["Age", "Temperature Threshold", "What to Do"],
          rows: [
            ["Under 3 months", "38°C (100.4°F) or above", "Emergency — call your doctor immediately or go to hospital"],
            ["3–6 months", "38.5°C (101.3°F) or above", "Call your paediatrician same day"],
            ["6–12 months", "39°C (102.2°F) or above, or lasting 2+ days", "Call your paediatrician"],
          ],
        },
        callout: {
          emoji: "⚠️",
          text: "In newborns under 3 months, never wait and watch with a fever. A temperature of 38°C or above is a medical emergency regardless of how well your baby looks.",
        },
      },
      {
        heading: "Dehydration: Harder to Spot Than You Think",
        paragraphs: [
          "Babies lose fluids quickly during illness. Dehydration can turn serious within hours, especially in summer or if your baby has diarrhoea and vomiting simultaneously.",
        ],
        list: [
          { label: "Early signs", text: "Fewer wet nappies (fewer than 4 in 24 hours), dry mouth, no tears when crying" },
          { label: "Moderate signs", text: "Sunken fontanelle (soft spot on head), sunken eyes, skin that tents when pinched" },
          { label: "Severe signs", text: "No urine for 8+ hours, very sunken fontanelle, extreme lethargy — go to hospital" },
        ],
      },
      {
        heading: "Breathing: When to Act Immediately",
        paragraphs: [
          "Occasional sneezes, snuffles, and irregular breathing during sleep are normal in newborns. What's not normal:",
        ],
        list: [
          { text: "Nostrils flaring with every breath" },
          { text: "Skin pulling in between ribs or below the chest (retractions)" },
          { text: "Breathing rate above 60 breaths per minute (for infants under 2 months)" },
          { text: "A grunt with every breath" },
          { text: "Blue tinge around the lips or fingernails (cyanosis) — call emergency services immediately" },
        ],
      },
      {
        heading: "Jaundice in Newborns",
        paragraphs: [
          "A yellowish tint to the skin and whites of the eyes is jaundice — caused by bilirubin accumulating in the blood. Mild jaundice is extremely common (over 60% of newborns) and usually resolves on its own within 2 weeks.",
          "What needs attention: jaundice appearing in the first 24 hours of life, jaundice lasting more than 3 weeks, or a baby who is very yellow, difficult to wake, or feeding poorly alongside jaundice.",
        ],
        callout: {
          emoji: "☀️",
          text: "Traditional sunbathing advice for jaundice is outdated. Modern guidance from the IAP recommends phototherapy in a clinical setting for significant jaundice — home sunlight is not sufficient and UV exposure carries its own risks.",
        },
      },
      {
        heading: "Growth: The Bigger Picture",
        paragraphs: [
          "Babies should roughly double their birth weight by 5 months and triple it by 12 months. A single weight measurement tells you little — it's the trend that matters. Tia's growth chart plots your baby's weight, height, and head circumference against the IAP reference curves, flagging percentiles that warrant a conversation with your doctor.",
          "Slow weight gain can have many causes — a latch problem, illness, or occasionally something that needs investigation. Don't try to self-diagnose from a chart; bring the data to your paediatrician.",
        ],
      },
      {
        heading: "The IAP Vaccination Schedule",
        paragraphs: [
          "Vaccines are one of the most powerful tools we have for protecting your baby in the first year. The IAP schedule includes vaccines at birth, 6 weeks, 10 weeks, 14 weeks, 6 months, 9 months, and 12 months — missing or delaying them leaves a real gap in protection.",
          "Tia tracks the complete IAP schedule and sends you alerts on Telegram before each due date. You can mark vaccines as given and keep a permanent record that travels with your family.",
        ],
        callout: {
          emoji: "💉",
          text: "Never skip or delay vaccines based on mild illness or a mild fever. The IAP guidance: vaccination is safe with mild illness. Significant fever or acute illness is the only reason to postpone.",
        },
      },
      {
        heading: "A Rule of Thumb for New Parents",
        paragraphs: [
          "When in doubt, call your paediatrician. There is no such thing as a silly question in the first year. A good paediatrician would rather you ring once too often than miss something important.",
          "Tia's Ask Tia feature is designed to answer parenting and logistics questions — sleep patterns, feeding concerns, developmental milestones. For any symptom question — fever, rash, breathing, pain — Ask Tia will always direct you to your paediatrician rather than try to diagnose. We built it that way on purpose.",
        ],
      },
    ],
  },
  {
    slug: "getting-started-with-tia",
    title: "Getting Started with Tia: Your First Week",
    excerpt:
      "A friendly walkthrough for new families — from creating your account to logging your first feed, setting up IAP vaccination alerts, and inviting your partner.",
    date: "2026-04-28",
    author: "Tia Team",
    category: "App Guide",
    categoryColor: "bg-violet-100 text-violet-700",
    readTime: "5 min read",
    emoji: "🌸",
    sections: [
      {
        paragraphs: [
          "Tia is designed to get out of your way. You shouldn't be spending more than a few seconds on a log when you have a baby in your arms. This guide takes you through the key things to set up in your first week — after that, the app is mostly just quick taps.",
        ],
      },
      {
        heading: "Step 1: Creating Your Family",
        paragraphs: [
          "Sign in with Google — that's it, no password to create or remember. On your first login you'll be prompted to set up your family: give it a name (most families use their last name or a nickname), and add your baby's name, date of birth, and a photo if you like.",
          "Tia supports multiple children, so if you have more than one baby, you can add them all and switch between their records instantly.",
        ],
        callout: {
          emoji: "🔒",
          text: "Your family data is stored privately. We use row-level security — your records are invisible to other families and to us. We don't sell your data and we don't run ads.",
        },
      },
      {
        heading: "Step 2: Logging Your First Entry",
        paragraphs: [
          "The Quick Log button is the first thing you see on the home screen. Tap it, pick the activity type (Feed · Sleep · Diaper · Medicine · Note), fill in the details, and tap Save. That's a log.",
          "For feeds, you can record breast milk (left, right, or both), formula (amount in ml), or solids. For sleep, tap Start when your baby goes down and End when they wake — or log it after the fact. Tia calculates the duration automatically.",
        ],
        list: [
          { label: "Feed", text: "Breastfeed (side + duration) or formula (amount ml) or solids" },
          { label: "Sleep", text: "Live timer or manual start/end time" },
          { label: "Diaper", text: "Wet, dirty, or both — with optional notes" },
          { label: "Medicine", text: "Name, dose, time — and Tia tracks the next due window" },
          { label: "Note", text: "Free-form text for anything that doesn't fit a category" },
        ],
      },
      {
        heading: "Step 3: Setting Up Vaccination Alerts",
        paragraphs: [
          "Go to Medical → Vaccinations. Tia pre-loads the complete IAP vaccination schedule based on your baby's date of birth. You'll see every upcoming vaccine with its due date and a description.",
          "To get Telegram reminders before each due date, tap 'Set up Telegram alerts' and follow the two-step flow: start a chat with our Telegram bot and send the code it gives you. That's it — you'll get a message before each upcoming vaccine so you can book the appointment in time.",
        ],
        callout: {
          emoji: "📲",
          text: "Telegram alerts are completely optional. You can also just check the Vaccinations page manually — it shows upcoming, due, and completed vaccines in a clear timeline.",
        },
      },
      {
        heading: "Step 4: Inviting Your Partner or a Caregiver",
        paragraphs: [
          "Go to Settings → Family Members → Invite. Enter the email address of the person you're inviting and choose their role:",
        ],
        list: [
          { label: "Admin", text: "Full access — can add/edit/delete all records and manage family settings" },
          { label: "Caregiver", text: "Can log and view all records, but can't change family settings" },
          { label: "Viewer", text: "Read-only — great for grandparents who want to follow along" },
        ],
      },
      {
        paragraphs: [
          "They'll receive an email with a link. Once they sign in, they're added to your family and can see all your shared records instantly — on their own phone, their own login, no passwords to share.",
        ],
      },
      {
        heading: "Step 5: Ask Tia — Your Parenting Companion",
        paragraphs: [
          "The AI chat (tap the ✨ icon in the bottom nav) is trained specifically for parenting questions — sleep schedules, feeding concerns, developmental milestones, age-appropriate activities. It knows your baby's age and recent logs, so you can ask things like 'Is she sleeping enough for her age?' and get a contextual answer.",
          "What Ask Tia won't do: diagnose symptoms, recommend medications, or tell you whether a fever is serious. For any health concern, it will always direct you to your paediatrician. We designed it this way deliberately — an app that plays doctor is dangerous. We'd rather be honest about our limits.",
        ],
      },
      {
        heading: "Step 6: Building Memories",
        paragraphs: [
          "The Memories section is where Tia becomes something more than a tracker. Upload photos and videos, write captions, and they're organised automatically by your baby's age. A 3-month photo, a first-smile video, a first-steps moment — all in one place, privately stored, and yours to export whenever you want.",
          "This is the archive your child will one day be able to look back through. Take two minutes every few days to add something. You'll be glad you did.",
        ],
      },
    ],
  },
  {
    slug: "telegram-vaccination-alerts-feature",
    title: "Introducing Telegram Vaccination Alerts: Never Miss a Jab",
    excerpt:
      "We've connected Tia's IAP vaccination schedule to Telegram so you get a reminder before every due date — even when you haven't opened the app in weeks.",
    date: "2026-04-15",
    author: "Tia Team",
    category: "Feature",
    categoryColor: "bg-sky-100 text-sky-700",
    readTime: "4 min read",
    emoji: "💉",
    sections: [
      {
        paragraphs: [
          "Missed vaccinations are one of the most common and preventable gaps in infant health care. It's not neglect — it's the chaos of early parenthood. Between feeds, sleep deprivation, and everything else, a vaccine due date in three weeks feels like a lifetime away. Until suddenly it's overdue.",
          "We built Telegram alerts to solve this problem simply and reliably.",
        ],
      },
      {
        heading: "Why Telegram?",
        paragraphs: [
          "We looked at several notification options: email, push notifications, SMS. Each had real problems for this use case.",
          "Email often gets buried. Push notifications only work if you have the app installed and haven't muted it. SMS costs money and has formatting limitations.",
          "Telegram messages arrive reliably, render beautifully on every phone, and — critically — don't require an active app install to receive. If you've set up the connection, you'll get the reminder even if you've uninstalled Tia, switched phones, or just haven't opened the app in a month. That reliability is the whole point.",
        ],
        callout: {
          emoji: "🔒",
          text: "We only use your Telegram connection to send vaccination reminders. No marketing, no promotions, no third-party sharing. You can disconnect at any time from Settings.",
        },
      },
      {
        heading: "What the IAP Schedule Covers",
        paragraphs: [
          "The Indian Academy of Pediatrics (IAP) releases an updated vaccination schedule each year. Tia's current schedule covers all vaccines from birth through 12 months, with plans to extend to 5 years.",
        ],
        list: [
          { label: "Birth", text: "BCG, Hepatitis B (1st dose), OPV-0" },
          { label: "6 weeks", text: "DTwP/DTaP, IPV, Hepatitis B (2nd), Hib, Rotavirus, PCV (1st)" },
          { label: "10 weeks", text: "DTwP/DTaP, IPV, Hib, Rotavirus, PCV (2nd)" },
          { label: "14 weeks", text: "DTwP/DTaP, IPV, Hib, Rotavirus, PCV (3rd)" },
          { label: "6 months", text: "Hepatitis B (3rd), OPV" },
          { label: "9 months", text: "MMR (1st), OPV" },
          { label: "12 months", text: "Hepatitis A (1st), PCV booster, Varicella (1st)" },
        ],
      },
      {
        paragraphs: [
          "Tia calculates exact due dates based on your baby's date of birth and sends you a Telegram reminder 7 days before each vaccine is due. You can mark vaccines as given directly from the app, and the record is permanently saved to your family's history.",
        ],
      },
      {
        heading: "How to Set It Up",
        paragraphs: [
          "It takes about two minutes:",
        ],
        list: [
          { label: "1", text: "Open Tia → Medical → Vaccinations" },
          { label: "2", text: "Tap 'Set up Telegram alerts'" },
          { label: "3", text: "Open Telegram and start a chat with @TiaBabyBot" },
          { label: "4", text: "Send the 6-digit code shown in the app" },
          { label: "5", text: "Done — you'll get a confirmation message immediately" },
        ],
        callout: {
          emoji: "✅",
          text: "Already missed a vaccine? No problem. Tia shows overdue vaccines clearly and lets you log catch-up doses with the actual date administered.",
        },
      },
      {
        heading: "What's Coming Next",
        paragraphs: [
          "Telegram alerts are just the beginning. We're working on:",
        ],
        list: [
          { text: "Alerts for medicines — automatic reminders when the next dose window opens" },
          { text: "Growth check reminders — a nudge every 4 weeks to log a new measurement" },
          { text: "Monthly milestone prompts — age-appropriate development questions to log" },
          { text: "WhatsApp as an alternative notification channel" },
        ],
      },
      {
        paragraphs: [
          "Early access families shape what we build next. If there's a reminder you'd like that isn't listed here, use the feedback button in Settings — we read every message.",
        ],
      },
    ],
  },
];

export function getPost(slug: string): BlogPost | undefined {
  return POSTS.find((p) => p.slug === slug);
}

export function formatDate(dateStr: string): string {
  return new Date(dateStr).toLocaleDateString("en-IN", {
    year: "numeric",
    month: "long",
    day: "numeric",
  });
}
