/* ==========================================================================
   The spotlight band.

   One photograph and one paragraph, side by side, inserted between two
   four-across grids to break a run of three of them. Its whole job is to
   have a DIFFERENT rhythm from its neighbours, so it is deliberately
   asymmetric - the photo column is wider than the text column - and it
   never becomes a grid of its own at any width.

   No background colour, on purpose. The lime band below it draws a wave on
   its top edge filled white, which only reads as a wave when the section
   above really is white. See the PAGE_BANDS note in templates/page.mjs.
   ========================================================================== */

/* The band sits closer to the section it interrupts than a normal section
   would. Both this and the section above carried 112px, stacking into 224px
   of white above the photograph - the single biggest empty run on the page,
   and most of what read as stark.

   :has() rather than a class on the section, so this stays a stylesheet
   change and the template does not move. The bottom padding is deliberately
   left alone: the lime wave below needs its run-up. */
.section:has(> .wrap.spotlight) {
  padding-top: clamp(1rem, 2.5vw, 2.25rem);
}

.spotlight {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}

/* position + z-index:0 opens a stacking context, so the keyline below can sit
   at z-index:-1 and still paint above the white section behind it. */
.spotlight__shot {
  margin: 0;
  position: relative;
  z-index: 0;
  --keyline: 3px;
}

.spotlight__shot img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---- The teal keyline -----------------------------------------------------

   This was first drawn with chained drop-shadow filters. That traces the
   alpha channel, which is exactly why it had to go: the photograph is a
   cut-out, and the coach's head and one child's arm rise OUT of the rounded
   rectangle. The filter faithfully outlined her hair too, which read as a
   halo. A filter has no way to outline part of a silhouette.

   So the keyline is now a shape in its own right, laid over the rounded
   rectangle only, with everything that overflows it left un-outlined.

   The numbers come from measuring the alpha channel of the source file,
   site/footer1-proc-2.webp, 1629x1447:

       rounded rect   x 97..1612   y 211..1431   corner radius 188px

   As a share of the image box that is 14.58% in from the top, 0.98% right,
   1.04% bottom, 5.95% left. border-radius percentages resolve horizontally
   against this box's width and vertically against its height, so 12.4%/15.4%
   is a circular 188px corner at every size.

   THIS IS TIED TO THAT ONE PHOTOGRAPH. If the spotlight image is ever
   swapped in the CMS, these six numbers have to be measured again or the
   line will sit in the wrong place. Nothing breaks - it just looks wrong.

   z-index:-1 puts it behind the photo, so it passes behind the arm that
   overhangs the left edge instead of being drawn across it. */
.spotlight__shot::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset:
    calc(14.58% - var(--keyline))
    calc(0.98%  - var(--keyline))
    calc(1.04%  - var(--keyline))
    calc(5.95%  - var(--keyline));
  border: var(--keyline) solid var(--teal);
  border-radius: 12.4% / 15.4%;
  pointer-events: none;
}

.spotlight__body { min-width: 0; }

.spotlight__stars {
  display: block;
  width: clamp(54px, 7vw, 74px);
  height: auto;
  margin-bottom: 0.9rem;
}

.spotlight__body h2 { margin: 0 0 0.75rem; }
.spotlight__body .eyebrow { margin-bottom: 0.4rem; }
.spotlight__body .lede { margin: 0; }

@media (max-width: 860px) {
  .spotlight {
    grid-template-columns: 1fr;
    gap: clamp(1.25rem, 5vw, 2rem);
  }
  /* Words first on a phone: the paragraph is the reason the section exists
     and a tall photograph would otherwise push it off the screen. */
  .spotlight__body { order: -1; }
  /* The cap goes on the FIGURE, not the image. The keyline is positioned
     against the figure's box, so the two have to stay the same size. */
  .spotlight__shot {
    max-width: 460px;
    margin-inline: auto;
    --keyline: 2px;
  }
}
