/* ============================================================
   HIARC — exhibition.css
   전시 랜딩: 포스터 히어로 + 스튜디오 소개 + 후원사 + 작품 그리드
   ============================================================ */

/* ── 전시 히어로 (포스터 배경) ───────────────────────────── */

.exhibit-hero {
  position: relative;
  width: 100%;
  /* 디자인 기준: 1280×1314 (헤더 포함) */
  aspect-ratio: 1280 / 1314;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000;
}

/*
 * header-light: header가 position:absolute로 흐름에서 빠지므로
 * hero가 자연스럽게 페이지 최상단에 위치.
 * aspect-ratio 1280/1314가 header(150)+hero(1164)를 합친 높이이므로
 * 배경이미지가 header 영역까지 자연스럽게 커버됨.
 * 별도 margin 조정 불필요.
 */

.exhibit-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.exhibit-hero__bg picture {
  display: block;
  width: 100%;
  height: 100%;
}

.exhibit-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* 포스터 텍스트 오버레이 컨테이너 */
.exhibit-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* 포스터 텍스트 블록 공통 */
.exhibit-hero__text {
  position: absolute;
  white-space: pre-line;
}

/* 블록1: 좌상단 */
.exhibit-hero__text--tl {
  top: calc(var(--header-height) + 24px);
  left: 64px;
}

/* 블록2: 좌하단 */
.exhibit-hero__text--bl {
  bottom: 64px;
  left: 64px;
}

/* 블록3: 우하단 */
.exhibit-hero__text--br {
  bottom: 64px;
  right: 64px;
}

/* 폴백: 텍스트 블록 없을 때 기존 스타일 */
.exhibit-hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--spacing-60) var(--spacing-32) var(--spacing-48);
  max-width: var(--container);
  margin-inline: auto;
  color: var(--color-white);
}

.exhibit-hero__year {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
  display: block;
}

.exhibit-hero__title {
  font-size: clamp(var(--fs-32), 5vw, var(--fs-56));
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-heading);
  color: var(--color-white);
  margin-bottom: var(--spacing-20);
  max-width: 720px;
}

.exhibit-hero__meta {
  font-size: var(--fs-16);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.75);
  line-height: var(--lh-relaxed);
}

/* 포스터 없을 때 fallback */
.exhibit-hero--no-poster {
  aspect-ratio: auto;
  min-height: 320px;
  background: var(--color-bg-inverse);
}

.exhibit-hero--no-poster .exhibit-hero__content {
  color: var(--color-text-inverse);
}

.exhibit-hero--no-poster .exhibit-hero__year { color: var(--color-accent); }
.exhibit-hero--no-poster .exhibit-hero__title { color: var(--color-text-inverse); }

/* ── 섹션 전환 탭 바 ──────────────────────────────────────── */
.exhibit-tab-bar {
  display: flex;
  justify-content: center;
  padding: 45px 0;
}

.exhibit-tab-bar__inner {
  display: inline-flex;
  align-items: center;
  border: 3px solid #000;
}

.exhibit-tab {
  font-family: var(--font-base);
  font-size: var(--fs-16);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #000;
  text-decoration: none;
  padding: 16px 36px;
  transition: background 0.15s, color 0.15s;
}

.exhibit-tab:hover {
  background: #f5f5f5;
}

.exhibit-tab.is-active {
  font-weight: var(--fw-extrabold);
}

.exhibit-tab-search {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000;
}

.exhibit-tab-search:hover {
  background: #f5f5f5;
}

/* ── 스튜디오 소개 섹션 ──────────────────────────────────── */
.studios-section {
  padding-bottom: var(--spacing-60);
}

.studio-row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 544px);
  gap: 64px;
  align-items: center;
  padding-block: 60px;
}

.studio-row:first-child { padding-top: 0; }
.studio-row:last-child  { padding-bottom: 0; }

/* 홀수(0,2,4): 텍스트 좌 + 이미지 우 (기본) */
.studio-row--text-left .studio-row__text  { order: 1; }
.studio-row--text-left .studio-row__image { order: 2; }

/* 짝수(1,3): 이미지 좌 + 텍스트 우 */
.studio-row--text-right {
  grid-template-columns: minmax(0, 544px) 1fr;
}
.studio-row--text-right .studio-row__image { order: 1; }
.studio-row--text-right .studio-row__text  { order: 2; }

.studio-row__image {
  width: 100%;
  max-width: 544px;
  aspect-ratio: 544 / 432;
  overflow: hidden;
  flex-shrink: 0;
}

