/* =========================================================================
   API 투자전략센터 — 공지사항 (Notice)
   list (header+search, tab filter, table, important row, pagination)
   detail (meta, body, code box, attachment, prev/next nav)
   ========================================================================= */

/* ---------- page hero ---------- */
.notice-hero { padding-top: 113px; padding-bottom: 40px; position: relative; overflow: hidden; }
.notice-hero__glow { position: absolute; width: 440px; height: 440px; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; background: radial-gradient(circle, var(--glow-navy), transparent 66%); top: -170px; right: 5%; opacity: 0.6; }
.notice-hero__inner { position: relative; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.notice-hero__tx h1 { margin: 0 0 8px; }
/* 부제는 공용 .lead(base.css) 를 쓴다 — 여기서 크기를 다시 정하지 않는다. */
/* 필터 행 — 좌:탭 / 우:검색 한 줄. 원본과 같이 목록 바로 위에 둔다. */
.notice-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 1rem; }
.notice-filter-row .board-tabs { padding-bottom: 0; }

/* 좁은 화면에서는 탭 줄과 검색 줄을 위아래로 나눈다.
   한 줄에 같이 두면 탭이 늘어날수록 검색칸이 눌려 껍데기만 남는다. */
@media (max-width: 640px) {
  .notice-filter-row { gap: 10px; }
  .notice-filter-row .board-tabs { flex: 1 1 100%; min-width: 0; }
  .notice-filter-row .board-search { flex: 1 1 100%; width: auto; min-width: 0; }
}

/* ---------- tab filter (uses shared .board-tabs/.board-tab in chrome.css) ---------- */
.notice-body { padding-block: clamp(32px, 4vw, 48px) var(--space-section); }

.notice-meta-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; }
.notice-meta-row .total { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-dim); }
.notice-meta-row .total b { color: var(--text); font-family: var(--font-sans); }

/* ---------- list table ---------- */
.notice-table { width: 100%; border-collapse: separate; border-spacing: 0; border-top: 2px solid var(--border-strong); }
.notice-table thead th { font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 700; color: var(--text-dim); text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.notice-table thead th.c-no, .notice-table thead th.c-cat, .notice-table thead th.c-date, .notice-table thead th.c-views { text-align: center; }
.notice-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); vertical-align: middle; }
.notice-table tbody tr { background-color: var(--bg); transition: background-color 0.16s; cursor: pointer; }
.notice-table tbody tr:hover { background: var(--surface-hover); }

.notice-table .c-no { text-align: center; font-family: var(--font-sans); color: var(--text-inactive); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); width: 64px; }
.notice-table .c-cat { text-align: center; width: 140px; white-space: nowrap; }
.notice-table .c-title { font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--text); font-weight: 500; }
.notice-table .c-title:hover .t { color: var(--chip-text); }
.notice-table .c-title .t { transition: color 0.18s; }
/* 검색어 하이라이트 — faq/자료실과 동일한 시안색으로 통일(<mark> 기본 노란색 대신) */
.c-title .hl { background: rgba(52,225,255,0.26); color: var(--text); border-radius: 3px; padding: 0 2px; }
.notice-table .c-date { text-align: center; font-family: var(--font-sans); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-dim); white-space: nowrap; width: 120px; }
.notice-table .c-views { text-align: center; font-family: var(--font-sans); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-dim); width: 90px; }

/* category badge */
/* 분류 — 원본은 테두리·배경 없는 dim 텍스트다(색으로 구분하지 않는다). */
.cat-badge { display: inline-block; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 400; color: var(--text-dim); white-space: nowrap; letter-spacing: -0.01em; }

/* important tag + row */
.imp-tag { display: inline-flex; align-items: center; font-size: 0.8125rem; font-weight: 500; padding: 3px 9px; border-radius: 4px; color: #fff; background: #fa4040; margin-right: 8px; flex-shrink: 0; white-space: nowrap; }
.imp-tag svg { display: none; }
.notice-table tr.is-important { background: var(--surface); }
.notice-table tr.is-important:hover { background: var(--surface-hover); }
.notice-table tr.is-important td { border-bottom-color: var(--border); }
.notice-table tr.is-important .c-no { color: var(--chip-text); }
.notice-table tr.is-important .c-title { font-weight: 500; }

.notice-table .c-title .pin { display: inline-flex; align-items: center; gap: 8px; }
.notice-table .c-title .pin .t { min-width: 0; }

/* empty state */
.notice-empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.notice-empty svg { width: 44px; height: 44px; color: var(--text-inactive); margin: 0 auto 16px; }
.notice-empty p { font-size: var(--fs-text-md); line-height: var(--lh-text-md); }
/* 상세를 못 불러온 안내에는 '목록으로' 버튼이 함께 붙는다(목록 빈 상태에는 버튼이 없다) */
.notice-empty .btn { margin-top: 18px; }

/* ---------- pagination (shared look) ---------- */

/* =====================  DETAIL VIEW  ===================== */
.notice-detail { display: none; }
.view-list.hidden { display: none; }
.view-detail.active .notice-detail { display: block; }

.detail-head { padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.detail-back { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 600; color: var(--text-dim); margin-bottom: 22px; transition: color 0.18s, gap 0.2s var(--ease); }
.detail-back:hover { color: var(--text); gap: 11px; }
.detail-back svg { width: 16px; height: 16px; }
.detail-badges { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
.detail-meta { display: flex; align-items: center; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.detail-meta span { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-dim); font-family: var(--font-sans); }
.detail-meta span svg { width: 15px; height: 15px; color: var(--text-inactive); }

/* body prose */
.detail-prose { max-width: 800px; }
.detail-prose p { color: var(--text-2); line-height: var(--lh-text-md); margin-bottom: 18px; font-size: var(--fs-text-md); }
.detail-prose h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: 700; margin: 34px 0 14px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.detail-prose h3 .bar { width: 3px; height: 18px; border-radius: 2px; background: var(--accent-prime); }
.detail-prose ul { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.detail-prose ul li { position: relative; padding-left: 22px; color: var(--text-2); line-height: 1.7; }
.detail-prose ul li::before { content: ""; position: absolute; left: 5px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cyan); box-shadow: 0 0 8px var(--glow-cyan); }
.detail-prose strong { color: var(--text); font-weight: 700; }
.detail-prose code { font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--chip-text); background: var(--chip-bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--chip-border); }
.detail-prose a.inline-link { color: var(--chip-text); font-weight: 600; border-bottom: 1px solid var(--chip-border); }
.detail-prose .codeblock { margin: 18px 0; max-width: 100%; }

/* schedule table inside detail */
.detail-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); margin: 8px 0 22px; }
.detail-table th, .detail-table td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.detail-table thead th { background: var(--surface-2); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 700; color: var(--text-2); }
.detail-table tbody tr:last-child td { border-bottom: none; }
.detail-table td:first-child { font-family: var(--font-sans); color: var(--text); font-weight: 600; white-space: nowrap; }

