/* Rogue Studio の登録ポップアップ（inc/rogue-popup.php・assets/js/rogue-popup.js と対）。
   position: fixed なので本文のレイアウトは動かない（CLS なし）。 */
.rogue-popup[hidden] { display: none; }

.rogue-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .2s ease;
}
.rogue-popup.is-open { opacity: 1; }

.rogue-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 20, .72);
}

.rogue-popup__panel {
  position: relative;
  /* SP: 最大 360×360、画面幅 − 32px まで縮める */
  width: min(360px, calc(100vw - 32px));
  margin-top: 52px; /* 上に置く閉じるボタンの分 */
}

.rogue-popup__link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .45);
}
.rogue-popup__link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.rogue-popup__link img {
  display: block;
  width: 100%;
  height: auto;
}

/* 閉じるボタン: 44×44px 以上。SP は画像の上（右寄せ）。 */
.rogue-popup__close {
  position: absolute;
  top: -52px;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 50%;
  background: rgba(20, 20, 32, .85);
  color: #fff;
  cursor: pointer;
}
.rogue-popup__close:hover { background: rgba(50, 50, 70, .95); }
.rogue-popup__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* PC（600px 以上）: 600×400、横3：縦2。画面が低いときは高さに合わせて縮める。 */
@media (min-width: 600px) {
  .rogue-popup__panel {
    width: min(600px, calc(100vw - 32px), calc((100vh - 120px) * 1.5));
  }
}

/* 画像の右上の外側に置ける幅があるときは外側へ。 */
@media (min-width: 740px) {
  .rogue-popup__panel { margin-top: 0; }
  .rogue-popup__close {
    top: -52px;
    right: -52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rogue-popup { transition: none; }
}
