/* Hero (full bleed) -------------------------------------------------------- */

.wl-hero-full {
  position: relative;
  display: grid;
  isolation: isolate;
  padding-block: 0;                 /* the section's own padding would break the bleed */
  background: var(--wl-ink);        /* seen while the image decodes, and when there is none */
  color: var(--wl-on-ink);
  overflow: hidden;
}

.wl-hero-full.is-tall { min-height: clamp(460px, 76svh, 820px); }
.wl-hero-full.is-full { min-height: 100svh; }

/* Media ------------------------------------------------------------------- */

.wl-hero-full__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.wl-hero-full__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* The scrim. This is the one gradient the house rules allow, and only here:
   text sits directly on a photograph the client chose, so its contrast
   cannot be left to chance. It is neutral and it only ever darkens. */
.wl-hero-full__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wl-hero-full.has-scrim-soft .wl-hero-full__media::after {
  background: linear-gradient(
    to top,
    rgba(10, 18, 24, 0.78) 0%,
    rgba(10, 18, 24, 0.42) 42%,
    rgba(10, 18, 24, 0.12) 72%,
    rgba(10, 18, 24, 0.04) 100%
  );
}

.wl-hero-full.has-scrim-strong .wl-hero-full__media::after {
  background: linear-gradient(
    to top,
    rgba(10, 18, 24, 0.9) 0%,
    rgba(10, 18, 24, 0.64) 45%,
    rgba(10, 18, 24, 0.36) 75%,
    rgba(10, 18, 24, 0.24) 100%
  );
}

/* Centred text needs the scrim even in the middle of the frame. */
.wl-hero-full.is-centre.has-scrim-soft .wl-hero-full__media::after {
  background: rgba(10, 18, 24, 0.44);
}

.wl-hero-full.is-centre.has-scrim-strong .wl-hero-full__media::after {
  background: rgba(10, 18, 24, 0.62);
}

/* No photograph: a flat field, not a broken frame. */
.wl-hero-full.is-flat { background: var(--wl-ink); }

/* Text -------------------------------------------------------------------- */

.wl-hero-full__inner {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.wl-hero-full.is-bottom-left .wl-hero-full__inner,
.wl-hero-full.is-bottom-wide .wl-hero-full__inner { align-content: end; }
.wl-hero-full.is-centre .wl-hero-full__inner { align-content: center; }

.wl-hero-full__text > * + * { margin-top: var(--wl-space-md); }

/*
 * A `ch` measure has to sit on the element whose font it is measuring.
 *
 * These three used to put it on __text, which inherits body type at ~17px,
 * so "20 characters" came out 214px wide — and the heading inside it, set at
 * 80px, wrapped one word per line on every desktop. The heading is the thing
 * being measured, so the heading carries the limit. The intro keeps its own,
 * further down, in its own size.
 */
.wl-hero-full.is-bottom-wide .wl-hero-full__text,
.wl-hero-full.is-bottom-left .wl-hero-full__text { max-width: none; }
.wl-hero-full.is-centre .wl-hero-full__text {
  margin-inline: auto;
  text-align: center;
}

.wl-hero-full__heading {
  font-size: var(--wl-text-4xl);
  color: var(--wl-on-ink);
  text-wrap: balance;
}

.wl-hero-full.is-bottom-left .wl-hero-full__heading { max-width: 16ch; }
.wl-hero-full.is-centre .wl-hero-full__heading {
  max-width: 18ch;
  margin-inline: auto;
}

.wl-hero-full.is-bottom-wide .wl-hero-full__heading {
  /* Running the width, so it can go larger than the standard display step. */
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  max-width: 16ch;
}

.wl-hero-full__intro {
  font-size: var(--wl-text-lg);
  line-height: 1.45;
  color: var(--wl-on-ink);
  max-width: 44ch;
}

.wl-hero-full.is-centre .wl-hero-full__intro { margin-inline: auto; }

.wl-hero-full__actions { margin-top: var(--wl-space-lg); }

/* The button sits on a photograph, so it is the light one regardless of the
   page's tone, matching how .is-ink treats buttons elsewhere. */
.wl-hero-full .wl-btn {
  background: var(--wl-on-ink);
  border-color: var(--wl-on-ink);
  color: var(--wl-ink);
}

.wl-hero-full .wl-btn:hover,
.wl-hero-full .wl-btn:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--wl-ink);
}

.wl-hero-full :focus-visible { outline-color: var(--wl-on-ink); }

/* Phone ------------------------------------------------------------------- */

@media (max-width: 47.99em) {
  .wl-hero-full.is-tall { min-height: clamp(420px, 68svh, 620px); }

  /* Centred text at phone width leaves the heading floating with nothing
     under it, so every position becomes bottom-aligned and left-read. */
  .wl-hero-full.is-centre .wl-hero-full__inner { align-content: end; }
  .wl-hero-full.is-centre .wl-hero-full__text {
    max-width: none;
    margin-inline: 0;
    text-align: left;
  }

  .wl-hero-full__text { max-width: none; }
  .wl-hero-full.is-bottom-left .wl-hero-full__text { max-width: none; }

  .wl-hero-full.is-bottom-wide .wl-hero-full__heading { font-size: clamp(2.25rem, 11vw, 3.5rem); }

  .wl-hero-full__actions { margin-top: var(--wl-space-md); }
  .wl-hero-full .wl-btn { display: block; text-align: center; }
}