/* callout reuse */
.detail-prose .callout { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); margin: 18px 0; }
.detail-prose .callout:has(.callout__body h4) { align-items: flex-start; }
.detail-prose .callout__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.detail-prose .callout__icon svg { width: 17px; height: 17px; }
.detail-prose .callout__body h4 { font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; margin-bottom: 4px; }
.detail-prose .callout__body p { font-size: var(--fs-text-sm); color: var(--text-dim); margin: 0; line-height: var(--lh-text-sm); }
.detail-prose .callout--warn { border-color: rgba(240,176,114,0.32); }
.detail-prose .callout--warn .callout__icon { background: rgba(240,176,114,0.14); color: var(--color-warning); }
:root[data-theme="light"] .detail-prose .callout--warn { background: rgba(240,176,114,0.07); }

/* attachments */
.attachments { margin-top: 30px; max-width: 800px; }
.attachments__title { font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-inactive); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.attachments__title svg { width: 15px; height: 15px; }
.attach { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); margin-bottom: 10px; transition: border-color 0.2s, background-color 0.2s; }
.attach:hover { border-color: var(--border-glow); background: var(--surface-hover); }
.attach__ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(91,168,255,0.12); border: 1px solid rgba(91,168,255,0.3); color: var(--accent-prime); flex-shrink: 0; }
.attach__ic svg { width: 19px; height: 19px; }
.attach__tx { flex: 1; min-width: 0; }
.attach__tx b { display: block; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); font-weight: 600; color: var(--text); }
.attach__tx span { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-inactive); }
.attach__dl { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--r-pill); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); flex-shrink: 0; transition: color 0.18s, border-color 0.18s, transform 0.18s; }
.attach__dl:hover { border-color: var(--border-glow); transform: translateY(-1px); }
.attach__dl.done { color: var(--color-success); border-color: rgba(43,214,110,0.4); }
.attach__dl svg { width: 15px; height: 15px; }

/* prev / next nav */
.detail-nav { margin-top: 40px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail-nav__row { display: flex; align-items: center; gap: 18px; padding: 18px 4px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background-color 0.16s; }
.detail-nav__row:last-child { border-bottom: none; }
.detail-nav__row:hover { background: var(--surface); }
.detail-nav__row.disabled { cursor: default; opacity: 0.45; }
.detail-nav__row.disabled:hover { background: none; }
.detail-nav__dir { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 600; color: var(--text-dim); width: 92px; flex-shrink: 0; }
.detail-nav__dir svg { width: 16px; height: 16px; }
.detail-nav__t { font-size: var(--fs-text-md); line-height: var(--lh-text-md); color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.18s; }
.detail-nav__row:not(.disabled):hover .detail-nav__t { color: var(--text); }

.detail-foot { display: flex; justify-content: center; margin-top: 30px; }
.btn-list { display: inline-flex; align-items: center; gap: 9px; }
.btn-list svg { width: 17px; height: 17px; }

@media (max-width: 640px) {
  .notice-hero { padding-top: 93px; }
}
@media (max-width: 720px) {
  .notice-hero__inner { flex-direction: column; align-items: stretch; }
  .notice-table .c-views, .notice-table thead .c-views { display: none; }
  .notice-table .c-date, .notice-table thead .c-date { display: none; }
  .detail-nav__dir { width: auto; }
  .detail-nav__t { font-size: 0.86rem; }
}
@media (max-width: 480px) {
  .notice-table .c-no, .notice-table thead .c-no { display: none; }
  .notice-table .c-cat, .notice-table thead .c-cat { display: none; }
  .notice-table { table-layout: fixed; }
  .notice-table td { padding: 12px; }
  .notice-table thead th { padding: 14px 12px; }

  /* 제목은 한 줄 말줄임, 분류는 생략 (자료실 모바일 패턴과 동일) */
  .notice-table .c-title .pin { display: flex; width: 100%; min-width: 0; }
  .notice-table .c-title .pin .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
}
