/*
 * 松屋アプリのポップアップ（浅草サイト全ページ・左下固定）
 * 配置先: wp-content/themes/matsuya-asakusa/css/app-popup.css
 * マークアップと表示制御のスクリプトは footer.php（.go-to-top の直後）。
 * 既定は非表示。footer.php のスクリプトが .is-visible を付けたときだけ表示する。
 */
.app-popup {
  display: none;
  position: fixed;
  left: 18px;
  bottom: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 990; /* .go-to-top・.header-fixed・.toggle-menu-list（いずれも 1000）より下 */
  width: 240px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  box-shadow: 0 0 23px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  color: #19191a;
  line-height: 1.7;
  letter-spacing: 0; /* テーマの p { letter-spacing: 1.6px } 相当を持ち込まない */
  transition: box-shadow 0.2s;
}
.app-popup.is-visible {
  display: block;
}
.app-popup:hover {
  box-shadow: 0 0 23px rgba(0, 0, 0, 0.32);
}

/* PC の検索オーバーレイ（body.js-body-search-active）を開いている間は隠す */
.js-body-search-active .app-popup {
  visibility: hidden;
}

.app-popup__link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.app-popup__img {
  display: block;
  width: 100%;
  height: auto;
}
.app-popup__title,
.app-popup__more {
  display: block;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}
.app-popup__title {
  margin-top: 12px;
  font-size: 16px;
}
.app-popup__more {
  margin-top: 4px;
  font-size: 14px;
}

/* 閉じるボタン（右上の丸い ×）。見た目は 22px、押せる範囲は ::before で 40px に広げる */
.app-popup__close {
  position: absolute;
  top: -11px;
  right: -11px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #19191a;
  border-radius: 50%;
  background: #fff;
  color: #19191a;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.app-popup__close::before {
  content: "";
  position: absolute;
  top: -9px;
  right: -9px;
  bottom: -9px;
  left: -9px;
}
.app-popup__close svg {
  display: block;
  width: 100%;
  height: 100%;
}
.app-popup__close:hover {
  background: #19191a;
  color: #fff;
}

/* テーマが * { outline: none } を当てているため、キーボード操作のフォーカスを明示する */
.app-popup__link:focus-visible,
.app-popup__close:focus-visible {
  outline: 2px solid #19191a;
  outline-offset: 2px;
}

/* スマートフォン（テーマの SP 切替と同じ 767px 以下） */
@media only screen and (max-width: 767px) {
  .app-popup {
    width: 150px;
    padding: 10px;
  }
  .app-popup__title {
    margin-top: 8px;
    font-size: 12px;
  }
  .app-popup__more {
    margin-top: 2px;
    font-size: 10px;
  }
}

/* 高さの無い画面（スマートフォン横向きなど）では一回り小さくする */
@media only screen and (max-height: 420px) {
  .app-popup {
    width: 124px;
    padding: 8px;
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .app-popup__title {
    margin-top: 6px;
    font-size: 10px;
  }
  .app-popup__more {
    margin-top: 0;
    font-size: 10px;
  }
}

@media print {
  .app-popup {
    display: none !important;
  }
}
