// data.jsx — recipe data + homepage content + AI answer canned response

const RECIPE = {
  slug: 'brown-butter-chocolate-chip-cookies',
  title: 'Brown Butter Chocolate Chip Cookies',
  // localized titles for the hero (just demo a few; fall back to en)
  titleI18n: {
    en: 'Brown Butter Chocolate Chip Cookies',
    id: 'Cookies Cokelat Mentega Bakar',
    ja: 'ブラウンバター・チョコチップクッキー',
    ko: '브라운 버터 초콜릿 칩 쿠키',
    it: 'Cookies al burro nocciola e cioccolato',
    fr: 'Cookies au beurre noisette et chocolat',
    de: 'Brown-Butter-Schoko-Cookies',
    es: 'Cookies de mantequilla tostada y chocolate',
  },
  summary: 'Deeply caramelized, just-set centers, crackled tops, two-day rested dough. The cookie that ended the search.',
  summaryI18n: {
    id: 'Tengah lembut karamel, permukaan retak, adonan diistirahatkan dua hari. Cookies yang menghentikan pencarianmu.',
    ja: '深く色づいたカラメル、しっとり中心、ひび割れた表面。二日間休ませた究極のクッキー。',
    ko: '깊게 캐러멜라이즈된, 살짝 덜 익은 중심, 갈라진 표면, 이틀 숙성. 검색을 끝낼 쿠키.',
    it: 'Caramellati in profondità, cuore appena cotto, superficie crepata, impasto riposato due giorni.',
    fr: 'Bord caramélisé, cœur fondant, surface craquelée, pâte reposée deux jours. Le cookie ultime.',
    de: 'Tief karamellisiert, weicher Kern, gerissene Oberfläche, zwei Tage geruhter Teig.',
    es: 'Bien caramelizadas, centros tiernos, superficie agrietada, masa reposada dos días.',
  },
  rating: 4.9,
  ratingCount: 2847,
  prep: 25,
  cook: 14,
  total: 49,
  rest: 1440, // 24h
  servings: 18,
  calories: 218,
  difficulty: 'Easy',
  cuisine: 'American',
  course: 'Dessert',
  diet: ['Vegetarian'],
  allergens: ['Gluten', 'Dairy', 'Egg', 'Soy (in chocolate)'],
  author: {
    name: 'Mira Chen',
    role: 'Senior recipe editor',
    credential: 'Trained at ICE NYC · 12 years',
    testNote: 'Recipe tested 14 times across 3 ovens. Final batch photographed unedited.',
    initials: 'MC',
  },
  updated: 'May 18, 2026',
  quickAnswer: {
    headline: 'Brown 1 cup butter, chill 2 hours, fold into a classic chocolate chip dough with both granulated and brown sugar, rest 24 hours, scoop 60g balls, bake at 375°F / 190°C for 12–14 minutes.',
    bullets: [
      'The brown butter is the entire trick — cook until the milk solids are dark amber, not blonde.',
      'Resting the dough overnight is non-negotiable for the cracked top and chewy center.',
      'Use a mix of dark chocolate chunks and chips. Salt the tops while warm.',
    ],
  },
  ingredientGroups: [
    {
      label: 'Dough',
      items: [
        { name: 'unsalted butter',         metric: 227, mUnit: 'g',  imp: 1,    iUnit: 'cup',  note: 'browned and cooled' },
        { name: 'dark brown sugar',        metric: 200, mUnit: 'g',  imp: 1,    iUnit: 'cup',  note: 'packed' },
        { name: 'granulated sugar',        metric: 100, mUnit: 'g',  imp: 0.5,  iUnit: 'cup' },
        { name: 'eggs',                    metric: 2,   mUnit: 'lg', imp: 2,    iUnit: 'lg',   note: 'room temperature' },
        { name: 'egg yolk',                metric: 1,   mUnit: 'lg', imp: 1,    iUnit: 'lg' },
        { name: 'vanilla bean paste',      metric: 10,  mUnit: 'g',  imp: 2,    iUnit: 'tsp',  note: 'or extract' },
        { name: 'all-purpose flour',       metric: 280, mUnit: 'g',  imp: 2.25, iUnit: 'cup' },
        { name: 'bread flour',             metric: 60,  mUnit: 'g',  imp: 0.5,  iUnit: 'cup',  note: 'for extra chew' },
        { name: 'fine sea salt',           metric: 6,   mUnit: 'g',  imp: 1,    iUnit: 'tsp' },
        { name: 'baking soda',             metric: 5,   mUnit: 'g',  imp: 1,    iUnit: 'tsp' },
      ],
    },
    {
      label: 'Chocolate & finish',
      items: [
        { name: '70% dark chocolate chunks', metric: 200, mUnit: 'g', imp: 1.25, iUnit: 'cup', note: 'roughly chopped' },
        { name: 'milk chocolate chips',      metric: 100, mUnit: 'g', imp: 0.66, iUnit: 'cup' },
        { name: 'flaky sea salt',            metric: 2,   mUnit: 'g', imp: 0.5,  iUnit: 'tsp', note: 'for finishing' },
      ],
    },
  ],
  steps: [
    { title: 'Brown the butter',
      body: 'In a light-bottomed saucepan over medium heat, melt the butter. Continue cooking, swirling often, until the foam subsides and the milk solids turn a deep amber — about 6–8 minutes. You should smell toasted hazelnuts. Pour into a heatproof bowl, scraping every brown bit. Chill 2 hours until just-firm but pliable.',
      timer: 8, tone: 'butter' },
    { title: 'Build the dough',
      body: 'Beat the cooled brown butter with both sugars until just combined — do not whip. Add the eggs and yolk one at a time, then the vanilla. The mixture should look glossy and emulsified.',
      tone: 'cream' },
    { title: 'Fold in the dries',
      body: 'Whisk the flours, salt, and baking soda. Add to the wet mixture and fold with a spatula until no streaks remain. Fold in both chocolates. The dough will look shaggy — that is correct.',
      tone: 'cocoa' },
    { title: 'Rest, overnight',
      body: 'Cover the dough and refrigerate at least 24 hours, ideally 48. This is the single biggest contributor to flavor and texture. The dough will firm up considerably.',
      timer: null, tone: 'cocoa' },
    { title: 'Scoop and bake',
      body: 'Heat the oven to 375°F / 190°C with a rack in the upper third. Scoop 60g balls onto a parchment-lined sheet, 8 per tray. Bake 12–14 minutes until the edges are deep gold and the centers look just barely underdone.',
      timer: 14, tone: 'butter' },
    { title: 'Salt and rest',
      body: 'Pull from the oven. Immediately tap the tray firmly on the counter to deflate the centers and create ripples. Sprinkle with flaky salt. Cool on the tray 10 minutes before moving — they finish setting as they cool.',
      timer: 10, tone: 'warm' },
  ],
  faqs: [
    { q: 'Can I skip the 24-hour rest?',
      a: 'You can — but the cookies will be flatter, less chewy, and noticeably less caramelized. The flour needs time to hydrate and the brown butter flavors need to bloom. If you must bake same-day, rest at least 2 hours in the fridge.' },
    { q: 'What is brown butter and why does it matter?',
      a: 'Brown butter is butter cooked until the milk solids caramelize into nutty, toasted flecks. It adds a hazelnut depth that regular butter cannot. Without it, this becomes a good chocolate chip cookie. With it, it becomes the chocolate chip cookie.' },
    { q: 'Can I make these gluten-free?',
      a: 'Yes — substitute the all-purpose and bread flour with a 1-to-1 gluten-free baking flour by weight (340g total). Add 1 extra tablespoon of milk to the dough. Rest the same way. Texture is excellent though slightly more delicate.' },
    { q: 'How long do they keep?',
      a: 'Three days at room temperature in an airtight container. The dough freezes beautifully — scoop, freeze on a tray, then bag. Bake from frozen, adding 2 minutes.' },
    { q: 'My butter looks black, not amber. What happened?',
      a: 'You took it past brown. Burnt butter is bitter and will ruin the batch — start over. Next time use a lighter pan so you can actually see the color, swirl constantly toward the end, and pull the moment you smell hazelnut.' },
    { q: 'What chocolate should I buy?',
      a: 'A quality 70% bar chopped into uneven chunks. Skip waxy chips for the dark portion — bar chocolate fractures into pools and shards. The milk chocolate chips add a little throwback chewiness.' },
  ],
  nutrition: { cal: 218, fat: 11, carb: 27, protein: 3, sugar: 18, fiber: 1, sodium: 110 },
  tags: ['baking', 'cookies', 'weekend', 'crowd-pleaser', 'make-ahead'],
};

