/* TipTap prose-mirror-detail Styles - Global CSS */
.prose-mirror-detail {
	color: #374151;
	max-width: none;
	font-size: 14px;
}

.editor-content .ProseMirror {
	font-size: 16px;
}

/* Hide featured images in TipTap editor to avoid duplication with thumbnail */
.ProseMirror img.featured-img {
  display: none;
}

/* Show featured images in preview/display mode */
.article-content img.featured-img,
.prose img.featured-img {
  display: block;
  max-width: 100%;
  height: auto;
}

.blog-detail .prose-mirror-detail {
	font-size: 16px;
	font-weight: normal;
}

/* Task list styles */
.prose-mirror-detail ul[data-type='taskList'] {
	list-style: none;
	padding: 0;
}

.prose-mirror-detail ul[data-type='taskList'] p {
	margin: 0;
}

.prose-mirror-detail ul[data-type='taskList'] li {
	display: flex;
	align-items: flex-start;
}

.prose-mirror-detail ul[data-type='taskList'] li > label {
	flex: 0 0 auto;
	margin-right: 0.5rem;
	user-select: none;
}

.prose-mirror-detail ul[data-type='taskList'] li > div {
	flex: 1 1 auto;
}

.prose-mirror-detail ul[data-type='taskList'] input[type='checkbox'] {
	cursor: pointer;
}

.prose-mirror-detail ul[data-type='taskList'] li[data-checked='true'] > div {
	opacity: 0.6;
	text-decoration: line-through;
}

/* Code block styles */
.prose-mirror-detail .code-block {
	background: #1f2937;
	border-radius: 0.5rem;
	color: #f9fafb;
	font-family: 'JetBrainsMono', 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
	padding: 0.75rem 1rem;
	white-space: pre-wrap;
	margin: 1rem 0;
	overflow-x: auto;
}

.prose-mirror-detail .code-block code {
	background: none;
	color: inherit;
	font-size: 0.875rem;
	padding: 0;
}

.prose-mirror-detail pre.code-block {
	background: #1f2937;
	border-radius: 0.5rem;
	color: #f9fafb;
	font-family: 'JetBrainsMono', 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
	padding: 0.75rem 1rem;
	white-space: pre-wrap;
	margin: 1rem 0;
	overflow-x: auto;
}

/* Placeholder styles */
.prose-mirror-detail p.is-editor-empty:first-child::before {
	color: #adb5bd;
	content: attr(data-placeholder);
	float: left;
	height: 0;
	pointer-events: none;
}

/* Focus styles */
.prose-mirror-detail-focused {
	outline: none;
}

