/**
 * @file
 * MLT Modern — Hero block.
 *
 * Full-bleed blue gradient hero, left content + right form layout from
 * rewires.html. Designed to be dropped into a Drupal block in a hero_*
 * region. The .mlt-hero wrapper provides the gradient + padding; the
 * .mlt-hero__container holds the inner two-column grid.
 *
 * Markup pattern (see templates/block--mlt-hero--example.html.twig):
 *   <section class="mlt-hero">
 *     <div class="mlt-hero__container">
 *       <div class="mlt-hero__left"> ... headline, trust, CTAs, stats ... </div>
 *       <div class="mlt-hero__form">  ... webform ... </div>
 *     </div>
 *   </section>
 */

.mlt-hero {
  background: linear-gradient(135deg, var(--mlt-primary) 0%, var(--mlt-primary-dark) 100%);
  color: #fff;
  padding: 60px 0 70px;
  position: relative;

  /* Default overlay variables - used by .mlt-hero--has-overlay::before.
   * Editor-set values from the Hero paragraph override these inline. */
  --mlt-hero-overlay-color: var(--mlt-primary-dark);
  --mlt-hero-overlay-opacity: 0.8;
}

/* ---------------------------------------------------------------------
 * Background image variant. When the editor uploads a background image,
 * the template adds .mlt-hero--has-bg and sets inline:
 *   background-image: url(...)
 *   background-position: <chosen position>
 * Background-size is fixed to "cover" here in CSS.
 * --------------------------------------------------------------------- */
.mlt-hero--has-bg {
  background-size: cover;
  background-repeat: no-repeat;
  /* background-image and background-position come from inline style. */
}

/* ---------------------------------------------------------------------
 * Overlay. Sits on top of the background image but below the content.
 * Colour and opacity are CSS custom properties — defaults defined on
 * .mlt-hero above, overridable per-instance via inline style on the
 * .mlt-hero wrapper (set by paragraph--hero.html.twig).
 *
 * Only rendered when .mlt-hero--has-overlay is present (template only
 * adds this class when opacity > 0).
 * --------------------------------------------------------------------- */
.mlt-hero--has-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--mlt-hero-overlay-color);
  opacity: var(--mlt-hero-overlay-opacity);
  z-index: 0;
  pointer-events: none;
}

/* Content sits above the overlay. */
.mlt-hero--has-overlay > * {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------
 * Height variants. Apply via .mlt-hero--height-{small|medium|large|full-screen}.
 * Uses min-height + flex centring so the content vertically aligns at the
 * middle regardless of how much content there is.
 * --------------------------------------------------------------------- */
.mlt-hero--height-small {
  min-height: 350px;
  display: flex;
  align-items: center;
}

.mlt-hero--height-medium {
  min-height: 500px;
  display: flex;
  align-items: center;
}

.mlt-hero--height-large {
  min-height: 700px;
  display: flex;
  align-items: center;
}

.mlt-hero--height-full-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* When flex centred, the inner container needs to flex too so it can grow
 * to fill the available width. */
.mlt-hero--height-small > .mlt-hero__container,
.mlt-hero--height-medium > .mlt-hero__container,
.mlt-hero--height-large > .mlt-hero__container,
.mlt-hero--height-full-screen > .mlt-hero__container {
  width: 100%;
}

.mlt-hero__container {
  max-width: var(--mlt-container-max);
  margin: 0 auto;
  padding: 0 var(--mlt-container-pad);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: stretch;
}

/* When the hero is used without a form (single column), use this modifier. */
.mlt-hero__container--single {
  grid-template-columns: 1fr;
  max-width: 900px;
  text-align: center;
}

.mlt-hero__left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mlt-hero__heading {
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 800;
  color: #fff;
}

/* Use a span inside the heading to highlight a phrase in accent colour. */
.mlt-hero__heading span {
  color: var(--mlt-accent);
}

.mlt-hero__lede {
  font-size: 19px;
  line-height: 1.5;
  margin: 0 0 25px;
  opacity: 0.95;
}

.mlt-hero__cta-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

/* Embedded form card — sits in the right column. */
.mlt-hero__form {
  background: #fff;
  color: var(--mlt-text);
  padding: 30px;
  border-radius: var(--mlt-radius-lg);
  box-shadow: var(--mlt-shadow-hero-form);
}

.mlt-hero__form h3 {
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--mlt-primary);
}

.mlt-hero__form-sub {
  font-size: 14px;
  color: var(--mlt-text-light);
  margin-bottom: 20px;
}

.mlt-hero__form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--mlt-text);
}

.mlt-hero__form input[type="text"],
.mlt-hero__form input[type="email"],
.mlt-hero__form input[type="tel"],
.mlt-hero__form select,
.mlt-hero__form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--mlt-border);
  border-radius: var(--mlt-radius-md);
  font-size: 15px;
  margin-bottom: 14px;
  font-family: inherit;
}

.mlt-hero__form input:focus,
.mlt-hero__form select:focus,
.mlt-hero__form textarea:focus {
  outline: none;
  border-color: var(--mlt-primary);
  box-shadow: 0 0 0 3px var(--mlt-primary-light);
}

.mlt-hero__form input[type="submit"],
.mlt-hero__form button[type="submit"],
.mlt-hero__form button {
  width: 100%;
  background: var(--mlt-primary);
  color: #fff;
  padding: 14px;
  border: none;
  border-radius: var(--mlt-radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.mlt-hero__form input[type="submit"]:hover,
.mlt-hero__form button:hover {
  background: var(--mlt-primary-dark);
}

.mlt-hero__form-foot {
  font-size: 12px;
  color: var(--mlt-text-light);
  text-align: center;
  margin-top: 12px;
}

/* If the form is rendered via the parent's webform share script (iframe),
 * normalise its dimensions. */
.mlt-hero__form iframe {
  width: 100% !important;
  border: 0;
  min-height: 420px;
  display: block;
}
