/* 全局图片灯箱与相册样式
 *
 * 灯箱 DOM 由 _layouts/default.html 输出唯一一份（#global-lightbox），
 * 行为由 assets/lightbox.js 驱动；文章内图片与相册图片共用这套灯箱。
 * 此处为唯一的样式定义处。
 */

/* ---------- 灯箱 ---------- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 80%;
  margin-top: 5%;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.lightbox .close:hover {
  color: #bbb;
}

.lightbox .caption {
  text-align: center;
  color: #ccc;
  padding: 10px 20px;
  position: absolute;
  bottom: 20px;
  width: 100%;
}

.lightbox .prev,
.lightbox .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.3s;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 0 3px 3px 0;
}

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

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

/* ---------- 相册网格 ---------- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.album-item {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.album-item:hover {
  transform: scale(1.05);
}

.album-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: zoom-in;
}

.album-caption {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  font-size: 0.9rem;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 70%;
  }
}
