/* ニュース一覧コンポーネント */
.news-list-container {
  width: 100%;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-list-item {
  padding: var(--size-24) 0;
  border-bottom: 1px solid var(--color-bg-light-gray2);
  position: relative;
  width: 100%;
  cursor: pointer;
}

.news-list-item:first-child {
  border-top: 1px solid var(--color-bg-light-gray2);
}

/* ホバー効果のバリエーション */
/* 1. 背景色変更（デフォルト） */
.news-list-item.hover-background {
  transition: background-color 0.3s ease;
}

.news-list-item.hover-background:hover {
  background-color: rgba(234, 234, 234, 0.3);
}

/* 2. 下線表示 */
.hover-underline .hover-text {
  position: relative;
  display: inline-block;
}

.hover-underline .hover-text::after {
  content: "";
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--color-accent-red);
  transition: width 0.3s ease;
}

.hover-underline:hover .hover-text::after {
  width: 100%;
}

/* 3. 効果なし */
.hover-none:hover {
  background-color: transparent;
}

/* リンクを全体に広げる - すべてのアイテムで適用 */
.news-list-item__link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.news-list-item__wrapper {
  display: grid;
  grid-template-columns: auto var(--size-160) 1fr;
  column-gap: var(--size-40);
  padding: 0 var(--size-14);
  position: relative;
  z-index: 0;
  width: 100%;
}

/* ラッパーがaタグの場合、テキスト装飾を削除 */
a.news-list-item__wrapper {
  text-decoration: none;
  color: inherit;
  display: grid;
}

.news-list-item__date {
  font-size: var(--size-14);
  color: var(--color-text-gray);
}

.news-list-item__categories {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--size-8);
}

.news-list-item__category {
  display: grid;
  place-items: center;
  font-size: var(--size-14);
  font-weight: var(--font-weight-bold);
  padding: var(--size-4);
  min-width: var(--size-160);
  background: var(--color-bg-light-gray2);
  position: relative;
  z-index: 2; /* カテゴリー要素をリンクより前面に */
}

.news-list-item__title {
  font-weight: normal;
}

.news-list-item__button {
  position: relative;
  z-index: 2;
  text-decoration: underline;
  margin-left: auto;
}

/* 一覧を見るボタン */
.news-more {
  display: flex;
  justify-content: center;
  margin-top: var(--size-40);
}

.link-button {
  min-width: var(--size-200);
  justify-content: center;
}

.link-button__icon {
  width: var(--size-16);
  height: var(--size-16);
}

/* 記事がない場合のメッセージ */
.news-list-empty {
  text-align: center;
  padding: var(--size-24);
  color: var(--color-text-gray);
}

@media screen and (max-width: 768px) {
  .news-list-item__wrapper {
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--size-12);
  }

  .news-list-item__date {
    flex: 0 0 auto;
  }

  .news-list-item__categories {
    flex: 1 1 1fr;
  }

  .news-list-item__title {
    flex: 0 0 1fr;
  }
}
