/* --- WORKS 페이지 최종 통합본 --- */

/* 1. 기본 배경 및 레이아웃 */
body.blank-page, .blank-main {
  background-color: #ffffff !important;
}

/* 상세페이지 흰 배경용 헤더 스타일 */
    .site-header.on-light {
        background-color: #ffffff !important;
        border-bottom: 1px solid #eeeeee;
    }

/* 3. 상단 타이틀 & 필터 바 */
.works-upper-bar {
  padding: 260px 4% 0 !important; /* 헤더 높이만큼 충분히 아래로 */
  background-color: #ffffff;
}

.page-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin: 0 0 40px 0;
  letter-spacing: -0.04em;
  color: #111;
}

/* 필터 네비게이션 컨테이너 */
.filter-nav {
  display: flex !important;
  gap: 12px !important; /* 버튼 사이 간격을 살짝 좁힘 */
  border-bottom: none !important; 
  padding-bottom: 30px !important;
  flex-wrap: wrap;
  align-items: center;
}

/* 기본 버튼 스타일 */
.filter-nav a {
  display: inline-flex !important; /* 아이콘과 텍스트 정렬 */
  align-items: center;
  padding: 10px 22px !important;
  border-radius: 999px !important; /* 캡슐 모양 */
  background-color: #f2f2f2 !important; /* 비활성 배경 */
  color: #888 !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}

/* [핵심] 선택되었을 때 스타일 (검은색 배경 + 흰색 글자) */
.filter-nav a.is-active {
  background-color: #000000 !important;
  color: #ffffff !important;
  padding-right: 15px !important; /* 아이콘 공간 확보를 위해 오른쪽 패딩 조절 */
}

/* 기본 상태에서는 아이콘 안 보임 */
.filter-nav a::after {
  content: '-'; /* 아이콘 텍스트 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0; /* 너비 0으로 숨김 */
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2); /* 반투명 흰색 원 */
  border-radius: 50%;
  margin-left: 0;
  font-size: 1rem;
  font-weight: 400;
  color: #ffffff;
  transition: all 0.3s ease;
  opacity: 0;
}

/* [핵심] 선택되었을 때 아이콘 나타남 (원형 배경) */
.filter-nav a.is-active::after {
  width: 20px; /* 너비를 줘서 나타나게 함 */
  margin-left: 10px;
  opacity: 1;
}
.filter-nav a.is-active:not(:first-child)::after {
  width: 20px;
  margin-left: 10px;
  opacity: 1;
}

/* ALL 버튼(첫 번째 자식)은 선택되어도 패딩을 유지 */
.filter-nav a.is-active:first-child {
  padding-right: 22px !important; 
}


/* 호버 효과 */
.filter-nav a:hover:not(.is-active) {
  background-color: #e0e0e0 !important;
}

.filter-nav a.is-active:hover {
  background-color: #333333 !important;
}
/* 4. 프로젝트 그리드 (3열) */
.work-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3등분 */
  gap: 0; /* 여백 0 */
  width: 100%;
}

/* 5. 개별 아이템 디자인 - 배경 제거 및 일체화 보정 */
.work-item {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  /* 이미지 뒤에 보이던 회색 배경을 완전히 제거 */
  background-color: transparent !important; 
  z-index: 1;
}

/* 이미지 박스 기본 설정 */
.img-box {
  width: 100% !important;
  height: 100% !important;
  margin-bottom: 0 !important;
  overflow: hidden;
  background-color: transparent !important; /* 이미지 로드 전 회색도 제거 */
}

.img-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  /* 원형 마스크 초기 상태: 사각형 전체를 덮도록 크게 설정 */
  clip-path: circle(100% at 50% 50%);
  /* 0.7초의 묵직한 리듬감 적용 */
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

/* 마우스 올렸을 때: 가장자리부터 스윽 좁혀오며 원형 생성 */
.work-item:hover .img-box img {
  clip-path: circle(35% at 50% 50%);
  transform: scale(1.05); /* 구형 왜곡 느낌을 위한 미세 확대 */
}

/* 텍스트 박스 및 그림자 설정 */
.work-item-info {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  /* 기본 그림자 */
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 00%) !important;
  color: #ffffff !important;
  z-index: 10;
  pointer-events: none;
  /* 투명도와 위치 변화에만 애니메이션 적용 (background는 제외하여 선 생김 방지) */
  transition: opacity 0.5s ease, transform 0.5s ease !important;
  opacity: 1;
}

