@charset "utf-8";

/* 解決 Modal 開啟時頁面晃動問題 */
body.modal-open {
    padding-right: 0 !important;
    overflow-y: scroll !important; /* 強制保留垂直卷軸 */
}

/* 如果您的導覽列或頁首有 fixed 定位，也需要修正 */
.fixed-top, .fixed-bottom, .sticky-top {
    padding-right: 0 !important; 
    margin-right: 0 !important;
}

.c-pointer{ cursor:pointer;}
.edit {
width:18px!important;
height:auto!important;
	opacity:0.5;
	position:absolute;
	cursor:pointer;
	z-index:1000;
	pointer-events:none
}

/* === 修正 Summernote 編輯器樣式 === */

/* 1. 隱藏 Summernote 自動產生的圖片縮放控制項 */
/* 這層如果不隱藏，會擋住圖片，導致您的 click 事件無法觸發 */
.note-control-selection {
    display: none !important;
}
.note-editable *:not(img):not(br):not(hr):not(i):not([class*="fa-"]):not(.has-img-content):where(:empty, :has(> br:only-child)) {

    min-width: 5px;
    min-height: 5px;
    display: inline-block;
    vertical-align: middle;
}

/* 針對區塊元素的還原設定 */
.note-editable :is(div, p, h1, h2, h3, h4, h5, h6, li):not(.has-img-content):where(:empty, :has(> br:only-child)) {
    display: block;
    min-height: 1.5em;
}
/* 2. 讓編輯中的圖片和連結顯示為「可點擊」的手指游標 */
.note-editable a:not([data-bs-toggle="tab"]):not([data-bs-toggle="pill"]):not([data-bs-toggle="collapse"]):not(.nav-link) {
    cursor: pointer !important;
    position: relative;
    z-index: 10; 
    pointer-events: auto !important; 
}

.note-editable a[data-bs-toggle="tab"], 
.note-editable a[data-bs-toggle="pill"],
.note-editable a[data-bs-toggle="collapse"],
.note-editable .nav-link {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: auto !important; /* 讓 Bootstrap 決定層級 */
}

.nav-pills .nav-link, 
.nav-tabs .nav-link {
    position: relative; 
    z-index: 20 !important; /* 確保高於一般文字連結 */
}

/* 設定滑鼠游標：讓使用者知道這裡可以編輯 */
/* 針對 .ratio (BS5影片) 與 .VideoBackground (您的Vimeo遮罩) */

.note-editable .VideoBackground {
pointer-events: auto!important;
cursor: pointer;
}

.note-editable .ratio {
    /* 編輯時，讓遮罩層恢復感應滑鼠，這樣才能點擊觸發編輯視窗 */
    pointer-events: auto; 
    cursor: pointer;
}


/* 確保編輯器內的 iframe 絕對不會搶走滑鼠事件 (雙重保險) */
.note-editable iframe {
    pointer-events: none !important;
}



/* 當區塊被 JS 標記為 "is-empty-block" 時 */
.note-editable .is-empty-block {
    border-left: 1px dotted #eeeeee;
}


.note-editable img {
cursor: pointer !important;
    pointer-events: auto !important; 
	
	}

.note-editable p > a {
	color: var(--link-color) !important;
	text-decoration: var(--link-decoration) !important;
	transition: all 0.3s ease !important;
}

.note-editable p > a:hover {
	color: var(--link-hover-color) !important;
	text-decoration: var(--link-hover-decoration) !important;

}



.note-editable h1, .note-editable h2, .note-editable h3, .note-editable h4, .note-editable h5, .note-editable h6, .note-editable li, .note-editable p,.note-editable img, .note-editable span,.note-editable small,.note-editable font,.note-editable a,.note-editable button,.note-editable strong,.note-editable b,.note-editable i,.note-editable u,.note-editable s{
position:relative;
z-index: 3;
}

/* 3. 強制繼承樣式 (防止字體跑版，這段您之前應該有) */
.note-editable {
    font-family: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
    background: transparent !important;
}



