/* 갤러리 전용 스타일 (개선 버전) */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.gallery figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery figure:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery figcaption {
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

/* 모달(확대 이미지) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 85%;
  max-height: 80vh;
  border-radius: 10px;
}

@keyframes zoom {
  from {transform: scale(0.8)}
  to {transform: scale(1)}
}

.modal-caption {
  text-align: center;
  color: #ccc;
  margin-top: 15px;
  font-size: 16px;
  padding: 10px;
}

.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #bbb;
}

/* Prev & Next Buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -30px;
  color: white;
  font-weight: bold;
  font-size: 24px;
  transition: 0.3s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev {
  left: 0;
}

.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.5);
}

.home-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007BFF; /* 파란색 */
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.home-button:hover {
    background-color: #0056b3; /* 마우스 올렸을 때 진한 파랑 */
}

/* 탭 버튼 */
.gallery-tabs {
  text-align: center;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  margin: 0 5px;
  border: none;
  border-radius: 6px;
  background: #eee;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.tab-btn.active {
  background: #007BFF;
  color: #fff;
}

.gallery-section {
  display: none;
  margin-top: 10px;
}

.gallery-section.active {
  display: block;
}

/* 모바일 대응 */
@media (max-width: 600px) {
  .gallery img { height: 140px; }
  .gallery { gap: 12px; }
}

@media (min-width: 1200px) {
  .gallery img { height: 220px; }
}