body {
  font-family: 'Inter', sans-serif;
  font-weight: 400; /* 기본 텍스트는 보통 400(Regular)입니다 */
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
  padding: 0 20px; /* 브라우저 양 끝에서 살짝 띄워줍니다 */
  background:#f5f6f8;
  color: black;
}

.header-info {
  font-weight: 700;
  text-align: center;
  margin-bottom: 435px;
}

.header {
  padding-top: 20px;
  text-align: center;
  margin-bottom: 0;
}

/* 선 */
.divider {
  width: 100%;
  border: none;
  border-top: 1px solid #c4c5c6;
  margin: 0;
}

/* 1. 전체 프로젝트 컨테이너 */
.projects {
  padding-top: 0px; /* 선(Divider) 아래의 100px 여백 */
}

/* 2. 개별 프로젝트 레이아웃 (Grid) */
.project {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr 2.5fr 5.1fr;
  gap: 18px;
  padding: 8px 0 80px 0;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* 3. 텍스트 요소 */
.year {
  color: #c4c5c6; /* Yedo 스타일은 연도도 검정색인 경우가 많습니다 */
}

.title {
  font-weight: 700;
  font-size: 15px;
}

.description {
  font-size: 13px;
  color: #9c9c9c;
  line-height: 1.4;
  padding-right: 40px;
  word-break: keep-all;
}

/* 4. 이미지 그리드 */
.grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

/* 4x3 세로형 그리드 컨테이너 */
.grid-4x3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

/* 세로형 이미지 박스 비율 설정 */
.grid-4x3 .img-box {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.grid-4x3 .img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 박스에 꽉 차게 배치 */
  display: block;
}

/* 모바일 대응: 화면이 좁아지면 2열로 변경 */
@media (max-width: 1000px) {
  .grid-4x3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

.img-box {
  width: 100%;
  aspect-ratio: 3 / 2; /* 프레임 비율 고정 */
  overflow: hidden;
  background-color: #000;
  cursor: pointer;
}

.img-box img {
  width: 100%;
  height: 100%;
  /* 원본 비율을 유지하며 프레임 안에 쏙 들어감 (안 잘림) */
  object-fit: cover; 
  display: block;
}

/* 창 너비가 783px 이하일 때 적용 */
@media (max-width: 1000px) {
  .project {
    /* 가로 그리드를 해제하고 세로로 쌓음 */
    display: flex;
    flex-direction: column; 
    gap: 15px;
    padding: 8px 0 60px 0; /* 모바일에서는 위아래 여백을 조정 */
  }

  .year, .title, .description {
    width: 100%; /* 텍스트가 가로 전체를 쓰도록 */
    padding-right: 0;
  }

  .grid-3x3 {
    /* 모바일에서 3열은 너무 작으므로 2열로 변경하여 몰입감 제고 */
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px;
    max-width: 100%; /* 제약 해제 */
  }

  .divider {
    margin-bottom: 0px; /* 선과 내용 사이 간격 최적화 */
  }
}

/* --- 라이트박스 (이미지 확대) 스타일 --- */

.lightbox {
  /* display: none 대신 visibility를 사용해야 애니메이션이 먹힙니다 */
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f6f8;
  padding: 35px 210px; 
  box-sizing: border-box;
  display: flex; /* 항상 flex 상태로 유지 */
  align-items: center;
  justify-content: center;
  cursor: pointer;

  opacity: 0;
  visibility: hidden; 
  transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

#lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 70px);
  object-fit: contain;
  display: block;
  cursor: default;
  opacity: 0;
  transform: scale(0.97);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease-out;
}

.lightbox.active {
  /* display 속성을 건드리지 않습니다 */
  opacity: 1;
  visibility: visible;
}


.lightbox.active #lightbox-img {
  opacity: 1;
  transform: scale(1);
}

/* 스크롤바 너비를 유지하기 위한 클래스 */
body.stop-scroll {
  overflow: hidden;
}

/* 버튼 공통 스타일 */
.close-btn, .nav-btn {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  transition: opacity 0.5s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

/* 2. 각 버튼의 개별 위치 설정 */

/* < 버튼: 왼쪽 중앙 */
.prev-btn { 
  left: 30px; 
  top: 50%;
  transform: translateY(-50%);
}

/* > 버튼: 오른쪽 중앙 (X 버튼이 예전에 있던 그 자리) */
.next-btn { 
  right: 30px; 
  top: 50%;
  transform: translateY(-50%);
}

/* X 버튼: 오른쪽 상단 (단, > 버튼과 가로 위치를 맞춤) */
.close-btn {
  right: 25px;
  top: 35px;   /* 상단 여백 */
}

/* 3. 1px 라인 디자인 및 컬러 (#c4c5c6) */

/* 화살표 모양 (<, >) */
.nav-btn::before {
  content: '';
  width: 10px;
  height: 10px;
  border-top: 1px solid #9b9b9b;
  border-right: 1px solid #9b9b9b;
  display: block;
}
.prev-btn::before { transform: rotate(-135deg); }
.next-btn::before { transform: rotate(45deg); }

/* X 모양 */
.close-btn::before, .close-btn::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 1px;
  background-color: #9b9b9b;
}
.close-btn::before { transform: rotate(45deg); }
.close-btn::after { transform: rotate(-45deg); }

/* 호버 시 */
.close-btn:hover, .nav-btn:hover {
  opacity: 0.5;
}