/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   記事検索機能のスタイル
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* 検索セクション */
.search-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
  padding: 40px 0 20px 0;
  margin-bottom: 0;
}

.search-section .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ソートセクション */
.sort-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
  padding: 20px 0 40px 0;
  margin-bottom: 40px;
}

.sort-section .container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ソートタブ */
.sort-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.sort-tab {
  background: #fff;
  border: 2px solid #e1e4e8;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sort-tab:hover {
  border-color: #3498DB;
  color: #3498DB;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.sort-tab.active {
  background: linear-gradient(135deg, #3498DB 0%, #2980B9 100%);
  border-color: #3498DB;
  color: #fff;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.sort-tab i {
  font-size: 16px;
}

/* 検索ボックス */
.search-box {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 18px 50px 18px 55px;
  font-size: 16px;
  border: 2px solid #e1e4e8;
  border-radius: 50px;
  background: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: #3498DB;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.search-input::placeholder {
  color: #aaa;
}

.clear-search {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s ease;
}

.clear-search:hover {
  color: #E74C3C;
}

/* 検索結果エリア */
.search-results {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results-header {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e1e4e8;
}

#searchResultsCount {
  color: #3498DB;
  font-weight: 600;
  font-size: 16px;
}

/* 検索結果コンテンツ */
.search-results-content {
  display: grid;
  gap: 20px;
}

/* 検索結果カード */
.search-result-card {
  display: flex;
  gap: 15px;
  padding: 15px;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  background: #fff;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.search-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #3498DB;
}

.search-result-thumbnail {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-category {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f0f2f5;
  color: #666;
  margin-bottom: 8px;
}

.search-result-title {
  font-size: 16px;
  font-weight: 600;
  color: #2C3E50;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

.search-result-meta i {
  margin-right: 4px;
}

/* ハイライト */
.highlight {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* 検索結果なしメッセージ */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-results i {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 15px;
}

.no-results p {
  font-size: 16px;
  margin-bottom: 10px;
}

.no-results-suggestions {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: left;
}

.no-results-suggestions h4 {
  font-size: 14px;
  color: #2C3E50;
  margin-bottom: 10px;
}

.no-results-suggestions ul {
  list-style: none;
  padding: 0;
}

.no-results-suggestions li {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.no-results-suggestions li:before {
  content: "•";
  position: absolute;
  left: 5px;
  color: #3498DB;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .search-section {
    padding: 30px 0 15px 0;
  }

  .sort-section {
    padding: 15px 0 30px 0;
  }

  .sort-tabs {
    gap: 8px;
  }

  .sort-tab {
    padding: 10px 18px;
    font-size: 14px;
  }

  .sort-tab i {
    font-size: 14px;
  }

  .search-input {
    padding: 15px 45px 15px 50px;
    font-size: 15px;
  }

  .search-icon {
    left: 15px;
    font-size: 16px;
  }

  .clear-search {
    right: 15px;
    font-size: 16px;
  }

  .search-result-card {
    flex-direction: column;
  }

  .search-result-thumbnail {
    width: 100%;
    height: 150px;
  }

  .search-result-title {
    font-size: 15px;
  }

  .search-result-excerpt {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .sort-tab {
    padding: 8px 14px;
    font-size: 13px;
    gap: 6px;
  }

  .sort-tab i {
    font-size: 13px;
  }

  .search-input {
    padding: 14px 40px 14px 45px;
    font-size: 14px;
  }

  .search-result-meta {
    flex-direction: column;
    gap: 6px;
  }
}
