/**
 * カスタム検索UI スタイル
 * PagefindUIと同様のデザインを実装
 */

/* 検索コンテナ */
.custom-search {
  width: 100%;
  font-family: 'Noto Sans JP', sans-serif;
}

/* 検索入力エリア */
.custom-search__input-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 16px;
}

.custom-search__input {
  width: 100%;
  padding: 12px 80px 12px 16px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  font-family: 'Noto Sans JP', sans-serif;
}

.custom-search__input:focus {
  border-color: #00084d;
}

.custom-search__input::placeholder {
  color: #999;
}

/* クリアボタン */
.custom-search__clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 12px;
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.custom-search__clear:hover {
  background-color: #e0e0e0;
  color: #333;
}

/* 検索結果コンテナ */
.custom-search__results {
  display: none;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 600px;
  overflow-y: auto;
}

/* 検索結果カウント */
.custom-search__count {
  padding: 16px;
  font-size: 14px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
  background-color: #fafafa;
  font-weight: 500;
}

/* メッセージ表示 */
.custom-search__message {
  padding: 24px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* 検索結果アイテム */
.custom-search__result {
  display: block;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.custom-search__result:hover {
  background-color: #f8f9fa;
}

.custom-search__result:last-of-type {
  border-bottom: none;
}

/* 検索結果タイトル */
.custom-search__result-title {
  font-size: 16px;
  font-weight: 600;
  color: #00084d;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* 検索結果カテゴリー */
.custom-search__result-category {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  padding: 2px 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  display: inline-block;
}

/* 検索結果抜粋 */
.custom-search__result-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

/* もっと見るボタン */
.custom-search__load-more {
  width: 100%;
  padding: 16px;
  background-color: #f8f9fa;
  border: none;
  border-top: 1px solid #e0e0e0;
  color: #00084d;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.custom-search__load-more:hover {
  background-color: #e9ecef;
}

/* スクロールバーのスタイル */
.custom-search__results::-webkit-scrollbar {
  width: 8px;
}

.custom-search__results::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.custom-search__results::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.custom-search__results::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .custom-search__input {
    font-size: 16px; /* iOSのズーム防止 */
    padding: 10px 70px 10px 12px;
  }

  .custom-search__result {
    padding: 12px;
  }

  .custom-search__result-title {
    font-size: 15px;
  }

  .custom-search__result-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .custom-search__count {
    padding: 12px;
    font-size: 13px;
  }
}