.studio-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-row__image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-gray-50);
}

.studio-row__title {
  font-family: Inter, var(--font-base);
  font-size: 32px;
  font-weight: 700;
  line-height: 160%;
  letter-spacing: -0.64px;
  color: #000;
  margin-bottom: 24px;
}

.studio-row__label {
  font-family: Inter, var(--font-base);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 160%;
  letter-spacing: -0.09px;
  color: #000;
  margin-bottom: 4px;
}

.studio-row__tutors {
  font-family: Inter, var(--font-base);
  font-size: 18px;
  font-weight: 700;
  line-height: 160%;
  letter-spacing: -0.09px;
  color: #000;
  margin-bottom: 20px;
}

.studio-row__students {
  display: flex;
  flex-direction: column;
}

.studio-row__student-row {
  display: flex;
  gap: 16px;
  font-family: Inter, var(--font-base);
  font-size: 18px;
  line-height: 160%;
  letter-spacing: -0.09px;
  color: #000;
}

.studio-row__student-name {
  font-weight: 700;
  flex-shrink: 0;
  min-width: 56px;
}

.studio-row__student-work {
  font-weight: 600;
  font-style: italic;
  color: inherit;
  text-decoration: none;
}

.studio-row__student-work:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 후원사 영역 ─────────────────────────────────────────── */
.sponsors-section {
  padding-block: 0;
}

.sponsors-section__line {
  border-top: 1px solid #000;
  margin-bottom: 30px;
}

.sponsors-section__label {
  font-family: Inter, var(--font-base);
  font-size: 16px;
  font-weight: 700;
  line-height: 145%;
  letter-spacing: -0.32px;
  color: #000;
}

.sponsors-section__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px 24px;
}

.sponsors-section__item {
  font-family: Inter, var(--font-base);
  font-size: 16px;
  font-weight: 700;
  line-height: 145%;
  letter-spacing: -0.32px;
  color: #000;
}

/* ── 작품 목록 섹션 ────────────────────────────────────────── */
.works-section {
  padding-bottom: 45px;
}

/* 필터 바 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-32);
  padding-bottom: var(--spacing-20);
  border-bottom: var(--border-base) solid var(--color-border-light);
}

.filter-bar__label {
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-right: var(--spacing-xs);
}

.filter-chip {
  display: inline-block;
  padding: 4px 12px;
  border: var(--border-base) solid var(--color-border-light);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--color-text);
}

.filter-chip.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-black);
}

/* 작품 수 + 정렬 */
.works-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  font-size: var(--fs-12);
  color: var(--color-text-muted);
}

/* ── 작품 카드 그리드 ──────────────────────────────────────── */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 50px;
}

.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-text);
  overflow: hidden;
}

/* 썸네일: 정사각형 */
.work-card__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-gray-50);
  flex-shrink: 0;
  position: relative;
}

.work-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.work-card:hover .work-card__thumb img {
  transform: scale(1.03);
}

.work-card__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-card__thumb--empty::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--color-gray-100);
  border-radius: 50%;
}

/* 수상 뱃지 (썸네일 위) */
.work-card__badges {
  position: absolute;
  top: var(--spacing-xs);
  left: var(--spacing-xs);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.work-card__badge {
  font-family: var(--font-base);
  font-size: var(--fs-10);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: -0.2px;
  padding: 2px 7px;
  background: var(--color-accent);
  color: var(--color-black);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 카드 텍스트 */
.work-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 32px;
}

.work-card__student {
  font-family: Inter, var(--font-base);
  font-size: 20px;
  font-weight: 600;
  line-height: 120%;
  letter-spacing: -0.4px;
  color: #000;
}

.work-card__title {
  font-family: Inter, var(--font-base);
  font-size: 16px;
  font-style: italic;
  font-weight: 700;
  line-height: 145%;
  letter-spacing: -0.08px;
  color: #000;
}

.work-card__studio {
  font-size: var(--fs-12);
  color: var(--color-text-muted);
  font-weight: var(--fw-medium);
}

/* ── 페이지네이션 ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-60);
  flex-wrap: wrap;
}

.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: var(--spacing-xs);
  border: var(--border-base) solid var(--color-border-light);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.pagination__item:hover { border-color: var(--color-text); }

.pagination__item.is-current {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}

.pagination__item.is-disabled {
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ── 탭 패널 ──────────────────────────────────────────────── */
.exhibit-panel[hidden] { display: none; }

/* ── 검색 UI ──────────────────────────────────────────────── */
.exhibit-search[hidden] { display: none; }

.exhibit-search {
  padding-block: var(--spacing-32);
}

.exhibit-search__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: var(--spacing-32);
}