/* 4. 編輯區塊提示框 (讓使用者知道範圍) */
.editable-section.is-editing {
   outline: 2px dashed #339933;
    min-height: 50px;	
	margin:1px;
	background:#FAFAFA!important;
}

.editable-section.is-editing .col-card {/*可以移動的col*/
    position: relative;
}

.sectionstyle .dropdown-menu {
    top: 100% !important;   /* 強制出現在按鈕下方 */
    bottom: auto !important; /* 禁用向上彈出的定位 */
    transform: none !important; /* 禁用 Popper 的 translate 計算 */
    margin-top: 5px !important;
}

/* 確保選單在縮放模式下不會跑位 */
#html-canvas.zoom-out-mode .sectionstyle .dropdown-menu {
    position: absolute !important;
}
.img-container {
    max-height: 400px; /* 限制剪裁區高度 */
    width: 100%;
    background-color: #f7f7f7;
    text-align: center;
    overflow: hidden; /* 防止圖片溢出 */
}

/* 確保圖片在容器內最大化顯示 */
.img-container img {
    max-width: 100%;
    display: block; /* 這是 Cropper.js 要求的 */
}




#crop-wrapper.img-container {
    /* 固定高度，確保 Modal 不會跳動 */
    /* 如果 HTML style 裡有寫 height，這裡可以不用寫，或是用 !important 覆蓋 */
    height: 300px; 
    
    width: 100%;
    overflow: hidden; /* 隱藏溢出的卷軸 */
    
    /* 建議改用深色背景，剪裁時對比度較好 */
    background-color: #333; 
}

/* 2. 原始圖片 (在 Cropper 初始化前) */
#image-to-crop {
    /* 關鍵：限制圖片最大高度與寬度，才不會撐爆容器 */
    max-width: 100%;
	width: 100%;
    max-height: 100%;
    display: block; 
}



/* 3. Cropper 容器置中修正 */
/* 這是 Cropper.js 生成的 DOM，確保它由 Flexbox 控制 */
.cropper-container {
    margin: auto;
}


/* === 新增：Icon 選擇器樣式 === */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.icon-option:hover {
    background-color: #e9ecef;
    border-color: #0d6efd;
    color: #0d6efd;
    transform: translateY(-2px);
}

.icon-option i {
    font-size: 24px;
    margin-bottom: 5px;
}

.icon-option span {
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 讓目前選中的 Icon 有不同樣式 */
.icon-option.active {
    background-color: #cfe2ff;
    border-color: #0d6efd;
    color: #0d6efd;
}

.handle { cursor: move; } /* 拖曳手把 */

        /* 新增區塊按鈕 */
        .add-block-area {
            border: 2px dashed #ccc;
            padding: 30px;
            text-align: center;
            margin: 20px;
            cursor: pointer;
            border-radius: 10px;
            background: rgba(255,255,255,0.5);
            transition: 0.3s;
        }
        .add-block-area:hover { background: #e9ecef; border-color: #0d6efd; }/**/
		
		/* 樣板挑選器專用樣式 */
.folder-card {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}
.folder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    border-color: #0d6efd;
}
.folder-label {
    background: rgba(0,0,0,0.03);
    border-top: 1px solid #eee;
}
.folder-icon {
    font-size: 3rem;
    color: #ffca28; /* 資料夾黃色 */
    margin-bottom: 10px;
}

#codeEditModal .CodeMirror {
    height: 65vh !important; /* 設定為視窗高度的 65% */
    font-size: 14px;
    border: 1px solid #444;
}
#codeEditorArea{
height:65vh;
width:100%;
}
/* =========================================

   全頁縮放拖曳 - (完美對齊版)

   ========================================= */



.zoom-out-mode {
   
    transform: scale(0.3); /* 縮小 50%，總覽視角 */
    transform-origin: top center; /* 錨點設為上方置中 */
    width: 200% !important;/* 寬度變兩倍以填滿畫面 */
    margin-left: -50%; /* 修正置中後的左側偏移 */
    padding-bottom: 200px;/* 底部多留空間 */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* 平滑過渡動畫 */
    background: #fff;
    z-index: 10;
}



