import { motion } from 'framer-motion'

interface Props {
  kicker: string
  title: string
  lead?: string
  image?: string
}

/** Compact hero banner for inner pages. */
export default function PageHero({ kicker, title, lead, image }: Props) {
  return (
    <header className="relative overflow-hidden bg-ocean-700 pt-36 pb-20 text-white">
      {image && (
        <div
          className="absolute inset-0 bg-cover bg-center opacity-30"
          style={{ backgroundImage: `url(${image})` }}
          aria-hidden
        />
      )}
      <div
        className="absolute inset-0 bg-gradient-to-b from-ocean-700/60 to-ocean-700/90"
        aria-hidden
      />
      <motion.div
        className="wrap relative z-10 text-center"
        initial={{ opacity: 0, y: 24 }}
        animate={{ opacity: 1, y: 0 }}
        transition={{ duration: 0.7, ease: 'easeOut' }}
      >
        <p className="mb-4 text-[0.78rem] font-semibold tracking-[0.3em] uppercase text-turquoise-200">
          {kicker}
        </p>
        <h1 className="mx-auto max-w-3xl text-[clamp(2.2rem,5vw,3.4rem)] font-semibold">{title}</h1>
        {lead && <p className="mx-auto mt-4 max-w-xl text-white/85">{lead}</p>}
      </motion.div>
    </header>
  )
}
