/* ============================================
   Works 페이지 스타일
   ============================================ */

.section-works-hero {
  padding: 124px 0 0;
  background: #fff;
}

.section-works-hero__title {
  font-size: 42px;
  font-weight: 700;
  color: #222;
  text-align: center;
  height: 130px;
  margin: 0 0 20px;
  line-height: 1.4;
}

.section-works-hero__highlight {
  color: #fff;
  transition: color 1s ease;
  transition-delay: 0.12s;
}

.section-works-hero.hero-highlight-visible .section-works-hero__highlight {
  color: var(--color-point-light);
  transition-delay: 0s;
}

.section-works-hero__image-wrap {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  aspect-ratio: 1760 / 720;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.section-works-hero.hero-visible .section-works-hero__image-wrap {
  opacity: 1;
  transform: translateY(0);
}

.section-works-hero__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.section-works-portfolio {
  padding: 20px 0 0px;
  padding-bottom: 100px;
  background: #fff;
}

/* 스크롤 인터랙션: 진입 시 탭·카드 순차 노출 */
.section-works-portfolio .works-tabs {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.section-works-portfolio.is-inview .works-tabs {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.section-works-portfolio .works-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: var(--works-card-delay, 0s);
}

.section-works-portfolio.is-inview .works-card {
  opacity: 1;
  transform: translateY(0);
}

.section-works-portfolio .works-more-wrap {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.section-works-portfolio.is-inview .works-more-wrap {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

/* 탭 전환 시 노출되는 카드 부드럽게 순차 노출 (전부 새로 올라오게) */
.section-works-portfolio .works-grid.tab-transition .works-card:not(.is-filtered) {
  opacity: 0;
  transform: translateY(24px);
  transition: none;
}

.section-works-portfolio .works-grid.tab-transition .works-card:not(.is-filtered).tab-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: var(--tab-reveal-delay, 0s);
}

/* 탭 메뉴 */
.works-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.works-tabs__btn {
  position: relative;
  padding: 12px 20px;
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #9CA3AF;
  cursor: pointer;
  transition: color 0.3s ease;
  text-align: center;
}

.works-tabs__btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-point-light);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.works-tabs__btn:hover {
  color: #222;
}

.works-tabs__btn.is-active {
  color: #222;
}

.works-tabs__btn.is-active::after {
  width: 100%;
}

/* 카드 그리드 */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 8px;
}

/* 카드 */
.works-card {
  background: transparent;
  overflow: hidden;
  cursor: pointer;
}

.works-card.is-hidden {
  display: none;
}

.works-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #E5E7EB;
  border-radius: 8px;
}

.works-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

/* PC/터치 가능 디바이스에서만 호버 시 이미지 확대 (모바일 터치 시 호버 stuck 방지) */
@media screen and (min-width: 769px) {
  .works-card:hover .works-card__image img {
    transform: scale(1.06);
  }
}

.works-card__content {
  padding: 16px 0 0;
}

.works-card__title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin: 0 0 8px;
  line-height: 1.4;
}

.works-card__desc {
  font-size: 15px;
  font-weight: 400;
  color: #6B7280;
  margin: 0;
}

/* 카드 숨김 처리 */
.works-card.is-hidden,
.works-card.is-filtered {
  display: none;
}

/* 더보기 클릭 시 새 카드 부드럽게 순차 노출 */
@keyframes loadMoreReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.works-card.load-more-reveal {
  animation: loadMoreReveal 0.45s ease forwards;
  animation-delay: var(--load-more-delay, 0s);
  animation-fill-mode: both;
}

/* 더보기 버튼 */
.works-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.works-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #222;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}


.works-more-btn.is-hidden {
  display: none;
}

/* ============================================
   모달 스타일
   ============================================ */
.works-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.works-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.works-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.works-modal__container {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.works-modal.is-open .works-modal__container {
  transform: scale(1);
}

.works-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.3s ease;
}

.works-modal__close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.works-modal__content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  padding-top: 20px;
  /* 스크롤바 UI */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.works-modal__content::-webkit-scrollbar {
  width: 8px;
}
.works-modal__content::-webkit-scrollbar-track {
  background: transparent;
}
.works-modal__content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.works-modal__content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4);
}

.works-modal__image {
  width: 100%;
  background: #ffffff;
  flex-shrink: 0;
}

.works-modal__image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  vertical-align: top;
}

