/*
 * Gradient page background — the alumni_gradient_background page
 * setting.
 *
 * PageSettingsProvider owns the whole feature: the meta, the editor
 * toggle, the body class, and this stylesheet, which it enqueues only
 * on pages with the setting (and in the editor, where the toggle must
 * preview live). The body carries `has-gradient-background`; the
 * `light` variant fades the backdrop out while keeping the surface
 * treatments.
 *
 * Pruned on migration from the classic css/bg-transition.css: the
 * .affinity-module.big-header and .content-block rules referenced
 * markup no live content emits.
 */

body.has-gradient-background:before {
  background-color: #300;
  background-image:
    radial-gradient(ellipse at 70% 0, rgba(153, 0, 0, 0.7) 0, transparent 100%),
    radial-gradient(circle at 90% 0, rgba(255, 204, 0, 0.4) 0, transparent 40%),
    radial-gradient(ellipse at 0 0, rgba(112, 77, 239, 0.3) 0, transparent 60%),
    radial-gradient(circle at 30% 100%, rgba(153, 0, 60, 0.6) 0, rgba(224, 0, 0, 0.6) 40%, transparent 80%),
    radial-gradient(ellipse at 10% 100%, rgba(255, 0, 0, 0.7) 0, transparent 50%);
  position: fixed;
  content: "";
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 1s ease;
}

/* The header lets the page's backdrop show through: its cardinal ground is
   the masthead group style (theme.json), cleared here. */
body.has-gradient-background .site-header,
body.has-gradient-background .site-navigation,
body.has-gradient-background .is-style-masthead {
  background: none;
}

.editor-styles-wrapper.has-gradient-background {
  position: relative;
}

.editor-styles-wrapper.has-gradient-background::before {
  background-color: #300;
  background-image:
    radial-gradient(ellipse at 70% 0, rgba(153, 0, 0, 0.7) 0, transparent 100%),
    radial-gradient(circle at 90% 0, rgba(255, 204, 0, 0.4) 0, transparent 40%),
    radial-gradient(ellipse at 0 0, rgba(112, 77, 239, 0.3) 0, transparent 60%),
    radial-gradient(circle at 30% 100%, rgba(153, 0, 60, 0.6) 0, rgba(224, 0, 0, 0.6) 40%, transparent 80%),
    radial-gradient(ellipse at 10% 100%, rgba(255, 0, 0, 0.7) 0, transparent 50%);
  position: sticky;
  content: "";
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  margin-bottom: -100vh;
  opacity: 1;
  transition: opacity 1s ease;
  z-index: 0;
  pointer-events: none;
}

@media only screen and (min-width: 35em) {
  body.has-gradient-background .site-header:after {
    background: none;
  }
}

/* .feature-blocks is this page-setting's own wrapper class (applied to the
 * group around media-text blocks); .wp-block-media-text is core's own
 * generated class on the link inside it. */
/* stylelint-disable-next-line selector-max-class */
body.has-gradient-background .feature-blocks .wp-block-media-text > a {
  background: #fff;
}

/* .editor-styles-wrapper is Gutenberg's own editor-root class, needed
 * alongside this feature's own .has-gradient-background/.light so the
 * toggle previews live in the editor too. .feature-blocks is this
 * page-setting's own wrapper class; .wp-block-media-text is core's own
 * generated class on the link inside it. */
/* stylelint-disable selector-max-class */
body.has-gradient-background.light:before,
.editor-styles-wrapper.has-gradient-background.light::before {
  opacity: 0;
}

body.has-gradient-background.light .feature-blocks .wp-block-media-text > a {
  background: #f4f4f4;
}
/* stylelint-enable selector-max-class */
