// Octopak website — shared content scaffolding.
// Family names, slugs, section labels, print-method names, and FAQ *questions*
// are structural (from the brief / generic). Every Octopak-specific value or
// answer is a <PH> placeholder or <Flag>, never invented.

// Flag is used inline inside answer JSX below (Shared.jsx loads first).
const { Flag } = window;

// Fallback content — used when cms-content.generated.js hasn't been produced
// (no internet, script not run yet, offline build). Kept in sync as the shape
// reference for the Sanity schemas in octopak-studio. Not deleted after the CMS
// cutover.
const FAMILIES_FALLBACK = [
  {
    slug: "coffee-cups", name: "Coffee cups", short: "coffee cups",
    h1: "Customised coffee cups in Singapore.",
    wedge: "Coffee cups for hot drinks, plus PET cups for ice drinks. Lids and sleeves, printed for the cup that gets photographed.",
    meta: { title: "Customised Coffee Cups Singapore | Octopak" },
    guideAnchor: "cup-linings",
    image: "assets/photos/folkyard-cups-stack-landscape.jpg",
    imageHover: "assets/photos/folkyard-cup-held-latte-landscape.jpg",
    workBrand: "Folkyard",
    closingSub: "Tell us your cup size, material, and quantity. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Paper: 8oz, 10oz, and 12oz. PET plastic: 12oz and 16oz.",
      colours: "Lid colour: black, white, beige, or translucent",
      materials: "White or kraft paper cup stock (single-wall or double-wall), or PET plastic",
      finishes: "Matte or glossy, on both the cup and the lid",
    },
    moq: {
      num: "5,000",
      note: "Starting MOQ is 5,000 pieces for double-wall cups and 10,000 pieces for single-wall. Higher quantities lower the unit price.",
    },
    faqs: [
      {
        q: "What can I customise on coffee cups?",
        a: "Octopak customises the print, lid colour, and finish on coffee cups. Choose paper (white or kraft, single-wall or double-wall, in 8oz, 10oz, or 12oz) or PET plastic (12oz or 16oz); lids come in black, white, beige, or translucent; and both the cup and lid can be matte or glossy.",
      },
      {
        q: "What's the minimum order for coffee cups?",
        a: "The starting MOQ for coffee cups is 5,000 pieces for double-wall and 10,000 pieces for single-wall. Higher quantities lower the unit price.",
      },
      {
        q: "Which print methods suit coffee cups?",
        a: "There's no choice to make here. Coffee cups are printed using a single fixed method, so unlike other packaging, you don't need to pick between print options.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
  },
  {
    slug: "paper-bags", name: "Paper bags", short: "paper bags",
    h1: "Customised paper bags in Singapore.",
    wedge: "Fully customisable paper bags: any size, paper type, or finish, twist-handle or flat-handle, printed for your brand.",
    meta: { title: "Custom Printed Paper Bags Singapore | Octopak" },
    guideAnchor: "materials-paper",
    closingSub: "Tell us your bag size, paper type, and quantity. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Fully customisable to your brand",
      colours: "Choose a base paper colour, printed in any colour you like",
      materials: "Any paper type, including kraft and white",
      finishes: "Foil stamping, or emboss and deboss",
    },
    moq: {
      num: "1,000",
      note: "Starting MOQ is 1,000 pieces. Higher quantities lower the unit price.",
    },
    faqs: [
      {
        q: "What can I customise on paper bags?",
        a: "Pretty much anything. Octopak customises the size, paper type, base colour, and handle style on paper bags, twist-handle or flat-handle, printed in any colour you like, with foil stamping or emboss and deboss finishes available.",
      },
      {
        q: "What's the minimum order for paper bags?",
        a: "The starting MOQ for paper bags is 1,000 pieces. Higher quantities lower the unit price.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
    finishes: [
      { name: "Foil stamping", body: "Hot foil pressed into the bag for a premium accent. Brightest on kraft, restrained on white. Most striking on logos, edges, and small marks." },
      { name: "Emboss and deboss", body: "Raised or recessed tactile detail. Felt as much as seen. Lifts a kraft bag from packaging to keepsake." },
    ],
  },
  {
    slug: "boxes", name: "Cake, pastry & corrugated boxes", short: "boxes",
    h1: "Customised boxes in Singapore.",
    wedge: "Fully customisable cake, pastry, and corrugated boxes: any size, board, or finish, built to protect the product and the presentation.",
    meta: { title: "Customised Cake & Corrugated Boxes Singapore | Octopak" },
    guideAnchor: "structure",
    hidden: true, // no real photos yet — hidden from grids/nav until shot, see [[hidden families]]
    closingSub: "Tell us your box type, size, and quantity. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Fully customisable to your brand",
      colours: "Printed in any colour you like",
      materials: "Coated or kraft board",
      finishes: "Foil stamping, or emboss and deboss",
    },
    moq: {
      num: "10,000",
      note: "Starting MOQ is 10,000 pieces. Higher quantities lower the unit price.",
    },
    faqs: [
      {
        q: "What can I customise on boxes?",
        a: "Pretty much anything. Octopak customises the size, board, closure, and finish on cake, pastry, and corrugated boxes, printed in any colour you like, with foil stamping or emboss and deboss finishes available.",
      },
      {
        q: "What's the minimum order for boxes?",
        a: "The starting MOQ for boxes is 10,000 pieces. Higher quantities lower the unit price.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
    finishes: [
      { name: "Foil stamping", body: "Hot foil pressed into the lid or face for a premium accent. Works on coated and kraft stocks; best on logos and small marks." },
      { name: "Emboss and deboss", body: "Raised or recessed tactile detail on lids or sides. Strongest impression on heavier board." },
    ],
  },
  {
    slug: "wrappers-and-paper", name: "Wrappers & greaseproof paper", short: "wrappers and paper",
    h1: "Customised wrappers & greaseproof paper in Singapore.",
    wedge: "Greaseproof sheets and wrappers that brand and protect food in direct contact.",
    meta: { title: "Custom Greaseproof Paper & Wrappers Singapore | Octopak" },
    guideAnchor: "materials-paper",
    image: "assets/photos/hideout-paper-sandwich-halved-landscape.jpg",
    imageHover: "assets/photos/hideout-paper-cake-eaten-landscape.jpg",
    workBrand: "Hideout",
    closingSub: "Tell us your sheet size, quantity, and print colours. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Customisable, up to 40 x 40cm",
      colours: false, // no separate colour spec — determined by print, see "What can I customise"
      materials: "White coated stock (greaseproof)",
      finishes: false, // no separate finish option offered
    },
    moq: {
      num: "10,000",
      note: "Starting MOQ is 10,000 pieces. Print is fully customisable, any colours you like, though more colours generally costs more.",
    },
    faqs: [
      {
        q: "What can I customise on wrappers & greaseproof paper?",
        a: "Octopak customises the size and print on wrappers & greaseproof paper. Sheets are cut to size up to 40 x 40cm, on white coated (greaseproof) stock, printed in any colours you like. More colours generally costs more.",
      },
      {
        q: "What's the minimum order for wrappers & greaseproof paper?",
        a: "The starting MOQ for wrappers & greaseproof paper is 10,000 pieces. Higher quantities lower the unit price.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
  },
  {
    slug: "tote-bags", name: "Tote bags", short: "tote bags",
    h1: "Customised tote bags in Singapore.",
    wedge: "Fully customisable tote bags: canvas, non-woven fabric, or thermal insulated, in any size, durable enough to carry your brand long after the sale.",
    meta: { title: "Customised Tote Bags Singapore | Octopak" },
    guideAnchor: "structure",
    hidden: true, // no real photos yet — hidden from grids/nav until shot
    closingSub: "Tell us your bag type, size, and quantity. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Fully customisable to your brand",
      colours: "Printed in any colour you like",
      materials: "Canvas, non-woven fabric, or thermal insulated",
      finishes: "Fully customisable, matched to your chosen material",
    },
    moq: {
      num: "10,000",
      note: "Starting MOQ is 10,000 pieces. Higher quantities lower the unit price.",
    },
    faqs: [
      {
        q: "What can I customise on tote bags?",
        a: "Pretty much anything. Octopak makes tote bags in canvas, non-woven fabric, or thermal insulated material, customised on size, print, and finish, printed in any colour you like.",
      },
      {
        q: "What's the minimum order for tote bags?",
        a: "The starting MOQ for tote bags is 10,000 pieces. Higher quantities lower the unit price.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
  },
  {
    slug: "pouches", name: "Pouches", short: "pouches",
    h1: "Customised pouches in Singapore.",
    wedge: "Fully customisable pouches: any size or finish, zip stand-up, no-zip, or VFFS, for snacks, coffee beans, and packaged goods.",
    meta: { title: "Customised Pouches Singapore | Octopak" },
    guideAnchor: "spot-uv",
    image: "assets/photos/milkywell-pouches-lineup-landscape.webp",
    imageHover: "assets/photos/milkywell-pouch-packing-landscape.webp",
    workBrand: "Milkywell",
    workPhotos: 2, // slots 0 and 1 are real (imageHover + pouches-work-2.webp); slot 2 still open
    closingSub: "Tell us your pouch type, size, and quantity. We'll come back with pricing and next steps within three business days, usually sooner.",
    specs: {
      sizes: "Fully customisable to your brand",
      colours: "Printed in any colour you like",
      materials: "Fully customisable, matched to what you're packing",
      finishes: "Spot UV, and other finishes on request",
    },
    moq: {
      num: "5,000",
      note: "Starting MOQ is 5,000 pieces. Higher quantities lower the unit price.",
    },
    faqs: [
      {
        q: "What can I customise on pouches?",
        a: "Pretty much anything. Octopak customises the size, pouch type, and finish: choose zip stand-up, no-zip, or VFFS, with spot UV and other finishes available.",
      },
      {
        q: "What's the minimum order for pouches?",
        a: "The starting MOQ for pouches is 5,000 pieces. Higher quantities lower the unit price.",
      },
      {
        q: "What artwork do you need from me?",
        a: "Vector files (AI, EPS, PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have and we'll tell you what's workable.",
      },
    ],
    finishes: [
      { name: "Spot UV", body: "Selective gloss against a matte body. A subtle premium signal that catches light on specific elements without coating the whole pouch." },
    ],
  },
  {
    slug: "vacuum-bags", name: "Vacuum bags", short: "vacuum bags", secondary: true, stock: true,
    h1: "Vacuum bags, in stock and ready to ship.",
    wedge: "Three standard sizes, in stock for food production, central kitchens, and sous vide.",
    meta: { title: "Vacuum Bags Singapore | Stock and Ready to Ship | Octopak" },
    image: "assets/photos/vacuum-bags-hero.webp",
  },
];

const familyBySlug = (slug) => FAMILIES.find((f) => f.slug === slug) || FAMILIES[0];

// Generic spec rows (brief §6.4.2). Print methods demoted to the guide; the
// buyer cares about materials and finishes (the result), so four specs land
// more cleanly than five.
// `key` looks up a per-family override in that family's `specs` object
// (see coffee-cups in FAMILIES_FALLBACK) — falls back to the generic `val`
// below, or the PH/Flag placeholder, when a family hasn't confirmed specs yet.
const SPEC_ROWS = [
  { icon: "ruler", label: "Sizes", key: "sizes" },
  { icon: "palette", label: "Colours", key: "colours" },
  // Eco substrates stay buyer-facing (brand guide v2.2 §5.4 demotes "eco" from the
  // brand line only). Named options; per-family list still to be locked by Gail.
  { icon: "layers", label: "Materials", key: "materials", val: "kraft, white coated, FSC-certified stocks, recycled-content where available", flagText: "options per family to confirm" },
  { icon: "droplet", label: "Finishes", key: "finishes" },
];

// Print methods (brief §6.4.4). Names + generic, accurate descriptions of the
// process; whether each is offered per family is flagged on the page.
const PRINT_METHODS = [
  { name: "Flexo", body: "Fast, cost-effective for large runs on kraft and uncoated stocks; best for bold, solid colours." },
  { name: "Offset", body: "Sharp detail and consistent colour for photographic artwork and big quantities." },
  { name: "Digital", body: "No plates, so it suits short runs, fast turnarounds, and variable designs." },
  { name: "Foil", body: "Metallic stamping for a premium accent: logos, edges, and highlights." },
  { name: "Emboss", body: "Raised, tactile detail that adds depth without ink. Felt as much as seen." },
];

// FAQ structure (brief §6.8). Questions are generic buyer questions.
// Answers lead with the answer in the first sentence (GEO), same treatment the
// coffee-cups and wrappers family pages got. Every stated fact is either
// already confirmed elsewhere on the site (compare table v2.2, family specs)
// or generic, accurate print knowledge. Anything Octopak-specific and still
// open carries an inline <Flag> — never invented.
// Fallback content — see FAMILIES_FALLBACK comment above.
const FAQ_CATEGORIES_FALLBACK = [
  {
    name: "Getting started",
    items: [
      {
        q: "How do I start an order with Octopak?",
        a: "Tell us three things: what you're packaging, roughly how many you need, and when you need them. Message us on WhatsApp or send the contact form, and we'll reply within three business days, usually sooner. From there we confirm what's possible at your quantity, quote it, and walk you through artwork. You don't need finished files or final numbers to start the conversation.",
        guideAnchor: "intro", guideLabel: "Intro",
      },
      {
        q: "What do I need to send you to begin?",
        a: "Less than you'd expect. For a quote we need the product, an approximate quantity, and your deadline. Artwork can follow later: a high-res logo and your brand's background colour is enough to begin. If you already have print-ready files, send them and we'll check them before anything goes to print.",
      },
      {
        q: "Can you help if I only have a logo, not artwork?",
        a: "Yes, if the logo itself is finished. Octopak is a packaging partner, not a design studio, so we don't create a brand or logo from scratch. Bring a high-res logo and your background colour, and we turn it into print-ready files: checking it, advising on print method and finish, and fixing file-level issues like resolution, colour profile, and dieline fit. If you already have print-ready artwork, we check it before it goes to print.",
      },
    ],
  },
  {
    name: "MOQ and pricing",
    items: [
      {
        q: "What is the minimum order quantity?",
        a: "It depends on the product: paper bags from 1,000, coffee cups and pouches from 5,000, and other customised lines generally from 10,000. Vacuum bags are stock items, so there's no print minimum at all. Higher quantities lower the unit price. If your numbers sit below these, tell us anyway and we'll say honestly whether it's workable.",
        guideAnchor: "print-methods", guideLabel: "Print methods overview",
      },
      {
        q: "How does unit price change with quantity?",
        a: "Unit price falls as quantity rises. A large share of the cost on a printed run is setup (plates, dielines, and make-ready), and that cost spreads across the whole order, so doubling the quantity never doubles the price. In practice, the step up from your minimum to the next quantity break is usually the cheapest per-unit improvement available to you. We quote the breaks side by side so you can see where they fall before you commit.",
      },
      {
        q: "Do you charge for design or setup?",
        a: (
          <span>
            Octopak doesn't offer design as a paid service, and doesn't create brands or logos
            from scratch. Turning your logo and background colour into print-ready files is part
            of the job and doesn't cost extra. Setup charges depend on the product: coffee cups
            don't carry one, but some other products may have a one-time setup fee on your first
            order. Whatever applies to your job is itemised in the quote up front, not added after
            you commit.
          </span>
        ),
      },
    ],
  },
  {
    name: "Lead times",
    items: [
      {
        q: "How long does a typical order take?",
        a: "Six to eight weeks from mockup sign-off, all in: production, shipping, and customs included. The clock starts when you approve the mockup, not when you first message us, so artwork rounds before that don't eat into the estimate. We tell you the timeline up front, not after you commit.",
        guideAnchor: "print-methods", guideLabel: "Print methods overview",
      },
      {
        q: "Can you handle rush orders?",
        a: (
          <span>
            Sometimes, depending on the product and where the factory schedule sits. We can speed
            up shipping with air freight or a mixed air-and-sea arrangement, which costs more; the
            exact cost depends on the arrangement. Tell us the date you need stock in hand and
            we'll say honestly whether it's achievable before you commit to anything, rather than
            promise a date we can't hold. Vacuum bags are stock items and ship far faster than any
            printed run.
          </span>
        ),
      },
    ],
  },
  {
    name: "Files and artwork",
    items: [
      {
        q: "What file formats do you accept?",
        a: "Vector files (AI, EPS, or PDF) for logos and line art, or raster files (TIFF or high-quality JPEG) at 300 dpi minimum for photography. Brand colours as Pantone codes where you have them. If your files aren't in these formats yet, send what you have. We'll tell you what's workable and what needs redrawing.",
        guideAnchor: "what-to-send", guideLabel: "What to send us",
      },
      {
        q: "What is a dieline and do you provide one?",
        a: "A dieline is the flat template showing where your packaging is cut, creased, and folded: the unfolded shape of the finished item, with every fold and glue tab marked. Yes, we provide one for your product and size, so artwork sits in the right place before it goes to print. Design on top of it, and keep logos and text clear of folds and seams.",
      },
      {
        q: "Will I see a proof before production?",
        a: (
          <span>
            Yes. Nothing goes to print until you've signed off. A digital proof is the standard
            step, already built into the timeline, so it doesn't add time on its own. A physical
            mockup is available on request and adds one to two weeks, at a cost that depends on
            the product.
          </span>
        ),
      },
    ],
  },
  {
    name: "Print methods",
    items: [
      {
        q: "Which print methods do you offer?",
        a: (
          <span>
            It depends on the product. Octopak works with a network of specialised printing
            partners, so the method is matched to what your packaging and artwork need rather
            than limited to one process in-house. The common options across packaging are
            flexographic, offset, digital, and screen printing, plus finishes like foil stamping,
            embossing, and spot UV. Coffee cups, for instance, are printed with a single fixed
            method, so there's no choice to make there. We'll tell you which apply to your job
            when we quote it.
          </span>
        ),
        guideAnchor: "print-methods", guideLabel: "Print methods overview",
      },
      {
        q: "Which method is right for my packaging?",
        a: "It follows your quantity, your material, and your artwork. Flexo is cost-effective on large runs on kraft and uncoated stock and handles bold, solid colour well. Offset gives sharper detail and more consistent colour, which suits photographic artwork and big quantities. Digital skips plates entirely, so it suits short runs and fast turnarounds. Screen printing lays ink down thickly, which is why it works on totes and textured surfaces. You don't have to decide alone. Tell us the product, the quantity, and the look you're after, and we'll recommend the method.",
      },
    ],
  },
  {
    name: "Sustainability",
    items: [
      {
        q: "How sustainable are your materials?",
        a: (
          <span>
            The honest answer is that packaging touching food carries real constraints, and not
            every material can be made from recycled content or composted at the end of its life.
            We offer both certified stocks (like FSC) and standard uncertified options, so you can
            choose based on what your brand and budget need. We'd rather tell you exactly what a
            material is and isn't than sell you a claim it can't support.
          </span>
        ),
        guideAnchor: "sustainability", guideLabel: "Sustainability, honestly",
      },
      {
        q: "Are your cups and bags recyclable or compostable?",
        a: (
          <span>
            It depends on the lining and on the facilities available locally. A paper cup needs a
            liner to hold liquid, and that liner decides whether the cup can be recycled, composted
            commercially, or neither. What Singapore can actually process matters as much as the
            material itself. We'll tell you what your specific spec can and can't claim, so nothing
            goes on your packaging that you can't stand behind.
          </span>
        ),
      },
    ],
  },
  {
    name: "Vacuum bags",
    items: [
      {
        q: "Do you stock vacuum bags?",
        a: "Yes. Vacuum bags are the one line we hold in stock rather than produce to order, in three standard sizes, so they ship quickly instead of running on a six-to-eight-week production timeline. They're plain rather than printed, and are used by food production kitchens, central kitchens, and sous vide operations.",
      },
      {
        q: "What sizes are available, and what are the order minimums?",
        a: (
          <span>
            Vacuum bags come in three standard sizes, small (150 x 200mm), medium (200 x 300mm),
            and large (300 x 400mm), held in stock, so there's no print minimum and no production
            wait. Minimum order is 100 bags, with free delivery on orders over $300. Tell us the
            size and quantity you need and we'll confirm availability the same way we would for
            any stock item.
          </span>
        ),
      },
    ],
  },
];

// Selected work (brief §6.6). Brand names use the existing roster placeholders;
// headlines are placeholders.
// Real client logos, downloaded from octopak.com. `name` is used as the img alt text.
const CLIENTS = [
  { name: "1GROUP", logo: "assets/photos/logos/1group.webp" },
  { name: "PBD", logo: "assets/photos/logos/pbd.webp" },
  { name: "Maxi Coffee Bar", logo: "assets/photos/logos/maxi.webp" },
  { name: "Guerilla", logo: "assets/photos/logos/guerilla.webp" },
  { name: "Kurasu", logo: "assets/photos/logos/kurasu.webp" },
  { name: "Le Matin", logo: "assets/photos/logos/le-matin.webp" },
  { name: "Folk Yard", logo: "assets/photos/logos/folkyard.webp" },
  { name: "Anagram", logo: "assets/photos/logos/anagram.webp" },
  { name: "Junior", logo: "assets/photos/logos/junior.webp" },
  { name: "Ma Cuisine", logo: "assets/photos/logos/ma-cuisine.webp" },
  { name: "Glass Roasters", logo: "assets/photos/logos/glass.webp" },
  { name: "Rough Guys", logo: "assets/photos/logos/rough-guys.webp" },
];

// Fallback content — see FAMILIES_FALLBACK comment above.
// `photos` (when present) feeds the case-card Carousel so a case study can show
// more than one real photo; omit it and the card falls back to a single
// `heroImage` / `work-[slug].webp` slot.
const CASE_STUDIES_FALLBACK = [
  {
    brand: "Folkyard", slug: "folkyard",
    headline: "A double-walled cup that keeps the coffee hot and the branding sharp.",
    photos: [
      { src: "assets/photos/folkyard-cups-stack-landscape.jpg", placeholder: "Folkyard cups on the counter" },
      { src: "assets/photos/folkyard-cup-held-coffee-landscape.jpg", placeholder: "Folkyard cup, held" },
      { src: "assets/photos/folkyard-cup-held-latte-landscape.jpg", placeholder: "Folkyard cup with latte art" },
      { src: "assets/photos/folkyard-cup-lid-closeup-portrait-2.jpg", placeholder: "Folkyard cup detail" },
    ],
  },
  {
    brand: "Hideout", slug: "hideout",
    headline: "Custom greaseproof paper that wraps every order in branding.",
    photos: [
      { src: "assets/photos/hideout-paper-sandwich-wrapped-landscape.jpg", placeholder: "Sandwich wrapped in Hideout greaseproof paper" },
      { src: "assets/photos/hideout-paper-sandwich-halved-landscape.jpg", placeholder: "Sandwich wrapped in Hideout greaseproof paper" },
      { src: "assets/photos/hideout-paper-cake-on-plate-landscape.jpg", placeholder: "Cake wrapped in Hideout greaseproof paper" },
      { src: "assets/photos/hideout-paper-cake-jam-closeup-portrait.jpg", placeholder: "Cake wrapped in Hideout greaseproof paper" },
    ],
  },
  {
    brand: "Milkywell", slug: "milkywell",
    headline: "Zip stand-up pouches that keep snacks fresh and the branding sharp.",
    photos: [
      { src: "assets/photos/milkywell-pouches-lineup-landscape.webp", placeholder: "Milkywell pouches and tote on the counter" },
      { src: "assets/photos/milkywell-pouch-packing-landscape.webp", placeholder: "Packing a Milkywell pouch" },
      { src: "assets/photos/pouches-work-2.webp", placeholder: "Milkywell cookies alongside the pouch" },
    ],
  },
  // Brand D–F placeholders removed for launch: real, well-photographed
  // studies read as confident where grey boxes read as unfinished. The
  // grid closes with an invitation card instead (see WorkView). Add new
  // studies here as client photos and permission come in.
];

// Comparison rows (brief §6.7). Final honest cell copy (v2.2).
const COMPARE_ROWS = [
  {
    label: "Design help",
    alt: "Usually none. You send print-ready artwork. If you don't have it yet, you find a designer separately, or you work from the factory's template, which is usually generic.",
    octopak: "We're a packaging partner, not a design studio. We don't create brands or logos from scratch, but bring a high-res logo and background colour and we'll turn it into print-ready files. If you already have artwork, we check it before it goes to print.",
  },
  {
    label: "MOQ flexibility",
    alt: "Often higher than the listing suggests. Quotes are per print plate, per colour, per size, and the sample MOQ and production MOQ are different numbers.",
    octopak: "Paper bags from 1,000. Coffee cups and pouches from 5,000. Other customised lines generally from 10,000. Vacuum bags are stock, no print MOQ. Higher quantities lower the unit price.",
  },
  {
    label: "Communication",
    alt: "Across time zones, often in a second language, across multiple chat threads. Workable if you have the time and the patience. Slower if you do not.",
    octopak: "One team on WhatsApp, in the same time zone. We reply within three business days, usually sooner. One conversation, not five.",
  },
  {
    label: "Lead time",
    alt: "Production can be quick. Shipping and customs add three to six weeks on top. Mistakes restart the clock, and you are the one finding out at the port.",
    octopak: "Six to eight weeks from mockup sign-off, all in. We tell you the timeline up front, not after you commit.",
  },
  {
    label: "Quality control",
    alt: "You usually see the run when it arrives. Pre-shipment inspections cost extra and need to be arranged separately. Recourse on a bad run is hard.",
    octopak: "We see the run before it leaves. We catch most issues; when something does go wrong, it is ours to fix, not yours to chase.",
  },
  {
    label: "Accountability",
    alt: "Spread across the factory, the agent, the freight forwarder, the courier. When something is off, it can take days to work out whose problem it is.",
    octopak: "One team, one inbox, one accountable point of contact from first message to delivered pallet.",
  },
  {
    label: "Total time cost to you",
    alt: "High. You become the project manager: sourcing, files, QC, shipping, chasing. That time has a cost, even if it doesn't sit on the invoice.",
    octopak: "You make the brand decisions; we run the project. Octopak costs more on the unit; the trade-off is the hours you get back.",
  },
];

// Print & Materials Guide — chapter rail (anchors per task PAGE STRUCTURE).
// Order matches the rendered sections. Hero has no rail entry.
const GUIDE_CHAPTERS = [
  { id: "intro", label: "Intro" },
  { id: "structure", label: "Choosing your structure" },
  { id: "materials-paper", label: "Materials: paper" },
  { id: "sustainability", label: "Sustainability, honestly" },
  { id: "cup-linings", label: "Cup linings" },
  { id: "print-methods", label: "Print methods overview" },
  { id: "flexo", label: "Flexographic printing" },
  { id: "offset", label: "Offset printing" },
  { id: "digital", label: "Digital printing" },
  { id: "screen", label: "Screen printing" },
  { id: "foil", label: "Finishes: foil stamping" },
  { id: "emboss", label: "Finishes: emboss and deboss" },
  { id: "spot-uv", label: "Finishes: spot UV" },
  { id: "colours", label: "Choosing colours" },
  { id: "what-to-send", label: "What to send us" },
  { id: "from-here", label: "From here" },
];

// CMS content (Sanity) is injected as window.CMS_CONTENT by cms-content.generated.js,
// loaded before this script (see index.html). Use it when present and non-empty;
// otherwise fall back to the literals above so the site never renders blank.
const CMS = window.CMS_CONTENT || {};
if (!window.CMS_CONTENT) console.info("CMS_CONTENT not found — using fallback content.");

const FAMILIES = (CMS.families && CMS.families.length) ? CMS.families : FAMILIES_FALLBACK;
const FAQ_CATEGORIES = (CMS.faqCategories && CMS.faqCategories.length) ? CMS.faqCategories : FAQ_CATEGORIES_FALLBACK;
const CASE_STUDIES = (CMS.caseStudies && CMS.caseStudies.length) ? CMS.caseStudies : CASE_STUDIES_FALLBACK;

// Families with `hidden: true` (no real photos shot yet) are kept in FAMILIES
// so direct links / the contact form still resolve them, but every listing
// or cross-link surface should render from this filtered view instead.
const FAMILIES_VISIBLE = FAMILIES.filter((f) => !f.hidden);

Object.assign(window, {
  FAMILIES, FAMILIES_VISIBLE, familyBySlug, SPEC_ROWS, PRINT_METHODS, FAQ_CATEGORIES,
  CLIENTS, CASE_STUDIES, COMPARE_ROWS, GUIDE_CHAPTERS,
});
