/**
 * The Magazine newsletter band and modal stacking.
 * Migrated from Simple Custom CSS and JS snippets 67000 and 67001.
 */

.jci-magazine-page__inner > .jci-mag-newsletter-band,
.jci-magazine-category .jci-magazine-page__inner > .jci-mag-newsletter-band,
.jci-article__newsletter-shell .jci-mag-newsletter-band {
  left: auto;
  right: auto;
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  background-color: #ecf2ff;
  box-shadow: 0 0 0 100vmax #ecf2ff;
  clip-path: inset(0 -100vmax);
}

.jci-magazine-page__inner > .jci-mag-newsletter-band .jci-mag-newsletter-band__inner,
.jci-magazine-category .jci-magazine-page__inner > .jci-mag-newsletter-band .jci-mag-newsletter-band__inner,
.jci-article__newsletter-shell .jci-mag-newsletter-band__inner {
  width: 100%;
  max-width: none;
}

/* The Magazine newsletter: keep the shared CTA and kicker readable across every Magazine template. */
.jci-mag-newsletter-band .jci-mag-home__kicker {
  color: var(--jci-editorial-accent, #2a62ff) !important;
}

/* The component owns the action geometry so modal buttons and fallback links
 * render identically in EN, ES and NL. */
.jci-mag-newsletter-band .jci-mag-home__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.jci-mag-newsletter-band .jci-mag-home-button,
.jci-mag-newsletter-band .jci-mag-home-link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  min-height: 46px;
  margin: 0;
  padding: 0 22px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.jci-mag-newsletter-band .jci-mag-home-button {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.jci-mag-newsletter-band .jci-mag-home-button,
.jci-mag-newsletter-band .jci-mag-home-button--newsletter-modal {
  border-color: var(--jci-editorial-accent, #2a62ff) !important;
  background: var(--jci-editorial-accent, #2a62ff) !important;
  color: #ffffff !important;
}

.jci-mag-newsletter-band .jci-mag-home-button:hover,
.jci-mag-newsletter-band .jci-mag-home-button:focus-visible,
.jci-mag-newsletter-band .jci-mag-home-button--newsletter-modal:hover,
.jci-mag-newsletter-band .jci-mag-home-button--newsletter-modal:focus-visible {
  border-color: #0f3fb6 !important;
  background: #0f3fb6 !important;
  color: #ffffff !important;
}

/* Newsletter CTA arrows use the same directional affordance in every
 * consumer. Keep this scoped to the shared newsletter component so the
 * homepage does not inherit Magazine-wide CTA behavior. */
.jci-mag-newsletter-band .jci-mag-home-button > span[aria-hidden="true"],
.jci-mag-newsletter-band .jci-mag-home-link > span[aria-hidden="true"],
.jci-new-home .jci-new-magazine__cta > span[aria-hidden="true"] {
  display: inline-block;
  transition: transform 160ms ease;
}

.jci-mag-newsletter-band .jci-mag-home-button:hover > span[aria-hidden="true"],
.jci-mag-newsletter-band .jci-mag-home-button:focus-visible > span[aria-hidden="true"],
.jci-mag-newsletter-band .jci-mag-home-link:hover > span[aria-hidden="true"],
.jci-mag-newsletter-band .jci-mag-home-link:focus-visible > span[aria-hidden="true"],
.jci-new-home .jci-new-magazine__cta:hover > span[aria-hidden="true"],
.jci-new-home .jci-new-magazine__cta:focus-visible > span[aria-hidden="true"] {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .jci-mag-newsletter-band .jci-mag-home-button > span[aria-hidden="true"],
  .jci-mag-newsletter-band .jci-mag-home-link > span[aria-hidden="true"],
  .jci-new-home .jci-new-magazine__cta > span[aria-hidden="true"] {
    transition: none;
  }

  .jci-mag-newsletter-band .jci-mag-home-button:hover > span[aria-hidden="true"],
  .jci-mag-newsletter-band .jci-mag-home-button:focus-visible > span[aria-hidden="true"],
  .jci-mag-newsletter-band .jci-mag-home-link:hover > span[aria-hidden="true"],
  .jci-mag-newsletter-band .jci-mag-home-link:focus-visible > span[aria-hidden="true"],
  .jci-new-home .jci-new-magazine__cta:hover > span[aria-hidden="true"],
  .jci-new-home .jci-new-magazine__cta:focus-visible > span[aria-hidden="true"] {
    transform: none;
  }
}


/* Shared newsletter modal. This component is loaded both by The Magazine and
 * the homepage, so the modal must own its complete layout here rather than in
 * magazine.css. That keeps the homepage lightweight while preserving the same
 * dialog behavior and appearance in every consumer. */
.jci-mag-modal-open {
  overflow: hidden;
}

.jci-mag-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 28px);
}

.jci-mag-modal[hidden] {
  display: none;
}

.jci-mag-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(26, 79, 215, 0.18), transparent 40%),
    rgba(7, 24, 58, 0.74);
  backdrop-filter: blur(10px);
}

.jci-mag-modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(920px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid rgba(7, 24, 58, 0.1);
  background:
    linear-gradient(180deg, rgba(247, 244, 236, 0.88), rgba(255, 255, 255, 0.98)),
    #ffffff;
  box-shadow: 0 30px 90px rgba(7, 24, 58, 0.24);
  overflow: hidden;
}

.jci-mag-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(7, 24, 58, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #07183a;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.jci-mag-modal__eyebrow {
  color: rgba(7, 24, 58, 0.54);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.jci-mag-modal__title {
  margin: 0;
  max-width: 12ch;
  color: #07183a;
  font-size: clamp(24px, 3.6vw, 46px);
  line-height: 0.94;
}

.jci-mag-modal__intro {
  margin: 0;
  max-width: 48ch;
  color: rgba(7, 24, 58, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.jci-mag-modal__frame-shell {
  height: 100px;
  border: 1px solid rgba(7, 24, 58, 0.08);
  background:
    linear-gradient(180deg, rgba(248, 248, 246, 0.95), rgba(255, 255, 255, 0.98)),
    #ffffff;
  overflow: hidden;
}

.jci-mag-modal__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.jci-mag-modal__close:hover,
.jci-mag-modal__close:focus-visible {
  border-color: rgba(26, 79, 215, 0.34);
  color: var(--jci-editorial-accent, #2a62ff);
}

@media (max-width: 1100px) {
  .jci-mag-modal__panel {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .jci-mag-modal__title {
    max-width: none;
  }

  .jci-mag-modal__frame-shell {
    height: 320px;
  }
}

/* Current Zoho Campaigns Web-Optin embeds render inside the same modal shell as
 * the legacy URL/iframe form. The modal already provides the newsletter title,
 * so the duplicate Zoho heading is hidden. Zoho outputs that heading with an
 * inline display declaration; the scoped !important is required only to
 * override that third-party inline style. */
.jci-mag-modal__frame-shell--embed {
  display: grid;
  place-items: center;
  padding-inline: 20px;
}

.jci-mag-modal__embed {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.jci-mag-modal__embed [data-type="signupform"],
.jci-mag-modal__embed [name="SIGNUP_BODY"] {
  max-width: 100%;
  margin-inline: auto;
}

.jci-mag-modal__embed #SIGNUP_HEADING {
  display: none !important;
}
