/* ================================
   記事一覧テーブルの最大幅制限と最適化
   ================================ */

/* メインコンテンツエリアの最大幅設定 */
.page-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  max-width: 1400px !important; /* index-styles.cssのmax-width: noneを上書き */
  margin: 0 auto;
}

/* 大画面での読みやすさを向上 */
@media (min-width: 1600px) {
  .main-content {
    max-width: 1500px !important;
  }
  
  .page-layout {
    padding: 0 40px;
  }
}

/* テーブルのレスポンシブ対応強化 */
.articles-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed; /* 列幅を固定して安定性向上 */
  margin-top: 20px;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* テーブルヘッダーのスタイル改善 */
.articles-table thead tr {
  background-color: #f8fafb;
}

.articles-table th {
  font-weight: 600;
  color: #1a73e8;
  border-bottom: 2px solid #e8eaed;
  padding: 12px 15px;
}

/* 列幅の最適化 */
.articles-table th:nth-child(1),
.articles-table td:nth-child(1) {
  width: 140px; /* 投稿日 - 固定幅 */
}

.articles-table th:nth-child(2),
.articles-table td:nth-child(2) {
  width: 35%; /* タイトル */
  min-width: 300px;
}

.articles-table th:nth-child(3),
.articles-table td:nth-child(3) {
  width: auto; /* 概要説明 - 残りの幅を使用 */
}

/* 概要説明の読みやすさ向上 */
.articles-table td:nth-child(3) {
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: #5f6368;
}

/* 概要説明内の段落スタイル */
.articles-table td:nth-child(3) p {
  margin-bottom: 0.8em;
  text-indent: 0;
}

.articles-table td:nth-child(3) p:last-child {
  margin-bottom: 0;
}

/* 行のホバー効果改善 */
.articles-table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.articles-table tbody tr:hover {
  background-color: #f8fafb;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transform: translateY(-1px);
}

/* 記事タイトルスタイル */
.article-title {
  font-weight: bold;
  margin-bottom: 8px;
}

/* タグコンテナ */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

/* タグのスタイル改善 */
.articles-table .tag,
.article-card-mobile .tag {
  display: inline-block;
  background: #e8f0fe;
  color: #1967d2;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 4px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.articles-table .tag:hover {
  background: #d2e3fc;
  transform: translateY(-1px);
}

/* 日付のスタイル改善 */
.articles-table td:nth-child(1) {
  color: #5f6368;
  font-size: 0.9rem;
  font-weight: 500;
}

/* タイトルリンクのスタイル改善 */
.articles-table td:nth-child(2) a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
  display: block;
  margin-bottom: 8px;
}

.articles-table td:nth-child(2) a:hover {
  color: #1557b0;
  text-decoration: underline;
}

/* スクロール可能なテーブルコンテナ */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -20px;
  padding: 0 20px;
}

/* 中型画面での調整 */
@media (max-width: 1200px) {
  .articles-table {
    font-size: 0.95rem;
  }
  
  .articles-table th,
  .articles-table td {
    padding: 10px 12px;
  }
  
  .articles-table th:nth-child(2),
  .articles-table td:nth-child(2) {
    width: 40%;
  }
}

/* タブレット対応 */
@media (max-width: 1024px) {
  .main-content {
    max-width: 100% !important;
  }
  
  .articles-table {
    font-size: 0.9rem;
  }
  
  .articles-table th,
  .articles-table td {
    padding: 8px 10px;
  }
  
  /* タグを小さく */
  .articles-table .tag {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
}

/* モバイル対応 - カード形式への切り替え */
@media (max-width: 768px) {
  .articles-table {
    display: none;
  }
  
  /* モバイル用カード形式 */
  .news-grid.list-layout {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
  }
  
  /* 記事カード */
  .article-card-mobile {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
  }
  
  .article-card-mobile:active {
    transform: scale(0.98);
  }
  
  .article-card-mobile .date {
    font-size: 0.85rem;
    color: #5f6368;
    margin-bottom: 8px;
  }
  
  .article-card-mobile .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
  }
  
  .article-card-mobile .title a {
    color: #1a73e8;
    text-decoration: none;
  }
  
  .article-card-mobile .excerpt {
    font-size: 0.9rem;
    color: #5f6368;
    line-height: 1.6;
    margin-bottom: 10px;
  }
  
  .article-card-mobile .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
}

/* 記事がない場合のメッセージ */
.no-articles-message {
  text-align: center;
  padding: 60px 20px;
  color: #5f6368;
  font-size: 1.1rem;
}

/* 記事リストタイトルのスタイル */
.article-list-title {
  font-size: 1.8rem;
  color: #202124;
  margin: 30px 0 20px;
  font-weight: 600;
  text-align: center;
}

/* カテゴリフィルター情報バー */
.filter-info,
.year-month-filter-info {
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

.filter-info-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-label {
  font-size: 1rem;
  color: #1967d2;
  font-weight: 500;
}

.filter-label i {
  margin-right: 8px;
}

.filter-label strong {
  color: #1557b0;
  font-weight: 600;
}

.filter-reset {
  background: #ea4335;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}

.filter-reset:hover {
  background: #d33b2c;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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