/* ===== 민건설 현장 기록 갤러리 ===== */

.gallery-section {
  padding: clamp(60px, 8vw, 100px) var(--gutter);
  background: var(--concrete-soft);
}
.gallery-inner { max-width: var(--max-w); margin: 0 auto; }

.gallery-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.gallery-filters button {
  padding: 8px 16px;
  font-family: var(--font-sub); font-weight: 700;
  font-size: 12px; letter-spacing: .1em;
  border: 1px solid var(--concrete-mid);
  background: transparent;
  color: var(--concrete-dark);
  border-radius: 2px;
  transition: all .2s;
  cursor: pointer;
}
.gallery-filters button:hover,
.gallery-filters button.active {
  background: var(--concrete-dark);
  color: var(--white);
  border-color: var(--concrete-dark);
}

/* ===== 데스크탑: Masonry-style grid ===== */
.gallery-grid {
  column-count: 4;
  column-gap: 12px;
}
.gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  background: var(--concrete-light);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0,0,0,.12);
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(26,26,24,.85) 100%);
  opacity: 0;
  transition: opacity .3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 16px;
  color: var(--white);
}
.gallery-item:hover .overlay { opacity: 1; }
.gallery-item .overlay .t {
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.gallery-item .overlay .tag {
  font-family: var(--font-sub); font-weight: 700;
  font-size: 10px;
  letter-spacing: .15em;
  color: var(--accent-soft);
}

@media (max-width: 1100px) { .gallery-grid { column-count: 3; } }
@media (max-width: 780px) {
  /* 모바일: 스와이프 레일 + 점진 로딩 */
  .gallery-grid {
    column-count: 1;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .gallery-item {
    flex: 0 0 85%;
    scroll-snap-align: center;
    margin-bottom: 0;
    aspect-ratio: 4/3;
  }
  .gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
  }
  .gallery-item .overlay { opacity: 1; }
  .gallery-item .overlay .t { font-size: 15px; }
  .gallery-hint {
    text-align: center;
    font-family: var(--font-sub);
    font-size: 12px;
    color: var(--concrete-mid);
    margin-top: 12px;
  }
}

.gallery-hint { display: none; }
@media (max-width: 780px) {
  .gallery-hint { display: block; }
  .gallery-hint::before { content: '← '; color: var(--accent); }
  .gallery-hint::after { content: ' →'; color: var(--accent); }
}

/* PhotoSwipe 커스텀 (배경 콘크리트 다크) */
.pswp { --pswp-bg: #1a1a18; }
.pswp__caption {
  font-family: var(--font-sub); font-weight: 300;
  color: var(--concrete-light);
  padding: 20px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.5));
}
.pswp__caption .c-title {
  font-family: var(--font-title);
  font-size: 15px;
  margin-bottom: 4px;
}
.pswp__caption .c-tag {
  font-family: var(--font-sub); font-weight: 700;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--accent-soft);
}
