/* Embeds -------------------------------------------------------------- */

.embed--spotify iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
}

/* A YouTube video keeps the player's 16:9 shape at whatever width the
   column gives it; the frame has no border and fills the box. */
.embed--youtube {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-raised);
}

.embed--youtube iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* A player held until the visitor allows videos and music: the frame waits
   in a <template>, and in its place stands a small dark stage as big as the
   player will be — so the page does not jump when the frame comes in — lit
   the way the hero is, pink from one corner and blue from the other, with
   the provider's mark, the player's title, why it waits and the button
   that lets it in. --fill takes the shape of a box that already has one
   (the 16:9 of a YouTube video); --tall and --short stand as high as
   Spotify's two players.

   The two-class selectors outrank .prose p, which the prose pack — linked
   after this one — sets on every paragraph of a text section. */
.embed-gate {
  container-type: inline-size;
}

.embed-gate--fill {
  height: 100%;
}

.embed-gate__ask {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-content: center;
  justify-items: center;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(90% 120% at 0% 0%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 62%),
    radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--secondary) 24%, transparent), transparent 62%),
    var(--stage-mid);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.embed-gate__mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-1);
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.embed-gate__mark svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.embed-gate .embed-gate__title {
  max-width: 32ch;
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
}

.embed-gate .embed-gate__note {
  max-width: 42ch;
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--ink-soft);
}

.embed-gate__action {
  margin-top: var(--space-2);
}

.embed-gate--tall .embed-gate__ask {
  min-height: 352px;
}

/* Spotify's bar is 152 px: the mark goes to the left and the words and the
   button stack beside it. */
.embed-gate--short .embed-gate__ask {
  min-height: 152px;
  grid-template-columns: auto minmax(0, 1fr);
  place-content: center stretch;
  justify-items: start;
  column-gap: var(--space-4);
  row-gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  text-align: start;
}

.embed-gate--short .embed-gate__mark {
  grid-row: 1 / span 3;
  align-self: center;
  margin: 0;
}

.embed-gate--short .embed-gate__title,
.embed-gate--short .embed-gate__note,
.embed-gate--short .embed-gate__action {
  grid-column: 2;
}

.embed-gate--short .embed-gate__title {
  font-size: var(--text-base);
}

.embed-gate--short .embed-gate__action {
  margin-top: var(--space-1);
}

/* --inline is a gate that holds no player — Google's survey on the
   thank-you page waits for its yes the same way — so it has no player's
   height to keep: the --short bar at its own height, a little apart from
   what is above and below it, and its explanation stays even when narrow,
   because why it waits is the whole point of it. */
.embed-gate--inline {
  margin-block: var(--space-4);
}

.embed-gate--inline .embed-gate__ask {
  min-height: 0;
}

/* Wide enough, the bar reads in one line the way Spotify's own does: mark,
   words, and the button at the far end. */
@container (min-width: 560px) {
  .embed-gate--short .embed-gate__ask {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .embed-gate--short .embed-gate__action {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
  }
}

/* A narrow player — a video floated beside the text, a phone — keeps the
   title and the button and lets the explanation go, unless it is Spotify's
   tall one, which has the height for it. */
@container (max-width: 380px) {
  .embed-gate:not(.embed-gate--tall, .embed-gate--inline) .embed-gate__note {
    display: none;
  }

  .embed-gate__ask {
    padding: var(--space-4);
  }

  .embed-gate__mark {
    width: 2.5rem;
    height: 2.5rem;
  }

  .embed-gate .embed-gate__title {
    font-size: var(--text-base);
  }
}
