/* Beehiiv embeds and their no-script link, scoped to newsletter placements. */
.beehiiv-signup {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.beehiiv-signup *,
.beehiiv-signup *::before,
.beehiiv-signup *::after {
  box-sizing: border-box;
}

.beehiiv-signup .beehiiv-form-slot {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.beehiiv-signup iframe,
.beehiiv-form-slot iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.beehiiv-form-link {
  margin: 0.65rem 0 0;
  font-size: 0.76rem;
  line-height: 1.5;
}

.beehiiv-form-link a {
  color: #176b8a;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

.beehiiv-form-link a:hover {
  color: #173344;
}

.beehiiv-form-link a:focus-visible {
  outline: 3px solid #147c8a;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Resources callout: preserve its blue surface and give the embed real room. */
.coherence-brief-box {
  min-width: 0;
}

.coherence-brief-box > div:first-child {
  flex: 1 1 0;
}

.coherence-brief-box > .beehiiv-signup,
.coherence-brief-box .beehiiv-signup {
  flex: 0 1 560px;
  width: min(100%, 560px);
  min-width: 260px;
  text-align: left;
}

/* Keep the guide signup centered and comfortably readable. */
.guide-subscribe .beehiiv-signup {
  max-width: 560px;
  margin: 1rem auto 0;
  text-align: left;
}

.guide-subscribe .beehiiv-form-link {
  text-align: center;
}

/* Reserve a useful measure for the provider without disturbing footer links. */
footer .footer-top .inner:has(.footer-newsletter .beehiiv-form-slot) {
  grid-template-columns:
    minmax(0, 1.1fr)
    minmax(120px, 0.82fr)
    minmax(120px, 0.82fr)
    minmax(280px, 1.4fr);
}

.footer-newsletter {
  min-width: 0;
}

.footer-newsletter .beehiiv-signup {
  max-width: 100%;
  text-align: left;
}

/* A light link surface stays legible on either light or dark footer treatments. */
.footer-newsletter .beehiiv-form-link {
  margin-top: 0.6rem;
}

.footer-newsletter .beehiiv-form-link a {
  display: inline-block;
  padding: 0.16rem 0.38rem;
  color: #173344;
  background: #eaf2f6;
  border-radius: 3px;
}

.footer-newsletter .beehiiv-form-link a:hover {
  color: #102a39;
  background: #d7e8f0;
}

.footer-newsletter .beehiiv-form-link a:focus-visible {
  outline-color: #b9eaf3;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  footer .footer-top .inner:has(.footer-newsletter .beehiiv-form-slot) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .coherence-brief-box > .beehiiv-signup,
  .coherence-brief-box .beehiiv-signup {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .guide-subscribe .beehiiv-signup {
    margin-top: 0.9rem;
  }

  /* This supplied form has 80px side gutters inside its cross-origin iframe.
     Remove those empty gutters from narrow placements, not the form content.
     Widening its viewport keeps the input and button full-size, unlike scaling. */
  .beehiiv-form-slot {
    overflow: hidden !important;
  }

  .beehiiv-form-slot iframe {
    width: calc(100% + 160px) !important;
    max-width: none !important;
    margin-left: -80px;
  }
}

@media (max-width: 600px) {
  footer .footer-top .inner:has(.footer-newsletter .beehiiv-form-slot) {
    grid-template-columns: minmax(0, 1fr);
  }
}
