/* ============================================
   공명 共鳴 RESONANCE — 공통 스타일시트
   모든 페이지가 이 파일 하나를 같이 씁니다.
   ============================================ */

@font-face {
  font-family: "OnulGubo";
  src: url("font/OnulGubo-Regular.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #EAEAEA;
  color: #1a1a1a;
  font-family: "OnulGubo";
  line-height: 1.6;
  padding-top: 84px;
}

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

/* ---------- 헤더 / 네비게이션 ---------- */

header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  border-bottom: 0px solid #eee;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #EAEAEA;
  z-index: 100;
  transition: padding-bottom 0.25s ease;
}

header.site-header:has(.nav-dropdown:hover) {
  padding-bottom: 56px;
}

.logo {
  display: flex;
  align-items: Center;
  gap: 12px;
}

.logo .logo-kr {
  font-size: 24px;
  font-weight: 50;
  letter-spacing: -0.1em;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.hanja {
  font-family: "Noto Serif KR", serif;
  font-weight: 550;
  letter-spacing: -0.1em;
}

.hangul-nudge {
  position: relative;
  top: -2px;
}

.logo .logo-sub {
  font-size: 11px;
  color: #0f0f0f;
  line-height: 1.4;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 45px;
  font-size: 14px;
  letter-spacing: 0.03em;
}

nav.main-nav a {
  color: #999;
  transition: color 0.2s ease;
}

nav.main-nav a:hover {
  color: #111;
}

nav.main-nav a.active {
  color: #111;
}

nav.main-nav a.active::before,
nav.main-nav a:not(.search-icon):hover::before {
  content: "( (( ";
}
nav.main-nav a.active::after,
nav.main-nav a:not(.search-icon):hover::after {
  content: " )) )";
}

/* ---------- 이미지 자리를 임시로 채워두는 회색 박스 ---------- */

.placeholder {
  background: #e2e2e2;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ---------- 괄호 섹션 타이틀 ---------- */

.bracket-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
}

/* ---------- 공통 컨테이너 ---------- */

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 48px 100px;
}

/* ---------- 푸터 ---------- */

footer.site-footer {
  border-top: 1px solid #eee;
  padding: 48px;
  margin-top: 80px;
}

footer.site-footer .footer-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 24px;
}

footer.site-footer .footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #777;
  gap: 24px;
}

footer.site-footer .footer-meta div {
  flex: 1;
}

footer.site-footer .footer-meta p {
  margin: 2px 0;
}

/* ============================================
   작품 갤러리
   ============================================ */

.gallery {
  --gallery-gap: 6px;
  --gallery-row-gap: 72px;
  --gallery-cols: 5;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  column-gap: var(--gallery-gap);
  row-gap: var(--gallery-row-gap);
  padding-top: 0;
}

.artwork-tile {
  position: relative;
  overflow: visible;
  cursor: pointer;
  flex: 0 0 calc((100% - (var(--gallery-cols) - 1) * var(--gallery-gap)) / var(--gallery-cols));
  min-height: 0;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 줄마다 위쪽에 고정으로 그어지는 선. 좌우로 gap의 절반씩 넘어가서
   옆 타일의 선과 맞닿아 하나로 이어져 보입니다. 호버해도 움직이지 않음. */
.artwork-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--gallery-gap) / -2);
  right: calc(var(--gallery-gap) / -2);
  height: 1px;
  background: #222;
  z-index: 2;
}

/* 실제 호버 시 움직이는 안쪽 상자. 선은 이 안에 없어서 같이 움직이지 않음. */
.tile-inner {
  position: relative;
  overflow: hidden;
  margin-top: 0px;
  transition: transform 0.45s ease;
}

.tile-pair .tile-inner {
  position: absolute;
  top: 0px;
  left: 0;
  right: 0;
  bottom: 0;
  margin-top: 0;
}

.artwork-tile:hover .tile-inner {
  transform: translateY(20px);
}

.artwork-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.4s ease;
}

.artwork-tile:hover img {
  filter: brightness(0.55);
}

.artwork-tile .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  padding: 16px;
}

.artwork-tile:hover .overlay {
  opacity: 1;
  transform: translateY(0);
}

.artwork-tile .overlay .title {
  font-size: 14px;
  letter-spacing: 0.05em;
  margin: 0 0 6px 0;
}

.artwork-tile .overlay .artist {
  font-size: 12px;
  color: #d9d9d9;
  margin: 0;
}

