/* =========================================
   Main Listing (Projects Grid)
   ========================================= */
.project-main {
  margin-top: 110px;
  padding-bottom: clamp(6rem, 10vw, 8rem);

  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3.5rem);
  background: transparent;
  color: var(--color-ink);
}

.project-main h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -0.01em;
  color: var(--color-ink);
  line-height: 1.15;
}

.project-main h3,
.project-main p {
  margin: 10px 0 0 0;
  font-size: clamp(1rem, 2vw, 1.15rem);
  letter-spacing: -0.01em;
  color: var(--color-muted);
  line-height: 1.6;
}

/* =========================================
   Filter / Search / Sort Controls
   ========================================= */
.project-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 24px 0 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-line);
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 필터 버튼 스타일 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 12px 24px;
  border: 2px solid #e8e8e8;
  border-radius: 50px;
  background: #fff;
  color: #555;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #ccc;
  background: #fafafa;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.filter-btn.active {
  background: linear-gradient(135deg, #333 0%, #000 100%);
  color: #fff;
  border-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.chip {
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 18px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-muted);
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(31, 54, 154, 0.04);
}

.chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(31, 54, 154, 0.25);
}

.search-sort {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  min-width: 260px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2px solid #e8e8e8;
  border-radius: 50px;
  padding: 8px 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-box:focus-within {
  border-color: #333;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-family: var(--font-family);
  color: var(--color-ink);
  min-width: 100px;
  font-weight: 500;
}

.search-box input::placeholder {
  color: #999;
  font-weight: 400;
}

.search-box button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #333 0%, #000 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-box button:hover {
  background: linear-gradient(135deg, #000 0%, #333 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.search-box button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

select#project-sort {
  border: 1px solid var(--color-line);
  border-radius: 20px;
  padding: 0 16px;
  background: #fff;
  color: var(--color-ink);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}

select#project-sort:focus {
  border-color: var(--color-primary);
}

/* =========================================
   Projects Grid & Cards
   ========================================= */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
}

.bundle {
  display: block;
  background: #fff;
  border-radius: 20px;
  padding: 12px;
  border: 1px solid transparent;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.bundle:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(16, 20, 31, 0.12);
  border-color: rgba(31, 54, 154, 0.2);
}

/* 이미지 영역 */
.review-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #f4f5f7;
  position: relative;
}

.review-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.bundle:hover .review-image img {
  transform: scale(1.05);
}

.before-after {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 8px 8px;
}

.before-after h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.before-after span {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--color-primary-dark);
  background: rgba(31, 54, 154, 0.08);
  /* 웜 베이지 대신 브랜드 톤앤매너 유지 */
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.review-more {
  display: flex;
  justify-content: center;
  margin: 40px 0 0;
}

/* =========================================
   Modal (Review/Project Detail Pop-up)
   ========================================= */
#reviewModal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modalContent {
  background: #fff;
  width: 100%;
  max-width: 680px;
  border-radius: 24px;
  padding: 40px;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-elevated);
  /* main.css 변수 사용 */
  animation: modalFadeUp 0.3s ease-out;
}

@keyframes modalFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modalContent h2 {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--color-ink);
  letter-spacing: -0.02em;
}

.modalContent p {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal-btn:hover {
  color: var(--color-ink);
}

/* =========================================
   Project Detail Page (Full Page)
   ========================================= */
.detail-main {
  width: 100%;
}

#detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 0 100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
}

@media (min-width: 1024px) {
  #detail-container {
    grid-template-columns: 340px 1fr;
    gap: 80px;
    align-items: start;
  }
}

/* Sidebar */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 1024px) {
  .detail-sidebar {
    position: sticky;
    top: 140px;
    height: fit-content;
  }
}

.detail-header-group {
  border-bottom: 2px solid var(--color-ink);
  padding-bottom: 24px;
}

.detail-category-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 12px;
  display: block;
  text-transform: uppercase;
}

.detail-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-ink);
  margin: 0;
  word-break: keep-all;
}

.detail-info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-item {
  /* display: grid;
  grid-template-columns: 100px 1fr; */
  font-size: 0.95rem;
  line-height: 1.6;
  align-items: baseline;
}

.info-label {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.info-value {
  color: var(--color-ink);
  font-weight: 600;
}

.detail-description {
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  white-space: pre-line;
  margin-top: 8px;
}

/* 뒤로가기 링크 */
.btn-back-list {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.btn-back-list:hover {
  color: var(--color-primary);
}

/* Gallery */
.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.gallery-image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  margin: 40px 0;
}

.gallery-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Cost Table */
.detail-costs-wrap {
  margin-top: 24px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  padding: 24px;
  background: #fbfbfb;
}

.detail-costs-wrap h3 {
  font-size: 1rem;
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--color-ink);
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.cost-row.total {
  border-bottom: none;
  font-weight: 700;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--color-ink);
  color: var(--color-primary);
  font-size: 1.2rem;
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 1050px) {
  .project-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-sort {
    width: 100%;
    justify-content: space-between;
  }

}

@media (max-width: 768px) {
  .project-main {
    padding-bottom: 40px;
  }

  /* 필터 버튼 개선 */
  .filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
  }

  .filter-btn.active {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  }

  .chip {
    padding: 8px 16px;
    font-size: 13px;
  }

  /* 검색+정렬 영역 */
  .search-sort {
    gap: 10px;
  }

  .search-box {
    padding: 8px 16px;
    min-width: 0;
  }

  .search-box input {
    font-size: 14px;
  }

  .search-box button {
    width: 36px;
    height: 36px;
  }

  .sort-select {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 50px;
    border: 2px solid #e8e8e8;
  }

  /* 프로젝트 그리드 */
  .project-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .bundle {
    padding: 0;
    overflow: hidden;
  }

  .review-image {
    border-radius: 0;
    margin-bottom: 0;
    aspect-ratio: 16 / 9;
  }

  .before-after {
    padding: 16px;
  }

  #detail-container {
    padding: 20px 0 60px;
    gap: 40px;
  }
}