// templates.jsx — Loaf'd social, opening-hours, launch-promo & tent-card templates
// Mounted as a new "Templates" section inside brand-pack.html.

// ── helpers ─────────────────────────────────────────────────────────────
const TemplateFrame = ({ label, width, height, scale = 0.28, dark, raspberry, children, style = {} }) => {
  // Renders a scaled-down preview of a "real-size" canvas so all cards line up.
  const bg = raspberry ? 'var(--raspberry)' : dark ? 'var(--black)' : 'var(--paper)';
  const fg = raspberry || dark ? 'var(--cream)' : 'var(--ink)';
  return (
    <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
      <div style={{
        width: width * scale, height: height * scale,
        background: 'rgba(0,0,0,0.04)', borderRadius: 10,
        overflow: 'hidden', position: 'relative',
        border: '1px solid rgba(0,0,0,0.08)',
        boxShadow: '0 12px 32px -16px rgba(0,0,0,0.18)'
      }}>
        <div style={{
          width, height, background: bg, color: fg,
          transform: `scale(${scale})`, transformOrigin: 'top left',
          position: 'absolute', top: 0, left: 0,
          fontFamily: 'var(--body)',
          ...style
        }}>
          {children}
        </div>
      </div>
      <div className="mono" style={{ fontSize: 11, letterSpacing: '0.12em', opacity: 0.55, textTransform: 'uppercase' }}>{label}</div>
    </div>);

};

// Auto-fit: shrink font when longest line exceeds capChars
const fitSize = (text, base, capChars = 8) => {
  const longest = String(text || '').split('\n').reduce((a, b) => a.length > b.length ? a : b, '');
  const len = longest.length || 1;
  return len <= capChars ? base : Math.floor(base * (capChars / len));
};

// ── Social posts (4:5 — 1080×1350) ──────────────────────────────────────
// Variation 1 · Bold type, raspberry on cream
const SocialV1 = ({ kicker, headline, subhead, price, tag }) =>
<div style={{ width: '100%', height: '100%', padding: 80, display: 'flex', flexDirection: 'column', justifyContent: 'space-between', background: 'var(--cream)' }}>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 24, letterSpacing: '0.2em', textTransform: 'uppercase' }}>{kicker}</div>
      <div className="wordmark" style={{ fontSize: 70 }}>LOAF'D</div>
    </div>
    <div>
      <div className="h-shadow" style={{ fontSize: fitSize(headline, 180, 8), lineHeight: 0.88, wordBreak: 'break-word' }}>{headline}</div>
      <div style={{ fontSize: 36, marginTop: 32, lineHeight: 1.3, maxWidth: '24ch' }}>{subhead}</div>
    </div>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' }}>
      <div style={{ fontFamily: 'var(--display)', fontSize: 90, color: 'var(--raspberry)', textShadow: '4px 4px 0 #4a1a2e', lineHeight: 1 }}>{price}</div>
      <div style={{ background: 'var(--ochre)', color: 'var(--black)', fontFamily: 'var(--display)', padding: '20px 28px', borderRadius: 10, fontSize: 32, transform: 'rotate(-4deg)', boxShadow: '5px 5px 0 var(--black)', textTransform: 'uppercase' }}>{tag}</div>
    </div>
  </div>;


// Variation 2 · Photo hero with raspberry caption band
const SocialV2 = ({ kicker, headline, subhead, price, placeholderLabel }) =>
<div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'column', background: 'var(--black)' }}>
    <div className="placeholder" style={{ flex: 3, borderRadius: 0, border: 'none', fontSize: 24, color: 'rgba(0,0,0,0.4)' }}>{placeholderLabel}</div>
    <div style={{ flex: 1.4, background: 'var(--raspberry)', color: 'var(--cream)', padding: '40px 64px', position: 'relative' }}>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 20, letterSpacing: '0.2em', opacity: 0.85, textTransform: 'uppercase' }}>{kicker}</div>
      <div className="h-shadow cream" style={{ fontSize: fitSize(headline, 100, 9), lineHeight: 0.9, marginTop: 14, wordBreak: 'break-word' }}>{headline}</div>
      <div style={{ fontSize: 28, marginTop: 18, opacity: 0.92, lineHeight: 1.35, maxWidth: '36ch' }}>{subhead}</div>
      <div style={{ position: 'absolute', top: -50, right: 48, fontFamily: 'var(--display)', fontSize: 64, color: 'var(--ochre)', textShadow: '5px 5px 0 var(--black)', transform: 'rotate(-4deg)' }}>{price}</div>
    </div>
  </div>;