.exhibit-search__bar svg {
  flex-shrink: 0;
  color: #999;
}

.exhibit-search__bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--fs-20);
  font-family: var(--font-base);
  font-weight: var(--fw-medium);
  background: transparent;
}

.exhibit-search__bar input::placeholder {
  color: #bbb;
}

.exhibit-search__bar button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #666;
}

.exhibit-search__bar button:hover {
  color: #000;
}

.exhibit-search__hint {
  font-size: var(--fs-14);
  color: var(--color-text-muted);
  padding-block: var(--spacing-lg);
}

/* ── 수상작 (Honors) 섹션 ─────────────────────────────────── */
.honors-section {
  padding-block: var(--spacing-60);
}

.honor-item {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 32px;
  align-items: start;
  padding-block: 40px;
  border-bottom: 1px solid var(--color-border-light);
}

.honor-item:first-child {
  padding-top: 0;
}

.honor-item:last-child {
  border-bottom: none;
}

.honor-item__award {
  font-family: var(--font-base);
  font-size: var(--fs-20);
  font-weight: var(--fw-extrabold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #000;
  margin-bottom: 12px;
}

.honor-item__title {
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
  margin-bottom: 4px;
}

.honor-item__title a {
  color: #000;
  text-decoration: none;
}

.honor-item__title a:hover {
  text-decoration: underline;
}

.honor-item__student {
  font-size: var(--fs-14);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.honor-item__desc {
  font-size: var(--fs-14);
  line-height: 1.7;
  color: #444;
}

.honor-item__image {
  width: 160px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  flex-shrink: 0;
}

.honor-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── 태블릿 ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  .exhibit-hero { aspect-ratio: 800 / 1200; }
  .exhibit-hero__text--tl { top: 80px; left: 20px; }
  .exhibit-hero__text--bl { bottom: 32px; left: 20px; }
  .exhibit-hero__text--br { bottom: 32px; right: 20px; }

  .studio-row,
  .studio-row--text-right {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .studio-row__image {
    width: 100%;
    height: auto;
    aspect-ratio: 544 / 432;
  }

  /* 모바일에서는 항상 이미지 위 + 텍스트 아래 */
  .studio-row--text-left .studio-row__image,
  .studio-row--text-right .studio-row__image { order: 1; }
  .studio-row--text-left .studio-row__text,
  .studio-row--text-right .studio-row__text  { order: 2; }

  .works-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .honor-item {
    grid-template-columns: 1fr 120px;
    gap: 20px;
    padding-block: 28px;
  }

  .honor-item__image { width: 120px; }

  .exhibit-tab-bar { padding: 30px 16px; }
  .exhibit-tab { font-size: 14px; padding: 10px 16px; }

  .sponsors-section__list { grid-template-columns: repeat(2, 1fr); }
}

/* ── 모바일 ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .exhibit-hero { aspect-ratio: 375 / 737; }
  .exhibit-hero__text--tl { top: 60px; left: 16px; right: 16px; }

  /* 좌하단이 우하단 위에 쌓이는 구조 */
  .exhibit-hero__text--bl {
    position: absolute; bottom: auto; left: 16px; right: 16px;
  }
  .exhibit-hero__text--br {
    position: absolute; bottom: 20px; left: 16px; right: 16px;
  }
  /* bl을 br 바로 위에 배치 (JS 없이 CSS만으로) */
  .exhibit-hero__overlay {
    display: flex; flex-direction: column; justify-content: flex-end;
    padding-bottom: 20px;
  }
  .exhibit-hero__overlay .exhibit-hero__text--tl {
    position: absolute;
  }
  .exhibit-hero__overlay .exhibit-hero__text--bl,
  .exhibit-hero__overlay .exhibit-hero__text--br {
    position: relative; bottom: auto; left: auto; right: auto;
    padding: 0 16px;
  }
  .exhibit-hero__overlay .exhibit-hero__text--bl {
    margin-bottom: 8px;
  }

  .studio-row { padding-block: 32px; }

  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .work-card__title { font-size: var(--fs-16); }

  .honor-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .honor-item__image {
    width: 100%;
    max-width: 200px;
  }

  .exhibit-tab-bar { padding: 20px 12px; }
  .exhibit-tab { font-size: 13px; padding: 8px 12px; }

  .sponsors-section__list { grid-template-columns: 1fr; }
}
