/* ============================================================
   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;
}

/* 요청 9: 포스터 프레이즈 좌우 패딩을 페이지 콘텐츠(1280px)의 좌우 패딩(64px)과 통일.
   와이드 화면에서 hero는 풀-와이드지만 콘텐츠는 1280px 중앙정렬이므로,
   1280 초과분의 절반 + 64px 을 오프셋으로 잡아 콘텐츠 좌우선과 일치시킴. */
:root { --exhibit-hero-inset: max(64px, calc((100% - 1280px) / 2 + 64px)); }

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

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

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

/* 폴백: 텍스트 블록 없을 때 기존 스타일 */
.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); }

/* ── 섹션 전환 탭 바 ──────────────────────────────────────── */
/* ── 전시 영상 — 포스터와 메뉴 사이 ──────────────────────── */
/* 설정에 주소가 있을 때만 출력된다. 아래 탭바가 위쪽 45px 여백을 가지므로
   여기서는 위 여백만 주고 아래는 탭바에 맡긴다. */
.exhibit-video {
  padding-top: 45px;
}

/* 16:9 비율 유지 — iframe은 비율을 스스로 지키지 못한다 */
.exhibit-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;   /* 로딩 중 흰 박스가 번쩍이지 않게 */
  overflow: hidden;
}

.exhibit-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* 1009 수정요청 1: 탭 박스를 컨테이너(영상·포스터와 같은) 전체 폭으로.
   ALL·STUDIOS·HONORS는 균등 배치, 검색 아이콘은 박스 안 오른쪽 끝. */
.exhibit-tab-bar {
  padding: 45px 0;
}

.exhibit-tab-bar__inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  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;
  flex: 1 1 0;
  /* 박스가 stretch 라 검색 버튼(52px) 높이로 늘어난다. 태블릿·모바일에서 탭이 그보다 낮아
     글자가 위에 붙었으므로 탭 자체를 flex 로 만들어 세로·가로 중앙에 둔다. */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  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;
  flex-shrink: 0;
}

/* 대표 이미지 — 544:432 비율 유지 */
.studio-row__image > img {
  width: 100%;
  aspect-ratio: 544 / 432;
  object-fit: cover;
  display: block;
}

.studio-row__image-placeholder {
  width: 100%;
  aspect-ratio: 544 / 432;
  background: var(--color-gray-50);
}

/* 추가 미디어(이미지 여러 장 + 영상) — 요청 11 */
.studio-row__media {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.studio-row__media-img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.studio-row__media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
}
.studio-row__media-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.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: normal;          /* 1019 수정요청 3: 이탤릭 → 노멀 */
  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;
  /* minmax(0,·) 없이 1fr만 쓰면 열의 최소 폭이 min-content(가장 긴 단어)가 된다.
     'Intentecture(intent+architecture)'(33자) 같은 공백 없는 토큰이
     그 열을 넓혀 열 폭이 달라지고, 정사각 썸네일 크기까지 달라진다. */
  grid-template-columns: repeat(4, minmax(0, 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%;
}

/* 수상 뱃지 (썸네일 위) — 1019 수정요청 2: 이전 디자인으로 복원, 배경색만 #FFFF00 (tokens.css) */
.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: 3px 8px;
  background: var(--color-award-label);
  color: var(--color-black);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* 1009 수정요청 2: 작가명 16px / 700 / 행간 120% (시안) */
.work-card__student {
  font-family: Inter, var(--font-base);
  font-size: 16px;
  font-weight: 700;
  line-height: 120%;
  letter-spacing: -0.2px;
  color: #000;
}

/* 1009 수정요청 2: 작품명 18px / 기울임 없음 (굵기는 시안 미기재 → 700 유지) */
.work-card__title {
  font-family: Inter, var(--font-base);
  font-size: 18px;
  font-style: normal;
  font-weight: 700;
  line-height: 115%;   /* 대표 지시 2026-10-15 */
  letter-spacing: -0.08px;
  color: #000;
  /* 공백 없는 긴 토큰이 열 폭을 밀지 않도록 어디서든 줄바꿈을 허용한다.
     제목 자체는 자르지 않는다. */
  overflow-wrap: anywhere;
}

/* 1009 수정요청 2: 튜터명 14px / 200 / #333 / 행간 100% (시안)
   — Inter 200은 tokens.css의 Google Fonts 요청에 추가됨 */
.work-card__studio,
.work-card__tutor {
  font-family: Inter, var(--font-base);
  font-size: 14px;
  font-weight: 200;
  line-height: 100%;
  color: #333;
}

/* ── 페이지네이션 ─────────────────────────────────────────── */
.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);
}

