/* History(연혁) 페이지: 왼쪽 시기 열(연·월, 세로선과 점) + 오른쪽 기록 카드.
   카드 = 왼쪽 띠(날짜·분류·장소) + 본문(정보 칩, 사진·포스터·교재, 상세내용). style.css 토큰을 그대로 쓴다. */
:root {
  --c-seminar: var(--accent-2);  /* 세미나: 교합지 블루 */
  --c-conf: var(--accent);       /* 학술대회: 교합지 레드 */
  --c-pub: #e9b863;              /* 교재·출판 */
  --c-soc: #6fcfb4;              /* 협회 */
  --chip-bg: color-mix(in srgb, var(--ink) 4%, var(--surface));
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

.hist { padding-block: 48px 72px }
.hist-intro { display: grid; gap: 10px; max-width: 64ch; margin-bottom: 36px }
.crumb { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.crumb a { text-decoration: none } .crumb a:hover { color: var(--ink) }
.hist-intro h1 { font-size: var(--step-4) }
.hist-intro .lede { color: var(--muted); font-size: 1.0625rem }
.note { font-size: .875rem; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap }
.tag-ex { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--accent); color: var(--accent) }

/* 탭 + 카테고리 */
.hist-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 28px }
.total { padding-bottom: 12px; color: var(--muted); font-size: .9375rem; font-variant-numeric: tabular-nums }
.filter { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface) }
.filter:focus-within { border-color: var(--accent-2) }
.filter select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: var(--ink); font: 500 .9375rem var(--font-body); padding: 9px 26px 9px 0; cursor: pointer; outline: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-size: 5px 5px; background-position: right 10px center, right 5px center; background-repeat: no-repeat }
.filter select option { background: var(--surface); color: var(--ink) }

/* 오늘 표시선: 위는 예정, 아래는 지난 기록 */
.today { display: flex; align-items: center; gap: 12px; color: var(--accent-2); font: 500 .8125rem var(--font-mono); letter-spacing: .06em }
.today::before, .today::after { content: ""; flex: 1; border-top: 1px dashed color-mix(in srgb, var(--accent-2) 60%, transparent) }
.today span { padding: 4px 12px; border: 1px solid color-mix(in srgb, var(--accent-2) 50%, transparent); border-radius: 999px; background: var(--bg); font-variant-numeric: tabular-nums }

/* 타임라인: 시기 묶음 */
.timeline { display: grid; gap: 40px }
.period { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 0 28px }
.when { position: relative; padding-right: 34px; text-align: right; border-right: 1px solid var(--line) }
.when-in { position: sticky; top: 92px; display: grid; gap: 4px; justify-items: end }
.when::after { content: ""; position: absolute; top: 4px; right: -9px; width: 17px; height: 17px; border-radius: 50%; background: var(--c, var(--accent-2)); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c, var(--accent-2)) 22%, var(--bg)) }
.when .y { font-family: var(--font-mono); font-size: .9375rem; color: var(--muted); font-variant-numeric: tabular-nums }
.when .mo { font-family: var(--font-display); font-size: 2.5rem; line-height: 1.05; font-weight: 700 }
.when .where { font-weight: 600; font-size: .9375rem }
.when .badge { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; font-size: .8125rem; font-weight: 600; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 16%, transparent) }
.when .badge.now { color: var(--c-soc); background: color-mix(in srgb, var(--c-soc) 16%, transparent) }
.when .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.when .count { font-size: .8125rem; color: var(--muted) }
.events { display: grid; gap: 16px; min-width: 0 }
.is-next .when { border-right-style: dashed }
.is-next .when::after { background: var(--bg); border: 3px solid var(--c, var(--accent-2)) }
.is-next .ev { border-style: dashed; background: color-mix(in srgb, var(--surface) 70%, var(--bg)) }

/* 기록 카드 */
.ev { display: grid; grid-template-columns: 168px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface) }
.ev-side { display: grid; align-content: start; gap: 4px; padding: 20px 18px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); border-left: 3px solid var(--c) }
.ev-side time { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; font-variant-numeric: tabular-nums }
.ev-side b { font-size: 1.0625rem }
.ev-side span { color: var(--muted); font-size: .9375rem }
.ev-main { display: grid; gap: 16px; padding: 20px 22px 22px; min-width: 0 }
.ev-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px }
.ev-head h3 { display: flex; align-items: center; gap: 8px; font-size: var(--step-1); color: var(--ink) }
.ev-head h3 svg { color: var(--c); flex: none }
.state { flex: none; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 8px; border: 1px solid; white-space: nowrap }
.state.done { color: #7fd3a0; border-color: color-mix(in srgb, #7fd3a0 45%, transparent); background: color-mix(in srgb, #7fd3a0 10%, transparent) }
.state.now { color: var(--ink); border-color: var(--c-soc); background: color-mix(in srgb, var(--c-soc) 22%, transparent) }
.ev-tags { display: inline-flex; gap: 6px; align-items: center; flex: none }
.state.soon { color: var(--accent-2); border-color: color-mix(in srgb, var(--accent-2) 45%, transparent); background: color-mix(in srgb, var(--accent-2) 10%, transparent) }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0 }
.chips li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--chip-bg); font-size: .9375rem; min-width: 0 }
.chips svg { color: var(--muted); flex: none }
.chips .k { color: var(--muted); white-space: nowrap; flex: none }
.chips b { font-weight: 600 }
.chips .mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums }

