/**
 * 엔스타일투어 리뉴얼 - 공지사항 (/notice/)
 * base.css 다음에 로드
 * 테마: 사이트 기본 색상 body[data-region="site"] (base.css 토큰)
 * 표 / 페이징 / 배지 / 버튼은 base.css 공통 컴포넌트 사용
 */

/* ==========================================================
   1. 목록
   ========================================================== */
.notice-intro { margin-top: -1.25rem; margin-bottom: 2rem; font-size: 0.92rem; color: var(--text-secondary); }

.notice-toolbar { display: flex; justify-content: flex-end; margin-bottom: 1.25rem; }
/* 검색어 입력은 base.css .search-field */

.notice-table { table-layout: fixed; }
.notice-table .col-num { width: 90px; }
.notice-table .col-date { width: 140px; }
.notice-table td.c-title a { display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%; }
.notice-table td.c-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-table td.c-title .clip { flex: none; width: 14px; height: 14px; color: var(--text-tertiary); }
.notice-table tr.is-top { background: var(--region-sub); }
.notice-table tr.is-top:hover { background: var(--region-sub-deep); }
.badge--top { background: var(--region); color: var(--white); }

/* ==========================================================
   2. 내용 보기
   ========================================================== */
.notice-section { background: var(--region-sub); }
.notice-wrap { max-width: 1000px; margin: 0 auto; }

.notice-article { background: var(--white); border: 1px solid var(--line); }
.notice-head { padding: 2rem 2.25rem 1.5rem; border-bottom: 1px solid var(--line); }
.notice-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.5px; line-height: 1.45; }
.notice-meta { margin-top: 0.7rem; font-size: 0.82rem; color: var(--text-tertiary); }

/* 관리자 등록 내용 (에디터 HTML) : 이미지·표·영상이 칸을 넘지 않게 */
.notice-body { min-height: 200px; padding: 2rem 2.25rem 2.5rem; line-height: 1.9; word-break: break-word; overflow-wrap: anywhere; }
.notice-body img { display: inline-block; max-width: 100%; height: auto !important; vertical-align: top; }
.notice-body table { max-width: 100%; }
.notice-body iframe, .notice-body video { max-width: 100%; }
.notice-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }

/* 첨부파일 */
.notice-files { padding: 1.25rem 2.25rem; border-top: 1px solid var(--line); background: var(--ivory); }
.notice-files-title { margin-bottom: 0.6rem; font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); }
.notice-files ul { display: grid; gap: 0.4rem; }
.notice-files li { min-width: 0; }
.notice-files a { display: inline-flex; align-items: flex-start; gap: 0.45rem; max-width: 100%; overflow-wrap: anywhere; word-break: break-all; font-size: 0.88rem; color: var(--text-primary); }
.notice-files a:hover { text-decoration: underline; text-underline-offset: 3px; }
.notice-files svg { flex: none; width: 15px; height: 15px; margin-top: 0.2em; color: var(--text-tertiary); }
.notice-files .size { white-space: nowrap; color: var(--text-tertiary); font-size: 0.78rem; }

/* 이전 / 다음 글 */
.notice-nav { margin-top: 1.25rem; border-top: 1px solid var(--line-strong); background: var(--white); }

.notice-nav a, .notice-nav span.empty {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.notice-nav .label { font-size: 0.8rem; font-weight: 700; color: var(--text-tertiary); }
.notice-nav .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.notice-nav a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.notice-nav span.empty .t { color: var(--text-tertiary); }

/* ==========================================================
   3. 반응형
   ========================================================== */
@media (max-width: 768px) {
  .notice-intro { margin-top: -0.75rem; margin-bottom: 1.25rem; font-size: 0.86rem; }
  .notice-toolbar { justify-content: stretch; }

  /* 표 → 한 줄 목록: 제목 + 등록일 */
  .notice-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
  .notice-table td { display: block; padding: 0; font-size: 0.8rem; color: var(--text-tertiary); text-align: left; }
  .notice-table td::before { content: none; }
  .notice-table td.c-num { display: none; }
  .notice-table tr.is-top td.c-num { display: block; order: 0; }
  .notice-table td.c-title { order: 1; width: 100%; font-size: 0.95rem; color: var(--text-primary); text-align: left; }
  .notice-table td.c-title a { display: flex; }
  .notice-table td.c-date { order: 2; }
  .notice-table tr.is-top { padding-left: 0.75rem; padding-right: 0.75rem; }
  .notice-table tr.is-top td.c-title { flex: 1; width: auto; min-width: 0; } /* [중요] 제목 한 줄 */
  .notice-table tr.is-top td.c-date { width: 100%; }
  .notice-table .empty-row td { width: 100%; text-align: center; }

  .notice-head { padding: 1.5rem 1.25rem 1.25rem; }
  .notice-title { font-size: 1.15rem; }
  .notice-body { min-height: 140px; padding: 1.5rem 1.25rem 2rem; font-size: 0.92rem; }
  .notice-files { padding: 1rem 1.25rem; }
  .notice-nav a, .notice-nav span.empty { grid-template-columns: 64px minmax(0, 1fr); padding: 0.9rem 1rem; }
}
