/* ホワイトペーパー訴求ポップアップ（PC=左下 / SP=右下） */
.wp-popup {
  --wp-popup-white: #fff;
  --wp-popup-black: #000;
  --wp-popup-highlight: #313ee2;
  --wp-popup-focus: #0e6ec8;
  position: fixed;
  left: 16px;
  right: auto;
  bottom: 16px;
  z-index: 10000;
  width: clamp(300px, 20vw, 400px);
  padding-top: 8px;
  opacity: 0;
}

.wp-popup[hidden] {
  display: none;
}

.wp-popup--is-visible {
  animation: wp-popup-show 0.8s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.wp-popup--is-hiding {
  animation: wp-popup-hide 0.3s cubic-bezier(0.33, 1, 0.68, 1) forwards;
  pointer-events: none;
}

.wp-popup__link,
.wp-popup__image {
  display: block;
}

.wp-popup__link {
  position: relative;
  border-radius: 4px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.32),
    0 3px 8px rgba(0, 0, 0, 0.22),
    0 0 0 3px transparent;
  transition: box-shadow 0.2s ease;
}

.wp-popup__link:hover,
.wp-popup__link:focus-visible {
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.32),
    0 3px 8px rgba(0, 0, 0, 0.22),
    0 0 0 3px var(--wp-popup-highlight);
}

.wp-popup__link:focus-visible {
  outline: 3px solid var(--wp-popup-focus);
  outline-offset: 2px;
}

.wp-popup__image {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* ✕ボタンはバナーの右上 */
.wp-popup__close {
  position: absolute;
  top: -6px;
  right: -14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wp-popup-white);
  box-shadow: none;
  color: var(--wp-popup-black);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.wp-popup__close svg {
  width: 18px;
  height: 18px;
}

.wp-popup__close:hover,
.wp-popup__close:focus-visible {
  opacity: 1;
}

.wp-popup__close:focus-visible {
  outline: 3px solid var(--wp-popup-focus);
  outline-offset: 2px;
}

@keyframes wp-popup-show {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes wp-popup-hide {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(30px);
    opacity: 0;
  }
}

/* SPは右下固定。サイトのSP切り替え(991px)に合わせる。 */
@media (max-width: 991px) {
  .wp-popup {
    left: auto;
    right: 16px;
    bottom: 16px;
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 600px;
    padding: 0;
  }

  .wp-popup__close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .wp-popup__close svg {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wp-popup {
    opacity: 1;
  }

  .wp-popup--is-visible {
    animation: none;
  }

  .wp-popup--is-hiding {
    animation: none;
    opacity: 0;
  }
}
