.gallery-list-wrapper {
  max-width: var(--max-width);
  margin: 50px auto;
  padding: 0 20px;
}

.gallery-list-wrapper h1 {
  font-size: 28px;
  margin-bottom: 30px;
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
}

/* 검색 */
.search-area {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 30px;
}

.search-form {
  display: flex;
  gap: 5px;
  width: 100%;
  max-width: 350px;
}

.search-input {
  flex-grow: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 15px;
  color: #333;
  transition: border-color 0.3s;
}

.search-input:focus {
  border-color: #333;
  outline: none;
}

.search-button {
  flex-shrink: 0;
  padding: 10px 15px;
  background-color: #333;
  color: #fff;
  border: 1px solid #333;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.3s;
}

.search-button:hover {
  background-color: #555;
  border-color: #555;
}

/* 카테고리 필터 */
.category-filter {
  margin-bottom: 20px;
}

.category-filter a {
  display: inline-block;
  padding: 8px 15px;
  margin-right: 10px;
  text-decoration: none;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.category-filter a.active {
  background-color: #333;
  color: #fff;
  border-color: #333;
}

/* 갤러리 그리드 */
.gallery-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 40px;
}

.gallery-grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

/* 카드 */
.gallery-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.gallery-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.gallery-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f0f0f0;
}

.gallery-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.gallery-card:hover .gallery-card__thumb img {
  transform: scale(1.04);
}

.gallery-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background-color: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 13px;
}

.gallery-card__cat {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-block;
  font-size: 12px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  padding: 3px 9px;
  backdrop-filter: blur(2px);
  z-index: 1;
}

.gallery-card__body {
  padding: 14px 16px;
}

.gallery-card__title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin: 0 0 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.gallery-card__meta {
  font-size: 13px;
  color: #999;
  margin: 0;
}

/* 결과 없음 */
.gallery-no-results {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  padding: 60px 0;
  font-size: 15px;
}

/* 페이지네이션 */
.pagination-area {
  text-align: center;
}

.pagination-area a,
.pagination-area span {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 4px;
  text-decoration: none;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.pagination-area span.current-page {
  background-color: #333;
  color: #fff;
  border-color: #333;
  font-weight: bold;
}

/* --- 태블릿 (≤1024px) --- */
@media (max-width: 1024px) {
  .search-form {
    max-width: 300px;
  }

  .search-input,
  .search-button {
    padding: 8px 12px;
    font-size: 14px;
  }

  .gallery-grid--4col,
  .gallery-grid--3col {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .pagination-area a,
  .pagination-area span {
    padding: 6px 10px;
  }
}

/* --- 모바일 (≤768px) --- */
@media (max-width: 768px) {
  .gallery-list-wrapper h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .search-area {
    justify-content: center;
    margin-bottom: 20px;
  }

  .search-form {
    width: 100%;
    max-width: 100%;
    padding: 0 5px;
  }

  .search-input {
    padding: 8px 10px;
  }

  .search-button {
    padding: 8px 10px;
    font-size: 14px;
  }

  .category-filter {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
  }

  .category-filter a {
    flex-shrink: 0;
    margin-right: 8px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .gallery-grid--4col,
  .gallery-grid--3col {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-card__body {
    padding: 12px 14px;
  }
}