/* [수정] 호버 시 효과 */
.work-item:hover .work-item-info {
  opacity: 0; /* 텍스트는 부드럽게 소멸 */
  transform: translateY(10px);
  /* [핵심] 그림자는 애니메이션 없이 즉시 투명화하여 이상한 선 제거 */
  background: none !important; 
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}
.img-box img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: clip-path 0.7s ease;
  clip-path: circle(71% at 50% 50%);
}

.work-item:hover .img-box img {
  clip-path: circle(35% at 50% 50%);
}

/* 6. 텍스트 상세 스타일 */
.text-box h3 {
  font-size: 1.5rem !important;
  font-weight: 500 !important;
  margin: 0 0 3px 0 !important;
  text-transform: uppercase;
  color: #111;
}

.text-box .sub-title {
  font-size: 0.95rem !important;
  font-weight: 200 !important;
  color: #555 !important;
  margin: 0 0 2px 0 !important;
}

.text-box .category-year {
  font-size: 0.85rem !important;
  font-weight: 200 !important;
  color: #999 !important;
  margin: 0 !important;
}

/* 7. 캡슐형 페이지네이션 */
.pagination {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 60px 4% 150px !important;
  background-color: #ffffff !important;
}

.page-controller {
  display: flex !important;
  align-items: center !important;
  background-color: #000000 !important;
  padding: 10px 24px !important;
  border-radius: 999px !important;
  color: #ffffff !important;
  gap: 18px;
}

.page-controller a {
  font-size: 1.1rem !important;
  font-weight: 400 !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

.page-status {
  font-size: 1rem !important;
  font-weight: 600 !important;
  min-width: 50px;
  text-align: center;
}

.page-controller a:hover {
  opacity: 0.5;
}
/* 선택되었을 때 아이콘 나타남 (ALL 버튼 제외) */
/* data-filter가 ALL이 아닌 요소의 active 상태에만 마이너스 표시 */
.filter-nav a.is-active:not([data-filter="ALL"])::after {
  content: '-';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  margin-left: 10px;
  font-size: 1rem;
  opacity: 1;
  transition: all 0.3s ease;
}

/* ALL 버튼은 선택되어도 아이콘 공간(padding)을 주지 않음 */
.filter-nav a.is-active[data-filter="ALL"] {
  padding-right: 22px !important;
}

.filter-nav a.is-active[data-filter="ALL"]::after {
  display: none !important; /* ALL은 확실히 제거 */
}

/* 글씨를 이미지 위로 */
.work-item-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 30px;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  /* 0%에서 시작하던 그라데이션을 70% 지점부터 시작하게 바꿔서 범위를 좁혔습니다 */
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 30%) !important;
  color: #ffffff !important;
  z-index: 10;
  pointer-events: none;
}

.work-item-info h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 5px 0;
}

.work-item-info p {
  font-size: 14px;
  margin: 0;
  opacity: 0.8;
}
/* 전체 아이템 성능 최적화 */
.work-item {
  content-visibility: auto;
  contain-intrinsic-size: 520px;
  will-change: transform, opacity;
}

/* 아래에서 위로 등장 */
.reveal-item {
  opacity: 0;
  transform: translate3d(0, 56px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 이미지도 살짝 늦게 따라오게 */
.reveal-item .img-box {
  transform: translateY(30px);
  opacity: 0;
  overflow: hidden;
}

.reveal-item.is-visible .img-box {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.6s ease, opacity 0.6s ease;
}
.img-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reveal-item.is-visible .img-box img {
  transform: scale(1) translateY(0);
}
.work-load-trigger {
  width: 100%;
  height: 120px;
}
.category-info-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 22px 0 20px;
}

.category-info-card {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 24px;
  background: #1b1b1b;
  color: #ffffff;
}

.category-info-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.03em;
  padding-right: 18px;
  border-right: 1px solid rgba(22, 22, 22, 0.22);
}

.category-info-ko,
.category-info-en {
  font-size: 11px;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
}

