/*
 * 03 / PROJECTS 전용 스타일
 * 화면 위치: 현장 프로젝트 사진 3장 + 클릭 시 열리는 원본 사진 확대창.
 * 사진 크기, 밝기, 색감, 오버레이는 이 파일 한 곳에서 수정합니다.
 */

/* 1. 사진 카드 배치: 왼쪽 큰 사진 1장 + 오른쪽 사진 2장 */
.project-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;       /* PC: 왼쪽 : 오른쪽 사진 너비 비율 */
  grid-template-rows: 280px 280px;       /* PC: 오른쪽 위/아래 사진 높이 */
  gap: 20px;                            /* 사진 사이 간격 */
}

.project {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 12px;
  transition: border-color 0.35s, box-shadow 0.35s;
}

.project-large {
  grid-row: span 2;                    /* 왼쪽 사진은 세로로 2개 행 차지 */
}

/* 2. 사진 자체: 카드 크기는 그대로 두고 사진 확대·위치·색감 조절 */
.project img {
  object-fit: cover;
  object-position: center center;       /* 사진 표시 위치 변경: 예) center 40% */
  filter: brightness(0.93) saturate(0.77); /* 평상시 밝기 93%, 채도 77% */
  transition: transform 0.5s, filter 0.4s;
}

.project:hover img {
  transform: scale(1.035);             /* 마우스를 올렸을 때 3.5% 확대 */
}

.project:hover img,
.project:focus-visible img {
  filter: brightness(1.08) saturate(0.96);
}

/* 3. 은은한 네이비 오버레이와 하단 제목 */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  background: linear-gradient(
    180deg,
    rgba(7, 28, 55, 0.36) 0%,
    rgba(8, 30, 58, 0.36) 46%,
    rgba(3, 13, 30, 0.80) 100%
  );
  transition: opacity 0.4s;
}

.project-caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 50px 27px 25px;
  background: linear-gradient(transparent, rgba(5, 12, 24, 0.96));
  color: #fff;
}

.project-caption h3 {
  font-size: 20px;
  margin-top: 8px;
}

.project-large .project-caption h3 {
  font-size: 28px;
}

.project-caption > p:last-child:not(.eyebrow) {
  font-size: 12px;
  margin-top: 9px;
  color: #c8d8e6;
}

/* 우측 상단 사진 확대 아이콘 */
.expand {
  position: absolute;
  z-index: 2;
  right: 18px;
  top: 18px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}

.project:hover,
.project:focus-visible {
  color: #fff;
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.07);
}

.project:hover::before,
.project:focus-visible::before {
  opacity: 0.45;
}

/* 4. 클릭 후 원본 사진 확대창 — 프로젝트 섹션의 <dialog class="lightbox"> */
.lightbox {
  border: 0;
  padding: 48px 20px 20px;
  max-width: 94vw;
  max-height: 94vh;
  border-radius: 10px;
  background: #0f172a;
  color: #f1f5f9;
  box-shadow: 0 20px 100px #000;
}

.lightbox::backdrop {
  background: rgba(0, 5, 15, 0.92);
  backdrop-filter: blur(6px);
}

.lightbox img {
  width: auto;
  max-width: 86vw;                      /* 확대창 사진 최대 너비 */
  height: auto;
  max-height: 76vh;                     /* 확대창 사진 최대 높이 */
  object-fit: contain;
  margin: auto;
}

.lightbox p {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
}

.lightbox-close {
  position: absolute;
  top: 7px;
  right: 16px;
  background: none;
  border: 0;
  padding: 5px 10px;
  color: #f1f5f9;
}

.modal-open {
  overflow: hidden;                      /* 확대창이 열린 동안 본문 스크롤 방지 */
}

/* 5. 모바일: 사진 3장을 위에서 아래로 쌓는 배치 */
@media (max-width: 760px) {
  .project-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 470px 300px 300px; /* 첫 번째/두 번째/세 번째 사진 높이 */
    gap: 16px;
  }

  .project-large {
    grid-row: auto;
  }

  .project-caption {
    padding: 45px 23px 23px;
  }

  .project-large .project-caption h3 {
    font-size: 25px;
  }
}
