@import url('sub-common.css');

/* ===== 카테고리 필터 ===== */
.news-filter {
  display: flex;
  justify-content: center;
  padding: 0 20px 40px;
}

.news-filter__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 9999px;
  padding: 6px 8px;
}

.news-filter__btn {
  background: none;
  border: none;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #332115;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.news-filter__btn:hover {
  color: #005891;
}

.news-filter__btn.active {
  background: #005891;
  color: #fff;
}

/* ===== 흰색 콘텐츠 영역 ===== */
.news-content {
  background: #fff;
  padding: 60px 0 40px;
}

/* ===== 뉴스 그리드 ===== */
.news-grid {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

/* ===== 뉴스 카드 ===== */
a.news-card {
  text-decoration: none;
  color: inherit;
  display: flex;
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #fff;
  box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 22px 22px 16px;
  min-height: 160px;
}

.news-card--green {
  background: #e4efe9;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.14);
}

.news-card__title {
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
  letter-spacing: -0.36px;
  color: #000;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 60px;
}

.news-card__meta {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.news-card__date {
  font-size: 14px;
  color: #000;
  line-height: 1.8;
}

.news-card__arrow {
  width: 30px;
  height: 30px;
  display: flex;
  flex-shrink: 0;
}

.news-card__arrow img {
  width: 100%;
  height: 100%;
}

/* ===== 페이지네이션 ===== */
.news-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 50px 20px 20px;
}

.news-pagination__arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.news-pagination__arrow:hover {
  opacity: 0.7;
}

.news-pagination__arrow img {
  width: 62px;
  height: 41px;
}

.news-pagination__nums {
  display: flex;
  align-items: center;
}

.news-pagination__num {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 400;
  color: #bebebe;
  cursor: pointer;
  padding: 4px 12px;
  font-family: inherit;
  transition: color 0.2s;
  letter-spacing: -0.36px;
}

.news-pagination__num.active {
  color: #000;
}

.news-pagination__num:hover:not(.active) {
  color: #005891;
}

.news-pagination__sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: #ccc;
}

/* ===== 반응형: 태블릿 ===== */
@media (max-width: 1024px) {
  .news-grid {
    max-width: 900px;
    gap: 24px 20px;
  }

  .news-card {
    border-radius: 16px;
    padding: 18px 18px 14px;
    min-height: 140px;
  }

  .news-card__title {
    font-size: 16px;
    line-height: 26px;
    min-height: 52px;
  }

  .news-card__date {
    font-size: 13px;
  }

  .news-card__arrow {
    width: 26px;
    height: 26px;
  }
}

/* ===== 반응형: 모바일 ===== */
@media (max-width: 768px) {
  .news-filter {
    padding: 0 16px 24px;
  }

  .news-filter__nav {
    gap: 6px;
    padding: 5px 6px;
  }

  .news-filter__btn {
    font-size: 13px;
    padding: 5px 14px;
  }

  .news-content {
    padding: 40px 0 30px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 16px;
  }

  .news-card {
    border-radius: 14px;
    padding: 18px 18px 14px;
    min-height: auto;
  }

  .news-card__title {
    font-size: 16px;
    line-height: 26px;
    min-height: 52px;
  }

  .news-card__meta {
    padding-top: 12px;
  }

  .news-card__date {
    font-size: 13px;
  }

  .news-card__arrow {
    width: 26px;
    height: 26px;
  }

  .news-pagination {
    padding: 30px 16px 10px;
    gap: 10px;
  }

  .news-pagination__arrow img {
    width: 40px;
    height: 26px;
  }

  .news-pagination__num {
    font-size: 15px;
  }
}

/* ===== 반응형: 소형 모바일 ===== */
@media (max-width: 480px) {
  .news-filter__nav {
    gap: 4px;
    padding: 4px;
  }

  .news-filter__btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  .news-content {
    padding: 30px 0 20px;
  }

  .news-grid {
    gap: 12px;
  }

  .news-card {
    padding: 16px 16px 12px;
    min-height: auto;
  }

  .news-card__title {
    font-size: 15px;
    line-height: 24px;
    min-height: 48px;
  }

  .news-card__date {
    font-size: 12px;
  }

  .news-card__arrow {
    width: 24px;
    height: 24px;
  }
}