/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ===== Tiptap (ProseMirror) エディタスタイル ===== */

/* エディタの基本スタイル */
.tiptap-editor {
  outline: none;
  cursor: text;
}

.tiptap-editor:focus {
  outline: none;
}

/* プレースホルダー */
.tiptap-editor p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
  font-style: italic;
}

/* 見出し */
.tiptap-editor h1 {
  font-size: 1.5em;
  font-weight: 700;
  color: #1f2937;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.3em;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.tiptap-editor h2 {
  font-size: 1.25em;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.2em;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
}

.tiptap-editor h3 {
  font-size: 1.1em;
  font-weight: 600;
  color: #4b5563;
  margin-top: 1em;
  margin-bottom: 0.4em;
}

/* ハイライト */
.tiptap-editor mark {
  background-color: #fef08a;
  padding: 0.1em 0.2em;
  border-radius: 0.2em;
}

/* 引用 */
.tiptap-editor blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 1em;
  margin: 1em 0;
  color: #6b7280;
  font-style: italic;
}

/* コードブロック */
.tiptap-editor pre {
  background-color: #1f2937;
  color: #e5e7eb;
  padding: 0.75em 1em;
  border-radius: 0.5em;
  overflow-x: auto;
  margin: 1em 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  line-height: 1.6;
}

.tiptap-editor pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* インラインコード */
.tiptap-editor code {
  background-color: #f3f4f6;
  color: #ef4444;
  padding: 0.15em 0.4em;
  border-radius: 0.25em;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* リスト */
.tiptap-editor ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.tiptap-editor ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.tiptap-editor li {
  margin: 0.25em 0;
}

.tiptap-editor li p {
  margin: 0;
}

/* タスクリスト */
.tiptap-editor ul[data-type="taskList"] {
  list-style-type: none;
  padding-left: 0;
}

.tiptap-editor ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
  margin: 0.35em 0;
}

.tiptap-editor ul[data-type="taskList"] li > label {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 0.15em;
}

.tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"] {
  cursor: pointer;
  width: 1em;
  height: 1em;
  accent-color: #4f46e5;
}

.tiptap-editor ul[data-type="taskList"] li > div {
  flex: 1;
  min-width: 0;
}

.tiptap-editor ul[data-type="taskList"] li[data-checked="true"] > div p {
  text-decoration: line-through;
  color: #9ca3af;
}

/* 水平線 */
.tiptap-editor hr {
  border: none;
  border-top: 2px solid #e5e7eb;
  margin: 1.5em 0;
}

/* 段落 */
.tiptap-editor p {
  margin: 0.5em 0;
}

.tiptap-editor p:first-child {
  margin-top: 0;
}

/* 取り消し線 */
.tiptap-editor s {
  text-decoration: line-through;
  color: #9ca3af;
}

/* 太字・斜体 */
.tiptap-editor strong {
  font-weight: 700;
}

.tiptap-editor em {
  font-style: italic;
}

/* 下線 */
.tiptap-editor u {
  text-decoration: underline;
}

/* リンク */
.tiptap-editor a {
  color: #4f46e5;
  text-decoration: underline;
}

.tiptap-editor a:hover {
  color: #4338ca;
}
