/* 架空 Wikipedia もどき スタイルシート */

/* リセット & ベース設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #222;
  background-color: #f8f9fa;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* メインタイトル */
h1 {
  font-size: 2.5rem;
  font-weight: 400;
  color: #000;
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 3px solid #a2a9b1;
}

/* 検索ボックス */
#search-box {
  width: 100%;
  max-width: 600px;
  padding: 12px 16px;
  font-size: 16px;
  border: 2px solid #a2a9b1;
  border-radius: 4px;
  margin: 0 auto 30px auto;
  display: block;
  background-color: #fff;
  transition: border-color 0.3s ease;
}

#search-box:focus {
  outline: none;
  border-color: #0645ad;
  box-shadow: 0 0 0 2px rgba(6, 69, 173, 0.1);
}

#search-box::placeholder {
  color: #72777d;
}

/* 記事リスト */
#article-list {
  list-style: none;
  background-color: #fff;
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  margin-bottom: 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#article-list li {
  border-bottom: 1px solid #eaecf0;
  padding: 16px 20px;
  transition: background-color 0.2s ease;
}

#article-list li:last-child {
  border-bottom: none;
}

#article-list li:hover {
  background-color: #f8f9fa;
}

/* 記事タイトル */
#article-list li h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0645ad;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
}

#article-list li h3:hover {
  text-decoration: underline;
}

/* 記事の説明文 */
#article-list li p {
  color: #54595d;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* メタ情報（カテゴリ、日付など） */
#article-list li .meta {
  font-size: 0.85rem;
  color: #72777d;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

#article-list li .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#article-list li .meta .category {
  background-color: #eaf3ff;
  color: #0645ad;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

/* ページネーション */
#pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}

#pagination button {
  padding: 8px 12px;
  border: 1px solid #a2a9b1;
  background-color: #fff;
  color: #0645ad;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
}

#pagination button:hover {
  background-color: #f8f9fa;
  border-color: #0645ad;
}

#pagination button:disabled {
  background-color: #eaecf0;
  color: #a2a9b1;
  cursor: not-allowed;
  border-color: #c8ccd1;
}

#pagination button.active {
  background-color: #0645ad;
  color: #fff;
  border-color: #0645ad;
}

#pagination .page-info {
  margin: 0 15px;
  color: #54595d;
  font-size: 14px;
}

/* 検索結果なしの表示 */
.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #72777d;
  font-size: 1.1rem;
  background-color: #fff;
  border: 1px solid #a2a9b1;
  border-radius: 4px;
}

/* ローディング表示 */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #72777d;
  font-size: 1.1rem;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #a2a9b1;
  border-top: 2px solid #0645ad;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  h1 {
    font-size: 2rem;
    margin-bottom: 20px;
  }
  
  #search-box {
    font-size: 16px; /* iOS のズーム防止 */
  }
  
  #article-list li {
    padding: 12px 15px;
  }
  
  #article-list li h3 {
    font-size: 1.2rem;
  }
  
  #article-list li .meta {
    flex-direction: column;
    gap: 8px;
  }
  
  #pagination {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  #pagination button {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }
  
  #article-list li {
    padding: 10px 12px;
  }
  
  #article-list li h3 {
    font-size: 1.1rem;
  }
  
  #pagination .page-info {
    margin: 0 8px;
    font-size: 13px;
  }
}

/* アクセシビリティ向上 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

