/* ─────────────────────────────────────────────
   설교 본문 인라인 편집기 스타일
   - 모든 설교 페이지에 공유됨
   ───────────────────────────────────────────── */

/* 편집 토글 버튼 — 좌측 펜·폰트 도구 아래 */
.edit-toggle {
  position: fixed;
  top: calc(50% + 130px);
  left: 24px;
  z-index: 600;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #D5DCE8;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  transition: all 0.2s;
  flex-shrink: 0;
}
.edit-toggle:hover {
  border-color: #C9A84C;
}
.edit-toggle.active {
  background: #C9A84C;
  border-color: #C9A84C;
  color: white;
  box-shadow: 0 0 0 4px rgba(201,168,76,0.22), 0 4px 24px rgba(0,0,0,0.18);
}

/* 편집 모드: 본문 요소에 hover 시 점선, focus 시 골드 outline */
body.edit-mode #editable-region * {
  cursor: text;
}
body.edit-mode #editable-region .sermon-p:hover,
body.edit-mode #editable-region .sermon-section-label:hover,
body.edit-mode #editable-region .audience-question:hover,
body.edit-mode #editable-region .proclamation:hover,
body.edit-mode #editable-region .sermon-verse:hover,
body.edit-mode #editable-region .greek-note:hover,
body.edit-mode #editable-region .illust-box:hover,
body.edit-mode #editable-region .midpoint-box:hover,
body.edit-mode #editable-region .highlight-box:hover,
body.edit-mode #editable-region .sermon-transition:hover {
  outline: 1px dashed #7B9BC0;
  outline-offset: 4px;
}
body.edit-mode #editable-region:focus,
body.edit-mode #editable-region [contenteditable="true"]:focus,
body.edit-mode #editable-region *:focus {
  outline-color: #C9A84C !important;
}

/* 편집 모드: 펜·인디케이터·탭 등은 비활성화 */
body.edit-mode .pen-toolbar { opacity: 0.3; pointer-events: none; }
body.edit-mode .sidebar-item { pointer-events: none; opacity: 0.5; }

/* ── 도구 모음 — 화면 하단 중앙 ── */
.editor-toolbar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: white;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.06);
  z-index: 700;
  padding: 10px 12px;
  display: flex;
  align-items: stretch;
  gap: 6px;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  transition: opacity 0.2s, transform 0.25s;
  font-family: 'Noto Sans KR', sans-serif;
}
.editor-toolbar.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.editor-toolbar .ed-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border-right: 1px solid #E0E0E0;
}
.editor-toolbar .ed-group:last-child {
  border-right: none;
}
.editor-toolbar .ed-group-label {
  font-size: 10px;
  color: #999;
  font-weight: 700;
  margin-right: 4px;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.editor-btn {
  background: #F7F5F0;
  border: 1px solid #D5DCE8;
  color: #2C3E6B;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.editor-btn:hover {
  background: #EEF2F8;
  border-color: #7B9BC0;
}
.editor-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.editor-btn.primary {
  background: #2C3E6B;
  color: white;
  border-color: #2C3E6B;
}
.editor-btn.primary:hover {
  background: #1a2a4a;
}
.editor-btn.gold {
  background: #C9A84C;
  color: white;
  border-color: #C9A84C;
}
.editor-btn.gold:hover {
  background: #B0922F;
}
.editor-btn.cancel {
  background: white;
  color: #999;
  border-color: #DDD;
}

/* 도구 모음 도움말 — 버튼 위에 작은 툴팁 */
.editor-btn[data-tooltip] { position: relative; }
.editor-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2A2A2A;
  color: white;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-bottom: 8px;
  z-index: 1000;
  pointer-events: none;
}

/* 저장 상태 표시 */
.editor-status {
  font-size: 12px;
  color: #999;
  padding: 0 8px;
  align-self: center;
  white-space: nowrap;
}
.editor-status.success { color: #1A4731; }
.editor-status.error { color: #B00020; }

@media (max-width: 768px) {
  .editor-toolbar {
    padding: 8px 10px;
    bottom: 8px;
    gap: 4px;
  }
  .editor-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .editor-toolbar .ed-group { padding: 0 3px; gap: 3px; }
  .editor-toolbar .ed-group-label { display: none; }
  .edit-toggle {
    top: auto;
    bottom: 16px;
    left: 16px;
  }
}

/* 인쇄 시 편집 도구 숨김 */
@media print {
  .edit-toggle { display: none !important; }
  .editor-toolbar { display: none !important; }
}
