/* Shengwang Photo Wall Component Styles */

.shengwang-photo-wall {
    padding: 80px 0;
    overflow: hidden;
    /* 避免 active 过渡时出现横向滚动条/页面被撑开 */
    overflow-x: clip;
    position: relative;
    --gap: 32px;
    --active-w: 55%;
    /* 2.5张布局：Active(50%) + Gap + Normal + Gap + 0.5*Normal = 100% */
    /* 1.5 * Normal = 50% - 2 * Gap */
    --normal-w: calc((55% - (2 * var(--gap))) / 2);
    /* 下一张切换时用于平滑补偿的宽度差（JS 动态写入） */
    --diff-w: 0px;
    /* 外层固定高度（JS 会用 active 的实际高度写入，避免切换/动画导致模块高度变化） */
    --wall-h: clamp(260px, 28vw, 560px);
    --radius: 20px;
  }
  
  .shengwang-photo-wall.has-single-slide .photo-controls {
    display: none;
  }
  
  /* Navigation Controls */
  .shengwang-photo-wall .photo-controls {
    position: absolute;
    left: 58%;
    bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 10;
  }
  
  .shengwang-photo-wall .control-btn {
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 3px solid #979797;
  }
  .shengwang-photo-wall .control-btn.swiper-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
    .shengwang-photo-wall .control-btn i{
      color:#737373;
      font-size: 30px;
    }
  .shengwang-photo-wall .control-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
  }
  .shengwang-photo-wall .control-btn:hover i{
    color:#fff;
  }
  
  .shengwang-photo-wall .control-btn svg {
    width: 100%;
    height: 100%;
    display: block;
  }
  
  /* Photo Swiper Container */
  .shengwang-photo-wall .photo-swiper {
    width: 100%;
    /* 放大效果不再依赖外溢显示，保持容器裁切，避免撑开页面 */
    overflow: hidden;
    height: var(--wall-h);
  }
  
  .shengwang-photo-wall .swiper-wrapper {
    display: flex;
    /* 不同高度时底部对齐，视觉更稳 */
    align-items: flex-start;
  }
  
  /* Photo Slide */
  .shengwang-photo-wall .photo-slide {
    /* 你刚手动删掉的 flex 很关键：Swiper slidesPerView:auto 依赖它稳定计算 */
    flex: 0 0 var(--normal-w);
    flex-basis: var(--normal-w);
    width: var(--normal-w);
    box-sizing: border-box;
    min-width: 200px;
    transform: translateZ(0);
    will-change: width, flex-basis;
    /* 普通项宽高比：509/523 */
    aspect-ratio: 509 / 523;
    height: auto;
    transition: width 650ms cubic-bezier(0.22, 1, 0.36, 1),
      flex-basis 650ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 650ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    position: relative;
  }
  
  .shengwang-photo-wall .photo-slide.swiper-slide-active {
    flex: 0 0 var(--active-w);
    flex-basis: var(--active-w);
    width: var(--active-w);
    transform-origin: left center;
    /* Active 宽高比：1039/659（高度允许与普通项不同） */
    aspect-ratio: 1039 / 659;
    /* 不再对整个卡片做 scale，避免溢出/抖动；放大交给图片的 zoom 实现 */
    transform: translateZ(0);
    /* box-shadow: 0 24px 60px rgba(13, 24, 64, 0.25); */
  }

  /* 修复：切换下一张时，上一个 active 缩回 normal 会导致后续 slides 偏移量在结束瞬间被 Swiper 重算，引发“闪一下” */
  /* 思路：仅在 next 方向的过渡期间，把新的 active 以及其后的 slides 统一右移 diff，抵消上一张缩回造成的 offset 变化 */
  .shengwang-photo-wall.is-animating-next .photo-slide.swiper-slide-active,
  .shengwang-photo-wall.is-animating-next .photo-slide.swiper-slide-active ~ .photo-slide {
    transform: translateX(var(--diff-w));
    /* 必须与 width/flex-basis 动画时间一致 */
    transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  
  /* Photo Link */
  .shengwang-photo-wall .photo-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* border-radius: var(--radius); */
  }
  
  /* Photo Image */
  .shengwang-photo-wall .photo-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    will-change: transform;
    transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  
  /* 方向性缩放：由 JS 写入 data-dir=next|prev */
  .shengwang-photo-wall[data-dir="next"] .photo-slide.swiper-slide-active img {
    transform-origin: right center; /* 下一张：从右往左放大 */
  }
  
  .shengwang-photo-wall[data-dir="prev"] .photo-slide.swiper-slide-active img {
    transform-origin: left center; /* 上一张：从左往右放大（与下一张相反） */
    transform: scale(1.04);
  }
  
  /* 没有方向标记时的默认放大 */
  .shengwang-photo-wall:not([data-dir]) .photo-slide.swiper-slide-active img {
    transform-origin: center;
    transform: scale(1.04);
  }

  .photo-slide-title{
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 13px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.60);
    color: #FFF;
    font-size: 20px;
