/* CV promotion popup */

.tcb-popup-root {
  --tcb-popup-brand: #4abaa4;
  position: fixed;
  inset: 0;
  /* ChatBot（z-index: 9999）より前面に出す */
  z-index: 10000;
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

/*
 * ポップアップ配下の全要素にルートのフォントを継承させる。
 * front-page.css のリセットが p / span / button 等へ font-family: sans-serif を
 * 直接指定しており、継承だけだと上書きされてしまう。
 */
.tcb-popup-root * {
  font-family: inherit;
}

.tcb-popup__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.tcb-popup-root--open .tcb-popup__overlay {
  opacity: 1;
}

.tcb-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  /*
   * バナーをできるだけ大きく見せる。上限は画像の原寸（852px）で、
   * それを超えて引き伸ばすとぼやけるため min() で頭打ちにする。
   */
  width: min(852px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  /* 画像をフチまで出すため余白と角丸は持たせない */
  padding: 0;
  border-radius: 0;
  background-color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  /* 開くときに下からわずかに持ち上げる */
  transform: translate(-50%, calc(-50% + 12px));
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.tcb-popup-root--open .tcb-popup {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* 余白が無いぶん、閉じるボタンはバナーの右上に重ねる */
.tcb-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  /* 画像の上でも視認できるよう白背景を敷く */
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tcb-popup__close:hover {
  background-color: #fff;
  color: #111;
}

.tcb-popup__close:focus,
.tcb-popup__close:focus-visible {
  outline: 2px solid var(--tcb-popup-brand);
  outline-offset: 1px;
}

/* heading を使うパターン用。ダイアログ側に余白が無いのでここで持たせる */
.tcb-popup__heading {
  margin: 0;
  padding: 20px 44px 14px 20px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: #333;
  text-align: center;
}

.tcb-popup__link {
  display: block;
  transition: opacity 0.18s ease;
}

.tcb-popup__link:hover {
  opacity: 0.88;
}

.tcb-popup__link:focus,
.tcb-popup__link:focus-visible {
  outline: 2px solid var(--tcb-popup-brand);
  outline-offset: 2px;
}

/* image_sp 指定時は <picture> で包まれる。picture は既定が inline なので block 化する */
.tcb-popup__picture {
  display: block;
}

.tcb-popup__image {
  display: block;
  width: 100%;
  height: auto;
}

/* type: 'iframe'（外部フォーム埋め込み）用 */
.tcb-popup__iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  border: none;
}

@media (max-width: 575px) {
  .tcb-popup {
    /* SP でも余白を最小限にして横幅いっぱいに見せる */
    width: calc(100vw - 16px);
  }

  .tcb-popup__heading {
    padding: 16px 40px 12px 16px;
    font-size: 14px;
  }

  .tcb-popup__iframe {
    min-height: 360px;
  }
}

/* アニメーションを控える設定の環境ではトランジションを無効化する */
@media (prefers-reduced-motion: reduce) {
  .tcb-popup__overlay,
  .tcb-popup {
    transition: none;
  }
}
