/* =========================
Base
========================= */


.gallery-wrapper {
  max-width: 1200px;position: relative; 
  margin: auto;
  padding: 40px 20px;
}

/* =========================
Fake Select
========================= */

.c-select {
  position: relative; margin:0 auto;
  width: 80vw; max-width: 460px;
  margin-bottom: 40px;
}

/* 主按鈕 */
.c-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 999px;
  background: #e9e9e9;
  border: 1px solid #cfcfcf;
  cursor: pointer;
  transition: background .2s ease;
}

.c-select-trigger:hover {
  background: #e3e3e3;
}

/* 文字 */
.c-select .label {
  font-weight: 700;
  font-size: 1em; line-height:1.2em;
}

/* =========================
雙箭頭（重點）
========================= */
.c-select .arrows {
  position: relative;
  width: 12px;
  height: 16px;
}

/* 上箭頭 */
.c-select .arrows::before,
.c-select .arrows::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  transform-origin: center;
}

/* ▲ */
.c-select .arrows::before {
  top: 0;
  transform: translateX(-50%) rotate(-135deg);
}

/* ▼ */
.c-select .arrows::after {
  bottom: 0;
  transform: translateX(-50%) rotate(45deg);
}


/* =========================
Dropdown（維持原本）
========================= */
.c-select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  width: 100%;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ccc;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: .2s ease;
  z-index: 10;
	
	max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS 慣性滑動 */
}

.c-select.open .c-select-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* option */
.c-select-option {
  padding: 12px 16px;
  font-size: 14px;
  cursor: pointer;
}

.c-select-option:hover {
  background: #f3f3f3;
}

.c-select-option.active {
  background: #e0e0e0;
}

.c-select-trigger:active {
  background: #ddd;
}

.c-select-option:active {
  background: #dcdcdc;
}
/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3欄 */
  gap: 16px;
}

@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #ddd;
}

.gallery-item img {
  width: 100%;
  display: block;
  opacity: 0;
  transition: .4s;
}

.gallery-item img.loaded {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: brightness(0.85);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: .3s;
}

.gallery-item:hover::after {
  background: rgba(0,0,0,0.2);
}

/* =========================
Modal
========================= */
.modal {
  position: fixed; z-index: 2000;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

.modal-btn {
  position: absolute; 
  color: #fff;
  font-size: 3rem;line-height: 3rem; padding: 2rem;
  cursor: pointer;
  user-select: none;
}

.modal-close { top: 0px; right: 10px; }
.modal-prev { left: 0px; top: 50%; transform: translateY(-50%); }
.modal-next { right: 0px; top: 50%; transform: translateY(-50%); }
