/* ==========================================================================
   Factory Gallery Page Stylesheet (极简画廊艺术风格) - Wanda Wood
   ========================================================================== */

/* Sub-page Hero / Breadcrumb */
/* 1. Factory Gallery Grid (纯白画廊风格) */
.factory-grid-section {
  background: var(--paper);
  padding: 120px 0;
}

.factory-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 40px;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background: transparent;
}

.gallery-item__media {
  position: relative;
  height: 360px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(11, 13, 14, 0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Elegant Lightbox Zoom Overlay */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 13, 14, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.35s ease;
}

/* Thin circular plus icon */
.gallery-item__overlay i {
  color: #fff;
  font-size: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.85);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.25s ease, color 0.25s ease;
}

/* Item hover styles */
.gallery-item:hover .gallery-item__media {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(11, 13, 14, 0.1);
}

.gallery-item:hover .gallery-item__media img {
  transform: scale(1.04);
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item:hover .gallery-item__overlay i {
  transform: scale(1);
  border-color: var(--brown);
  color: var(--brown);
}

/* Caption under the bare image */
.gallery-item__caption {
  padding: 0 4px;
}

.gallery-item__num {
  font-size: 11px;
  font-weight: 700;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 6px;
  display: block;
}

.gallery-item__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  line-height: 1.35;
  transition: color 0.25s ease;
}

.gallery-item:hover .gallery-item__title {
  color: var(--brown);
}

/* 2. Lightbox Modal Layer (暗色遮罩弹层) */
.factory-lightbox {
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(11, 13, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.factory-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.factory-lightbox.active .lightbox-content img {
  transform: scale(1);
}

.lightbox-caption {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-top: 18px;
  text-align: center;
  font-family: inherit;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 46px;
  font-weight: 200;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.2s ease;
  z-index: 100000;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--brown);
  transform: scale(1.1);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
  .factory-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
  }

  .gallery-item__media {
    height: 300px;
  }
}

@media (max-width: 760px) {
  .factory-grid-section {
    padding: 64px 0 80px;
  }

  .factory-gallery-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .gallery-item__media {
    height: 240px;
    margin-bottom: 14px;
  }

  .lightbox-close {
    top: 20px;
    right: 20px;
    font-size: 38px;
  }

  .lightbox-caption {
    font-size: 15px;
    margin-top: 12px;
  }
}
