/* ========== PORTFOLIO PAGE ========== */
/* 포트폴리오 최상단 여백 — 커뮤니티(.community-header)와 동일 150px 통일 */
.project-section {
  padding-top: calc(var(--header-height) + 80px);
}
.portfolio-header {
  text-align: center;
  padding: calc(var(--header-height) + 60px) 0 20px;
}
.portfolio-header h1 {
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--color-brand-beige);
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: 8px;
}
.portfolio-header p {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  letter-spacing: 1px;
}

/* LNB — sticky category tabs (HOUSE / OFFICE) */
.filter-tabs {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid #e5e1d6;
}
.filter-tabs button {
  position: relative;
  font-size: 13px;
  letter-spacing: 3px;
  color: #b8b1a2;
  padding: 14px 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    font-size 180ms ease,
    font-weight 180ms ease;
}
.filter-tabs button:hover {
  color: var(--color-brand-beige);
  font-size: 15px;
  font-weight: 700;
}
.filter-tabs button.active {
  color: var(--color-brand-beige);
  font-weight: 600;
  background: #efe6d0;
}
.filter-tabs button.active:hover {
  font-size: 15px;
  font-weight: 700;
}

/* Sub Filter — 텍스트 링크 + "|" 구분자 */
.sub-filter {
  display: flex;
  justify-content: center;
  padding: 28px 0 32px;
}
.sub-filter .sub-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.sub-filter .sub-group.hidden {
  display: none;
}
.sub-filter button {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--color-text-light);
  padding: 4px 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s;
}
.sub-filter button:hover {
  color: var(--color-text-heading);
}
.sub-filter button.active {
  color: var(--color-text-heading);
  font-weight: 600;
}
.sub-filter .sep {
  color: #c9c3b4;
  font-size: 12px;
  user-select: none;
}
.sub-filter.hidden {
  display: none;
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  padding-bottom: var(--section-padding);
}
.portfolio-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
  cursor: pointer;
}
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.portfolio-card:hover img {
  transform: scale(1.03);
}
.portfolio-card .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 24px;
  background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.4) 100%);
  text-align: center;
  opacity: 0;
  transition: opacity var(--transition);
}
.portfolio-card:hover .card-overlay {
  opacity: 1;
}
.card-overlay .card-name {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 1px;
  font-weight: 300;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 300;
  overflow-y: auto;
  padding: 40px;
}
.modal-overlay.open {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal-close {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  z-index: 301;
}
.modal-title {
  font-size: 18px;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-align: center;
}
.modal-images {
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-images img {
  width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  .modal-overlay {
    padding: 20px;
  }
  /* 로고 아래 공백 — 커뮤니티 페이지와 동일(헤더 70 + 48 = 118px) */
  .project-section {
    padding-top: calc(var(--header-height) + 48px);
  }
  /* LNB 크기 축소 */
  .filter-tabs button {
    font-size: 11px;
    letter-spacing: 2px;
    padding: 10px 14px;
  }
  .filter-tabs button:hover,
  .filter-tabs button.active:hover {
    font-size: 12px;
  }
  /* Sub filter: 가운데 정렬 + 3+2 행 분할 */
  .sub-filter {
    padding: 22px 16px 28px;
  }
  .sub-filter .sub-group {
    justify-content: center;
    gap: 8px;
  }
  .sub-filter button {
    font-size: 12px;
    padding: 4px 4px;
  }
  /* 30~40평과 40~50평 사이 구분자를 줄바꿈 트리거로 전환 */
  .sub-filter .row-break {
    flex-basis: 100%;
    visibility: hidden;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}