/* ---------- 국가 필터 탭 ---------- */

.country-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 15px;
  color: #888;
  margin: 32px 0;
  position: sticky;
  top: 83px;
  z-index: 90;
  background: #EAEAEA;
  padding: 16px 0;
}

.country-tabs a.active {
  color: #111;
}

.country-tabs a.active::before { content: "(( "; }
.country-tabs a.active::after { content: " ))"; }

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  display: flex;
  gap: 20px;
  white-space: nowrap;
  padding-top: 18px;
  font-size: 13px;
  color: #999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
}

.nav-dropdown:hover .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.35s ease 0.3s, transform 0.35s ease 0.3s, visibility 0.35s ease 0.3s;
}

.dropdown-panel a {
  color: #999;
}

.dropdown-panel a:hover,
.dropdown-panel a.active {
  color: #111;
}

.dropdown-panel a:hover::before,
.dropdown-panel a.active::before { content: "(( "; }
.dropdown-panel a:hover::after,
.dropdown-panel a.active::after { content: " ))"; }

.search-icon svg {
  display: block;
}

.search-wrap {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.bracket {
  opacity: 0;
  color: #999;
  font-size: 14px;
  transition: opacity 0.3s ease 0.1s;
  pointer-events: none;
}

.search-wrap:hover .bracket,
.search-wrap:focus-within .bracket,
.search-wrap.open .bracket {
  opacity: 1;
}

.search-input {
  width: 0;
  opacity: 0;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #111;
  padding: 0;
  transition: width 0.3s ease 0.1s, opacity 0.3s ease 0.1s;
  pointer-events: none;
}

.search-wrap:hover .search-input,
.search-wrap:focus-within .search-input,
.search-wrap.open .search-input {
  width: 140px;
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   인사 페이지: 언어 탭 + 인사말
   ============================================ */

.lang-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  font-size: 15px;
  color: #888;
  margin: 60px 0 32px;
}

.lang-tabs a {
  cursor: pointer;
}

.lang-tabs a.active {
  color: #111;
}

.lang-tabs a.active::before { content: "(( "; }
.lang-tabs a.active::after { content: " ))"; }

.lang-content {
  display: none;
}

.lang-content.active {
  display: block;
}

.greeting-block {
  max-width: 960px;
  margin: 0 auto;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 10vh;
}

.greeting-name {
  font-size: 13px;
  color: #333;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-align: center;
}

.greeting-title-line {
  font-size: 30px;
  font-weight: 500;
  color: #333;
  margin: 0 0 24px;
  text-align: center;
  line-height: 1.5;
  word-break: keep-all;
}

.greeting-credit {
  font-size: 13px;
  color: #333;
  margin: 0 0 20px;
  text-align: center;
}

.greeting-text {
  font-size: 15px;
  line-height: 2;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.greeting-text.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.greeting-text p {
  margin: 0 0 20px;
}

.greeting-text p:last-child {
  margin-bottom: 0;
}

.greeting-text .choi-section-title {
  font-weight: 600;
  color: #111;
  margin: 32px 0 10px;
}

.greeting-sig {
  margin-top: 24px;
  font-size: 13px;
  color: #888;
  text-align: right;
}

.greeting-more {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #888;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.lang-content[data-lang="zh"] {
  font-family: "Noto Serif SC", serif;
}

.lang-content[data-lang="ja"] {
  font-family: "Noto Serif JP", serif;
}

/* ===== 인사 페이지 전용 (소개 페이지에는 영향 없음) ===== */

.page-greeting .lang-tabs {
  margin: 32px 0 32px;
}

.page-greeting .lang-content > .greeting-block:first-child {
  padding-top: 24px;
}

/* ===== 소개 페이지 전용 ===== */

.page-about .lang-content > .greeting-block:first-child {
  padding-top: 24px;
}

.bio-col[lang="zh"] { font-family: "Noto Serif SC", serif; }
.bio-col[lang="ja"] { font-family: "Noto Serif JP", serif; }

.placeholder-tile {
  cursor: default;
  aspect-ratio: 3 / 4;
}

.tile-pair .pair-images {
  display: flex;
  height: 100%;
  gap: 3px;
}

.tile-pair .pair-images img {
  width: auto;
  height: 100%;
  display: block;
}

/* 마지막 줄이 5개를 못 채울 때, 빈 칸을 채워서 선과 줄 길이를 맞춰줍니다.
   실제 이미지는 없고 위쪽 선만 있는 투명한 자리예요. */
.gallery-filler {
  cursor: default;
}

/* ============================================
   작가 상세 페이지: "더보기" 버튼
   PC에서는 항상 숨김 → 아래 모바일 구간에서만 다시 켬.
   반드시 모바일 media query들보다 앞에 있어야 함
   (같은 우선순위일 때 CSS는 "나중에 나온 규칙"이 이기므로).
   ============================================ */

#bio-more {
  display: none;
  margin: 0;
}

#bio-section {
  line-height: 1.6 !important;
}

