/* ---------- 页面入口区 ---------- */
.photos {
  padding: clamp(80px, 12vh, 160px) clamp(20px, 5vw, 60px);
  max-width: var(--maxw);
  margin: 0 auto;
}
.photos__head { margin-bottom: 50px; }
.photos__label { font-family: var(--font-en); font-size: 13px; letter-spacing: .3em; color: var(--accent); text-transform: uppercase; }
.photos__head h2 {
  font-size: clamp(30px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  margin-top: 18px;
}
.photos__gallery {
  width: 100%;
  height: 560px;
  margin-top: 20px;
  border-radius: 20px;
  position: relative;
}

@media (max-width: 768px) {
  .photos__gallery {
    height: 420px;
  }
}

/* ---------- CircularGallery (CSS/JS version) ---------- */
.circular-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  background: transparent;
}

.circular-gallery[data-dragging] {
  cursor: grabbing;
}

/* 组件挂到 .photos__gallery 上时必须有确定高度：
   .circular-gallery 的 height:100% 在父级没有固定高度时会塌成 0，
   所有卡片会被 overflow:hidden 裁掉，整个照片区看起来是空白。 */
.photos__gallery.circular-gallery { height: 560px; }

@media (max-width: 768px) {
  .photos__gallery.circular-gallery { height: 420px; }
}

/* Track — holds all cards */
.cg-track {
  position: absolute;
  inset: 0;
  /* 卡片内部 z-index 最高为 1000，限制在轨道层内，不能盖住翻页按钮。 */
  z-index: 0;
  pointer-events: none;
}

/* Individual card */
.cg-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-w, 260px);
  height: var(--card-h, 340px);
  border-radius: 14px;
  overflow: hidden;
  background: #16161a;
  box-shadow: 0 12px 36px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  will-change: transform, opacity;
  pointer-events: auto;
  cursor: pointer;
  transition: filter .45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .45s cubic-bezier(0.16, 1, 0.3, 1);
}

.cg-card--gray {
  filter: grayscale(1) brightness(0.85);
}

/* 缩略图与原图都加载失败（照片已被删除）：立刻隐藏，等待外层重建画廊 */
.cg-card.is-broken {
  display: none !important;
  pointer-events: none;
}

.cg-card:hover,
.cg-card:focus-visible,
.cg-card.is-center {
  filter: grayscale(0) brightness(1) !important;
  box-shadow:
    0 22px 58px rgba(0, 0, 0, .65),
    0 0 0 1px rgba(255, 255, 255, .14),
    0 0 0 1.5px rgba(232, 176, 75, .28);
}

.cg-card__img-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.cg-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.cg-card:hover .cg-card__img {
  transform: scale(1.06);
}

/* Title overlay at bottom of card */
.cg-card__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 14px 12px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.84) 0%,
    rgba(0, 0, 0, 0.38) 65%,
    transparent 100%
  );
  font-family: 'Manrope', 'Noto Sans SC', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  letter-spacing: .02em;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .38s cubic-bezier(0.16, 1, 0.3, 1), transform .38s cubic-bezier(0.16, 1, 0.3, 1);
}

.cg-card:hover .cg-card__title,
.cg-card.is-center .cg-card__title {
  opacity: 1;
  transform: translateY(0);
}

/* Close button */
.cg-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  color: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, background .2s;
  z-index: 10;
}

.cg-close[data-visible] {
  opacity: 0.8;
  pointer-events: auto;
}

.cg-close:hover {
  opacity: 1;
  background: rgba(0,0,0,.6);
}

/* ---------- 左右切换按钮 ---------- */
.cg-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(24, 24, 28, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 32px rgba(0, 0, 0, .55);
  transition: background .32s cubic-bezier(0.16, 1, 0.3, 1), border-color .32s cubic-bezier(0.16, 1, 0.3, 1), color .32s,
              transform .32s cubic-bezier(0.16, 1, 0.3, 1), opacity .3s ease, box-shadow .32s;
}

.cg-nav--prev { left: 22px; }
.cg-nav--next { right: 22px; }

.cg-nav svg { display: block; width: 24px; height: 24px; pointer-events: none; }

/* 视觉圆形之外再留 10px 点击余量，整块区域都交给按钮。 */
.cg-nav::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.cg-nav:hover:not(:disabled) {
  background: rgba(232, 176, 75, .94);
  border-color: rgba(255, 224, 160, 0.9);
  color: #12100c;
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 10px 32px rgba(232, 176, 75, .36), 0 0 0 5px rgba(232, 176, 75, .1);
}

.cg-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(.92);
}

.cg-nav:focus-visible {
  outline: 2px solid rgba(255, 138, 76, .8);
  outline-offset: 4px;
}

.cg-nav:disabled {
  opacity: .3;
  cursor: default;
  box-shadow: none;
}

/* ---------- 页码指示器 ---------- */
.cg-counter {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(20, 20, 24, .66);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: 'Manrope', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .5);
  pointer-events: none;
  user-select: none;
}

.cg-counter__cur {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent, #e8b04b);
  letter-spacing: .04em;
}

.cg-counter__sep { opacity: .5; }

/* ---------- 操作提示 ---------- */
.cg-hint {
  position: absolute;
  right: 22px;
  bottom: 26px;
  z-index: 10;
  font-family: 'Manrope', 'Noto Sans SC', sans-serif;
  font-size: 11px;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .45);
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  .cg-nav { width: 56px; height: 56px; }
  .cg-nav--prev { left: 12px; }
  .cg-nav--next { right: 12px; }
  .cg-counter { bottom: 14px; padding: 7px 14px; }
  .cg-hint { display: none; }
}

/* Edge fade overlay */
.circular-gallery::before,
.circular-gallery::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 5;
  pointer-events: none;
}

.circular-gallery::before {
  left: 0;
  background: linear-gradient(to right, rgba(10,10,11,.5), transparent);
}

.circular-gallery::after {
  right: 0;
  background: linear-gradient(to left, rgba(10,10,11,.5), transparent);
}