/* 拖曳時背景變深色 */
body.is-dragging-zoom {
    background-color: #666 !important; 
    overflow-x: hidden; 
    cursor: move !important;     
}

.sortable-fallback {
    position: fixed !important;
    /* 設定位置為滑鼠座標 */
    top: var(--cursor-y) !important;
    left: var(--cursor-x) !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999;
    display: block;
    margin: 0 !important; 
    /* 讓滑鼠點擊穿透卡片，確保感應到底下的放置區 */
    pointer-events: none; 
}



.sortable-fallback > * { display: none !important; }/* 隱藏替身內原本的複雜 HTML */



/* 2. 放置目標 */

.sortable-ghost {

    opacity: 1 !important;

    background-color: rgba(0, 0, 0, 0.2) !important; /* 半透明黑 */

    margin: 20px 0;

    visibility: visible !important;

    overflow: hidden;   

}



/* 3. 背景原本的區塊 */

.zoom-out-mode .editable-section {
    opacity: 0.8; /* 稍微變淡 */
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}



section[data-id] {
    position: relative;
    z-index: 1;
    overflow: hidden; /* 確保遮罩與背景不會溢出圓角或邊界 */
}

/* 遮罩層：同樣針對 section[data-id] 的偽元素 */
section[data-id]::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; /* 確保在背景圖之上，但在內容文字之下 */
    pointer-events: none;
    
    /* 接收來自 JSON 設定的 CSS 變數 */
    background-color: var(--ol-color, transparent);
    opacity: var(--ol-opacity, 0);
    transition: opacity 0.3s, background-color 0.3s;
}


/* 隱藏下拉箭頭 */
.no-caret::after { display: none !important; }

/* 樣式面板本體：移除所有 hover 自動顯示的邏輯 */
.style-popover-panel {
    /* 核心 Flex 佈局 */
    display: none;             /* 由 Bootstrap 控制顯示 */
    flex-direction: column;
    
    /* 尺寸與定位 */
    width: 250px;
    max-height: 350px;
    margin-top: 10px !important; /* 與按鈕保持一點距離，避免太擠 */
    
    /* 視覺樣式 */
    padding: 0 !important;
    border: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25) !important;
    overflow: hidden;
}

/* 當 Bootstrap 激活時強制轉為 flex */
.style-popover-panel.show {
    display: flex !important;
}

/* 捲動主體 */
.style-popover-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    scrollbar-width: thin;
    background: #fff;
}

/* 固定底部腳部 */
.style-popover-footer {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

/* 捲軸美化 */
.style-popover-body::-webkit-scrollbar { width: 6px; }
.style-popover-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/*編輯home相關欄位*/

[id^="home_"] {
    transition: all 0.2s;
}
/* 滑鼠移入時顯示黃色虛線，提示可點擊 */
[id^="home_"]:hover {
    outline: 1px dashed #ffc107 !important;
    outline-offset: 2px;
    cursor: text;
}
/* 針對超連結圖示，游標改為 pointer */
a[id^="home_"]:hover {
    cursor: pointer;
}
/* 正在打字編輯時的藍色聚焦框 */
[id^="home_"][contenteditable="true"]:focus {
    outline: 1px solid #0d6efd !important;
    outline-offset: 2px;    
}

/* 讓 home_ 開頭的圖片滑鼠移過去有編輯提示 */
img[id^="home_"] {transition: all 0.2s;}
img[id^="home_"]:hover {
        opacity: 0.7;
        outline: 1px dashed #ffc107;
        cursor: pointer;
    }

/* Meta 編輯專用視覺樣式 */
.meta-edit-text {
    transition: all 0.2s;
    min-height: 38px;
}
.meta-edit-text:hover {
    outline: 1px dashed #ffc107 !important;
    cursor: text;
    background-color: #ffffff !important;
}
.meta-edit-text[contenteditable="true"] {
    outline: 1px solid #0d6efd !important;
    background-color: #ffffff !important;
}
.meta-edit-img:hover {
    opacity: 0.8;
    outline: 1px dashed #ffc107;
}