:root {
  --ink: #1a1a1a;
  --muted: #767676;
  --line: #e4e4e4;
  --bg: #fdfdfc;
  --max: 980px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

:root { --sidebar-w: 200px; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 2.5rem 1.5rem;
  border-right: 1px solid var(--line);
}

.sidebar nav { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.92rem; }
.sidebar nav hr { border: none; border-top: 1px solid var(--line); margin: 0.6rem 0; }
.sidebar nav a { color: var(--muted); }
.sidebar nav a:hover { color: var(--ink); }
.sidebar nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.sidebar .nav-home { font-weight: 600; color: var(--ink); }
.nav-exhibitions { display: flex; flex-direction: column; gap: 0.5rem; }

main {
  max-width: var(--max);
  margin: 0 0 0 var(--sidebar-w);
  padding: 2.5rem 2.5rem 6rem;
}

.menu-toggle { display: none; }

/* 좁은 화면(폰)에서는 왼쪽 사이드바 대신 햄버거 버튼으로 여닫는 메뉴로 */
@media (max-width: 768px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    overflow-y: visible;
    padding: 0.9rem 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 20px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; background: var(--ink); }
  #site-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 1rem;
  }
  .sidebar.nav-open #site-nav { display: flex; }
  .nav-exhibitions { flex-direction: column; }
  main { margin-left: 0; padding: 1.5rem 1.25rem 4rem; }
  .index-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

.hero { padding: 3rem 0; }
.hero h1 { font-size: 2rem; margin: 0; }

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.index-card { background: var(--bg); padding: 2rem 1.5rem; }
.index-card h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.index-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.index-card:hover { background: #f5f5f4; }

h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
h1 small { font-weight: 400; color: var(--muted); font-size: 1rem; }
.meta { color: var(--muted); font-size: 0.92rem; margin-top: 0; }
.empty { color: var(--muted); }

.list { list-style: none; margin: 2rem 0 0; padding: 0; }
.list > li { border-top: 1px solid var(--line); }
.list > li:last-child { border-bottom: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; }
.list.list-plain a { display: block; padding: 0.9rem 0; }
.li-title { font-weight: 500; }
.li-meta { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.list.list-plain .li-meta { display: block; margin-left: 0; margin-top: 0.2rem; }
.thumb { width: 64px; height: 64px; object-fit: cover; background: var(--line); flex: none; }

.hero-gallery { display: grid; gap: 0.5rem; margin: 1.5rem 0; }
.hero-img { width: 100%; display: block; cursor: zoom-in; }

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}
.artwork img { width: 100%; display: block; cursor: zoom-in; background: var(--line); }
.artwork img[hidden] { display: none; }
.artwork figcaption { margin-top: 0.5rem; font-size: 0.85rem; }
.cap-title { display: block; }
.cap-title-en { display: block; font-style: italic; color: var(--muted); font-size: 0.92em; margin-top: 0.1rem; }

.prose-page { max-width: 640px; }
.prose { margin-top: 1.5rem; }
.prose blockquote {
  margin: 1.2rem 0; padding-left: 1rem; border-left: 2px solid var(--line);
  color: var(--muted); font-style: italic;
}
.prose h2, .prose h3 { margin-top: 2rem; }

.lightbox {
  position: fixed; inset: 0; background: rgba(10,10,10,0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem; z-index: 100;
}
.lightbox[hidden] { display: none; }
.lb-img { max-width: 90vw; max-height: 78vh; object-fit: contain; }
.lb-caption { color: #eee; font-size: 0.9rem; text-align: center; }
.lb-line { margin-top: 0.2rem; }
.lb-line-en { color: #bbb; }
.lb-line em { font-style: italic; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; background: none; border: none; color: #fff;
  font-size: 1.6rem; cursor: pointer; padding: 0.5rem 1rem;
}
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); font-size: 2.4rem; }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); font-size: 2.4rem; }
