/* ============================================================
   Qera — Hero
   Handles full-bleed alignment, responsive heights, and copy overlays.
   ============================================================ */

{% scope_css %}
.qera-hero {
  position: relative;
  width: 100%;
  min-height: 80dvh;
  display: flex;
  align-items: center;
  background-color: var(--primitives-qera-black-950);
  
  /* Allocate space for the absolutely-positioned global header */
  padding-top: calc(var(--spacing-3xl) + 90px);
  padding-bottom: var(--spacing-3xl);
  overflow: hidden;
}

/* Background image or video container styling */
.qera-hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.qera-hero__image,
.qera-hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scrim that keeps white text legible over an arbitrary photo.
   Tinted with Qera Black rather than pure black.

   Strength is driven by --qera-scrim-pct, set from the "Image
   overlay strength" slider on the Styles tab (default 73). The
   three stops keep their relative weighting — 1 : 0.63 : 0.22 —
   so the gradient's shape holds at any strength, and the default
   resolves to the brand ladder's 73 / 46 / 16.

   The arithmetic is done here in calc() rather than in HubL, so
   the template only has to pass a plain integer through. */
.qera-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 8, 7, calc(var(--qera-scrim-pct, 73) * 1%)) 0%,
    rgba(10, 8, 7, calc(var(--qera-scrim-pct, 73) * 0.63%)) 50%,
    rgba(10, 8, 7, calc(var(--qera-scrim-pct, 73) * 0.22%)) 100%
  );
  z-index: 2;
}

.qera-hero__container {
  position: relative;
  z-index: 3; /* Positions container on top of backdrop and overlay */
}

.qera-hero__content {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: var(--spacing-md);
  max-width: 60ch;
}

.qera-hero__eyebrow {
  font-family: var(--typography-family-primary);
  font-weight: var(--typography-weight-semibold);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: calc(-1 * var(--spacing-xs));
}

.qera-hero__eyebrow--muted {
  color: var(--primitives-qera-blue-300);
}

.qera-hero__eyebrow--accent {
  color: var(--color-text-accent);
}

.qera-hero__eyebrow--white {
  color: rgba(253, 251, 251, 0.6);
}

/* Heading and body are white on the dark backdrop. The Styles-tab
   colour pickers feed --qera-heading-override / --qera-body-override,
   so they still work here. */
.qera-hero__heading {
  color: var(--qera-heading-override, var(--primitives-qera-white-0));
  font-family: var(--typography-family-primary);
  font-weight: var(--typography-weight-bold);
  font-size: var(--typography-size-h1);
  line-height: var(--typography-line-height-h1);
  letter-spacing: var(--typography-letter-spacing-h1);
  margin: 0;
}

.qera-hero__body {
  color: var(--qera-body-override, var(--primitives-qera-white-50));
  font-family: var(--typography-family-primary);
  font-weight: var(--typography-weight-regular);
  font-size: var(--typography-size-body-reg);
  line-height: var(--typography-line-height-body);
  letter-spacing: var(--typography-letter-spacing-body);
  opacity: var(--opacity-high);
}

.qera-hero__body p {
  margin: 0;
}

.qera-hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-md);
}

.qera-hero__secondary-link {
  color: var(--primitives-qera-white-0) !important;
}

.qera-hero__secondary-link:hover {
  color: var(--color-text-accent) !important;
}

@media (max-width: 767px) {
  .qera-hero {
    min-height: auto;
    padding-top: calc(var(--spacing-2xl) + 80px);
    padding-bottom: var(--spacing-2xl);
  }

  /* On a phone the text runs the full width, so the left-to-right
     fade left the end of every line over the lightest part of the
     photo. An even scrim keeps the whole line legible. */
  .qera-hero__overlay {
    background: rgba(10, 8, 7, calc(var(--qera-scrim-pct, 73) * 0.8%));
  }
}
{% endscope_css %}
