/* 確保 .aaf-bg-fader 本身是相對定位 */
.aaf-bg-fader {
  position: relative;
}

/* 改成絕對填滿父層 */
.aaf-bg-fader-target {
  position: absolute;   /* 改成 absolute */
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -2;  /* 確保在最底層 */
}

/* 背景圖層維持絕對定位、填滿 */
.aaf-fader-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: -1;
}

/* 當切換到 .visible，就顯示該層 */
.aaf-fader-layer.visible {
  opacity: 1;
  z-index: -1;
}

/* 只要某個 section 帶 .aaf-bg-fader，就把它的背景清除 */
.et_pb_section.aaf-bg-fader {
  background-color: transparent !important;
  background-image: none !important;
}

/* 確保文字內容在最上層 */
.et_pb_text_inner {
  position: relative;
  z-index: 2;
}

/* 確保所有內容元素在背景層之上 */
.et_pb_row,
.et_pb_column,
.et_pb_module {
  position: relative;
  z-index: 1;
}