// Variation 3 · Big sticker collage on black
const SocialV3 = ({ kicker, words, subhead, price }) =>
<div style={{ width: '100%', height: '100%', padding: 70, background: 'var(--black)', color: 'var(--cream)', position: 'relative', overflow: 'hidden' }}>
    {/* corner blob */}
    <div style={{ position: 'absolute', width: 360, height: 360, background: 'var(--ochre)', borderRadius: '50%', top: -120, right: -120 }} />
    <div style={{ position: 'absolute', width: 240, height: 240, background: 'var(--raspberry)', borderRadius: '50%', bottom: -60, left: -80 }} />
    <div style={{ position: 'relative', display: 'flex', flexDirection: 'column', height: '100%', justifyContent: 'space-between' }}>
      <div className="wordmark" style={{ fontSize: 80 }}>LOAF'D</div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 12, alignItems: 'flex-start' }}>
        <div style={{ fontFamily: 'var(--mono)', fontSize: 22, letterSpacing: '0.22em', opacity: 0.7, textTransform: 'uppercase' }}>{kicker}</div>
        {words.map((w, i) =>
      <div key={i} style={{
        fontFamily: 'var(--display)', fontSize: fitSize(w, 150, 7), lineHeight: 0.88, wordBreak: 'break-word',
        color: i === 1 ? 'var(--ochre)' : 'var(--cream)',
        textShadow: i === 1 ? '5px 5px 0 var(--raspberry)' : '5px 5px 0 var(--raspberry)',
        transform: i === 1 ? 'translateX(40px)' : 'translateX(0)',
        textTransform: 'uppercase'
      }}>{w}</div>
      )}
      </div>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' }}>
        <div style={{ fontSize: 28, lineHeight: 1.4, maxWidth: '28ch' }}>{subhead}</div>
        <div style={{ fontFamily: 'var(--display)', fontSize: 80, color: 'var(--ochre)', textShadow: '4px 4px 0 var(--raspberry)' }}>{price}</div>
      </div>
    </div>
  </div>;


// Variation 4 · Editorial — type-first, all raspberry
const SocialV4 = ({ kicker, headline, subhead, price, tag }) =>
<div style={{ width: '100%', height: '100%', padding: 88, background: 'var(--raspberry)', color: 'var(--cream)', display: 'flex', flexDirection: 'column', justifyContent: 'space-between', position: 'relative' }}>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 22, letterSpacing: '0.2em', textTransform: 'uppercase', opacity: 0.85 }}>{kicker}</div>
      <div className="chip dot" style={{ color: 'var(--cream)', fontSize: 20, padding: '10px 22px 8px' }}>SWORDS · ASHBOURNE · DROGHEDA</div>
    </div>
    <div>
      <div style={{ fontFamily: 'var(--display)', fontSize: fitSize(headline, 210, 8), lineHeight: 0.85, textTransform: 'uppercase', textShadow: '6px 6px 0 var(--black)', wordBreak: 'break-word' }}>{headline}</div>
      <div style={{ borderTop: '4px solid var(--cream)', marginTop: 32, paddingTop: 32, display: 'grid', gridTemplateColumns: '1fr auto', gap: 48, alignItems: 'center' }}>
        <div style={{ fontSize: 36, lineHeight: 1.3, maxWidth: '30ch' }}>{subhead}</div>
        <div style={{ textAlign: 'right' }}>
          <div style={{ fontFamily: 'var(--display)', fontSize: 90, color: 'var(--ochre)', textShadow: '5px 5px 0 var(--black)', lineHeight: 1 }}>{price}</div>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 18, letterSpacing: '0.2em', opacity: 0.8, marginTop: 12, textTransform: 'uppercase' }}>{tag}</div>
        </div>
      </div>
    </div>
    <div className="wordmark reverse" style={{ fontSize: 70, alignSelf: 'flex-end' }}>LOAF'D</div>
  </div>;


