/**
 * Hello Home — "Take Drum Channel with You Anywhere".
 *
 * Copy and a white button on the left, a cut-out of two phones on the right,
 * on the site's red band. The live page ships this as two rows hidden from
 * each other by device; one grid does both.
 */

.hello-anywhere {
  --hello-pad-y: clamp(40px, 5vw, 72px);
  --hello-pad-x: clamp(20px, 5vw, 60px);
  --hello-width: calc(1180px + 2 * clamp(20px, 5vw, 60px));
  /* The band is the accent unless an editor sets one. The live page paints
     the row #e11d3d by hand; this tracks the plugin's red instead, so the
     two stay in step if it ever moves. */
  background: var(--hello-bg, var(--hello-accent));
  color: #fff;
  position: relative;
  isolation: isolate;
}

/**
 * The logo swoosh over the band.
 *
 * On the live page this is a .mpc-overlay child div, not a row background,
 * which is why it is easy to miss when reading the markup. Same treatment
 * here -- cover, centred -- but as a pseudo-element, so the widget keeps one
 * element per thing that is actually content. The artwork carries its own
 * 0.6 opacity, so none is applied.
 */
.hello-anywhere::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("anywhere/swoosh.svg") center / cover no-repeat;
  pointer-events: none;
}

.hello-anywhere .hello-widget__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

/* ---- copy --------------------------------------------------------------- */

.hello-anywhere__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* The kicker is white here. Its usual accent red is the band. */
.hello-anywhere__kicker {
  color: #fff;
}

.hello-anywhere__heading {
  margin: 0 0 18px;
  font-size: clamp(30px, 3.6vw, 50px) !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
  text-wrap: balance;
}

/**
 * Gold, not red: an accent run on an accent-coloured band would be invisible.
 * The shared on-dark rule turns accents white, which is also wrong here --
 * the whole heading is already white, so it would pick out nothing.
 */
.hello-anywhere .hello-widget__accent {
  color: var(--hello-gold);
}

.hello-anywhere__body {
  /* The live page pins this to width: 500px, which overflows its column
     below about 560px. A measure in ch does the same job and reflows. */
  max-width: 54ch;
  margin: 0 0 28px;
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.6;
}

.hello-anywhere .hello-btn.hello-anywhere__btn {
  min-width: 263px;
  min-height: 64px;
  font-size: 17px;
  font-weight: 700;
}

/* ---- the cut-out -------------------------------------------------------- */

/**
 * No frame, no ratio box: this is a PNG with an alpha channel and the band
 * is meant to show through it. Height is capped rather than set so a taller
 * replacement cannot stretch the section.
 */
.hello-anywhere__media {
  display: flex;
  justify-content: center;
}

.hello-anywhere__img {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  /* The theme rounds images in post content; a cut-out has no corners to
     round, and the radius clips the phones. */
  border-radius: 0;
}

/* ---- image on the left -------------------------------------------------- */

.hello-anywhere--flip .hello-anywhere__copy {
  order: 2;
}
.hello-anywhere--flip .hello-anywhere__media {
  order: 1;
}

/* ---- centred, no image -------------------------------------------------- */

/**
 * What the lesson pages' "Ready to Rock?" band is: the same copy and button,
 * no artwork, everything on the centre line. One column rather than two, so
 * the grid is overridden rather than given an empty second track -- an empty
 * track would still take half the width and push the copy off centre.
 */
.hello-anywhere--centered .hello-widget__inner {
  grid-template-columns: minmax(0, 1fr);
}

.hello-anywhere--centered .hello-anywhere__copy {
  align-items: center;
  text-align: center;
}

.hello-anywhere--centered .hello-anywhere__body {
  /* Centred text reads at a narrower measure than ragged-right does. */
  max-width: 46ch;
}

/* ---- stacked ------------------------------------------------------------ */

@media (max-width: 899px) {
  .hello-anywhere .hello-widget__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  /**
   * Image above the copy, whichever side it takes on desktop -- which is how
   * the live page's stacked variant (#mobile-m) orders it. Its own source
   * order puts the kicker first, then the phones, then the heading; one
   * element cannot do that without splitting the copy block, and the kicker
   * riding above the image earns less than the consistency costs.
   */
  .hello-anywhere__media {
    order: 1;
  }
  .hello-anywhere__copy {
    order: 2;
    align-items: center;
    text-align: center;
  }
  .hello-anywhere__body {
    max-width: none;
  }
  .hello-anywhere__img {
    max-width: 440px;
  }
}

@media (max-width: 599px) {
  .hello-anywhere .hello-btn.hello-anywhere__btn {
    width: 100%;
    min-width: 0;
  }
}