/* Image styles with resize functionality */
.prose-mirror-detail img {
	max-width: 100%;
	height: auto;
	border-radius: 0.5rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.prose-mirror-detail img:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.prose-mirror-detail img.prose-mirror-detail-selectednode {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
	resize: both;
	overflow: hidden;
}

/* Hide featured image in TipTap editor */
.prose-mirror-detail img.featured-img {
	display: none;
}

/* Image resize handles */
.prose-mirror-detail img.resize-image {
	resize: both;
	overflow: hidden;
	min-width: 50px;
	min-height: 50px;
}

/* Link styles */
.prose-mirror-detail a {
	color: #3b82f6;
	text-decoration: underline;
}

.prose-mirror-detail a:hover {
	color: #1d4ed8;
}

/* Blockquote styles */
.prose-mirror-detail blockquote {
	border-left: 4px solid #e5e7eb;
	margin: 1.5rem 0;
	padding-left: 1rem;
	font-style: italic;
	color: #6b7280;
}

/* Horizontal rule styles */
.prose-mirror-detail hr {
	border: none;
	border-top: 2px solid #e5e7eb;
	margin: 2rem 0;
}

/* Inline code styles */
.prose-mirror-detail code {
	background: #f3f4f6;
	border-radius: 0.25rem;
	color: #dc2626;
	font-family: 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
	font-size: 0.875em;
	padding: 0.125rem 0.25rem;
}

/* Heading styles */
.prose-mirror-detail h1 {
	font-size: 2.25rem;
	font-weight: bold;
	line-height: 1.2;
	margin: 1.5rem 0 1rem 0;
}

.prose-mirror-detail h2 {
	font-size: 1.875rem;
	font-weight: bold;
	line-height: 1.3;
	margin: 1.25rem 0 0.75rem 0;
}

.prose-mirror-detail h3 {
	font-size: 1.5rem;
	font-weight: bold;
	line-height: 1.4;
	margin: 1rem 0 0.5rem 0;
}

.prose-mirror-detail h4 {
	font-size: 1.25rem;
	font-weight: bold;
	line-height: 1.4;
	margin: 0.75rem 0 0.5rem 0;
}

.prose-mirror-detail h5 {
	font-size: 1.125rem;
	font-weight: bold;
	line-height: 1.4;
	margin: 0.75rem 0 0.5rem 0;
}

.prose-mirror-detail h6 {
	font-size: 1rem;
	font-weight: bold;
	line-height: 1.4;
	margin: 0.75rem 0 0.5rem 0;
}

/* List styles */
.prose-mirror-detail ul {
	list-style-type: disc;
	margin: 1rem 0;
	padding-left: 1.5rem;
}

.prose-mirror-detail ol {
	list-style-type: decimal;
	margin: 1rem 0;
	padding-left: 1.5rem;
}

.prose-mirror-detail li {
	margin: 0.25rem 0;
}

.prose-mirror-detail li p {
	margin: 0;
}

/* Paragraph styles */
.prose-mirror-detail p {
	margin: 0.75rem 0;
	line-height: 1.6;
}

.prose-mirror-detail p:first-child {
	margin-top: 0;
}

.prose-mirror-detail p:last-child {
	margin-bottom: 0;
}

/* Highlight styles */
.prose-mirror-detail mark {
	border-radius: 0.25rem;
	padding: 0.125rem 0.25rem;
}

/* Text alignment */
.prose-mirror-detail[style*='text-align: center'] {
	text-align: center;
}

.prose-mirror-detail[style*='text-align: right'] {
	text-align: right;
}

.prose-mirror-detail[style*='text-align: left'] {
	text-align: left;
}

/* Selection styles */
.prose-mirror-detail-selectednode {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

/* YouTube embed styles */
.youtube-embed {
	margin: 1rem 0;
	border-radius: 0.5rem;
	overflow: hidden;
}

/* Details/Summary styles */
.prose-mirror-detail details {
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	margin: 1rem 0;
	padding: 0;
}

.prose-mirror-detail details summary {
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	padding: 0.75rem 1rem;
	cursor: pointer;
	font-weight: 500;
	user-select: none;
}

.prose-mirror-detail details[open] summary {
	border-bottom: 1px solid #e5e7eb;
}

.prose-mirror-detail details > *:not(summary) {
	padding: 1rem;
}

/* Text colors */
.prose-mirror-detail [style*="color"] {
	/* Preserve inline color styles */
}

/* Superscript and subscript */
.prose-mirror-detail sup {
	vertical-align: super;
	font-size: 0.75em;
}

.prose-mirror-detail sub {
	vertical-align: sub;
	font-size: 0.75em;
}

/* Justify alignment */
.prose-mirror-detail[style*="text-align: justify"] {
	text-align: justify;
}

/* Code block styling with syntax highlighting */
.prose-mirror-detail pre.hljs {
	background: #2d3748;
	color: #e2e8f0;
	border-radius: 0.375rem;
	padding: 1rem;
	margin: 1rem 0;
	overflow-x: auto;
	font-family: 'SFMono-Regular', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
}

/* Syntax highlighting colors */
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in {
	color: #4299e1;
}

.hljs-string,
.hljs-attr {
	color: #68d391;
}

.hljs-number,
.hljs-literal {
	color: #f6ad55;
}

.hljs-comment {
	color: #a0aec0;
	font-style: italic;
}

.hljs-tag,
.hljs-name {
	color: #ed8936;
}

.hljs-function,
.hljs-title {
	color: #9f7aea;
}

.hljs-variable,
.hljs-template-variable {
	color: #38b2ac;
}

/* Drag and drop styles */
.prose-mirror-detail.drag-over {
	background-color: rgba(59, 130, 246, 0.1);
	border: 2px dashed #3b82f6;
}

/* Table styles */
.prose-mirror-detail table {
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
	margin: 1rem 0;
	overflow: hidden;
}

.prose-mirror-detail table td,
.prose-mirror-detail table th {
	min-width: 1em;
	border: 1px solid #e5e7eb;
	padding: 8px 12px;
	vertical-align: top;
	box-sizing: border-box;
	position: relative;
}

.prose-mirror-detail table th {
	font-weight: bold;
	text-align: left;
	background: #f9fafb;
}

.prose-mirror-detail table .selectedCell:after {
	z-index: 2;
	position: absolute;
	content: "";
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	background: rgba(59, 130, 246, 0.1);
	pointer-events: none;
}

.prose-mirror-detail table .column-resize-handle {
	position: absolute;
	right: -2px;
	top: 0;
	bottom: -2px;
	width: 4px;
	background-color: #3b82f6;
	pointer-events: none;
}