/* Publications 페이지. 색·모서리는 site.css 변수만 쓴다. 숫자와 그래프 막대는 impact-dashboard.js 가 채운다. */

/* 연구 성과 숫자 */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 24px; border-top: 1px solid var(--line); }
.kpis div { display: flex; flex-direction: column; align-items: center; padding: 20px 0 0; text-align: center; }   /* 숫자와 이름을 칸 가운데에 */
.kpis strong { font-size: 36px; font-weight: 800; color: var(--navy); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis span { margin-top: 4px; font-size: 14px; color: var(--muted); }
.quartiles { margin-top: 20px; font-size: 14px; color: var(--muted); }
.quartiles b { color: var(--ink); font-weight: 600; }

/* 그래프 칸 */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
.chart-box { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.chart-wide { grid-column: 1 / -1; }
.chart-box h3 { font-size: 15px; margin-bottom: 16px; }

/* 연도별: 세로 막대 */
.year-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; }
.impact-year-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.impact-year-col b { margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.impact-year-track { flex: 1; width: 100%; max-width: 36px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; margin-bottom: 4px; }
.impact-year-fill { display: block; width: 100%; background: var(--navy); border-radius: 4px 4px 0 0; }
.impact-year-col small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 연구 분야별: 가로 막대 */
.impact-area-row + .impact-area-row { margin-top: 12px; }
.impact-area-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.impact-area-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.impact-area-track { height: 6px; margin-top: 4px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.impact-area-fill { display: block; height: 100%; background: var(--navy); }

/* 원고 현황: 한 줄 막대 */
.pipeline-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.pipeline-legend b { color: var(--ink); font-weight: 600; margin-left: 2px; }
.pipeline-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; }
.pipeline-track { display: flex; height: 10px; margin-top: 14px; border-radius: 5px; overflow: hidden; background: var(--bg2); }
.pipeline-segment { display: block; height: 100%; }
.published { background: var(--navy); }
.revision { background: var(--accent); }
.submitted { background: var(--muted); }

/* 전체 목록 */
/* 종류 탭: 모양은 projects.css 의 .tabs 와 같게 (Publications 전용 사본) */
.tabs { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 20px 0 8px; }
.tabs button { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 16px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button span { margin-left: 4px; font-weight: 400; }
.tabs button:hover { color: var(--navy); }
.tabs button[aria-selected="true"] { border-bottom-color: var(--navy); color: var(--navy); }
.legend { margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.pub-list { border-top: 1px solid var(--line); }
.pub { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.pub[hidden] { display: none; }
.pub:target { background: var(--bg2); }
.pub time { color: var(--muted); font-variant-numeric: tabular-nums; }
.pub time small { display: block; font-size: 13px; }
.pub h3 { font-size: 16.5px; font-weight: 600; color: var(--navy); }
.pub-authors { margin-top: 6px; font-size: 14.5px; color: var(--muted); }
.lab-author { font-weight: 600; color: var(--ink); }
.author-role { margin-left: 4px; font-size: 11.5px; color: var(--muted); }
.author-role::before { content: "("; } .author-role::after { content: ")"; }   /* 이름 (First author) 처럼 괄호로 묶어 이름과 구분 */
.pub-meta { margin-top: 4px; font-size: 14.5px; color: var(--muted); }
.pub-meta b { font-weight: 500; color: var(--ink); }
.pub-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 8px; font-size: 13.5px; }
.pub-area { color: var(--muted); }

@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis strong { font-size: 28px; }
  .charts { grid-template-columns: 1fr; }
  .tabs { gap: 0 18px; } .tabs button { font-size: 15px; }
  .pub { grid-template-columns: 1fr; gap: 4px; }
  .pub time small { display: inline; margin-left: 6px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .year-chart { gap: 4px; }
  .chart-box { padding: 20px 16px; }
  .impact-year-col small, .impact-year-col b { font-size: 10.5px; }
}



/* 그래프 위 마우스 상자 (impact-dashboard.js): 그 칸에 들어간 논문 목록 */
.has-tip { cursor: default; }
.impact-year-col.has-tip:hover .impact-year-fill, .impact-area-row.has-tip:hover .impact-area-fill { background: var(--accent); }
.pipeline-segment.has-tip:hover { filter: brightness(1.25); }
.chart-tip { position: fixed; z-index: 20; width: 340px; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 12.5px; line-height: 1.4; box-shadow: 0 10px 28px rgba(9,34,61,.12); pointer-events: none; opacity: 0;   /* 떠 있는 동안(.is-on)은 마우스를 받음 — 상자 위에서 스크롤 */ transform: translateY(6px) scale(.98); transform-origin: top left; transition: opacity .1s ease, transform .1s ease; }   /* 사라질 땐 0.1초 — 마우스가 벗어나면 바로 (사용자 요청) */
.chart-tip.is-on { opacity: 1; transform: none; pointer-events: auto; transition: opacity .3s ease, transform .3s ease, left .25s ease, top .25s ease; }   /* 나타날 땐 0.3초. 떠 있는 채로 옆 칸에 올리면 자리가 0.25초에 걸쳐 미끄러져 옮겨감(뚝 안 튀게) */
.chart-tip b { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--navy); }
/* 목록 칸은 늘 같은 높이(190px) — 논문이 많아져도 상자 크기가 변하지 않고, 넘치면 안에서 스크롤(마우스를 상자 위에 올리고 휠). 끝에 닿아도 페이지로 안 번짐. 좁은 화면은 아래 미디어 쿼리 */
.chart-tip ul { margin: 0; padding: 0 6px 0 0; list-style: none; height: 190px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chart-tip ul::-webkit-scrollbar { width: 6px; }
.chart-tip ul::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--line); }
.chart-tip li { padding: 5px 0; border-top: 1px solid var(--line); }
.chart-tip li:first-child { border-top: 0; }
.chart-tip li span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.chart-tip p { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .chart-tip { transition: none; } }
@media (max-width: 420px) { .chart-tip { width: calc(100vw - 16px); } .chart-tip ul { height: 150px; } }

/* 연구 분야별 막대는 데이터를 받은 뒤 채워져서, 처음부터 그만큼 자리를 잡아 둠 (안 그러면 칸이 커지며 아래가 밀림) */
.area-chart { min-height: 215px; }
@media (max-width: 394px) { .area-chart { min-height: 237px; } }
@media (max-width: 360px) { .year-chart { gap: 2px; } .impact-year-col b, .impact-year-col small { font-size: 9px; } }
@media (max-width: 350px) { .area-chart { min-height: 260px; } }   /* 더 좁으면 분야 이름 둘이 두 줄로 */   /* 연도 9칸이 좁은 화면에서 옆으로 넘치지 않게 */   /* 아주 좁은 화면: 분야 이름 하나가 두 줄로 접혀 그래프가 22px 커짐 — 그만큼 자리를 미리 잡음 */
