/* ==========================================================
   중부대학교 정보보호학과 졸업작품 홈페이지 — 공통 스타일
   ========================================================== */

:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --ink: #152036;
  --muted: #5a6478;
  --line: #d9dee7;
  --accent: #2445b5;
  --accent-ink: #ffffff;
  --award: #9a6608;
  --award-bg: #fbf0d6;

  /* 연도 페이지 상단 (data.json의 theme 값으로 덮어씀) */
  --hero-bg: #0d1b3a;
  --hero-ink: #eaf0fa;
  --hero-muted: #a9b6cf;
  --year-accent: #6fc3ff;

  --font: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo",
    "Malgun Gothic", sans-serif;
  --wrap: 1200px;
  --gutter: 16px;
  --radius: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141d;
    --surface: #171d29;
    --ink: #e5e9f0;
    --muted: #9aa4b6;
    --line: #2a3242;
    --accent: #8ea6ff;
    --accent-ink: #0f141d;
    --award: #e3b453;
    --award-bg: #2e2512;
    --hero-bg: #0a1430;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141d;
  --surface: #171d29;
  --ink: #e5e9f0;
  --muted: #9aa4b6;
  --line: #2a3242;
  --accent: #8ea6ff;
  --accent-ink: #0f141d;
  --award: #e3b453;
  --award-bg: #2e2512;
  --hero-bg: #0a1430;
  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
  min-height: 60px; padding-block: 8px;
}
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand b { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.brand span { color: var(--muted); font-size: 0.92rem; }
.site-nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-size: 0.95rem; padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 500; }
.year-select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7488'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 28px 5px 10px; font-size: 0.92rem; cursor: pointer;
}
.theme-toggle {
  border: 1px solid var(--line); background: transparent; border-radius: var(--radius);
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 719px) {
  .theme-toggle { order: 2; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; }
}

/* ---------- 공통 섹션 ---------- */
main { display: block; }
.section { padding-block: 56px; }
.section + .section { padding-top: 8px; }
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: 1.5rem; font-weight: 700; }
.section-head .count { color: var(--muted); font-weight: 400; font-size: 1rem; margin-left: 8px; }
.lead { color: var(--muted); max-width: 64ch; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  padding: 10px 18px; border-radius: var(--radius); font-weight: 500;
}
.btn:hover { filter: brightness(1.08); }

.notice {
  padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); background: var(--surface);
}
.notice code { font-size: 0.9em; }

