/* ============================================================
   gallery-fix.css
   活動花絮頁 + 首頁預覽 + 燈箱（獨立檔，不依賴 CSS 變數）
   在 gallery.html 與 index.html 中接在其他樣式之後載入
   ============================================================ */

/* ── 相簿列表 ── */
.gallery-page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery-album-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e2da;
  background: #ffffff;
  cursor: pointer;
  transition: box-shadow .25s ease, transform .25s ease;
}

.gallery-album-card:hover {
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  transform: translateY(-4px);
}

.gallery-album-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0efe9;
}

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

.gallery-album-card:hover .gallery-album-cover img {
  transform: scale(1.05);
}

.gallery-album-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7efec;
  color: #3B7A6E;
  font-size: 14px;
}

.gallery-album-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 100px;
  letter-spacing: .05em;
}

.gallery-album-info {
  padding: 18px 20px 20px;
  min-width: 0;
  overflow-wrap: break-word;
}

.gallery-album-title {
  font-size: 16px;
  font-weight: 700;
  color: #2b2b28;
  margin: 0 0 4px;
}

.gallery-album-date {
  font-size: 13px;
  color: #8a8a82;
}

.gallery-album-desc {
  font-size: 13px;
  color: #5c5c55;
  margin: 8px 0 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 首頁活動花絮預覽 ── */
.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.gallery-preview-card {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e2da;
  text-decoration: none;
  background: #ffffff;
  transition: box-shadow .25s ease, transform .25s ease;
}

.gallery-preview-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,.10);
  transform: translateY(-3px);
}

.gallery-preview-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0efe9;
}

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

.gallery-preview-card:hover .gallery-preview-img img {
  transform: scale(1.05);
}

.gallery-preview-caption {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-preview-caption span {
  font-size: 14px;
  font-weight: 700;
  color: #2b2b28;
}

.gallery-preview-caption small {
  font-size: 12px;
  color: #8a8a82;
}

/* ── 燈箱 ── */
.album-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.album-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-stage {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 90vw;
}

.album-lightbox img {
  max-width: 90vw;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-caption {
  display: flex;
  align-items: baseline;
  gap: 16px;
  color: rgba(255,255,255,.85);
  font-size: 14px;
}

.lightbox-caption #lightbox-counter {
  color: rgba(255,255,255,.55);
  letter-spacing: .08em;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
  z-index: 1;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255,255,255,.28);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 30px;
  line-height: 1;
  padding-bottom: 4px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ── RWD ── */
@media (max-width: 1024px) {
  .gallery-page-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-preview-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .gallery-page-grid { grid-template-columns: 1fr; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 24px; }
  .album-lightbox img { max-width: 96vw; }
}
