.custombox-overlay { left: 0; z-index: 300000 !important; }
.custombox-content { left: 0; z-index: 300001 !important; }

/* CustomboxのfadeInとページ全体のfadeInの名前衝突を避ける。 */
body {
  -webkit-animation-name: zutto-page-fade-in;
  animation-name: zutto-page-fade-in;
}
@keyframes zutto-page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.custombox-fadein.custombox-content.custombox-open {
  animation-name: zutto-popup-content-in;
}
.custombox-fadein.custombox-content.custombox-close {
  animation-name: zutto-popup-content-out;
}
@keyframes zutto-popup-content-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes zutto-popup-content-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
.custombox-open #zutto-popup-banner .zutto-popup-banner__image {
  animation: zutto-popup-image-in 300ms ease-out 150ms both;
}
.custombox-close #zutto-popup-banner .zutto-popup-banner__image {
  animation: zutto-popup-image-out 300ms ease-in both;
}
@keyframes zutto-popup-image-in {
  from { transform: scale(0.7); }
  to { transform: scale(1); }
}
@keyframes zutto-popup-image-out {
  from { transform: scale(1); }
  to { transform: scale(0.7); }
}

#zutto-popup-banner {
  display: none;
  position: relative;
  width: fit-content;
  max-width: calc(100vw - 48px);
  max-height: none;
}
#zutto-popup-banner > a { display: block; }
#zutto-popup-banner .zutto-popup-banner__image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(800px, calc(100vw - 48px));
  max-height: calc(100dvh - 96px);
  object-fit: contain;
}
#zutto-popup-banner .zutto-popup-banner__close {
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 50%;
  background: #fff;
  color: #222;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
#zutto-popup-banner .zutto-popup-banner__close:focus-visible {
  outline: 3px solid #222;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .custombox-content, .custombox-overlay { animation-duration: 1ms !important; }
  #zutto-popup-banner .zutto-popup-banner__image {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