font-weight: 400;
line-height: 1.2;
letter-spacing: 0.5px;
white-space: nowrap;
overflow: hidden; 
text-overflow: ellipsis;
  }
  
  /* Responsive Styles */
  @media screen and (max-width: 1400px) {
    .shengwang-photo-wall {
      padding: 70px 0;
      --gap: 28px;
      --normal-w: calc((55% - (2 * var(--gap))) / 2);
    }
    .shengwang-photo-wall .photo-controls{
      bottom:70px;
    }
  }
  
  @media screen and (max-width: 1200px) {
    .shengwang-photo-wall {
      padding: 60px 0;
      --gap: 24px;
      --active-w: 55%;
      /* --normal-w: calc((45% - (2 * var(--gap))) / 1.5); */
    }
    .shengwang-photo-wall .photo-controls{
      bottom:60px;
    }
  }
  
  @media screen and (max-width: 992px) {
    .photo-slide-title{
      padding: 10px 0;
      font-size: 14px;
    }
    .shengwang-photo-wall {
      padding: 50px 0;
      --gap: 20px;
      /* --normal-w: calc((40% - (2 * var(--gap))) / 1.5); */
      --wall-h: clamp(220px, 46vw, 520px);
    }
    .shengwang-photo-wall .control-btn i{
        font-size: 24px;
    }
  
    .shengwang-photo-wall .photo-controls {
      bottom: 50px;
    }
  
    .shengwang-photo-wall .control-btn {
      width: 45px;
      height: 45px;
      border-radius: 15px;
      border: 2px solid #979797;
    }
  }
  
  @media screen and (max-width: 768px) {
    .shengwang-photo-wall {
      padding: 40px 0;
      --gap: 16px;
      --active-w: 75%;
      --normal-w: 75%;
      --radius: 14px;
      --wall-h: clamp(200px, 62vw, 520px);
    }
  
    .shengwang-photo-wall .photo-controls {
      gap: 15px;
      padding: 12px 0;
      position: unset;
    }
  
    .shengwang-photo-wall .control-btn {
      width: 40px;
      height: 40px;
    }

    /* 移动端：去除所有放大/变宽效果，改为一屏两张的常规轮播 */
    .shengwang-photo-wall .photo-swiper {
      height: auto;
    }

    .shengwang-photo-wall .swiper-wrapper {
      align-items: stretch;
    }

    .shengwang-photo-wall .photo-slide {
      flex: 0 0 auto;
      width: auto;
      min-width: 0;
      /* 两张布局时保持统一比例 */
      aspect-ratio: 509 / 523;
      transition: none;
      transform: none;
    }

    .shengwang-photo-wall .photo-slide.swiper-slide-active {
      flex: 0 0 auto;
      width: auto;
      aspect-ratio: 509 / 523;
      transition: none;
      transform: none;
    }

    .shengwang-photo-wall.is-animating-next .photo-slide.swiper-slide-active,
    .shengwang-photo-wall.is-animating-next .photo-slide.swiper-slide-active ~ .photo-slide {
      transform: none;
      transition: none;
    }

    .shengwang-photo-wall .photo-slide img,
    .shengwang-photo-wall[data-dir="next"] .photo-slide.swiper-slide-active img,
    .shengwang-photo-wall[data-dir="prev"] .photo-slide.swiper-slide-active img,
    .shengwang-photo-wall:not([data-dir]) .photo-slide.swiper-slide-active img {
      transform: none !important;
      transition: none;
    }
  }
  
  @media screen and (max-width: 576px) {
    .photo-slide-title{
      padding: 6px 0;
      font-size: 12px;
    }
    .shengwang-photo-wall {
      padding: 30px 0;
      --gap: 12px;
      --active-w: 90%;
      --normal-w: 90%;
      --radius: 12px;
      --wall-h: clamp(180px, 80vw, 520px);
    }
  
    .shengwang-photo-wall .photo-controls {
      gap: 12px;
      padding: 10px 0;
    }
    .shengwang-photo-wall .photo-slide img {
      height: 100%;
    }
  }