// Homepage trending recipes
const TRENDING = [
  { title: 'Brown Butter Chocolate Chip Cookies', author: 'Mira Chen',    time: 49, rating: 4.9, tone: 'butter', tag: 'Baking', isHero: true },
  { title: 'One-Pan Crispy Gochujang Chicken',     author: 'Ji-ho Park',   time: 30, rating: 4.8, tone: 'warm',   tag: 'Weeknight' },
  { title: 'Bright Lemon Olive Oil Cake',          author: 'Sofia Romano', time: 65, rating: 4.9, tone: 'cream',  tag: 'Baking' },
  { title: 'Charred Broccoli Caesar',              author: 'Alex Bauer',   time: 22, rating: 4.7, tone: 'green',  tag: 'Salad' },
  { title: 'Slow-Roasted Salmon, Citrus & Fennel', author: 'Mira Chen',    time: 45, rating: 4.9, tone: 'sea',    tag: 'Dinner' },
  { title: 'Nasi Goreng Kampung',                  author: 'Dewi Pratama', time: 25, rating: 4.8, tone: 'warm',   tag: 'Asian' },
  { title: 'Burrata with Roasted Stone Fruit',     author: 'Sofia Romano', time: 18, rating: 4.7, tone: 'berry',  tag: 'Summer' },
  { title: 'Miso-Glazed Eggplant Donburi',         author: 'Akira Tanaka', time: 35, rating: 4.9, tone: 'cocoa',  tag: 'Vegetarian' },
];