// ── Opening hours posters ───────────────────────────────────────────────
const HoursPoster = ({ location, hours, address, size = 'A3' }) => {
  // A3 = 297×420mm; A2 = 420×594mm. We'll use proportional px (1mm ≈ 4px).
  const W = size === 'A2' ? 1680 : 1188;
  const H = size === 'A2' ? 2376 : 1680;
  const days = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'];
  return (
    <div style={{ width: W, height: H, background: 'var(--cream)', padding: 100, display: 'flex', flexDirection: 'column', position: 'relative', overflow: 'hidden' }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
        <div className="wordmark" style={{ fontSize: 180 }}>LOAF'D</div>
        <div style={{ textAlign: 'right' }}>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 28, letterSpacing: '0.2em', opacity: 0.55, textTransform: 'uppercase' }}>OPENING</div>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 28, letterSpacing: '0.2em', opacity: 0.55, textTransform: 'uppercase' }}>HOURS</div>
        </div>
      </div>
      <div style={{ marginTop: 80, fontFamily: 'var(--display)', fontSize: fitSize(location, 220, 7), color: 'var(--raspberry)', textShadow: '8px 8px 0 #4a1a2e', WebkitTextStroke: '2px #4a1a2e', lineHeight: 0.9, textTransform: 'uppercase' }}>
        {location}
      </div>
      <div style={{ marginTop: 60, flex: 1, display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
        {days.map((d, i) =>
        <div key={d} style={{ display: 'grid', gridTemplateColumns: '180px 1fr auto', alignItems: 'baseline', gap: 32, padding: '24px 0', borderTop: i === 0 ? '4px solid var(--black)' : '1px solid rgba(0,0,0,0.18)' }}>
            <div style={{ fontFamily: 'var(--display)', fontSize: 64, textTransform: 'uppercase' }}>{d}</div>
            <div style={{ fontFamily: 'var(--mono)', fontSize: 24, letterSpacing: '0.15em', opacity: 0.5, textTransform: 'uppercase' }}>{i === 5 || i === 6 ? 'WEEKEND' : 'WEEKDAY'}</div>
            <div style={{ fontFamily: 'var(--display)', fontSize: 64, color: 'var(--raspberry)' }}>{hours[i]}</div>
          </div>
        )}
        <div style={{ borderTop: '4px solid var(--black)' }} />
      </div>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginTop: 60 }}>
        <div>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 26, letterSpacing: '0.18em', opacity: 0.55, textTransform: 'uppercase' }}>FIND US</div>
          <div style={{ fontFamily: 'var(--display)', fontSize: 48, marginTop: 8, textTransform: 'uppercase' }}>{address}</div>
        </div>
        <div className="chip dot" style={{ background: 'var(--raspberry)', color: 'var(--cream)', borderColor: 'var(--raspberry)', fontSize: 32, padding: '14px 30px 12px' }}>{location.toUpperCase()}</div>
      </div>
    </div>);

};

