/**
 * Alpha 特色文字＆向量圖（效能＋混和＋位置＋描邊）
 */
.alpha-ftv {
  --alpha-ftv-gap: 0.08em;
  --alpha-ftv-size: 72px;
  --alpha-ftv-weight: 700;
  --alpha-ftv-style: normal;
  --alpha-ftv-ls: 0;
  --alpha-ftv-lh: 1.1;
  --alpha-ftv-blend: normal;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: var(--alpha-ftv-justify, flex-start);
  gap: var(--alpha-ftv-gap);
  font-family: var(--alpha-ftv-font, inherit);
  font-size: var(--alpha-ftv-size) !important; /* 壓過主題 h1–h6；實際值由 Elementor 響應式覆寫 */
  font-weight: var(--alpha-ftv-weight);
  font-style: var(--alpha-ftv-style);
  letter-spacing: var(--alpha-ftv-ls);
  line-height: var(--alpha-ftv-lh);
  max-width: 100%;
  /* 位移用的單元可超出；避免裁切 */
  overflow: visible;
  contain: layout style;
}

/* 未設個別字級的單元：吃整體字級 */
.alpha-ftv__char:not([data-ftv-own-size]) {
  font-size: 1em;
}

.alpha-ftv__svg:not([data-ftv-own-size]) {
  width: 1em;
  height: 1em;
}

.alpha-ftv__unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
  mix-blend-mode: var(--alpha-ftv-unit-blend, var(--alpha-ftv-blend, normal));
  isolation: isolate;
  /* X / Y：響應式 CSS 變數（Elementor 各斷點覆寫 --alpha-ftv-tx / ty） */
  --alpha-ftv-tx: 0px;
  --alpha-ftv-ty: 0px;
  --alpha-ftv-z: auto;
  transform: translate3d(var(--alpha-ftv-tx), var(--alpha-ftv-ty), 0);
  z-index: var(--alpha-ftv-z);
}

/* 文字單元 */
.alpha-ftv__char {
  display: inline-block;
  white-space: pre;
  font-family: var(--alpha-ftv-unit-font, inherit);
  font-weight: var(--alpha-ftv-unit-weight, inherit);
  font-style: var(--alpha-ftv-unit-style, inherit);
  font-size: var(--alpha-ftv-unit-size, inherit);
  line-height: inherit;
  letter-spacing: inherit;
}

/* 無填充：繼承／透明描邊可另加 */
.alpha-ftv__char.is-none {
  color: inherit;
  -webkit-text-fill-color: currentColor;
  background: none;
}

/* 純色字 */
.alpha-ftv__char.is-solid {
  color: var(--alpha-ftv-fill, currentColor);
  -webkit-text-fill-color: var(--alpha-ftv-fill, currentColor);
  background: none;
}

/* 漸層／圖片填字 */
.alpha-ftv__char.is-clip {
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  background-image: var(--alpha-ftv-fill-image, none);
  background-size: var(--alpha-ftv-fill-size, cover);
  background-position: var(--alpha-ftv-fill-pos, center);
  background-repeat: var(--alpha-ftv-fill-repeat, no-repeat);
  -webkit-background-clip: text;
  background-clip: text;
  transform: translateZ(0);
}

/* 字邊框（描邊）— 與 clip 可並用 */
.alpha-ftv__char.is-stroke {
  -webkit-text-stroke-width: var(--alpha-ftv-stroke-w, 1px);
  -webkit-text-stroke-color: var(--alpha-ftv-stroke-c, #000);
  paint-order: stroke fill;
}

/* clip + stroke：描邊仍可見 */
.alpha-ftv__char.is-clip.is-stroke {
  /* 保留透明 fill；stroke 走 webkit-text-stroke */
  paint-order: stroke fill;
}

/* 向量圖 */
.alpha-ftv__svg {
  display: inline-flex;
  width: var(--alpha-ftv-unit-size, 1em);
  height: var(--alpha-ftv-unit-size, 1em);
  line-height: 0;
}

.alpha-ftv__svg svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.alpha-ftv__svg.is-none svg,
.alpha-ftv__svg.is-none svg * {
  fill: currentColor;
}

.alpha-ftv__svg.is-solid svg,
.alpha-ftv__svg.is-solid svg path,
.alpha-ftv__svg.is-solid svg circle,
.alpha-ftv__svg.is-solid svg rect,
.alpha-ftv__svg.is-solid svg polygon,
.alpha-ftv__svg.is-solid svg ellipse {
  fill: var(--alpha-ftv-fill, currentColor);
}

/* 整段文字 */
.alpha-ftv.is-whole {
  display: block;
  contain: none;
}

.alpha-ftv__whole-text {
  display: inline-block;
  white-space: pre-wrap;
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  mix-blend-mode: var(--alpha-ftv-blend, normal);
}

.alpha-ftv__whole-text.is-none {
  color: inherit;
}

.alpha-ftv__whole-text.is-solid {
  color: var(--alpha-ftv-fill, currentColor);
}

.alpha-ftv__whole-text.is-clip {
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  background-image: var(--alpha-ftv-fill-image, none);
  background-size: var(--alpha-ftv-fill-size, cover);
  background-position: var(--alpha-ftv-fill-pos, center);
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
}

/* 語義標籤重置 margin（h1–h6/p）— 不可覆蓋 font-size（否則整體字級失效） */
.alpha-ftv--tag {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: var(--alpha-ftv-size, 1em);
  font-weight: var(--alpha-ftv-weight, inherit);
  font-style: var(--alpha-ftv-style, inherit);
  line-height: var(--alpha-ftv-lh, 1.1);
}

.alpha-ftv-editor-hint {
  padding: 16px;
  border: 2px dashed #ccc;
  background: #fafafa;
  color: #666;
  font-size: 13px;
  text-align: center;
}

/* 減少 will-change 常駐（僅位移非 0 時有感；簡化維持 transform 即可） */
@media (prefers-reduced-motion: reduce) {
  .alpha-ftv__unit {
    will-change: auto;
  }
}
