/* news.php, news-detail.php 공통 */

.news-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.news-item:first-child {
  border-top: 1px solid var(--border-subtle);
}

.news-item-thumb {
  flex-shrink: 0;
  width: 180px;
  height: 130px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f4eee6;
}

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

.news-item-thumb.is-broken {
  display: none;
}

.news-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.news-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.news-item-date {
  font-size: 14px;
  color: var(--muted);
}

.news-item-title {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.4;
}

.news-item-excerpt {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.news-tag-chip {
  font-size: 14px;
  color: var(--muted);
}

.news-item-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-top: auto;
}

.news-item-link:hover {
  text-decoration: underline;
}

/* News / Notice 제목 링크 */
.news-item-title-link {
  text-decoration: none;
  color: inherit;
}

.news-item-title-link:hover .news-item-title {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 720px) {
  .news-item {
    flex-direction: column;
    gap: 12px;
  }
  .news-item-thumb {
    width: 100%;
    height: 180px;
  }
}

/* ============================================================
   news-detail.php 상세 공통 (detail.css 통합)
   ============================================================ */

/* Detail hero meta (날짜, 뱃지) */
.detail-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* 목록으로 버튼 */
.detail-back-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Article 래퍼 */
.detail-article {
  margin-bottom: 48px;
}

/* 이미지 갤러리 */
.detail-gallery {
  margin-bottom: 32px;
}

.detail-gallery-main {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #f4eee6;
}

.detail-gallery-main img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  display: block;
}

.detail-gallery-main.is-broken {
  display: none;
}

/* 본문 */
.detail-content {
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 28px;
}

.detail-content h2,
.detail-content h3 {
  margin: 1.5em 0 0.5em;
}

.detail-content p {
  margin: 0 0 1em;
}

.detail-content img {
  max-width: 100%;
  border-radius: var(--radius-lg);
}

/* 태그 */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.detail-tag-chip {
  font-size: 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 12px;
}

/* 관련 링크 */
.detail-external-link {
  margin-top: 20px;
}

/* 이전/다음 글 탐색 */
.detail-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
}

.detail-nav-item a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--text);
}

.detail-nav-item a:hover .detail-nav-title {
  color: var(--accent);
}

.detail-nav-label {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-nav-title {
  font-size: 16px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-nav-next {
  text-align: right;
}

/* 갤러리 썸네일 버튼 */
.detail-gallery-thumb-btn {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: none;
  padding: 0;
}

.detail-gallery-thumb-btn.is-active {
  border-color: var(--accent);
}

.detail-gallery-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 720px) {
  .detail-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .detail-nav-next {
    text-align: left;
  }
  .detail-gallery-main img {
    max-height: 400px;
  }
  .detail-gallery-thumb-btn {
    width: 60px;
    height: 60px;
  }
}
