/* ============================================
   News 스타일 — 메인 섹션(index.html) + /news 페이지(news.html) 공용
   - 디자인 토큰은 common.css(:root) 사용, 카드 비주얼은 faq-card 톤과 통일
   - 카드 동작은 outreach 카드와 동일(전체 <a>, 새 탭 이동)
   ============================================ */

/* /news 페이지 배경 — faq 페이지와 동일(연회색) */
.news-page {
  background-color: var(--surface-neutral-2);
}
.news-page [hidden] {
  display: none !important;
}

/* ----------------------------------------------------------------
   1. 메인 화면 News 섹션 (outreach 위에 배치)
   배경 흰색 — 바로 아래 outreach(#C4EBF3)와 자연스럽게 대비
   ---------------------------------------------------------------- */
.news-section {
  background-color: var(--surface-white);
  color: var(--surface-dark-blue-2);
  padding: 120px 0;
}

.news-section__head {
  margin-bottom: 48px;
  text-align: center;
}

.news-section__title {
  font-family: var(--font-pretendard);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  color: var(--surface-dark-blue-2);
  margin: 0 0 14px;
}

.news-section__lead {
  font-family: var(--font-pretendard);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--surface-neutral-5);
  margin: 0;
}

/* 메인 섹션 하단 '뉴스 전체보기' 버튼 */
.news-section__more {
  margin-top: 48px;
  text-align: center;
}

.news-more-btn {
  display: inline-block;
  padding: 14px 36px;
  border: 1.5px solid var(--surface-primary);
  border-radius: 999px;
  font-family: var(--font-pretendard);
  font-size: 16px;
  font-weight: 600;
  color: var(--surface-primary);
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.news-more-btn:hover {
  background-color: var(--surface-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ----------------------------------------------------------------
   2. 카드 그리드 (메인 3열 / 페이지 반응형 다열)
   ---------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

/* /news 페이지 그리드(전체 목록) — 동일 3열, 좁아지면 자동 축소 */
.news-grid--full {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ----------------------------------------------------------------
   3. 카드 (faq-card 톤 + outreach 카드 동작)
   ---------------------------------------------------------------- */
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-white);
  border: 1px solid #e7edf2;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--drop-shadow-1);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease,
    opacity 0.6s ease;
  /* 진입 애니메이션(news.js가 .is-visible 부여) */
  opacity: 0;
  transform: translateY(20px);
}

.news-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.news-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--surface-primary-2);
  transform: translateY(-4px);
}

/* 썸네일 — 16:10, 없거나 로드 실패 시 브랜드 그라데이션 플레이스홀더 */
.news-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #00b2cf 0%, #1b3146 100%);
  overflow: hidden;
}

/* 플레이스홀더 워터마크(이미지가 덮으면 가려짐) */
.news-card__thumb::after {
  content: "INTIN";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pretendard);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
}

.news-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1; /* 플레이스홀더 워터마크 위로 */
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 24px;
  flex: 1 1 auto;
}

.news-card__date {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--surface-primary);
  letter-spacing: 0.02em;
}

.news-card__title {
  margin: 0;
  font-family: var(--font-pretendard);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--surface-dark-blue-2);
  /* 최대 2줄 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__excerpt {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #4a5560;
  /* 최대 3줄 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ----------------------------------------------------------------
   4. /news 페이지 전용 — faq 페이지와 동일한 레이아웃/배경
   ---------------------------------------------------------------- */
.news-page-main {
  padding-bottom: 0;
}

/* 헤더(다크블루 반투명)와 자연스럽게 이어지는 네이비 그라데이션 — faq-hero와 동일 */
.news-hero {
  position: relative;
  padding-top: calc(var(--header-height) + clamp(40px, 6vw, 76px));
  padding-bottom: clamp(48px, 7vw, 88px);
  padding-left: var(--gutter-x);
  padding-right: var(--gutter-x);
  background: radial-gradient(120% 150% at 50% 0%,
    var(--surface-dark-blue-1) 0%,
    var(--surface-dark-blue-2) 48%,
    var(--surface-dark-blue-3) 100%);
  text-align: center;
  overflow: hidden;
}

.news-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}

.news-hero__title {
  margin: 0;
  font-family: var(--font-pretendard);
  color: var(--surface-white);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}

.news-hero__desc {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.6;
}

/* 하단 액센트 라인(시안→퍼플) — faq-hero__accent와 동일 */
.news-hero__accent {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--surface-primary) 0%, var(--surface-secondary) 100%);
}

/* 본문 여백 — faq-body와 동일 */
.news-body {
  padding: clamp(32px, 5vw, 56px) 0 clamp(64px, 9vw, 120px);
}

