@charset "utf-8";

.namelist ul li:hover a {
  font-weight: 700;
}

/* 클릭해 활성화된 항목 */
.namelist ul li.active a {
  font-weight: 700;
}

.center {
  position: relative;
}

.center .w-maincon {
  position: relative;
  flex: none;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 100vh;
  padding: 60px 40px 60px;
  overflow: visible;
  cursor: default;
  background-image: url("../img/mbg.png");
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
}

/* 전체 콘텐츠 영역 */
.center .w-maincon .margin {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 50px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 64px;
}


/* 작품 카드 호버 효과 */
.works-lettering {
  position: relative;
  width: 100%;
  aspect-ratio: 1202 / 847;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
}

.works-lettering img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.works-lettering::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.works-hover-content {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;

  color: #fff;
  font-size: 14px;
  letter-spacing: 0.08em;
  white-space: nowrap;

  transform: translate(-50%, -40%);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s ease;
  pointer-events: none;
}

.works-hover-star {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.works-card:hover .works-hover-content,
.works-card:focus-visible .works-hover-content {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.works-card:hover .works-lettering::before,
.works-card:focus-visible .works-lettering::before {
  opacity: 1;
}

.works-card:hover .works-lettering::after,
.works-card:focus-visible .works-lettering::after {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* 작품제목소개글 영역 */
.works-info {
  padding-top: 20px;
}

.works-info h2 {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 7px;
}

.works-info p {
  font-weight: 500;
}







/* 모달 배경: 화면 높이를 꽉 채움 */
.works-modal-layer {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 250px;
  right: 0;
  z-index: 1000;

  box-sizing: border-box;
  padding: 0 40px;

  align-items: stretch;
  justify-content: center;

  background: rgba(0, 0, 0);
}

.works-modal-layer.is-open {
  display: flex;
}


.works-modal {
  position: relative;
  width: 100%;
  max-width: 1100px;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;

  overflow: visible;
  display: flex;
  flex-direction: column;
  background-color: #FAFAFA;
}

/* 스크롤 기능은 유지하고 스크롤바만 숨기기 */
.modal-content {
  overflow-y: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* 구형 IE */
}

.modal-content::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}

/* X 버튼 */

.works-modal-layer .modal-close {
  position: absolute;
  top: 0;
  left: calc(50% + min(550px, 50vw));

  width: 42px;
  height: 42px;
  padding: 0;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  appearance: none;
  -webkit-appearance: none;
border: none;
border-radius: 0;
  outline: none;
  box-shadow: none;

  background: #FAFAFA;
  cursor: pointer;
  z-index: 10001;
}

.works-modal-layer .modal-close span {
  position: absolute;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #333;
}

.works-modal-layer .modal-close span:first-child {
  transform: rotate(45deg);
}

.works-modal-layer .modal-close span:last-child {
  transform: rotate(-45deg);
}

.works-modal-layer .modal-close:hover {
  background: #eee;
}

.works-modal-layer .modal-close:focus-visible {
  outline: 2px solid #333;
  outline-offset: 3px;
}


/* 모달 이미지 */
.modal-image {
  display: block;
  width: 100%;
  height: auto;
}

/* 작은 화면 */
@media (max-width: 520px) {
  .works-modal-layer {
    left: 250px;
    padding: 0 12px;
  }

  .works-modal {
    padding: 24px 18px;
  }
}

/* 모달 내부 콘텐츠 */
.works-modal .modal-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* 작품 제목 */
.works-modal #modalTitle {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 20px 0 16px;
  padding-bottom: 20px;
  border-bottom: 3px solid #d7d7d7;
}

/* 작품 설명 */
.works-modal .modal-description {
  font-size: 1rem;
  line-height: 1.8;
  margin: 0 0 0px;
  white-space: pre-line;
}

/* 작품 상세 콘텐츠 */
.works-modal .modal-detail {
  width: 100%;
}

/* 모달 내부 이미지 */
.works-modal .modal-detail img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 32px;
}

/* 스크롤 테스트용 콘텐츠 */
.works-modal .modal-test-content {
  margin-top: 32px;
  padding-bottom: 100px;
}

.works-modal .modal-test-content p {
  font-size: 1rem;
  line-height: 1.8;
  margin: 24px 0;
}

/* 모달 안 작품 소개글 */
.works-modal .modal-detail .work-intro {
  font-size: 18px;
  line-height: 1.8;
  padding: 20px 0;
  margin: 0 0 24px;
  cursor: default;
}

