/* ===== 照片區塊樣式 ===== */
.photo-gallery {
  margin: 2em 0;
  padding: 1em;
  background: #f9f9f9;
  border-radius: 8px;
}

.photo-gallery h3 {
  text-align: center;
  font-size: 14pt;
  margin-bottom: 1em;
  color: #333;
  border-bottom: 2px solid #0066CC;
  padding-bottom: 0.5em;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin-bottom: 1em;
  justify-content: center;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex: 1 1 calc(50% - 0.5em);
  min-width: 280px;
  max-width: 400px;
  cursor: pointer; /* 點選游標 */
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.photo-item:hover img {
  transform: scale(1.05); /* 懸停時微微放大 */
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: white;
  padding: 1em;
  font-size: 10pt;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.photo-item:hover .photo-caption {
  transform: translateY(0);
}

/* 點選放大提示 */
.photo-item::after {
  content: "🔍 點選放大";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 8pt;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover::after {
  opacity: 1;
}

/* ===== Lightbox 樣式 ===== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.lightbox.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  animation: zoomIn 0.3s ease;
}

.lightbox img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(0,0,0,0.8);
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 15px;
  font-size: 14px;
  background: rgba(0,0,0,0.7);
  margin-top: 10px;
  border-radius: 4px;
}

/* Lightbox 動畫效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

/* ===== 照片響應式設計 ===== */
@media (max-width: 768px) {
  /* 照片響應式 */
  .photo-item {
    flex: 1 1 calc(50% - 0.5em);
    min-width: 250px;
  }
  
  .photo-item img {
    height: 180px;
  }
  
  .photo-caption {
    font-size: 9pt;
    padding: 0.8em;
  }

  /* Lightbox 響應式 */
  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 80%;
  }
}

@media (max-width: 480px) {
  .photo-item {
    flex: 1 1 100%;
    min-width: auto;
  }
  
  .photo-item img {
    height: 160px;
  }
}