/* ============================================
   모바일 대응 (전체 사이트)
   ============================================ */

@media (max-width: 768px) {

  /* 화면 폭을 넘어가는 요소가 있어도 가로 스크롤 자체가
     생기지 않게 막는 안전장치. 항상 맨 위에 둡니다. */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* ---------- 헤더 ---------- */
  body { padding-top: 112px; }

  header.site-header,
  header.site-header:has(.nav-dropdown:hover) {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
    padding-bottom: 12px !important;
  }

  .logo-img { height: 30px; }
  .logo .logo-sub { font-size: 10px; }

  nav.main-nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 14px;
    font-size: 12px;
    letter-spacing: 0;
    overflow: hidden;
  }

  /* 호버로만 열리던 드롭다운은 터치에서 못 여니 항상 숨김.
     "작품" 글자를 누르면 그냥 archive.html로 이동합니다. */
  .dropdown-panel { display: none !important; }

  nav.main-nav a.active::before,
  nav.main-nav a.active::after,
  nav.main-nav a:not(.search-icon):hover::before,
  nav.main-nav a:not(.search-icon):hover::after { content: none; }
  nav.main-nav a.active { border-bottom: 1px solid #111; }

  .search-wrap { flex-basis: auto; flex-shrink: 0; justify-content: flex-start; margin-top: 0; margin-left: auto; }
  .search-wrap.open .search-input,
  .search-wrap:focus-within .search-input { width: 90px; }

  /* ---------- 공통 여백 ---------- */
  section.page-wrap,
  section[class="page-wrap"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 16px !important;
  }

  div[style*="padding:0 56px"] {
    margin-top: 24px !important;
  }
  div[style*="margin-left:120px"] div[style*="margin-bottom:24px"] {
    margin-top: 24px !important;
  }

  .page-about section.page-wrap,
  .page-greeting section.page-wrap,
  #desc-section,
  #bio-section {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  footer.site-footer { padding: 24px 16px; margin-top: 24px; font-size: 12px; }
  footer.site-footer .footer-brand { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px; }
  footer.site-footer .footer-meta { flex-direction: column; gap: 10px; font-size: 11px; }
  footer.site-footer .footer-meta p { margin: 1px 0; }

  /* ---------- index.html: 히어로 영상 ---------- */
  section[style*="max-width:none"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
  }
  div[style*="video/hero.mp4"],
  div:has(> video source[src*="hero.mp4"]) {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 70vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  div:has(> video source[src*="hero.mp4"]) video {
    object-fit: cover !important;
  }

  /* ---------- about.html: 인트로 문단 + 괄호 장식 ---------- */
  div[style*="min-height:85vh"] { min-height: auto !important; padding-top: 2vh !important; }
  h1[style*="font-size:30px"] { font-size: 17px !important; margin-bottom: 48px !important; white-space: nowrap; }
  h1[style*="font-size:30px"]::before { content: "((\00a0"; }
  h1[style*="font-size:30px"]::after { content: "\00a0))"; }
  div[style*="padding:0 100px"] { padding: 0 8px !important; margin-bottom: 48px !important; }
  svg[width="50"][height="260"] { display: none; }

  /* about.html: 포스터 + 전시 정보 */
  div[style*="gap:48px; align-items:flex-start"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 24px !important;
  }
  .placeholder[style*="width:420px"],
  img[src*="poster.jpg"] {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 7 / 10;
  }

  /* about.html: 프로그램 3단 */
  div[style*="margin:120px auto 0"],
  div[style*="margin:200px auto 0"] { margin-top: 96px !important; }
  h2[style*="text-decoration:underline"] { font-size: 22px !important; margin-bottom: 16px !important; }
  div[style*="gap:48px; align-items:flex-start; text-align:center"] {
    flex-direction: column !important;
    gap: 40px !important;
  }

  /* about.html / greeting.html: 인사말 영역 */
  .greeting-title-line { font-size: 20px; }
    .greeting-block { min-height: auto; padding-top: 32px; margin-bottom: 48px; }
  .lang-tabs { margin-top: 0 !important; }

  /* ---------- venue.html / location.html: 고정 여백·폭 풀기 ---------- */
  div[style*="margin-left:120px"] { margin-left: 0 !important; }
  div[style*="margin-left:120px"] + div[style*="margin-left:120px"] { margin-top: 64px !important; }

  [style*="115px"] { margin-left: 20px !important; margin-right: 20px !important; width: calc(100% - 40px) !important; }

    div[style*="margin-left:120px"] div[style*="margin-bottom:24px"] {
    text-align: center !important;
  }
  span[style*="margin-left:-40px"] {
    margin-left: 0 !important;
  }
  span[style*="margin-left:25px"] {
    display: none !important;
  }

  /* venue.html: 층수(1F/B1/2F) 표시 — 괄호 장식 SVG는 숨기고 글자 괄호로 대체 */
  div[style*="padding:0 56px"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  div[style*="padding:0 56px"] svg { display: none !important; }
  div[style*="padding:0 56px"] > div[style*="align-items:baseline"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    text-align: center !important;
  }
  div[style*="padding:0 56px"] span[style*="font-size:40px"] {
    position: static !important;
    font-weight: 400 !important;
    font-size: 26px !important;
  }
  div[style*="padding:0 56px"] span[style*="font-size:40px"]::before { content: "(( "; }
  div[style*="padding:0 56px"] span[style*="font-size:40px"]::after { content: " ))"; }

  [style*="height:600px"] { height: 580px !important; }
  [style*="height:200px"] { height: 90px !important; }
  span[style*="margin-left:-40px"] { margin-left: 0 !important; }
  div[style*="justify-content:space-between; margin:0 40px"] {
    flex-wrap: wrap !important;
    gap: 4px 16px !important;
  }

  /* ---------- 작품 갤러리 (archive.html) ---------- */
  .gallery {
    --gallery-cols: 2 !important;
    --gallery-row-gap: 32px !important;
    margin-top: 64px !important;
  }

  /* 국가 탭: sticky 대신 fixed. iOS 사파리에서 sticky가 스크롤 중
     반투명하게 비치는 고질적 렌더링 버그를 피하려고 아예 항상
     고정으로 띄워둡니다. */
  .country-tabs {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    gap: 16px;
    font-size: 13px;
    padding: 12px 0;
    z-index: 90;
    background: #EAEAEA !important;
  }

  /* ---------- artist-detail.html ---------- */

  /* 대표 이미지를 감싼 relative div를 세로 배치로 바꿔
     이전/다음 링크가 이미지 위·아래로 옵니다. */
  div[style*="text-align:center; margin:-20px 0 32px"] {
    padding: 0 !important;
  }
  div[style*="text-align:center; margin:-20px 0 32px"] > div[style*="position:relative"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

    #prev-link, #next-link {
    position: static !important;
    display: inline-block !important;
    margin: 0 !important;
    font-size: 20px;
    color: #111;
  }
  #prev-link svg, #next-link svg { display: none; }
  #prev-link::after { content: "( "; }
  #next-link::before { content: " )"; }

  div[style*="text-align:center; margin:-20px 0 32px"] > div[style*="position:relative"] {
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 24px !important;
  }

  #hero-slot img,
  #hero-slot .placeholder { max-width: 100% !important; height: auto !important; }

  /* 좌우 2장짜리 작품: 모바일에서는 위아래로 쌓음 */
    .hero-pair {
    flex-direction: row !important;
    max-height: none !important;
    align-items: stretch !important;
  }
  .hero-pair img {
    max-height: none !important;
    width: 50% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  #bio-photo {
    width: 160px !important;
    height: 206px !important;
  }

  /* 작가 약력: 처음엔 국문만 보이고, "더보기"를 눌러야
     중문/일문/영문 3단이 펼쳐집니다. */
  #bio-section {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
}

#bio-ko, #bio-zh, #bio-ja, #bio-en {
  text-align: left !important;
}
  #bio-foreign-cols {
    display: none !important;
  }
  #bio-foreign-cols.open {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  #bio-more {
    display: block !important;
  }
  #bio-ko-col, #bio-zh-col, #bio-ja-col, #bio-en-col {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

    #desc-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
  }
    #desc-trans, #desc-orig {
    text-align: center !important;
  }
  #desc-trans-col, #desc-orig-col {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

p {
  text-wrap: pretty;
}
