/* assets/fluid/media/media.css — 模块 A 渐进图占位与可打断 FLIP 灯箱样式 */

/* 1. ThumbHash 与异步解码渐进图（保证 CLS = 0） */
img[data-fluid-media="pending"] {
  opacity: 0.92;
  filter: blur(8px);
  transform: scale(1.015);
  transition: opacity 0.36s ease, filter 0.42s ease, transform 0.42s ease;
}

img[data-fluid-media="loaded"] {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity 0.36s ease, filter 0.42s ease, transform 0.42s ease;
}

html[data-fluid-reduced-motion="true"] img[data-fluid-media] {
  filter: none !important;
  transform: none !important;
  transition: none !important;
}

.post-content img:not(.avatar):not(.emoji):not(.wp-smiley):not(.no-fluid-lightbox),
.entry-content img:not(.avatar):not(.emoji):not(.wp-smiley):not(.no-fluid-lightbox) {
  cursor: zoom-in;
}

/* 2. 全链路可打断弹簧 FLIP 大图灯箱 */
.fluid-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
}

.fluid-lightbox.is-open {
  display: block;
}

html.fluid-lightbox-active {
  overscroll-behavior: none;
}

.fluid-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.86);
  opacity: 0;
  will-change: opacity;
}

html.darkmode .fluid-lightbox__backdrop {
  background: rgba(5, 6, 10, 0.9);
}

.fluid-lightbox__hud {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.fluid-lightbox__counter {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.92);
  background: #12141c;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.fluid-lightbox__counter:empty {
  visibility: hidden;
  padding: 0;
  border: 0;
  background: transparent;
}

.fluid-lightbox__btn,
.fluid-lightbox__nav {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #12141c;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.4), background-color 0.15s ease;
}

.fluid-lightbox__btn:hover,
.fluid-lightbox__nav:hover {
  background: color-mix(in srgb, var(--themecolor, #fa7298) 42%, #12141c);
}

.fluid-lightbox__btn:active,
.fluid-lightbox__nav:active {
  transform: scale(0.92);
}

.fluid-lightbox__btn:focus-visible,
.fluid-lightbox__nav:focus-visible {
  outline: 2px solid var(--themecolor, #fa7298);
  outline-offset: 2px;
}

.fluid-lightbox__close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 15px;
}

.fluid-lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  will-change: opacity;
}

.fluid-lightbox__nav:disabled {
  pointer-events: none;
}

.fluid-lightbox__prev {
  left: 18px;
}

.fluid-lightbox__next {
  right: 18px;
}

.fluid-lightbox__img {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  object-fit: contain;
  cursor: grab;
  will-change: transform;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

.fluid-lightbox__img:active {
  cursor: grabbing;
}

.fluid-lightbox__caption {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 3;
  max-width: min(86vw, 680px);
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
  background: #12141c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.fluid-lightbox__caption:empty {
  display: none;
}

@media (max-width: 640px) {
  .fluid-lightbox__nav {
    width: 36px;
    height: 36px;
    margin-top: -18px;
  }
  .fluid-lightbox__prev {
    left: 10px;
  }
  .fluid-lightbox__next {
    right: 10px;
  }
}

