// HoneyLabel.jsx — square honey-jar label. Two variants: standard, comb.
// Designed at 1:1 (320 × 320 mm screen units mapping to ~70 × 70 mm print).

const HoneyLabel = ({
  variant = 'standard',
  hive = 'No. VII',
  press = 'July MMXXV',
  weight = '340 g',
  flora = 'BRAMBLE · LIME · KNAPWEED',
  lot   = 'LOT 25-07-A',
}) => {
  const isComb = variant === 'comb';
  return (
    <div style={hlStyles.shell}>
      {/* Outer hairline frame */}
      <div style={hlStyles.frame}>
        {/* Inner hairline */}
        <div style={hlStyles.innerFrame}>

          <div style={hlStyles.top}>
            <div style={hlStyles.tinyMark}>· {hive} ·</div>
            <img src="../../assets/mark-hex.svg" alt="" style={hlStyles.mark}/>
            <div style={hlStyles.tinyMark}>· {lot} ·</div>
          </div>

          <hr style={hlStyles.doubleA} />
          <hr style={hlStyles.doubleB} />

          <div style={hlStyles.center}>
            <div style={hlStyles.house}>HEXQUEEN</div>
            <div style={hlStyles.provLine}>SOMERSET HONEY HOUSE</div>
            <div style={hlStyles.kind}>
              {isComb ? (<>Comb<br/><em style={hlStyles.italic}>in the jar</em></>) :
                       (<>Hedgerow<br/><em style={hlStyles.italic}>{press.split(' ')[0]}</em></>)}
            </div>
            <div style={hlStyles.flora}>{flora}</div>
          </div>

          <hr style={hlStyles.doubleA} />
          <hr style={hlStyles.doubleB} />

          <div style={hlStyles.bottom}>
            <div style={hlStyles.fact}>RAW</div>
            <div style={hlStyles.fact}>·</div>
            <div style={hlStyles.fact}>{weight}</div>
            <div style={hlStyles.fact}>·</div>
            <div style={hlStyles.fact}>{press.toUpperCase()}</div>
          </div>
        </div>
      </div>
    </div>
  );
};

const hlStyles = {
  shell: { width: 320, height: 320, position: 'relative' },
  frame: {
    position: 'absolute', inset: 0, background: 'var(--wax)',
    border: '1px solid var(--copper)',
    padding: 8,
    backgroundImage: "url('../../assets/texture-paper.svg')",
    backgroundSize: 'cover', backgroundBlendMode: 'multiply',
  },
  innerFrame: {
    width: '100%', height: '100%',
    border: '1px solid rgba(94,47,26,0.45)',
    padding: '16px 18px',
    display: 'flex', flexDirection: 'column',
    color: 'var(--ink)',
  },
  top: {
    display: 'flex', justifyContent: 'space-between', alignItems: 'center',
    marginBottom: 8,
  },
  tinyMark: {
    fontFamily: 'var(--font-display)', fontSize: 8, letterSpacing: '0.24em',
    color: 'var(--copper)', textTransform: 'uppercase',
  },
  mark: { width: 28, height: 28, color: 'var(--copper)' },
  doubleA: { border: 0, borderTop: '1px solid var(--copper)', margin: 0 },
  doubleB: { border: 0, borderTop: '0.5px solid var(--copper)', margin: '2px 0 0', opacity: 0.55 },
  center: {
    flex: 1, display: 'flex', flexDirection: 'column',
    alignItems: 'center', justifyContent: 'center',
    padding: '8px 0', textAlign: 'center', gap: 6,
  },
  house: {
    fontFamily: 'var(--font-display)', fontSize: 22, letterSpacing: '0.36em',
    color: 'var(--ink)', textTransform: 'uppercase',
  },
  provLine: {
    fontFamily: 'var(--font-display)', fontSize: 7.5, letterSpacing: '0.32em',
    color: 'var(--copper)', textTransform: 'uppercase', marginBottom: 8,
  },
  kind: {
    fontFamily: 'var(--font-editorial)', fontWeight: 500, fontSize: 30,
    lineHeight: 1.05, color: 'var(--ink)', letterSpacing: '-0.01em',
    fontVariantNumeric: 'oldstyle-nums',
  },
  italic: { fontFamily: 'var(--font-italic)', fontStyle: 'italic', color: 'var(--copper)', fontWeight: 400 },
  flora: {
    fontFamily: 'var(--font-display)', fontSize: 8, letterSpacing: '0.28em',
    color: 'var(--smoke)', textTransform: 'uppercase', marginTop: 4,
  },
  bottom: {
    display: 'flex', justifyContent: 'center', alignItems: 'center',
    gap: 8, marginTop: 8,
  },
  fact: {
    fontFamily: 'var(--font-display)', fontSize: 9, letterSpacing: '0.22em',
    color: 'var(--copper)', textTransform: 'uppercase',
  },
};

window.HoneyLabel = HoneyLabel;
