/*
 * 图片列表页专属样式
 * 基础变量、Banner、面包屑、section、page-content、section-header
 * 均复用网站现有的 common.css 与 inpage.css。
 */

.gallery-page-banner {
  background-color: var(--brand-green-dark, #01612f);
  background-image: linear-gradient(120deg, var(--brand-green-deep, #014020), var(--brand-green, #017f40));
}

.gallery-section {
  padding-top: 88px;
  padding-bottom: 112px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.gallery-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border, #e8ecf0);
  border-radius: var(--radius-md, 10px);
  background: var(--bg-white, #fff);
  box-shadow: var(--shadow-card, 0 4px 12px rgba(26,148,68,.04));
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
  border-color: rgba(1,127,64,.18);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(10,82,36,.12));
}

.gallery-card > button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--bg-white, #fff);
  text-align: left;
  cursor: zoom-in;
}

.gallery-card > button:focus-visible {
  outline: 3px solid var(--gold, #a2f253);
  outline-offset: -3px;
}

.gallery-image {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-light, #f7f9fb);
}

.gallery-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
}

.gallery-card:hover .gallery-image img {
  transform: scale(1.055);
}

.gallery-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(1,64,32,.62), transparent 52%);
  opacity: .28;
  transition: opacity .3s ease;
}

.gallery-card:hover .gallery-shade {
  opacity: .65;
}

.gallery-zoom {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(26,148,68,.08));
  transform: translate(-50%,-44%) scale(.82);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}

.gallery-zoom::before {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--brand-green, #017f40);
  font-size: 30px;
  font-style: normal;
  font-weight: 300;
}

.gallery-card:hover .gallery-zoom {
  transform: translate(-50%,-50%) scale(1);
  opacity: 1;
}

.gallery-title {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 18px 22px;
  color: var(--text-dark, #1a2a20);
  font-size: var(--type-card-title, 20px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .5px;
  transition: color .25s ease;
}

.gallery-card:hover .gallery-title {
  color: var(--brand-green, #017f40);
}

/* 图片放大层 */
.lightbox[hidden] {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 96px;
  background: rgba(1,35,18,.94);
  backdrop-filter: blur(8px);
}

.lightbox figure {
  width: min(1100px, calc(100vw - 210px));
  max-height: calc(100vh - 78px);
  margin: 0;
}

.lightbox-image {
  width: 100%;
  height: min(66vh, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md, 10px);
  background: #092a19;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.lightbox figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  color: #fff;
}

.lightbox figcaption h2 {
  margin: 0;
  color: #fff;
  font-size: var(--font-size-24, 24px);
  font-weight: 500;
}

.lightbox figcaption em {
  color: rgba(255,255,255,.58);
  font-family: var(--font-family-number, "MiSans", Arial, sans-serif);
  font-size: var(--font-size-14, 16px);
  font-style: normal;
  letter-spacing: 1px;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: 1px solid rgba(255,255,255,.24);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.lightbox-close:hover,
.lightbox-arrow:hover,
.lightbox-close:focus-visible,
.lightbox-arrow:focus-visible {
  border-color: var(--gold, #a2f253);
  outline: 0;
  background: var(--brand-green, #017f40);
}

.lightbox-close {
  width: 44px;
  height: 44px;
  right: 30px;
  top: 28px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.lightbox-arrow {
  width: 52px;
  height: 72px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: var(--radius-sm, 6px);
  font-size: 38px;
}

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

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .gallery-grid {
    gap: 20px;
  }

  .gallery-title {
    min-height: 66px;
    padding: 16px 18px;
    font-size: var(--font-size-18, 18px);
  }

  .lightbox {
    padding: 56px 58px;
  }

  .lightbox figure {
    width: calc(100vw - 130px);
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-image {
    aspect-ratio: 1.35 / 1;
  }

  .lightbox {
    padding: 70px 16px 30px;
  }

  .lightbox figure {
    width: 100%;
  }

  .lightbox-image {
    height: 52vh;
  }

  .lightbox figcaption h2 {
    font-size: var(--font-size-20, 20px);
  }

  .lightbox-close {
    right: 15px;
    top: 15px;
  }

  .lightbox-arrow {
    top: 50%;
    bottom: auto;
    width: 52px;
    height: 48px;
    transform: translateY(-50%);
  }

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

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-image img,
  .gallery-shade,
  .gallery-zoom {
    transition-duration: .01ms !important;
  }
}
