/* LiteEditor Core Styles - 에디터 핵심 스타일 */

/* 기본 레이아웃 구조 */
.lite-editor {
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Ensure nothing spills outside the editor */
}

/* 분리 모드: 독립 툴바 스타일 */
.lite-editor-toolbar:not(.lite-editor .lite-editor-toolbar) {
  border: 1px solid #ddd;
  border-radius: 4px 4px 0 0;
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 분리 모드: 독립 콘텐츠 영역 스타일 */
.lite-editor-content:not(.lite-editor .lite-editor-content) {
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 툴바 기본 구조 */
.lite-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap; /* Changed from wrap to nowrap to prevent wrapping */
  min-height: 36px;
  padding: 4px 6px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  overflow: hidden; /* Hide overflowing content instead of scrolling */
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap; /* Prevent items from wrapping */
}

/* 툴바 구분선 */
.lite-editor-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background-color: #e0e0e0;
  flex-shrink: 0; /* Prevent dividers from shrinking */
}

/* 컨텐츠 영역 기본 구조 */
.lite-editor-content {
  padding: 15px;
  min-height: 120px;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  overflow: auto; /* Enable scrolling in all directions */
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  max-height: 100%; /* Respect the container's height */
}

/* 플레이스홀더 */
.lite-editor-content:empty:before {
  content: attr(data-placeholder);
  color: #aaa;
  pointer-events: none;
}

/* 선택 영역 스타일 */
.lite-editor-content ::selection {
  background: rgba(0, 120, 215, 0.4) !important;
  color: inherit !important;
}

/* 기본 타이포그래피 - 헤딩 */
.lite-editor-content h1, 
.lite-editor-content h2, 
.lite-editor-content h3, 
.lite-editor-content h4, 
.lite-editor-content h5, 
.lite-editor-content h6 {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  font-weight: 600;
  line-height: 1.3;
}

.lite-editor-content h1 { font-size: 2.2em; }
.lite-editor-content h2 { font-size: 1.5em; }
.lite-editor-content h3 { font-size: 1.17em; }
.lite-editor-content h4 { font-size: 1em; }
.lite-editor-content h5 { font-size: 0.83em; }
.lite-editor-content h6 { font-size: 0.67em; }

/* 기본 타이포그래피 - 문단 */
.lite-editor-content p {
  margin-top: 0;
  margin-bottom: 0.85em;
}

/* 기본 타이포그래피 - 인용구 */
.lite-editor-content blockquote {
  /* p-3: padding 0.75rem (12px) */
  padding: 8px;
  
  /* bg-blue-50: 연한 파란색 배경 */
  background-color: #eff6ff;
  
  /* border-l-4: 왼쪽 테두리 4px */
  border-left-width: 4px;
  
  /* border-blue-500: 파란색 테두리 */
  border-left-color: #3b82f6;
  
  /* text-gray-700: 진한 회색 텍스트 */
  color: #374151;
  
  /* mb-4: 하단 마진 1rem (16px) */
  margin-bottom: 1rem;
}

/* 기본 타이포그래피 - 코드 블록 */
.lite-editor-content pre {
  background-color: #f6f8fa;
  border-radius: 3px;
  padding: 16px;
  overflow: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 85%;
  line-height: 1.45;
  margin-bottom: 1em;
}

/* 기본 타이포그래피 - 인라인 코드 */
.lite-editor-content code {
  background-color:#e8e8e8;
  border-radius: 3px;
  font-size: 95%;
  margin: 0;
  padding: 5px 10px;
  white-space: pre-wrap;
  display: inline-block;
  text-indent: 0;
}

/* 여러 줄 코드 블록 처리 */
.lite-editor-content code:has(br) {
  display: block;
  padding: 8px;
  line-height: 1.2;
}

/* 기본 타이포그래피 - 목록 */
.lite-editor-content ul, 
.lite-editor-content ol {
  margin-top: 0;
  margin-bottom: 0.2em;
  padding-left: 2em;
}

.lite-editor-content li + li {
  margin-top: 0.25em;
}

/* 기본 타이포그래피 - 링크 */
.lite-editor-content a {
  color: #0366d6;
  text-decoration: none;
}

.lite-editor-content a:hover {
  text-decoration: underline;
}

/* 기본 타이포그래피 - 테이블 */
.lite-editor-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}

.lite-editor-content table th,
.lite-editor-content table td {
  border: 1px solid #ddd;
  padding: 6px 13px;
}

.lite-editor-content table th {
  background-color: #f6f8fa;
  font-weight: 600;
}

/* 기본 타이포그래피 - 이미지 */
.lite-editor-content img {
  max-width: 100%;
  height: auto;
}