/* 로딩 상태 메시지(목록 fetch 중) */
.news-status {
  text-align: center;
  padding: 64px 0;
  font-size: 16px;
  color: var(--surface-neutral-5);
  margin: 0;
}
.news-status[hidden] {
  display: none;
}

/* 빈 상태 */
.news-empty {
  text-align: center;
  padding: 80px 0;
}

.news-empty__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--surface-dark-blue-2);
  margin: 0 0 8px;
}

.news-empty__desc {
  font-size: 15px;
  color: var(--surface-neutral-5);
  margin: 0;
}

/* 더보기 버튼(전체 목록 9개째부터 노출) — 버튼 자체는 .news-more-btn 핀 스타일 재사용 */
.news-more {
  margin-top: 44px;
  text-align: center;
}
.news-more[hidden] {
  display: none;
}
.news-more .news-more-btn {
  cursor: pointer;
}

/* ----------------------------------------------------------------
   5. 상세 페이지 (news-detail.html) — 본문 블록을 사이트 양식(CSS)으로 렌더
   ---------------------------------------------------------------- */
.news-detail-page {
  background-color: var(--surface-white);
}
.news-detail-page [hidden] {
  display: none !important;
}

.news-detail-main {
  padding-top: calc(var(--header-height) + clamp(16px, 3vw, 28px));
  padding-bottom: clamp(48px, 8vw, 96px);
}

/* 상단 바: 뒤로 버튼 */
.news-detail__bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(16px, 2.5vw, 24px);
}

.news-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 9px 16px;
  border: 1.5px solid var(--surface-primary);
  border-radius: 999px;
  font-family: var(--font-pretendard);
  font-size: 14px;
  font-weight: 600;
  color: var(--surface-primary);
  background: var(--surface-white);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.news-detail__back:hover {
  background: var(--surface-primary);
  color: #ffffff;
}
.news-detail__back-arrow {
  font-size: 16px;
  line-height: 1;
}

.news-detail__status {
  margin: 0;
  padding: 80px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--surface-neutral-5);
}

/* ── 기사 본문(통일 양식) — 가독성을 위해 가운데 정렬 + 본문 폭 제한 ── */
.news-article {
  max-width: 760px;
  margin: 0 auto;
}

.news-article__head {
  margin-bottom: clamp(24px, 4vw, 36px);
  padding-bottom: clamp(20px, 3vw, 28px);
  border-bottom: 1px solid #e7edf2;
}

.news-article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

/* 카테고리 배지 */
.news-article__category {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-neutral-2);
  color: var(--surface-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.news-article__date {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--surface-neutral-5);
  letter-spacing: 0.02em;
}

.news-article__title {
  margin: 0;
  font-family: var(--font-pretendard);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: var(--tracking-tight);
  color: var(--surface-dark-blue-2);
}

.news-article__summary {
  margin: 18px 0 0;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  font-weight: 500;
  color: #4a5560;
}

.news-article__source {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--surface-neutral-5);
  word-break: break-all;
}
.news-article__source a {
  color: var(--surface-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* 본문 블록 타이포그래피 */
.news-article__body {
  font-family: var(--font-pretendard);
  font-size: clamp(16px, 1.9vw, 18px);
  line-height: 1.85;
  color: #2c3640;
}

.news-article__body .na-p {
  margin: 0 0 1.25em;
}

/* 본문 안 URL 자동 링크(linkify) */
.news-article__body a,
.news-article__body .na-list a {
  color: var(--surface-primary);
  text-decoration: underline;
  word-break: break-all;
}
.news-article__body a:hover {
  color: var(--surface-secondary);
}

.news-article__body .na-heading {
  margin: 1.8em 0 0.7em;
  font-size: 1.32em;
  font-weight: 700;
  line-height: 1.4;
  color: var(--surface-dark-blue-2);
}

.news-article__body .na-list {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
}
.news-article__body .na-list li {
  margin: 0 0 0.5em;
}

.news-article__body .na-figure {
  margin: 1.6em 0;
}
.news-article__body .na-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* 본문 안 데이터 표 */
.news-article__body .na-table-wrap {
  margin: 1.6em 0;
  overflow-x: auto;
}
.news-article__body .na-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
.news-article__body .na-table td {
  padding: 10px 14px;
  border: 1px solid #e7edf2;
  vertical-align: top;
  line-height: 1.6;
}
.news-article__body .na-table tr:nth-child(even) td {
  background: var(--surface-neutral-2);
}

/* ----------------------------------------------------------------
   6. 반응형
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .news-section {
    padding: 72px 0;
  }
  .news-grid,
  .news-grid--full {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .news-card__body {
    padding: 18px 18px 20px;
  }
  .news-article__title {
    font-size: clamp(23px, 7vw, 30px);
  }
}
