/* =============================================================
   연세대학교 문화인류학과 동문회 사진 아카이브
   모바일 우선: 기본 스타일 = 휴대폰, @media 로 넓은 화면 보완
   ============================================================= */

:root {
  --navy: #0f2c59;
  --navy-dark: #0a1f40;
  --navy-soft: #eef2f8;
  --accent: #3d6cb3;
  --text: #1f2329;
  --muted: #5f6773;
  --line: #dfe3ea;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --radius: 6px;
  /* 간격 단계: 이 값들만 씁니다 (DESIGN.md 참고) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --inner: 1200px;
  --gutter: 16px;
  --header-h: 60px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--navy); }
.content-section a, .news-body a, .album-desc a, .contact-list a {
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 8px 14px;
  background: var(--navy); color: #fff; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; color: #fff; }

.inner { width: 100%; max-width: var(--inner); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }

/* ---------- 상단 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 12px; }
.brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-ko { font-size: 16px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; }
.brand-en { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-toggle {
  position: relative; z-index: 120; flex: none;
  width: 44px; height: 44px; margin-right: -8px; border: 0; background: none;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--navy);
  transition: transform 0.25s, background-color 0.25s;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-open .nav-toggle-bar { background: transparent; }
.nav-open .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
  width: min(80vw, 320px); padding: calc(var(--header-h) + 8px) 24px 24px;
  background: #fff; box-shadow: -8px 0 24px rgba(10, 31, 64, 0.12);
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.28s ease, visibility 0s linear 0.28s;
}
.nav-open .site-nav { transform: none; visibility: visible; transition: transform 0.28s ease; }
.site-nav-title { position: absolute; top: 18px; left: 24px; font-size: 13px; font-weight: 600; color: var(--muted); }
.site-nav li { border-bottom: 1px solid var(--line); }
.site-nav a { display: block; padding: 16px 4px; font-size: 17px; font-weight: 600; }
.site-nav a[aria-current="page"] { color: var(--navy); }
.nav-backdrop { position: fixed; inset: 0; z-index: 105; background: rgba(10, 31, 64, 0.4); }
.nav-open { overflow: hidden; }

/* ---------- 메인 배너 ---------- */
.hero {
  position: relative; overflow: hidden;
  height: clamp(280px, 68vw, 560px);
  background: var(--navy-dark); color: #fff;
  touch-action: pan-y;
}
.hero-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 0.8s ease; }
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 31, 64, 0.25) 0%, rgba(10, 31, 64, 0.45) 55%, rgba(10, 31, 64, 0.75) 100%);
}
.hero-slide figcaption {
  position: absolute; left: var(--gutter); bottom: 54px; z-index: 3;
  font-size: 12px; opacity: 0.85;
}
.hero-slide figcaption a { color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.5); }
.hero-text {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 var(--gutter) 24px; text-align: center;
}
.hero-title { font-size: clamp(22px, 5.6vw, 42px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.3; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25); }
.hero-sub { margin-top: 10px; font-size: clamp(10px, 2.6vw, 14px); letter-spacing: 0.18em; opacity: 0.85; }
.hero-controls {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 4;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.hero-prev, .hero-next {
  position: relative; width: 36px; height: 36px; border: 0; background: none;
}
.hero-prev::before, .hero-next::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px;
  border-top: 2px solid #fff; border-left: 2px solid #fff;
}
.hero-prev::before { transform: translate(-30%, -50%) rotate(-45deg); }
.hero-next::before { transform: translate(-70%, -50%) rotate(135deg); }
.hero-dots { display: flex; gap: 2px; }
.hero-dot { width: 24px; height: 24px; border: 0; background: none; position: relative; }
.hero-dot::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.45); transition: width 0.3s;
}
.hero-dot.is-active::before { width: 20px; border-radius: 4px; background: #fff; }
.hero-empty { background: linear-gradient(135deg, var(--navy-dark), var(--navy) 60%, #2b4e86); }

/* ---------- 바로가기 ---------- */
.quick-section { position: relative; z-index: 5; margin-top: 20px; }
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-links a {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: 100%;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.quick-links a:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(15, 44, 89, 0.08); }
.quick-links .icon { width: 28px; height: 28px; color: var(--navy); margin-bottom: 8px; }
.ql-label { font-weight: 700; color: var(--navy); }

/* ---------- 3칸 미리보기 ---------- */
.mini-boards { display: grid; gap: 36px; margin: 44px auto 64px; }
.mini-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; border-bottom: 2px solid var(--navy);
}
.mini-head h2 { font-size: 19px; font-weight: 700; color: var(--navy); letter-spacing: -0.02em; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); padding: 6px 0 6px 8px; }
.more span { font-size: 18px; line-height: 1; color: var(--navy); }
.mini-list li { border-bottom: 1px solid var(--line); }
.mini-list a { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; }
.mini-title { font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mini-summary { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mini-date { font-size: 13px; color: var(--muted); }
.mini-albums a { flex-direction: row; align-items: center; gap: 14px; padding: 12px 0; }
.mini-albums img { width: 88px; height: 62px; flex: none; object-fit: cover; border-radius: 4px; background: var(--bg-soft); }
.mini-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mini-years a { flex-direction: row; align-items: baseline; justify-content: space-between; }
.mini-year { font-size: 18px; font-weight: 700; color: var(--navy); }
.empty { padding: 28px 0; color: var(--muted); text-align: center; }

/* 동문회 소개 사진 */
.about-photo { margin: 0 0 40px; }
.about-photo img { width: 100%; height: auto; border-radius: var(--radius); }
.about-photo figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ---------- 하위 페이지 머리 ---------- */
.page-head { background: var(--navy-soft); border-bottom: 1px solid var(--line); padding: 28px 0 30px; }
.breadcrumb { display: flex; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.breadcrumb a + a::before { content: "›"; margin: 0 8px; color: #9aa2ad; }
.page-title { font-size: clamp(24px, 6vw, 34px); font-weight: 700; color: var(--navy); letter-spacing: -0.03em; line-height: 1.3; }
.page-lead { margin-top: 8px; color: var(--muted); font-size: 15px; }
.page-body { padding-top: 32px; padding-bottom: 64px; }

.content-section + .content-section { margin-top: 40px; }
.section-title {
  font-size: 19px; font-weight: 700; color: var(--navy); margin-bottom: 14px;
  padding-left: 12px; border-left: 3px solid var(--navy); line-height: 1.3;
}
.content-section p + p { margin-top: 10px; }
.bullet-list li { position: relative; padding-left: 14px; }
.bullet-list li + li { margin-top: 8px; }
.bullet-list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--navy); }

.button {
  display: inline-block; padding: 10px 20px; border-radius: var(--radius);
  background: var(--navy); color: #fff; font-weight: 600; text-decoration: none;
}
.button:hover { color: #fff; background: var(--navy-dark); }
.button-line { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.button-line:hover { color: var(--navy); background: var(--navy-soft); }

/* ---------- 연락처 ---------- */
.contact-list { margin: 0; border-top: 1px solid var(--line); }
.contact-list div { display: flex; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.contact-list dt { flex: none; width: 72px; font-weight: 600; color: var(--navy); }
.contact-list dd { margin: 0; }
.contact-empty { color: var(--muted); }

/* ---------- 사진 아카이브 ---------- */
.year-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-7); }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 600; background: #fff;
}
.chip:hover { border-color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* 연도 사이 간격은 부모의 gap 으로: 필터로 숨긴 연도가 여백을 남기지 않음 */
.archive-list { display: flex; flex-direction: column; gap: var(--space-8); }
.year-group[hidden] { display: none; }
.year-title { font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: var(--space-5); }
.semester-group + .semester-group { margin-top: var(--space-6); }

/* 아직 사진이 없는 연도: 앨범 카드와 같은 모양의 자리 표시 */
.album-card-placeholder .album-thumb {
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-soft); color: #9fb0cc;
}
.album-card-placeholder .album-thumb .icon { width: 36px; height: 36px; }
.album-card-placeholder .album-title { color: var(--muted); }
.semester-title {
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.semester-title::before { content: "[동문회 아카이브] "; color: var(--navy); font-weight: 600; }

.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
.album-card a { display: block; }
.album-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--bg-soft); }
.album-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.album-card a:hover .album-thumb img { transform: scale(1.04); }
.album-body { padding-top: 10px; }
.album-sem { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.album-title { font-size: 15px; font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; }
.album-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- 갤러리 ---------- */
.album-desc { margin-bottom: 24px; color: #3a414b; }
.album-desc p + p { margin-top: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-link { display: block; aspect-ratio: 1; overflow: hidden; background: var(--bg-soft); }
.photo-link img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.photo-link:hover img { opacity: 0.85; }

.album-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px;
}
.album-nav a { min-width: 0; }
.album-nav span { display: block; font-size: 12px; color: var(--muted); }
.album-nav-prev, .album-nav-next { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.album-nav-next { text-align: right; }
.album-nav-list { padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; }

/* ---------- 크게 보기 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column;
  background: rgba(6, 12, 24, 0.985); color: #fff; touch-action: pinch-zoom;
}
.lightbox[hidden] { display: none; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 8px 0 16px; flex: none; }
.lb-counter { font-size: 14px; opacity: 0.85; font-variant-numeric: tabular-nums; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  user-select: none; -webkit-user-drag: none; transition: opacity 0.2s;
}
.lb-img.is-loading { opacity: 0.3; }
.lb-caption { flex: none; padding: 12px 16px 18px; font-size: 14px; text-align: center; opacity: 0.85; }
.lb-btn { width: 48px; height: 48px; border: 0; background: none; color: #fff; position: relative; }
.lb-close::before, .lb-close::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 2px; background: #fff;
}
.lb-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.lb-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: none; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-prev::before, .lb-next::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  border-top: 2px solid #fff; border-left: 2px solid #fff;
}
.lb-prev::before { transform: translate(-30%, -50%) rotate(-45deg); }
.lb-next::before { transform: translate(-70%, -50%) rotate(135deg); }
.lb-btn[disabled] { opacity: 0.25; cursor: default; }
.lb-open { overflow: hidden; }

/* ---------- 소식 ---------- */
.news-list { border-top: 2px solid var(--navy); }
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a { display: flex; flex-direction: column; gap: 4px; padding: 18px 4px; }
.news-title { font-size: 17px; font-weight: 700; line-height: 1.45; }
.news-summary { color: var(--muted); font-size: 15px; }
.news-date { font-size: 13px; color: var(--muted); }
.news-body { font-size: 16.5px; line-height: 1.8; max-width: 760px; }
.news-body p + p { margin-top: 1em; }

/* ---------- 하단 ---------- */
.site-footer { background: var(--navy-dark); color: rgba(255, 255, 255, 0.78); font-size: 14px; padding: 36px 0 40px; }
.site-footer a { color: #fff; }
.footer-top { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.footer-name { font-size: 17px; font-weight: 700; color: #fff; }
.footer-dept { display: inline-flex; align-items: center; gap: 6px; text-decoration: none !important; }
.footer-dept .icon { width: 16px; height: 16px; }
.footer-grid { display: grid; gap: 24px; padding: 24px 0; }
.footer-heading { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-contact { margin: 0; }
.footer-contact div { display: flex; gap: 12px; padding: 2px 0; }
.footer-contact dt { width: 60px; flex: none; color: rgba(255, 255, 255, 0.55); }
.footer-contact dd { margin: 0; }
.footer-notice p + p { margin-top: 4px; }
.footer-notice a { text-decoration: underline; text-underline-offset: 3px; }
.footer-copy { font-size: 12px; color: rgba(255, 255, 255, 0.5); padding-top: 20px; }
.footer-contact-line { margin-top: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-contact-line strong { color: #fff; margin-right: 4px; }
.footer-contact-line .sep { color: rgba(255, 255, 255, 0.35); }

/* =============================================================
   넓은 화면
   ============================================================= */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .quick-links { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .album-grid { grid-template-columns: repeat(3, 1fr); gap: 28px 18px; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-top { flex-direction: row; justify-content: space-between; align-items: center; }
  .lb-prev, .lb-next { display: block; }
  .lb-stage { padding: 0 64px; }
}

@media (min-width: 960px) {
  :root { --header-h: 80px; }
  .brand-ko { font-size: 19px; }
  .brand-en { font-size: 11px; }
  .nav-toggle, .nav-backdrop, .site-nav-title { display: none !important; }
  .site-nav {
    position: static; width: auto; padding: 0; transform: none; visibility: visible;
    background: none; box-shadow: none; transition: none;
  }
  .site-nav ul { display: flex; gap: 8px; }
  .site-nav li { border: 0; }
  .site-nav a { position: relative; padding: 8px 14px; font-size: 16.5px; }
  .site-nav a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
    background: var(--navy); transform: scaleX(0); transition: transform 0.2s;
  }
  .site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
  .nav-open { overflow: auto; }

  .hero { height: 540px; }
  .hero-controls { bottom: 64px; }
  .hero-slide figcaption { bottom: 76px; }
  .hero-text { padding-bottom: 48px; }
  .quick-section { margin-top: -48px; }
  .quick-links a { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 14px; padding: 22px 24px; box-shadow: 0 8px 24px rgba(15, 44, 89, 0.08); }
  .quick-links .icon { margin: 0; width: 34px; height: 34px; }
  .mini-boards { grid-template-columns: repeat(3, 1fr); gap: 40px; margin: 64px auto 88px; }
  .page-head { padding: 40px 0 44px; }
  .page-body { padding-top: 48px; padding-bottom: 88px; }
}

@media (min-width: 1080px) {
  .album-grid { grid-template-columns: repeat(4, 1fr); }
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