.works-modal__info {
  padding: 32px;
  flex-shrink: 0;
}

.works-modal__title {
  font-size: 24px;
  font-weight: 700;
  color: #222;
  margin: 0 0 8px;
}

.works-modal__category {
  font-size: 14px;
  font-weight: 500;
  color: #0469DD;
  margin: 0 0 16px;
}

.works-modal__desc {
  font-size: 15px;
  font-weight: 400;
  color: #6B7280;
  margin: 0;
  line-height: 1.7;
}

.works-modal__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 32px 32px 60px;
  flex-shrink: 0;
  background: #f2f4f7;
}

.works-modal__gallery-item {
  flex: 1 1 calc((100% - 24px) / 3);
  min-width: calc((100% - 24px) / 3);
}

.works-modal__gallery-item.is-wide {
  flex: 1 1 100%;
  max-width: 100%;
}

.works-modal__gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ============================================
   미디어 쿼리 (디바이스별 반응형 스타일)
   ============================================ */

/* 데스크탑: 1025px 이상 */
@media screen and (min-width: 1025px) {
  /* PC만 호버 적용 (테블릿·모바일은 터치 시 다음 요소에 호버 stuck 방지) */
  .works-more-btn:hover {
    background: #222;
    color: #fff;
    border-color: #222;
  }
}

/* 태블릿: 1024px 이하 */
@media screen and (max-width: 1024px) {
  .section-works-hero {
    padding: 104px 0 0;
  }

  .section-works-hero__title {
    font-size: 32px;
    height: 100px;
    margin: 0 0 20px;
  }

  .section-works-hero__image-wrap {
    width: 95%;
    margin: 0 auto;
    border-radius: 8px 8px 0 0;
  }

  .section-works-portfolio {
    padding: 0px 0 100px;
  }

  .works-tabs {
    margin-bottom: 32px;
  }

  .works-tabs__btn {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 8px;
  }

  .works-card__content {
    padding: 16px 0 0;
  }

  .works-card__title {
    font-size: 15px;
  }

  .works-card__desc {
    font-size: 14px;
  }

  /* 모달 */
  .works-modal__container {
    width: 95%;
    max-width: 700px;
  }

  .works-modal__info {
    padding: 24px;
  }

  .works-modal__title {
    font-size: 20px;
  }

  .works-modal__desc {
    font-size: 14px;
  }

  .works-modal__gallery {
    padding: 24px 24px 60px;
  }

  .works-modal__gallery-item {
    flex: 1 1 calc((100% - 12px) / 2);
    min-width: calc((100% - 12px) / 2);
  }
}

/* 모바일: 768px 이하 */
@media screen and (max-width: 768px) {
  .section-works-hero {
    padding: 94px 0 0;
  }

  .section-works-hero__title {
    font-size: 26px;
    margin: 0;
    line-height: 1.4;
  }

  .section-works-hero__image-wrap {
    width: 100%;
    margin: 0;
    border-radius: 0;
    aspect-ratio: auto;
    height: 80vh;
  }

  .section-works-hero__image {
    height: 100%;
    object-fit: cover;
  }

  .section-works-portfolio {
    padding: 0px 0 80px;
  }

  .works-tabs {
    justify-content: flex-start;
    gap: 0;
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-left: -20px;
    margin-right: -20px;
    padding: 0 20px;
  }

  .works-tabs::-webkit-scrollbar {
    display: none;
  }

  .works-tabs__btn {
    height: 44px;
    padding: 0 12px;
    font-size: 14px;
    flex-shrink: 0;
    width: auto;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .works-tabs__btn:last-child {
    padding-right: 12px;
  }

  .works-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .works-card__content {
    padding: 12px 0 0;
  }

  .works-card__title {
    font-size: 18px;
    margin: 0 0 4px;
  }

  .works-card__desc {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 모달 */
  .works-modal__container {
    width: calc(100% - 48px);
    max-width: none;
    max-height: 100vh;
    border-radius: 12px;
    margin: 0 24px;
    box-sizing: border-box;
  }

  .works-modal__close {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }

  .works-modal__info {
    padding: 20px;
  }

  .works-modal__title {
    font-size: 18px;
  }

  .works-modal__desc {
    font-size: 14px;
  }

  .works-modal__gallery {
    padding: 20px 20px 60px;
    gap: 8px;
  }

  .works-modal__gallery-item {
    flex: 1 1 100%;
    min-width: 0;
  }
}