// ── Open-the-box launch promo ───────────────────────────────────────────
const LaunchPromo = ({ size = 'A3', headline, subhead, dateLine, locationLine, prize }) => {
  const W = size === 'A2' ? 1680 : 1188;
  const H = size === 'A2' ? 2376 : 1680;
  return (
    <div style={{ width: W, height: H, background: 'var(--black)', color: 'var(--cream)', padding: 100, display: 'flex', flexDirection: 'column', position: 'relative', overflow: 'hidden' }}>
      {/* opening box graphic — abstract */}
      <svg viewBox="0 0 1000 700" style={{ position: 'absolute', top: 280, right: -120, width: 900, opacity: 0.95 }}>
        {/* box base */}
        <path d="M 200 500 L 800 500 L 720 680 L 280 680 Z" fill="var(--mocha)" stroke="#000" strokeWidth="6" />
        {/* box back flap */}
        <path d="M 200 500 L 800 500 L 850 380 L 250 380 Z" fill="var(--ochre)" stroke="#000" strokeWidth="6" />
        {/* steam puff 1 */}
        <ellipse cx="500" cy="280" rx="160" ry="90" fill="var(--rose)" stroke="#000" strokeWidth="6" />
        <ellipse cx="380" cy="200" rx="100" ry="60" fill="var(--cream)" stroke="#000" strokeWidth="6" />
        <ellipse cx="640" cy="190" rx="110" ry="65" fill="var(--cream)" stroke="#000" strokeWidth="6" />
        {/* toastie peeking */}
        <rect x="380" y="430" width="240" height="80" fill="var(--ochre)" stroke="#000" strokeWidth="6" />
        <rect x="380" y="430" width="240" height="20" fill="var(--raspberry)" stroke="#000" strokeWidth="6" />
      </svg>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', position: 'relative', zIndex: 2 }}>
        <div className="wordmark" style={{ fontSize: 160 }}>LOAF'D</div>
        <div className="chip dot" style={{ background: 'var(--ochre)', color: 'var(--black)', borderColor: 'var(--ochre)', fontSize: 28, padding: '14px 30px 12px' }}>LAUNCH WEEK</div>
      </div>
      <div style={{ marginTop: 64, position: 'relative', zIndex: 2 }}>
        <div style={{ fontFamily: 'var(--mono)', fontSize: 32, letterSpacing: '0.25em', opacity: 0.75, textTransform: 'uppercase' }}>{dateLine}</div>
        <div className="h-shadow cream" style={{ fontSize: 260, lineHeight: 0.85, marginTop: 24, color: 'var(--cream)', WebkitTextStroke: '2px var(--raspberry)', textShadow: '8px 8px 0 var(--raspberry)' }}>
          OPEN<br />THE<br />BOX.
        </div>
        <div style={{ fontSize: 44, marginTop: 40, maxWidth: '24ch', lineHeight: 1.3 }}>{subhead}</div>
      </div>
      <div style={{ marginTop: 'auto', display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 64, position: 'relative', zIndex: 2 }}>
        <div>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 24, letterSpacing: '0.2em', opacity: 0.6, textTransform: 'uppercase' }}>HOW IT WORKS</div>
          <div style={{ fontSize: 32, marginTop: 14, lineHeight: 1.35 }}>{headline}</div>
        </div>
        <div style={{ background: 'var(--raspberry)', padding: 48, borderRadius: 14 }}>
          <div style={{ fontFamily: 'var(--mono)', fontSize: 22, letterSpacing: '0.2em', opacity: 0.85, textTransform: 'uppercase' }}>YOU COULD WIN</div>
          <div style={{ fontFamily: 'var(--display)', fontSize: fitSize(prize, 72, 12), lineHeight: 0.95, marginTop: 14, textShadow: '5px 5px 0 var(--black)', textTransform: 'uppercase', wordBreak: 'break-word' }}>{prize}</div>
        </div>
      </div>
      <div style={{ marginTop: 48, fontFamily: 'var(--mono)', fontSize: 24, letterSpacing: '0.18em', opacity: 0.6, textTransform: 'uppercase' }}>{locationLine}</div>
    </div>);

};