/* 사진·포스터·교재 */
.media-h { font-size: .8125rem; color: var(--muted); font-weight: 500; margin-bottom: 8px }
.media { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end }
.m { position: relative; display: grid; place-items: center; align-content: center; gap: 6px; padding: 8px; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 10px; background: var(--ph-bg); color: var(--muted); font: 500 .75rem var(--font-body); text-align: center; cursor: zoom-in; max-width: 100% }
.m:hover { border-color: var(--accent); color: var(--ink) }
.m svg { color: var(--accent) }
.m.photo { width: 148px; aspect-ratio: 4 / 3 }
.m.poster { width: 102px; aspect-ratio: 3 / 4 }
.m.book { width: 102px; aspect-ratio: 3 / 4; border-left-width: 7px; border-left-style: solid; border-radius: 4px 10px 10px 4px }
.m small { font-family: var(--font-mono); font-size: .625rem; letter-spacing: .06em; color: var(--accent) }
.m.has-img { padding: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface) }
.m.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block }
.m.has-img:hover { border-color: var(--accent-2) }
.m.poster.has-img { width: 132px }
.prog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.prog li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 14px; align-items: baseline; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--chip-bg) }
.prog time, .prog .mono { font-family: var(--font-mono); font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums }
.prog time { color: var(--ink); font-weight: 500 }
@media (max-width: 560px) { .prog li { grid-template-columns: auto minmax(0, 1fr) } .prog li > span:last-child { grid-column: 1 / -1 } }
.m.more { width: 64px; aspect-ratio: 3 / 4; border-style: solid; border-color: var(--line); background: var(--chip-bg); font: 500 .875rem var(--font-mono) }

.detail { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--bg) 35%, var(--surface)) }
.detail .k { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--muted); margin-bottom: 4px }
.detail p:last-child { max-width: 70ch; white-space: pre-line }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px }

/* 크게 보기 */
.viewer { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); padding: 0; max-width: min(560px, calc(100vw - 32px)); width: 100% }
.viewer::backdrop { background: rgb(4 8 12 / .72) }
.viewer-box { display: grid; gap: 14px; padding: 18px }
.viewer-media .m { width: 100%; cursor: default; font-size: .9375rem }
.viewer-media .m.poster, .viewer-media .m.book { width: 62%; margin-inline: auto }
.viewer-img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; border-radius: 8px }
.viewer-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; color: var(--ink-2, var(--ink)); font-size: .875rem; font-variant-numeric: tabular-nums }
.viewer-nav .vn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); font-size: 1.375rem; line-height: 1; cursor: pointer }
.viewer-nav .vn:hover { border-color: var(--ink) }
.viewer-close { justify-self: end; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--ink); font: 500 .9375rem var(--font-body); cursor: pointer }

@media (prefers-reduced-motion: no-preference) {
  .ev { animation: rise .35s ease both }
  @keyframes rise { from { transform: translateY(6px) } }
}

@media (max-width: 860px) {
  .ev { grid-template-columns: 1fr }
  .ev-side { grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 12px; padding: 12px 16px; border-left: 0; border-top: 3px solid var(--c) }
}
@media (max-width: 680px) {
  .period { grid-template-columns: minmax(0, 1fr); gap: 14px }
  .when { text-align: left; border-right: 0; padding: 0 0 0 30px }
  .when::after { left: 2px; right: auto; top: 6px; width: 13px; height: 13px }
  .when-in { position: static; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px }
  .when .mo { font-size: 1.875rem }
  .ev-main { padding: 16px }
  .m.photo { width: calc(50% - 5px) }
}

/* 홈페이지(index.html) 연혁 섹션: 소개 글은 오른쪽 열, 타임라인은 섹션 전체 폭 */
.hist-sec .wrap > .timeline { grid-column: 1 / -1 }
.hist-sec .body { gap: 14px }
.hist-sec .hist-bar { margin-bottom: 0 }
.nav a[aria-current="page"] { color: var(--ink) }
.when .mo::first-letter { text-transform: uppercase }