.category-info-en {
  color: rgba(255,255,255,0.78);
}
.img-box {
  background: #000;
}
/* ===== WORKS MOBILE FIX ===== */
@media (max-width: 768px) {
  .works-upper-bar {
    padding: 150px 20px 20px !important;
  }

  .page-title {
    font-size: 42px !important;
    margin-bottom: 28px !important;
  }

  .filter-nav {
    gap: 8px !important;
    padding-bottom: 24px !important;
  }

  .filter-nav a {
    padding: 8px 14px !important;
    font-size: 12px !important;
  }

  .work-list {
    grid-template-columns: 1fr !important;
  }

  .work-item {
    aspect-ratio: 16 / 11 !important;
  }

  .work-item:hover .img-box img {
    clip-path: circle(100% at 50% 50%) !important;
    transform: none !important;
  }

  .work-item-info {
    padding: 22px !important;
  }

  .work-item-info h3 {
    font-size: 20px !important;
    line-height: 1.25;
  }

  .work-item-info p {
    font-size: 12px !important;
    line-height: 1.4;
  }

  .category-info-list {
    margin-bottom: 24px !important;
  }
}
/* ===== MOBILE LANDSCAPE : WORKS 2 COLUMN ===== */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape),
       (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-width: 950px) {
  .work-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .work-item {
    aspect-ratio: 16 / 10 !important;
  }
}
/* ===== MOBILE LANDSCAPE : WORK ITEM TITLE SIZE ===== */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape),
       (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-width: 950px) {
  .work-info h3,
  .work-title,
  .work-item h3 {
    font-size: 18px !important;
    line-height: 1.25 !important;
    letter-spacing: -0.04em !important;
    word-break: keep-all !important;
  }

  .work-info p,
  .work-subtitle,
  .work-item p {
    font-size: 11px !important;
    line-height: 1.35 !important;
  }
}
/* ===== MOBILE LANDSCAPE : WORKS TOP GAP REDUCE ===== */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape),
       (orientation: landscape) and (hover: none) and (pointer: coarse) and (max-width: 950px) {
  .works-upper-bar {
    padding: 120px 4% 0 !important;
  }

  .filter-nav {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  .category-info-list {
    display: none !important;
  }

  .work-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .work-item {
    aspect-ratio: 16 / 8.5 !important;
  }
}
/* ===== WORKS TABLET LANDSCAPE : 2 COLUMN + TEXT SIZE ===== */
@media (min-width: 768px) and (max-width: 1366px) and (min-height: 600px) and (orientation: landscape) {

  /* 상단 여백 조정 */
  .works-upper-bar {
    padding: 190px 4% 0 !important;
  }

  /* 포트폴리오 2열 */
  .work-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .work-item {
    aspect-ratio: 16 / 9 !important;
  }

  /* 썸네일 이미지 */
  .img-box,
  .img-box img {
    width: 100% !important;
    height: 100% !important;
  }

  .img-box img {
    object-fit: cover !important;
  }

  /* 카드 안 텍스트 영역 */
  .work-info {
    left: 28px !important;
    right: 28px !important;
    bottom: 24px !important;
  }

  /* 한글 제목 */
  .work-info h3,
  .work-title,
  .work-item h3 {
    font-size: 28px !important;
    line-height: 1.18 !important;
    font-weight: 700 !important;
    letter-spacing: -0.045em !important;
    word-break: keep-all !important;
  }

  /* 영문 제목 / 보조 텍스트 */
  .work-info p,
  .work-subtitle,
  .work-item p {
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em !important;
  }
}
/* ===== WORKS TABLET PORTRAIT FINAL ===== */
@media (min-width: 768px) and (max-width: 1024px) and (min-height: 900px) and (orientation: portrait) {

  /* 상단 여백 */
  .works-upper-bar {
    padding: 150px 40px 0 !important;
  }

  /* 필터/카테고리 설명 숨김 */
  .filter-nav,
  .category-info-list {
    display: none !important;
  }

  /* 포트폴리오 2열 */
  .work-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
  }

  .work-item {
    aspect-ratio: 16 / 11 !important;
    overflow: hidden !important;
  }

  .img-box {
    width: 100% !important;
    height: 100% !important;
  }

  .img-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* 텍스트 위치 */
  .work-info {
    left: 24px !important;
    right: 24px !important;
    bottom: 22px !important;
  }

  /* 한글 제목 */
  .work-info h3,
  .work-title,
  .work-item h3 {
    font-size: 24px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: -0.045em !important;
    word-break: keep-all !important;
  }

  /* 영문 제목 */
  .work-info p,
  .work-subtitle,
  .work-item p {
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em !important;
  }
}/* ===== WORKS PC : REMOVE 1PX GRID SEAM ===== */
@media (min-width: 1025px) {




  /* 1열, 2열 아이템을 오른쪽으로 1px씩 겹쳐서 세로 틈 제거 */
  .work-item:not(:nth-child(3n)) {
    width: calc(100% + 1px) !important;
  }

  .img-box,
  .img-box img {
    display: block !important;
  }
}
/* ===== WORKS PC : REMOVE 1PX ROW SEAM ===== */
@media (min-width: 1025px) {
  /* 2번째 줄부터 위로 1px 겹쳐서 가로 틈 제거 */
  .work-item:nth-child(n + 4) {
    margin-top: -1px !important;
  }

  /* 겹친 만큼 카드 높이 보정 */
  .work-item {
    height: calc(100% + 1px) !important;
  }

  .img-box,
  .img-box img {
    display: block !important;
  }
}