/* 事故治療ナビのポップアップバナー (tmp/popup-banner.php / js/popup-banner.js)
   本文の流れに入れない position:fixed の重ね表示なので、出ても本文はずれない (CLS なし)。 */
.p-popup-banner[hidden] {
  display: none;
}

.p-popup-banner {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10000; /* SP 追従バー(.footer-fixed, 3000)・ヘッダーより前 */
  display: flex;
  align-items: center;
  justify-content: center;
  animation: p-popup-banner-fade 0.25s ease-out;
}

.p-popup-banner__overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* SP: 横幅 80%・最大 320px。縦が短い画面でも収まるよう高さの 70% も上限にする */
.p-popup-banner__dialog {
  position: relative;
  width: min(80vw, 320px, 70vh);
}

/* PC: 最大 440px (1440 幅で画面の約 30%)。縦が短い画面では高さの 60% まで */
@media screen and (min-width: 761px) {
  .p-popup-banner__dialog {
    width: min(440px, 60vh);
  }
}

.p-popup-banner__link {
  display: block;
  /* 画像の角 (青枠の角丸の外) を切り落とす */
  border-radius: 2.4%;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s;
}

.p-popup-banner__link:hover {
  opacity: 0.9;
}

.p-popup-banner__link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* 右上の大きめの×ボタン (押しやすいよう 44px) */
.p-popup-banner__close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #222;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  -webkit-appearance: none;
  appearance: none;
}

.p-popup-banner__close:hover {
  opacity: 0.8;
}

@keyframes p-popup-banner-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
