/* gallery：图片画廊家族；落地时并入宿主页 CSS，勿单独 link 本文件名 */

.wa-fam-section[data-family="gallery"] .wa-fam-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wa-fam-section[data-family="gallery"] .wa-fam-card__stage {
  justify-content: stretch;
  align-items: stretch;
}

.wa-fam-section[data-family="gallery"] .wa-fam-card__stage > .wa-gallery,
.wa-fam-section[data-family="gallery"] .wa-fam-card__stage > .wa-gallery-wrap,
body.wa-preview-embed .wa-preview-stage[data-slug^="gallery-"] .wa-embed__stage > .wa-gallery,
body.wa-preview-embed .wa-preview-stage[data-slug^="gallery-"] .wa-embed__stage > .wa-gallery-wrap {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}

body.wa-preview-embed .wa-preview-stage[data-slug^="gallery-"].wa-embed {
  width: min(544px, calc(100% - 32px));
}

body.wa-preview-embed .wa-preview-stage[data-slug^="gallery-"] .wa-embed__stage {
  align-items: stretch;
}

.wa-gallery {
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 8px);
}

.wa-gallery .arco-carousel-item,
.wa-gallery-slide {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.wa-gallery-slide {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--color-fill-2);
}

.wa-gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* multiple：在卡片舞台内垂直居中（同行等高时舞台撑满） */
.wa-fam-section[data-family="gallery"] .wa-fam-card[data-slug="gallery-multiple"] {
  height: 100%;
  align-self: stretch;
}

.wa-fam-section[data-family="gallery"] .wa-fam-card[data-slug="gallery-multiple"] .wa-fam-card__top {
  flex: 0 0 auto;
}

.wa-fam-section[data-family="gallery"] .wa-fam-card[data-slug="gallery-multiple"] .wa-fam-card__stage,
body.wa-preview-embed .wa-preview-stage[data-slug="gallery-multiple"] .wa-embed__stage {
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
}

.wa-gallery-wrap--multiple {
  position: relative;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  width: 100%;
}

.wa-gallery-wrap--multiple > .arco-btn {
  flex: 0 0 auto;
}

.wa-gallery-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--border-radius-medium, 8px);
  background: var(--color-fill-2);
  container-type: inline-size;
  container-name: wa-gallery-vp;
}

.wa-gallery-track {
  display: flex;
  gap: 8px;
  width: max-content;
  transition: transform 0.35s ease;
  will-change: transform;
}

.wa-gallery-cell {
  flex: 0 0 calc((100cqw - 16px) / 3);
  width: calc((100cqw - 16px) / 3);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--border-radius-small, 4px);
  background: var(--color-fill-2);
  box-sizing: border-box;
}

.wa-gallery-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* dots emphasis */
.wa-gallery--dots .arco-carousel-indicator-item {
  width: 8px;
  height: 8px;
}

.wa-gallery--dots .arco-carousel-indicator-item-active {
  width: 18px;
  border-radius: 999px;
}

/* thumbnails bottom */
.wa-gallery-wrap--thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.wa-gallery-wrap--thumbs .wa-gallery {
  height: 180px;
}

.wa-gallery-thumbs {
  display: flex;
  gap: 8px;
  width: 100%;
}

.wa-gallery-thumb {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--border-radius-small, 4px);
  overflow: hidden;
  background: var(--color-fill-2);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.wa-gallery-thumb.is-active {
  opacity: 1;
  border-color: rgb(var(--primary-6));
}

.wa-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* side thumbs：主图与右侧缩略列同高 */
.wa-gallery-wrap--thumbs-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 10px;
  width: 100%;
  height: 200px;
  align-items: stretch;
}

.wa-gallery-wrap--thumbs-side .wa-gallery {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.wa-gallery-thumbs--side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  height: 100%;
}

.wa-gallery-thumbs--side .wa-gallery-thumb {
  flex: 1 1 0;
  width: 100%;
  height: auto;
  min-height: 0;
}

/* counter */
.wa-gallery-wrap--counter {
  position: relative;
  width: 100%;
}

.wa-gallery-wrap--counter .wa-gallery {
  height: 220px;
}

.wa-gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  pointer-events: none;
}

/* progress */
.wa-gallery-wrap--progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.wa-gallery-wrap--progress .wa-gallery {
  height: 200px;
}

.wa-gallery-progress {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-fill-3);
}

.wa-gallery-progress__bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgb(var(--primary-6));
  animation: wa-gallery-progress-fill 4s linear forwards;
}

@keyframes wa-gallery-progress-fill {
  from { width: 0; }
  to { width: 100%; }
}

/* custom arrows：按钮在图片两侧，不叠在图上 */
.wa-gallery-wrap--arrows {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.wa-gallery-wrap--arrows .wa-gallery {
  flex: 1;
  min-width: 0;
  height: 200px;
  width: auto;
}

.wa-gallery-wrap--arrows > .arco-btn {
  flex: 0 0 auto;
}

/* arrows-bottom：箭头居中放在图片下方 */
.wa-gallery-wrap--arrows-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.wa-gallery-wrap--arrows-bottom .wa-gallery {
  width: 100%;
  height: 200px;
}

.wa-gallery-arrows-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* arrows-dots：两侧箭头 + 底部胶囊圆点 */
.wa-gallery-wrap--arrows-dots {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.wa-gallery-arrows-dots__row {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.wa-gallery-arrows-dots__row .wa-gallery {
  flex: 1;
  min-width: 0;
  height: 200px;
}

.wa-gallery-arrows-dots__row > .arco-btn {
  flex: 0 0 auto;
}

.wa-gallery-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.wa-gallery-pill {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--color-border-3);
  border-radius: 50%;
  background: var(--color-bg-2);
  cursor: pointer;
  transition: width 0.15s ease, border-radius 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.wa-gallery-pill.is-active {
  width: 20px;
  border-radius: 999px;
  border-color: var(--color-text-1);
  background: var(--color-text-1);
}