// ── A5 tent card (148×210 mm — double-sided) ─────────────────────────────
const TentFront = ({ headline, subhead, price, tag }) =>
<div style={{ width: 592, height: 840, background: 'var(--cream)', padding: 56, display: 'flex', flexDirection: 'column', justifyContent: 'space-between', position: 'relative' }}>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
      <div className="wordmark" style={{ fontSize: 72 }}>LOAF'D</div>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 14, letterSpacing: '0.2em', opacity: 0.5, textTransform: 'uppercase' }}>TODAY</div>
    </div>
    <div>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 16, letterSpacing: '0.22em', opacity: 0.6, textTransform: 'uppercase' }}>ON THE PASS</div>
      <div className="h-shadow" style={{ fontSize: fitSize(headline, 84, 10), marginTop: 16, lineHeight: 0.9, wordBreak: 'break-word' }}>{headline}</div>
      <div style={{ fontSize: 22, marginTop: 20, lineHeight: 1.4, maxWidth: '28ch', opacity: 0.85 }}>{subhead}</div>
    </div>
    <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' }}>
      <div>
        <div style={{ fontFamily: 'var(--display)', fontSize: 84, color: 'var(--raspberry)', textShadow: '4px 4px 0 #4a1a2e', lineHeight: 1 }}>{price}</div>
        <div style={{ fontFamily: 'var(--mono)', fontSize: 13, letterSpacing: '0.18em', opacity: 0.55, marginTop: 6, textTransform: 'uppercase' }}>ASK YOUR SERVER</div>
      </div>
      <div style={{ background: 'var(--ochre)', color: 'var(--black)', fontFamily: 'var(--display)', padding: '14px 20px', borderRadius: 8, fontSize: 22, transform: 'rotate(-5deg)', boxShadow: '4px 4px 0 var(--black)', textTransform: 'uppercase' }}>{tag}</div>
    </div>
  </div>;


const TentBack = ({ items, social }) =>
<div style={{ width: 592, height: 840, background: 'var(--raspberry)', color: 'var(--cream)', padding: 56, display: 'flex', flexDirection: 'column', justifyContent: 'space-between' }}>
    <div>
      <div className="wordmark reverse" style={{ fontSize: 60 }}>LOAF'D</div>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 16, letterSpacing: '0.22em', opacity: 0.8, marginTop: 12, textTransform: 'uppercase' }}>WHILE YOU WAIT</div>
    </div>
    <div>
      <div className="h-shadow cream" style={{ fontSize: 72, lineHeight: 0.95 }}>FOLLOW US.<br />GET HYPED.</div>
      <div style={{ marginTop: 32, display: 'flex', flexDirection: 'column', gap: 14 }}>
        {items.map((line, i) =>
      <div key={i} style={{ display: 'flex', gap: 14, alignItems: 'baseline' }}>
            <div style={{ width: 10, height: 10, borderRadius: '50%', background: 'var(--ochre)', flex: '0 0 auto', transform: 'translateY(-3px)' }} />
            <div style={{ fontSize: 22, lineHeight: 1.35 }}>{line}</div>
          </div>
      )}
      </div>
    </div>
    <div style={{ borderTop: '2px solid rgba(255,255,255,0.3)', paddingTop: 24 }}>
      <div style={{ fontFamily: 'var(--display)', fontSize: 36, color: 'var(--ochre)', textShadow: '3px 3px 0 var(--black)', textTransform: 'uppercase' }}>{social}</div>
      <div style={{ fontFamily: 'var(--mono)', fontSize: 14, letterSpacing: '0.18em', opacity: 0.8, marginTop: 8, textTransform: 'uppercase' }}>LOAFD.IE</div>
    </div>
  </div>;


