/* =========================================================
   Factory Photo Display - 两排独立 flex 交错画廊
   桌面：两排 flex，标题与箭头固定窄，卡片等分
   平板/手机：竖排堆叠
   ========================================================= */

/* ============================================
   外层容器
   ============================================ */
.factory-gallery {
  width: 100%;
  background: #ffffff;
  padding: 30px 0;
}

.gallery-scroll-area {
  width: 100%;
}

/* 包裹两排 */
.gallery-rows-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   每一排：窄块 + 卡片区
   ============================================ */
.gallery-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
}

/* 标题块 & 箭头块：同宽固定 */
.title-block,
.arrow-block {
  flex-shrink: 0;
  width: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-block {
  justify-content: flex-start;
}

.title-text {
  color: #f5a623;
  font-size: clamp(24px, 2.1vw, 40px);
  text-transform: uppercase;
  font-family: var(--title-font-family);
  font-weight: 700;
  line-height: 1.2;
}

.title-text .title-mob {display: none;}

.title-text span {
  display: block;
}

/* 卡片区：4 张卡片等分剩余空间 */
.gallery-cards {
  flex: 1;
  display: flex;
  gap: 16px;
  min-width: 0;
}

/* ============================================
   卡片
   ============================================ */
.factory-item {
  flex: 1 1 0;
  min-width: 0;            /* 取消最小宽度，靠 flex 等分 */
  text-decoration: none;
  color: inherit;
  display: block;
}

.factory-item .content {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.factory-item:hover .content {
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.content-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eee;
}

.content-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  aspect-ratio: 16 / 9;
}

.factory-item:hover .content-image img {
  transform: scale(1.05);
}

.content-text {
  background: rgba(0,0,0,0.75);
  padding: 8px 12px;
  margin-top: auto;
}

.content-text span {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   右侧小箭头
   ============================================ */
.arrow-btn {
  width: 36px;
  height: 36px;
  border: 2px solid #f5a623;
  border-radius: 50%;
  color: #f5a623;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.arrow-btn svg {
  width: 18px;
  height: 18px;
  color: #f5a623;
}

.arrow-btn:hover {
  background: #f5a623;
}

.arrow-btn:hover svg{
  color: #fff;
}

@media(max-width:1500px){
  .title-block, .arrow-block {width: 180px;}
}

@media(max-width:1280px){
  .title-block, .arrow-block {width: 170px;}
}


/* ============================================
   响应式：平板及以下 → 竖排堆叠
   第1排：标题居中
   第2排：4 张图一行
   第3排：4 张图一行
   第4排：箭头居中
   ============================================ */
@media screen and (max-width: 992px) {

  .gallery-rows-wrapper {
    gap: 12px;
  }

  /* 每排改成竖排 */
  .gallery-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  /* 标题/箭头占满宽，居中 */
  .title-block,
  .arrow-block {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .title-block {
    padding: 10px 0;
  }

  .title-text {
    font-size: clamp(22px, 4vw, 32px);
  }

  /* 卡片区：4 张一行，等宽 */
  .gallery-cards {
    flex-wrap: nowrap;
    width: 100%;
    gap: 12px;
  }

  .factory-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .content-text span {
    font-size: 12px;
  }

.title-text .title-pc {display: none;}
.title-text .title-mob {display: block;}
}

@media screen and (max-width: 768px) {
  .factory-gallery {
    padding: 20px 0;
  }

  /* 手机：一行 2 张 */
  .gallery-cards {
    flex-wrap: wrap;
    gap: 10px;
  }

  .factory-item {
    flex: 0 0 calc(50% - 5px);  /* 2 per row */
  }

  .title-text {
    font-size: clamp(18px, 5vw, 26px);
  }

  .arrow-btn {
    width: 30px;
    height: 30px;
  }

  .arrow-btn svg {
    width: 14px;
    height: 14px;
  }

  .content-text {
    padding: 6px 8px;
  }

  .content-text span {
    font-size: 11px;
  }
}
