.webfluence-popup__overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;

  display: flex;
  justify-content: center;
  align-items: center;
  /* Equal breathing room on every side; combined with the popup's
     width: 100% this guarantees the popup stays perfectly centered. */
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.webfluence-popup__popup {
  position: relative;
}

.webfluence-popup__overlay.active {
  opacity: 1;
  pointer-events: all;
}

.webfluence-popup__popup {
  /* Inherit the site's design tokens set in Global settings so the popup
     matches the configured colours, radius and typography. */
  background-color: var(--sectionBgColor, #fff);
  color: var(--textBodyColor, inherit);
  border-radius: var(--borderRadius, 0);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Landscape images need a wider popup, otherwise they are shown too small. */
.webfluence-popup__popup--landscape {
  max-width: 720px;
}

/* Full-bleed image at the top of the popup. */
.webfluence-popup__image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Padded text content. Extra top padding leaves room for the close button
   when there is no image. */
.webfluence-popup__body {
  padding: 40px 30px 30px;
}

.webfluence-popup__content {
  padding: 20px;
}

.webfluence-popup__title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.webfluence-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--sectionBgColor, #fff);
  color: var(--textBodyColor, #092426);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.webfluence-popup__close svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.webfluence-popup__close:hover,
.webfluence-popup__close:focus,
.webfluence-popup__close:active {
  background-color: var(--primaryColor, #092426);
  color: var(--textColorOnPrimaryBg, #fff);
  transform: scale(1.05);
}
