/* 圖片懸停效果 */
.img-hover-card {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 15px;
  line-height: 0;
  font-size: 0;
  vertical-align: middle;
  /* 移除固定高度限制，讓高度由圖片內容決定 */
}

.img-hover-card img {
  width: 100%;           /* 寬度撐滿容器 */
  height: auto;          /* 高度自動依比例，除非有標籤屬性強制指定 */
  display: block;
  margin: 0 !important;
  padding: 0 !important;
}

.img-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 15px;
  text-align: center;
  line-height: 1.5;
  font-size: 1rem;
  pointer-events: none;
  z-index: 2;
}

.img-hover-overlay h3 {
  margin: 0 0 10px 0 !important;
  color: white !important;
  font-size: 1.2em;
  font-weight: bold;
}

.img-hover-overlay p {
  margin: 0 !important;
  color: white !important;
  font-size: 0.9em;
}

.img-hover-card:hover .img-hover-overlay {
  opacity: 1;
}

/* --- 編輯器內部的特別處理 --- */
body[contenteditable="true"] .img-hover-overlay {
    display: none !important;
}

.cke_editable .img-hover-card {
    cursor: pointer;
    outline: none;
}

.cke_editable .img-hover-card:hover,
.cke_editable .img-hover-card:focus {
    outline: 2px solid #007bff;
}
