/* ============================================================================
   UNIFIED HERO SYSTEM — shared hero base + variants  (T16.3)
   ----------------------------------------------------------------------------
   The single hero foundation the 8 per-context heroes migrate onto (frontpage,
   deal, news, workflow, agent + inline about/landing/partner-badge). Slot-driven
   like card-base: the common skeleton (lead/eyebrow/title/subtitle/desc/badges/
   meta/actions/media/aside) lives here; module-specific behaviour (search auto-
   complete, bookmark/follow state) is injected through raw *_html slots.

   Token-pure: every value references a design token via var(). Surfaces/borders
   use the `var(--semantic, var(--canonical))` pattern so the hero renders in BOTH
   light (canonical fallback) and dark (semantic layer, filled in T16.17).

   Layout variants: --centered (default) | --split | --media | --compact
   Inert until module markup adopts the classes (migrations are Phases 5–14).
   ========================================================================== */

/* ── Base ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  display: block;
  padding-block: var(--space-12);
  padding-inline: var(--space-5);
  background: var(--surface-card, var(--color-bg-primary));
  color: var(--color-text-primary);
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-max, 1200px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Decorative background layers (gradient/media). Behind content via z-index. */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 80% at 50% 0%, rgba(var(--color-primary-rgb), 0.08), transparent 70%);
}
.hero__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface-card, var(--color-bg-primary)));
}

/* ── Content blocks ──────────────────────────────────────────────────────── */
.hero__lead {            /* breadcrumbs / pre-title slot */
  margin-bottom: var(--space-2);
}
.hero__eyebrow {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-link, var(--color-primary));
}
.hero__title {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight, 1.1);
  color: var(--color-text-primary);
}
.hero__title-link {
  color: inherit;
  text-decoration: none;
}
.hero__title-link:hover {
  color: var(--color-text-link, var(--color-primary));
}
.hero__subtitle {
  margin: 0;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}
.hero__desc {
  margin: 0;
  max-width: 60ch;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
}

/* Badge / meta rows reuse the unified badge + meta-row systems. */
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-tertiary);
  font-size: var(--font-size-sm);
}

/* ── Actions (CTA row) ───────────────────────────────────────────────────── */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* ── Media + aside ───────────────────────────────────────────────────────── */
.hero__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero__media-img {
  display: block;
  width: 100%;
  height: auto;
}
.hero__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken, var(--color-bg-secondary));
  overflow: hidden;
}
.hero__logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero__search {
  width: 100%;
  max-width: 720px;
}
.hero__aside {
  flex: 0 0 auto;
}

/* ── Variant: centered (default) ─────────────────────────────────────────── */
.hero--centered .hero__inner {
  align-items: center;
  text-align: center;
}
.hero--centered .hero__desc {
  margin-inline: auto;
}
.hero--centered .hero__actions,
.hero--centered .hero__badges {
  justify-content: center;
}

/* ── Variant: split (text + media/aside side by side) ────────────────────── */
.hero--split .hero__inner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-10);
}
.hero--split .hero__body {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}
@media (max-width: 900px) {
  .hero--split .hero__inner {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Variant: media (full-bleed background image + overlay) ───────────────── */
.hero--media {
  color: var(--color-text-inverse, var(--color-white));
}
.hero--media .hero__title,
.hero--media .hero__subtitle,
.hero--media .hero__desc {
  color: var(--color-white);
}
.hero--media .hero__overlay {
  background: linear-gradient(to top, var(--color-overlay), transparent 70%);
}

/* ── Variant: compact (archive/section headers — tighter rhythm) ─────────── */
.hero--compact {
  padding-block: var(--space-8);
}
.hero--compact .hero__title {
  font-size: var(--font-size-3xl);
}
.hero--compact .hero__inner {
  gap: var(--space-3);
}

/* ── Responsive type scaling ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero {
    padding-block: var(--space-8);
  }
  .hero__title {
    font-size: var(--font-size-3xl);
  }
  .hero__subtitle {
    font-size: var(--font-size-lg);
  }
  .hero__desc {
    font-size: var(--font-size-base);
  }
}

/* Respect reduced-motion: nothing animates here by default, but keep media
   transforms (if a caller adds them) from running. */
@media (prefers-reduced-motion: reduce) {
  .hero *,
  .hero *::before,
  .hero *::after {
    transition: none !important;
  }
}