/* 1019 수정요청 4: 시안대로 좌(글)·우(이미지) 2단 — 이미지 칸은 전체의 약 42%, 글 칸은 최대 520px.
   글: 수상명 → 작가명+작품명 → 심사평(라벨 표시) → 부상. 800px 이하에서는 글 위·이미지 아래로 쌓는다. */
.honor-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  gap: 40px;
  align-items: start;
  padding-block: 48px;
  border-bottom: 1px solid var(--color-border-light);
}

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

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

.honor-item__text {
  max-width: 520px;
}

/* 상등급 배지 (GRAND PRIZE 등) */
.honor-item__award {
  display: inline-block;
  font-family: Inter, var(--font-base);
  font-size: 18px;              /* 1009 수정요청 6: 18px, 자간 0 */
  font-weight: var(--fw-extrabold);
  letter-spacing: 0;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 16px;
  line-height: 1.2;
}

/* 학생명 + 작품명 */
.honor-item__names {
  margin-bottom: 20px;
}
.honor-item__names a {
  color: #000;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.honor-item__names a:hover .honor-item__title { text-decoration: underline; }

.honor-item__student {
  font-size: var(--fs-16);
  font-weight: var(--fw-bold);
  color: #000;
}

/* 1009 수정요청 6: 작품명 굵기 600, 기울임 없음 */
.honor-item__title {
  font-size: var(--fs-16);
  font-style: normal;
  font-weight: var(--fw-semibold);
  color: #000;
}

/* 심사평 / 부상 필드 (라벨 + 값) */
.honor-item__field {
  margin-top: 14px;
}
.honor-item__label {
  display: block;
  font-size: 13px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  color: #000;
  margin-bottom: 5px;
}
.honor-item__value {
  font-size: var(--fs-14);
  line-height: 1.7;
  color: #444;
  margin: 0;
}
.honor-item__field--prize {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.honor-item__field--prize .honor-item__label { margin-bottom: 0; }

/* 작품 이미지는 자르지 않는다 — 비율 강제(16:10 cover) 제거, 원래 비율로 폭만 맞춤 */
.honor-item__image {
  width: 100%;
}

.honor-item__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── 태블릿 ─────────────────────────────────────────────── */
@media (max-width: 800px) {
  .exhibit-hero { aspect-ratio: 800 / 1200; }
  .exhibit-hero__text--tl { top: 120px; 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, minmax(0, 1fr));
    gap: 24px;
  }

  /* 요청 12: 태블릿·모바일에서는 텍스트 위 / 이미지 아래로 세로 스택 */
  .honor-item {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-block: 28px;
  }

  .honor-item__text { max-width: none; }

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

  .exhibit-tab-bar { padding: 30px 0; }   /* 좌우는 .container 가 맞춘다 — 영상 폭과 일치 */
  .exhibit-tab-bar__inner {
    display: flex;
    width: 100%;
  }
  .exhibit-tab {
    font-size: 14px;
    padding: 10px 16px;
    flex: 1;
    text-align: center;
  }

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

/* ── 모바일 ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .exhibit-hero { aspect-ratio: 375 / 737; }
  .exhibit-hero__text--tl { top: 100px; 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, minmax(0, 1fr)); gap: 16px; }
  .work-card__title { font-size: var(--fs-16); }
  /* 모바일은 2열이라 칸이 좁다. PC용 여백 32px를 그대로 쓰면
     이미지와 제목이 멀어져 카드가 끊겨 보인다. (사용자 승인 2026-10-05) */
  .work-card__body { padding-top: 16px; gap: 6px; }

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

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

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

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