/* ---------- 연도 페이지: 상단 ---------- */
.year-hero { background: var(--hero-bg); color: var(--hero-ink); }
.year-hero .wrap {
  display: grid; gap: 40px; padding-block: 56px 64px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 880px) {
  .year-hero .wrap { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
}
.year-hero h1 { display: grid; gap: 6px; }
.year-hero h1 .y { font-size: 1.05rem; font-weight: 500; color: var(--hero-muted); }
.year-hero h1 .t { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 700; color: var(--hero-ink); }
.year-hero .org { margin-top: 10px; color: var(--hero-muted); }

.schedule { list-style: none; margin: 36px 0 0; padding: 0; border-top: 1px solid rgb(255 255 255 / 0.16); max-width: 640px; }
.schedule li {
  display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px 16px;
  padding: 12px 0; border-bottom: 1px solid rgb(255 255 255 / 0.16);
}
.schedule .when { color: var(--year-accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.schedule .when small { display: block; color: var(--hero-muted); font-weight: 400; font-size: 0.85rem; }
.schedule .what b { font-weight: 500; }
.schedule .what span { display: block; color: var(--hero-muted); font-size: 0.92rem; }
@media (max-width: 520px) { .schedule li { grid-template-columns: minmax(0, 1fr); } }

.staff { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 28px 0 0; }
.staff div { display: grid; }
.staff dt { font-size: 0.82rem; color: var(--hero-muted); }
.staff dd { margin: 0; font-weight: 500; }

.hero-poster { justify-self: center; width: min(100%, 340px); }
@media (max-width: 879px) { .hero-poster { justify-self: start; width: min(60%, 240px); } }
.hero-poster button { all: unset; cursor: zoom-in; display: block; border-radius: 4px; }
.hero-poster button:focus-visible { outline: 3px solid var(--year-accent); outline-offset: 4px; }
.hero-poster img { width: 100%; border-radius: 4px; box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.6); }

/* ---------- 연도 페이지: 필터 ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 14px; font-size: 0.9rem; cursor: pointer;
}
.chip small { color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.7; }
.search {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 6px 12px; min-width: 0; width: 15rem; max-width: 100%;
}

/* ---------- 연도 페이지: 작품 (전시 패널 + 설명) ---------- */
.wall {
  display: grid; gap: 48px 28px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
@media (max-width: 599px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 14px; }
  .work h3 { font-size: 1rem; }
  .actions a { padding: 2px 7px; font-size: 0.8rem; }
  .search { width: 100%; }
  .filters, .filters label { width: 100%; }
}
.work { display: grid; align-content: start; gap: 16px; }
.work[hidden] { display: none; }
.work-panel {
  display: block; aspect-ratio: 2 / 3; background: var(--line);
  border-radius: 4px; overflow: hidden; border: 1px solid var(--line);
}
.work-panel img { width: 100%; height: 100%; object-fit: cover; }
.work-panel:hover { border-color: var(--muted); }
.work.is-award .work-panel { outline: 3px solid var(--award); outline-offset: 3px; }
.work-label { display: grid; gap: 6px; }
.work-team { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 0.9rem; color: var(--muted); }
.work-team b { color: var(--ink); font-weight: 500; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 500;
  color: var(--award); background: var(--award-bg); padding: 1px 8px; border-radius: 999px;
}
.badge svg { width: 12px; height: 12px; }
.work h3 { font-size: 1.1rem; font-weight: 700; }
.people { font-size: 0.9rem; color: var(--muted); }
.people b { color: var(--ink); font-weight: 500; }

.actions { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.actions a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.84rem; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: 4px; padding: 3px 9px; background: var(--surface);
}
.actions a:hover { border-color: var(--accent); color: var(--accent); }
.actions svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.actions a:hover svg { color: inherit; }

.empty { grid-column: 1 / -1; }

/* 개인 졸업논문 */
.papers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.papers > li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.papers > li:first-child { padding-top: 0; }
.papers h3 { font-size: 1.05rem; font-weight: 500; }
@media (max-width: 600px) { .papers > li { grid-template-columns: minmax(0, 1fr); } }
.team-list .work-label { gap: 4px; }
.papers > li.is-award { box-shadow: inset 3px 0 0 var(--award); padding-left: 16px; }
[hidden] { display: none !important; }

/* 포스터 */
.posters { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.posters figure { margin: 0; flex: 0 0 auto; width: 220px; scroll-snap-align: start; display: grid; gap: 8px; align-content: start; }
.posters button { all: unset; cursor: zoom-in; display: block; border-radius: 4px; }
.posters button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.posters img { width: 100%; height: 300px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); background: var(--line); }
.posters figcaption { font-size: 0.9rem; display: flex; gap: 10px; flex-wrap: wrap; }
.posters figcaption a { font-size: 0.85rem; }
.extras { margin-top: 12px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.92rem; }

/* 사진 */
.photos { columns: 3 260px; column-gap: 12px; }
.photos button { all: unset; display: block; margin-bottom: 12px; cursor: zoom-in; border-radius: 4px; break-inside: avoid; }
.photos button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.photos img { width: 100%; border-radius: 4px; background: var(--line); }

/* ---------- 라이트박스 ---------- */
.lightbox {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgb(6 10 18 / 0.94); color: #eef2f8;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: transparent; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 0.92rem; }
.lb-stage { display: grid; place-items: center; padding: 0 56px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-caption { text-align: center; padding: 10px 16px 18px; font-size: 0.95rem; }
.lb-btn {
  background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.2); color: inherit;
  border-radius: var(--radius); padding: 6px 12px; cursor: pointer;
}
.lb-btn:hover { background: rgb(255 255 255 / 0.16); }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 1.4rem; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
@media (max-width: 600px) { .lb-stage { padding: 0 8px; } .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; } }

/* ---------- 홈 ---------- */
.home-hero { padding-block: 64px 40px; }
.home-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; }
#home-hero h1 { font-size: clamp(1.1rem, 5.2vw, 3.2rem); white-space: nowrap; }
.home-hero .lead { margin-top: 18px; font-size: 1.08rem; }
.home-hero .btn { margin-top: 28px; }

.news {
  display: grid; gap: 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
}
.news > div:first-child { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.news h3 { font-size: min(1.15rem, 3.8vw); white-space: nowrap; }
@media (max-width: 479px) { .news { padding: 16px; } }
.news .lead { flex-basis: 100%; order: 3; font-size: 0.95rem; }
.news-btn { padding: 8px 16px; font-size: 0.95rem; }
.home-hero:has(+ #news) { padding-bottom: 8px; }
.news .schedule { margin: 0; border-top-color: var(--line); max-width: none; }
.news .schedule li { border-bottom-color: var(--line); }
.news .schedule .when { color: var(--accent); }
.news .schedule .when small, .news .schedule .what span { color: var(--muted); }

.archive { display: grid; gap: 28px 18px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.archive a { color: var(--ink); text-decoration: none; display: grid; gap: 8px; }
.archive img { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); background: var(--line); }
.archive a:hover img { border-color: var(--muted); }
.archive b { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.archive span { font-size: 0.85rem; color: var(--muted); }
.archive .latest img { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- 행사소개 ---------- */
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.3rem; margin: 40px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p + p { margin-top: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.history { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 0.95rem; }
.history th, .history td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.history thead th { font-weight: 500; color: var(--muted); font-size: 0.85rem; background: var(--bg); }
.history tbody tr:last-child td, .history tbody tr:last-child th { border-bottom: 0; }
.history td.num, .history th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.history img { width: 40px; height: 54px; object-fit: cover; object-position: top; border-radius: 3px; border: 1px solid var(--line); }

/* ---------- 명예의 전당 ---------- */
.hof-year { display: grid; gap: 16px 32px; padding-block: 28px; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .hof-year { grid-template-columns: 140px minmax(0, 1fr); } }
.hof-year h2 { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hof-year h2 small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.hof-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.hof-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
.hof-item.no-thumb { grid-template-columns: minmax(0, 1fr); }
.hof-item img { width: 56px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }
.hof-item h3 { font-size: 1.02rem; font-weight: 500; }
.hof-item h3 a { color: var(--ink); }
.hof-item h3 a:hover { color: var(--accent); }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .wrap { padding-block: 28px; color: var(--muted); font-size: 0.88rem; display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
