/* Pagefind 検索 modal の独自スタイル。
   <dialog> backdrop が Twenty Sixteen テーマ環境で描画されない問題が
   あったため、自前 <div> ベースの overlay + panel 構成にした。 */

/* === 検索トリガー (sidebar) === */
.pagefind-open-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4em;
  width: 100%;
  height: 38px;
  padding: 0 0.9em;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  justify-content: flex-start;
}
.pagefind-open-btn:hover {
  background: #f5f5f5;
  border-color: #999;
}
.pagefind-open-btn svg {
  flex-shrink: 0;
}

/* === Modal overlay === */
.pagefind-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: block;
}
.pagefind-modal[hidden] {
  display: none !important;
}
.pagefind-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.pagefind-modal__panel {
  position: relative;
  max-width: 720px;
  width: 90vw;
  max-height: 80vh;
  margin: 8vh auto 0;
  padding: 1.5rem;
  background: #fff;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: auto;
}

/* === Pagefind UI のテーマ干渉を解除 === */
.pagefind-modal a,
.pagefind-modal a:hover,
.pagefind-modal a:focus,
.pagefind-modal a:visited {
  color: #034ad8;
  text-decoration: none;
}
.pagefind-modal a:hover {
  text-decoration: underline;
}

/* Pagefind UI default の input padding-left は icon 位置 (left: calc(20px
   * scale) + width calc(18px * scale) + 余白) と整合する calc(54px * scale)
   (scale 0.8 で 43.2px)。Twenty Sixteen の input base style が specificity
   競合で勝って padding を上書きしてしまうため、明示的に !important で固定。
   em ベース指定だと mobile で font-size auto-zoom 連動して狭くなるため px。 */
.pagefind-modal .pagefind-ui input.pagefind-ui__search-input {
  padding-left: calc(54px * var(--pagefind-ui-scale, 0.8)) !important;
  box-sizing: border-box;
}

.pagefind-modal .pagefind-ui button {
  color: inherit;
}