/* 모달 안에서 직접 추가한 이미지 */
.works-modal .modal-detail img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 0px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.modal-detail img.receipt {
  width: 50%;
  height: auto;
  margin: 0 auto;
}
.work-intro .work-title {
  display: block;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.work-intro .work-text {
  display: block;
}


/* =========================
   WORKS 모바일 전용 스타일
========================= */
@media (max-width: 768px) {
  body:has(.works-modal-layer.is-open) .mobile-menu-btn {
    display: none;
  }
  /* 작품 목록: 2열 그리드 */
  .center .w-maincon {
    padding: 72px 16px 40px;
    box-sizing: border-box;
    min-width: 0;
    background-size: 100% auto;
    background-position: center top;
  }

  .center .w-maincon .margin {
    width: 100%;
    max-width: none;
  }

  .works-grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 32px;
  }

  .works-card {
    min-width: 0;
  }

  .works-lettering {
    width: 100%;
    aspect-ratio: 1202 / 847;
  }

  .works-lettering > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* 모바일에서는 호버 장식 숨기기 */
  .works-lettering::before {
    display: none;
  }

  .works-hover-content {
    display: none;
  }

  /* 작품 제목과 작가명 */
  .works-info {
    padding-top: 10px;
  }

  .works-info h2 {
    margin-bottom: 4px;
    font-size: 1.1rem;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .works-info p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  /* =========================
     작품 상세 모달
  ========================= */

  /* 모바일 화면 전체 사용 */
  .works-modal-layer {
    left: 0;
    right: 0;
    width: 100%;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  .works-modal {
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  /* 모달 콘텐츠만 스크롤 */
  .works-modal .modal-content {
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    padding: 0 16px 32px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 작품 제목 */
  .works-modal #modalTitle {
    margin: 56px 0 16px;
    padding-bottom: 14px;
    border-bottom-width: 2px;
    font-size: 20px;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  /* 모달 설명 */
  .works-modal .modal-description {
    font-size: 14px;
    line-height: 1.8;
  }

  /* 작품 소개글 */
  .works-modal .modal-detail .work-intro {
    margin-bottom: 16px;
    padding: 12px 0;
    font-size: 14px;
    line-height: 1.9;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .works-modal .work-intro .work-title {
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.7;
    word-break: keep-all;
  }

  .works-modal .work-intro .work-text {
    font-size: 14px;
    line-height: 1.9;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  /* 작품 이미지 */
  .works-modal .modal-detail img {
    width: 100%;
    height: auto;
    margin: 0;
    box-shadow: none;
  }

  /* 영수증 이미지 */
  .works-modal .modal-detail img.receipt {
    width: 70%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
  }

  /* 모달 닫기 버튼 */
  .works-modal-layer .modal-close {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 44px;
    height: 44px;
    background: #FAFAFA;
    z-index: 10001;
  }

  .work-text br {
    display: none;
  }
}

/* 작은 모바일 화면 */
@media (max-width: 380px) {

  .center .w-maincon {
    padding-right: 12px;
    padding-left: 12px;
  }

  .works-grid {
    column-gap: 9px;
    row-gap: 26px;
  }

  .works-info h2 {
    font-size: 1.1rem;
  }
  .works-info p{
    font-size: 0.95rem;
  }
  .works-modal .modal-content {
    padding-right: 12px;
    padding-left: 12px;
  }
}

/* 방명록카드이미지 */

.guestbook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 0;
  row-gap: 0;
  padding: 10px 10px 110px;
  overflow: visible;
  align-items: start;
}


.guestbook-card {
  position: relative;
  width: calc(100% + 16px);
  aspect-ratio: 3 / 4;
  margin-left: -8px;
  margin-bottom: -90px;

  perspective: 1000px;
  cursor: pointer;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  -webkit-tap-highlight-color: transparent;
  transform: none !important;
}



.guestbook-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
}

.guestbook-front,
.guestbook-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.guestbook-back {
  transform: rotateY(180deg);
}


.works-modal .modal-detail .guestbook-front img,
.works-modal .modal-detail .guestbook-back img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
  box-shadow: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}



@media (hover: hover) and (pointer: fine) {
  .guestbook-card.pc-hover-flipped {
    z-index: 1000 !important;
  }

  .guestbook-card.pc-hover-flipped > .guestbook-card-inner {
    transform: rotateY(180deg);
  }
}


@media (max-width: 768px) {
  .guestbook-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (hover: none), (pointer: coarse) {
  .guestbook-card.is-flipped {
    z-index: 1000 !important;
  }

  .guestbook-card.is-flipped > .guestbook-card-inner {
    transform: rotateY(180deg);
  }
}


@media (prefers-reduced-motion: reduce) {
  .guestbook-card-inner {
    transition: none;
  }
}