// ── Main templates section ───────────────────────────────────────────────
const TemplatesSection = ({ data }) => {
  const d = data;
  return (
    <section className="section" id="templates" data-screen-label="10 Templates" style={{ background: 'var(--paper)' }}>
      <div className="section-head">
        <div className="section-num">SECTION<strong>10</strong>TEMPLATES</div>
        <div>
          <h2 className="section-title">Templates.</h2>
          <p className="section-kicker">
            Pre-built layouts for the things you actually need every week — social posts, hours posters, a launch promo and table tents. All editable from the Tweaks panel: change a price, a date or a headline and watch it flow through every layout.
          </p>
        </div>
      </div>

      {/* — Social posts — */}
      <div style={{ marginTop: 24, marginBottom: 16 }}>
        <div className="card-label">10.1 · INSTAGRAM 4:5 · 1080×1350</div>
      </div>

      {/* Brunch served all day */}
      <div style={{ marginBottom: 16, fontFamily: 'var(--display)', fontSize: 28, textTransform: 'uppercase' }}>Brunch, all day.</div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 24, marginBottom: 56 }}>
        <TemplateFrame label="V1 · TYPE-LED · CREAM" width={1080} height={1350}>
          <SocialV1 kicker={d.brunch.kicker} headline={d.brunch.headline} subhead={d.brunch.subhead} price={d.brunch.price} tag={d.brunch.tag} />
        </TemplateFrame>
        <TemplateFrame label="V2 · PHOTO HERO" width={1080} height={1350}>
          <SocialV2 kicker={d.brunch.kicker} headline={d.brunch.headlineShort} subhead={d.brunch.subhead} price={d.brunch.price} placeholderLabel="OVERHEAD BRUNCH FLAT-LAY" />
        </TemplateFrame>
        <TemplateFrame label="V3 · STICKER COLLAGE" width={1080} height={1350}>
          <SocialV3 kicker={d.brunch.kicker} words={['BRUNCH.', 'ALL.', 'DAY.']} subhead={d.brunch.subhead} price={d.brunch.price} />
        </TemplateFrame>
        <TemplateFrame label="V4 · EDITORIAL RASPBERRY" width={1080} height={1350}>
          <SocialV4 kicker={d.brunch.kicker} headline={'YES,\nALL DAY.'} subhead={d.brunch.subhead} price={d.brunch.price} tag={d.brunch.tag} />
        </TemplateFrame>
      </div>

      {/* New item launch */}
      <div style={{ marginBottom: 16, fontFamily: 'var(--display)', fontSize: 28, textTransform: 'uppercase' }}>New item launch.</div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 24, marginBottom: 56 }}>
        <TemplateFrame label="V1 · TYPE-LED · CREAM" width={1080} height={1350}>
          <SocialV1 kicker={d.launch.kicker} headline={d.launch.headline} subhead={d.launch.subhead} price={d.launch.price} tag={d.launch.tag} />
        </TemplateFrame>
        <TemplateFrame label="V2 · PHOTO HERO" width={1080} height={1350}>
          <SocialV2 kicker={d.launch.kicker} headline={d.launch.headlineShort} subhead={d.launch.subhead} price={d.launch.price} placeholderLabel="HAND-HELD · 45° · CHEESE PULL" />
        </TemplateFrame>
        <TemplateFrame label="V3 · STICKER COLLAGE" width={1080} height={1350}>
          <SocialV3 kicker={d.launch.kicker} words={['NEW.', d.launch.shortName.toUpperCase() + '.']} subhead={d.launch.subhead} price={d.launch.price} />
        </TemplateFrame>
        <TemplateFrame label="V4 · EDITORIAL RASPBERRY" width={1080} height={1350}>
          <SocialV4 kicker={d.launch.kicker} headline={d.launch.shortName.toUpperCase() + '.'} subhead={d.launch.subhead} price={d.launch.price} tag={d.launch.tag} />
        </TemplateFrame>
      </div>

      {/* Matcha menu */}
      <div style={{ marginBottom: 16, fontFamily: 'var(--display)', fontSize: 28, textTransform: 'uppercase' }}>Matcha menu.</div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 24, marginBottom: 80 }}>
        <TemplateFrame label="V1 · TYPE-LED · CREAM" width={1080} height={1350}>
          <SocialV1 kicker={d.matcha.kicker} headline={d.matcha.headline} subhead={d.matcha.subhead} price={d.matcha.price} tag={d.matcha.tag} />
        </TemplateFrame>
        <TemplateFrame label="V2 · PHOTO HERO" width={1080} height={1350}>
          <SocialV2 kicker={d.matcha.kicker} headline={d.matcha.headlineShort} subhead={d.matcha.subhead} price={d.matcha.price} placeholderLabel="ICED MATCHA · OVERHEAD" />
        </TemplateFrame>
        <TemplateFrame label="V3 · STICKER COLLAGE" width={1080} height={1350}>
          <SocialV3 kicker={d.matcha.kicker} words={['MATCHA.', 'NOW ON.']} subhead={d.matcha.subhead} price={d.matcha.price} />
        </TemplateFrame>
        <TemplateFrame label="V4 · EDITORIAL RASPBERRY" width={1080} height={1350}>
          <SocialV4 kicker={d.matcha.kicker} headline={'MATCHA\nMENU.'} subhead={d.matcha.subhead} price={d.matcha.price} tag={d.matcha.tag} />
        </TemplateFrame>
      </div>

      {/* — Opening hours posters — */}
      <div style={{ marginTop: 24, marginBottom: 16 }}>
        <div className="card-label">10.2 · OPENING HOURS · A3 + A2 · ONE PER LOCATION</div>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24, marginBottom: 48 }}>
        <TemplateFrame label="SWORDS · A3" width={1188} height={1680} scale={0.18}>
          <HoursPoster location="SWORDS" hours={d.hours.swords} address="Swords · Co. Dublin" size="A3" />
        </TemplateFrame>
        <TemplateFrame label="ASHBOURNE · A3" width={1188} height={1680} scale={0.18}>
          <HoursPoster location="ASHBOURNE" hours={d.hours.ashbourne} address="Ashbourne · Co. Meath" size="A3" />
        </TemplateFrame>
        <TemplateFrame label="DROGHEDA · A3" width={1188} height={1680} scale={0.18}>
          <HoursPoster location="DROGHEDA" hours={d.hours.drogheda} address="Drogheda · Co. Louth" size="A3" />
        </TemplateFrame>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24, marginBottom: 80 }}>
        <TemplateFrame label="SWORDS · A2" width={1680} height={2376} scale={0.13}>
          <HoursPoster location="SWORDS" hours={d.hours.swords} address="Swords · Co. Dublin" size="A2" />
        </TemplateFrame>
        <TemplateFrame label="ASHBOURNE · A2" width={1680} height={2376} scale={0.13}>
          <HoursPoster location="ASHBOURNE" hours={d.hours.ashbourne} address="Ashbourne · Co. Meath" size="A2" />
        </TemplateFrame>
        <TemplateFrame label="DROGHEDA · A2" width={1680} height={2376} scale={0.13}>
          <HoursPoster location="DROGHEDA" hours={d.hours.drogheda} address="Drogheda · Co. Louth" size="A2" />
        </TemplateFrame>
      </div>

      {/* — Open-the-box launch promo — */}
      <div style={{ marginTop: 24, marginBottom: 16 }}>
        <div className="card-label">10.3 · OPEN-THE-BOX LAUNCH PROMO · A3 + A2</div>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 32, marginBottom: 80 }}>
        <TemplateFrame label="A3" width={1188} height={1680} scale={0.27}>
          <LaunchPromo size="A3" headline={d.launch.promoHow} subhead={d.launch.promoSub} dateLine={d.launch.promoDate} locationLine={d.launch.promoWhere} prize={d.launch.promoPrize} />
        </TemplateFrame>
        <TemplateFrame label="A2" width={1680} height={2376} scale={0.19}>
          <LaunchPromo size="A2" headline={d.launch.promoHow} subhead={d.launch.promoSub} dateLine={d.launch.promoDate} locationLine={d.launch.promoWhere} prize={d.launch.promoPrize} />
        </TemplateFrame>
      </div>

      {/* — Tent cards — */}
      <div style={{ marginTop: 24, marginBottom: 16 }}>
        <div className="card-label">10.4 · A5 TENT CARD · DOUBLE-SIDED</div>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: 32 }}>
        <TemplateFrame label="FRONT · TODAY'S SPECIAL" width={592} height={840} scale={0.5}>
          <TentFront headline={d.tent.frontHeadline} subhead={d.tent.frontSub} price={d.tent.frontPrice} tag={d.tent.frontTag} />
        </TemplateFrame>
        <TemplateFrame label="BACK · WHILE YOU WAIT" width={592} height={840} scale={0.5}>
          <TentBack items={d.tent.backItems} social={d.tent.backSocial} />
        </TemplateFrame>
      </div>
    </section>);

};

window.TemplatesSection = TemplatesSection;