const QUICK_DINNERS = [
  { title: '15-Minute Garlic Butter Shrimp',  time: 15, rating: 4.9, tone: 'butter' },
  { title: 'Crispy Skin Chicken Thighs',      time: 28, rating: 4.8, tone: 'warm'   },
  { title: 'Sheet-Pan Harissa Halloumi',      time: 25, rating: 4.7, tone: 'herb'   },
  { title: 'Cold Sesame Noodles',             time: 12, rating: 4.9, tone: 'sea'    },
];

// World regions
const REGIONS = [
  { code: 'asia',      name: 'Asia',          count: 1240, tone: 'warm',   examples: ['Nasi Goreng', 'Bibimbap', 'Pad Krapow', 'Mapo Tofu'] },
  { code: 'europe',    name: 'Europe',        count:  980, tone: 'cream',  examples: ['Carbonara', 'Coq au Vin', 'Paella', 'Bratwurst'] },
  { code: 'americas',  name: 'Americas',      count:  840, tone: 'butter', examples: ['Chili', 'Mole', 'Chimichurri', 'Cornbread'] },
  { code: 'africa',    name: 'Africa & Levant', count: 520, tone: 'warm',  examples: ['Tagine', 'Shakshuka', 'Jollof', 'Hummus'] },
  { code: 'oceania',   name: 'Oceania',       count:  180, tone: 'sea',    examples: ['Pavlova', 'Hangi', 'Lamington'] },
];

// AI Answer canned response (for the AI Answer page)
const AI_ANSWER = {
  question: 'Why do my chocolate chip cookies turn out flat?',
  summary: 'Flat cookies almost always come down to one of four things: butter that is too warm, dough that did not rest, too little flour, or an oven that is not hot enough. The fix is usually to chill the dough longer and weigh — not measure — your flour.',
  bullets: [
    'Soft, melty butter spreads before the structure sets. Brown butter must be chilled until pliable, not pourable.',
    'Resting the dough 24 hours hydrates the flour and lets it hold its shape in the oven.',
    'Most flat cookies are under-floured. A digital scale removes the guesswork — aim for 280g all-purpose flour per batch.',
    'A cool oven means the edges spread before they crisp. Preheat fully, and bake one tray at a time on the upper rack.',
  ],
  sources: [
    { title: 'Brown Butter Chocolate Chip Cookies', by: 'Mira Chen',   year: 2026, rating: 4.9, cite: 'Tested 14 times' },
    { title: 'Why your cookies are spreading',     by: 'Sofia Romano', year: 2025, rating: 4.8, cite: 'Technique guide' },
    { title: 'A baker’s guide to butter temperature', by: 'Alex Bauer', year: 2024, rating: 4.7, cite: 'Reference' },
  ],
  followups: [
    'How do I brown butter without burning it?',
    'Can I bake cookies from frozen dough?',
    'What is the difference between baking soda and baking powder in cookies?',
    'How do I get the cracked top on a chocolate chip cookie?',
  ],
};

Object.assign(window, { RECIPE, TRENDING, QUICK_DINNERS, REGIONS, AI_ANSWER });
