/* /assets/css/news.css
   - News list + view styles
   - 정리 버전 (중복 제거 / 값 통일 / 주석 정돈)
*/

/* =========================
   0) Tokens (자주 쓰는 값)
========================= */
:root {
  --news-border: #e6e6e6;
  --news-bg: #f3f3f3;
  --news-bg-soft: #fafafa;
  --news-text: #222;
  --news-radius: 14px;
  --news-radius-sm: 12px;
  --news-maxw: 800px;
}

/* =========================
   1) Hero (목록 상단 배너)
========================= */
.news-hero {
  --hero-image: none;
  position: relative;
  width: 100%;
  border-radius: var(--news-radius);
  overflow: hidden;
  border: 1px solid var(--news-border);
  background: var(--news-bg);
  margin-top: 120px;
  margin-bottom: 30px;
}

.news-hero::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 6;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
}

.news-hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  color: #fff;
  background: none;
}

.news-hero__title { margin: 0; font-size: 28px; line-height: 1.2; }
.news-hero__sub   { margin: 0; font-size: 14px; opacity: 0.95; }

/* 목록 데이터 없을 때 */
.news-empty {
  padding: 24px;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius-sm);
  background: var(--news-bg-soft);
}

/* =========================
   2) List Grid (목록)
========================= */
/* 2열 고정 */
.news-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 카드 링크 */
.news-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 썸네일 래퍼 */
.news-card__thumbWrap {
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius-sm);
  overflow: hidden;
  background: var(--news-bg);
  transition: background 0.15s ease;
}

.news-card:hover .news-card__thumbWrap { background: #efefef; }

/* 16:9 + cover */
.news-card__thumb,
.news-card__thumb--empty {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--news-bg);
}

.news-card__thumb {
  object-fit: cover;
  object-position: center;
}

/* 제목(한 줄 말줄임) */
.news-card__line {
  margin: 10px 0 10px 10px;
  font-size: 14px;   /* 모바일 기본 */
  font-weight: 500;
  line-height: 1.2;
  color: var(--news-text);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PC에서만 키우기 */
@media (min-width: 1024px) {
  .news-card__line {
    margin: 15px 0 15px 10px;
    font-size: 18px;
    font-weight: 400;
  }
}

/* =========================
   3) Pagination (페이징)
   - JS에서 모바일은 번호 3개만 출력
   - CSS는 "한 줄 유지 + 비율 축소"만 담당
========================= */
.news-pagination {
  margin-top: 22px;
  margin-bottom: 36px;
  padding-bottom: 10px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;  /* PC는 줄바꿈 허용(페이지 많을 때) */
  gap: 8px;
}

/* 버튼 공통 (pill) */
.news-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 36px;
  height: 36px;
  padding: 0 12px;

  border: 1px solid #e4e4e4;
  border-radius: 999px;
  background: #fff;
  color: var(--news-text);
  text-decoration: none;

  font-size: 13px;
  font-weight: 600;
  line-height: 1;

  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.news-page:hover {
  background: #f3f3f3;
  border-color: #d6d6d6;
}
.news-page:active { transform: translateY(1px); }

/* 현재 페이지 */
.news-page--current {
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 700;
}

/* 비활성 */
.news-page--disabled {
  opacity: 0.45;
  background: var(--news-bg-soft);
  pointer-events: none;
}

/* 이전/다음(PC에선 텍스트, 모바일에선 < > ) */
.news-page--prev,
.news-page--next {
  padding: 0 14px;
  font-weight: 700;
}

/* 숫자끼리만 살짝 간격(원하면 조절) */
.news-page:not(.news-page--prev):not(.news-page--next) {
  margin: 0 2px;
}

/* 모바일: 한 줄 고정 + 비율로 축소 (스크롤 없음) */
@media (max-width: 767px) {
  .news-pagination {
    flex-wrap: nowrap;      /* 한 줄 고정 */
    overflow: hidden;       /* 스크롤 절대 없음 */
    gap: clamp(6px, 2vw, 10px);
  }

  .news-page {
    min-width: 0;
    height: clamp(28px, 8vw, 34px);
    padding: 0 clamp(6px, 2.2vw, 10px);
    font-size: clamp(11px, 3.2vw, 13px);
    flex: 0 1 auto;         /* 화면에 맞게 줄어듦 */
    white-space: nowrap;
  }
}

/* =========================
   4) View (상세)
========================= */
/* 헤더가 fixed라면 상세 시작 위치 보정 */
.news-view-wrap { margin-top: 120px; }

.news-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 대표 이미지: 800px 제한 + 가운데 */
.news-view__heroWrap {
  max-width: var(--news-maxw);
  margin: 0 auto;

  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  overflow: hidden;
  background: var(--news-bg);
}

/* 대표 이미지 16:9 cover */
.news-view__hero {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
  background: var(--news-bg);
}

/* 타이틀/요약 */
.news-view__title { margin: 0; font-size: 22px; line-height: 1.25; }
.news-view__summary { margin: 0; font-size: 14px; line-height: 1.6; opacity: 0.9; }

/* 추가 이미지 영역: 800px 제한 + 가운데 */
.news-view__images {
  max-width: var(--news-maxw);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr;
  gap: 16px; /* 이미지 사이 간격 */
}

/* ✅ 추가 이미지: 박스/보더 제거 + 꽉 차게 */
.news-view__img {
  width: 85%;
  margin: 30px auto;
  display: block;
  border: none;
  border-radius: 0; /* 필요하면 12px로 */
  background: transparent;
  object-fit: cover;
}

/* 패턴 A 가로선(섹션 구분) */
.news-sep {
  width: 100%;
  height: 1px;
  background: var(--news-border);
  margin: 22px 0;   /* ✅ UX 분리감 */
}

/* 목록 버튼 */
.news-btn {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background 0.15s ease;
}
.news-btn:hover { background: #efefef; }

/* 목록 버튼 우측 정렬 */
.news-view__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

/* 이전/다음 네비 */
.news-nav {
  margin-top: 10px;
  margin-bottom: 48px; /* footer와 거리 */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.news-nav__item {
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background 0.15s ease;
}

.news-nav__item:hover { background: #efefef; }
.news-nav__item--disabled {
  opacity: 0.55;
  background: var(--news-bg-soft);
  pointer-events: none;
}

.news-nav__label { display: block; font-size: 12px; opacity: 0.75; margin-bottom: 6px; }
.news-nav__title { display: block; font-size: 13px; line-height: 1.35; font-weight: 600; }
