/* ============================================
   Стили для страницы отдельной статьи блога
   ============================================ */

/* Контейнер контента */
.blog-content {
	font-size: 1.125rem;
	line-height: 1.6;
	color: #e5e7eb;
}

/* Параграфы - без отступов */
.blog-content p {
	margin-bottom: 0;
	margin-top: 0;
}

/* Пустые параграфы (переносы строк через Enter) */
.blog-content p:empty {
	margin-bottom: 0.35rem;
	margin-top: 0;
	height: 0;
}

/* Убираем лишние margin у пустых параграфов в начале/конце блоков */
.blog-content p:empty:first-child {
	display: none;
}
.blog-content p:empty:last-child {
	display: none;
}

/* BR теги - универсальное решение для всех устройств */
.blog-content br {
	display: inline;
	content: "";
}

.blog-content br::after {
	content: "\A";
	white-space: pre;
	display: block;
	margin-bottom: 0.35rem;
}

/* Убираем двойные отступы от br подряд */
.blog-content br + br::after {
	margin-bottom: 0;
}

/* Альтернативный вариант для старых браузеров */
@supports not (content: "\A") {
	.blog-content br {
		display: block;
		margin-bottom: 0.35rem;
	}
}

/* Заголовки */
.blog-content h2 {
	font-size: 1.75rem;
	font-weight: 700;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
	color: white;
	line-height: 1.3;
}

.blog-content h3 {
	font-size: 1.375rem;
	font-weight: 600;
	margin-top: 0.875rem;
	margin-bottom: 0.375rem;
	color: #f3f4f6;
	line-height: 1.4;
}

/* Списки */
.blog-content ul,
.blog-content ol {
	list-style-type: disc;
	margin: 0.25rem 0 0.25rem 1.5rem;
}

.blog-content ol {
	list-style-type: decimal;
}

.blog-content li {
	margin-bottom: 0.125rem;
}

.blog-content li:last-child {
	margin-bottom: 0;
}

/* Цитаты */
.blog-content blockquote {
	border-left: 4px solid #a855f7;
	padding-left: 1rem;
	margin: 0.5rem 0;
	color: #9ca3af;
	font-style: italic;
}

/* Ссылки */
.blog-content a {
	color: #c27bff;
	text-decoration: underline;
	transition: color 0.2s ease;
}

.blog-content a:hover {
	color: #a855f7;
}

/* Форматирование текста */
.blog-content strong {
	font-weight: 700;
	color: white;
}

.blog-content em {
	font-style: italic;
}

.blog-content u {
	text-decoration: underline;
}

.blog-content s {
	text-decoration: line-through;
}

/* Код */
.blog-content pre {
	background: #1f2937;
	border: 1px solid #374151;
	border-radius: 0.75rem;
	padding: 0.75rem;
	overflow-x: auto;
	margin: 0.75rem 0;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 0.875rem;
	color: #e5e7eb;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.blog-content code {
	background: #1f2937;
	padding: 0.125rem 0.375rem;
	border-radius: 0.375rem;
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-size: 0.875rem;
}

/* Изображения */
.blog-content img {
	max-width: 100%;
	height: auto;
	border-radius: 0.75rem;
	margin: 0.75rem 0;
}

/* Выравнивание изображений */
.blog-content .ql-align-center img {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.blog-content .ql-align-right img {
	display: block;
	margin-left: auto;
}

/* Выравнивание текста */
.blog-content .ql-align-center {
	text-align: center;
}

.blog-content .ql-align-right {
	text-align: right;
}

.blog-content .ql-align-justify {
	text-align: justify;
}

/* Таблицы */
.blog-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.75rem 0;
}

.blog-content th,
.blog-content td {
	border: 1px solid #374151;
	padding: 0.5rem;
	text-align: left;
}

.blog-content th {
	background: #1f2937;
	font-weight: 600;
}

/* Разделитель */
.blog-content hr {
	border: none;
	border-top: 1px solid #374151;
	margin: 1rem 0;
}

/* Ссылки с target="_blank" - добавляем иконку */
.blog-content a[target="_blank"]::after {
	content: " ↗";
	font-size: 0.75em;
	opacity: 0.7;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
	.blog-content {
		font-size: 1rem;
		line-height: 1.55;
	}
	
	.blog-content h2 {
		font-size: 1.5rem;
		margin-top: 0.875rem;
		margin-bottom: 0.375rem;
	}
	
	.blog-content h3 {
		font-size: 1.25rem;
		margin-top: 0.75rem;
		margin-bottom: 0.25rem;
	}
	
	.blog-content p {
		margin-bottom: 0;
	}
	
	.blog-content p:empty {
		margin-bottom: 0.3rem;
	}
	
	/* Мобильная версия для BR */
	.blog-content br::after {
		margin-bottom: 0.3rem;
	}
	
	@supports not (content: "\A") {
		.blog-content br {
			margin-bottom: 0.3rem;
		}
	}
	
	.blog-content blockquote {
		padding-left: 0.75rem;
		margin: 0.375rem 0;
	}
	
	.blog-content pre {
		font-size: 0.75rem;
		padding: 0.5rem;
		margin: 0.5rem 0;
	}
	
	.blog-content ul,
	.blog-content ol {
		margin: 0.125rem 0 0.125rem 1.25rem;
	}
	
	.blog-content li {
		margin-bottom: 0;
	}
	
	.blog-content img {
		margin: 0.5rem 0;
	}
}

/* ============================================
   Плашки тегов
   ============================================ */
.tag-chip {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	background: rgba(168, 85, 247, 0.15);
	border: 1px solid rgba(168, 85, 247, 0.3);
	border-radius: 12px;
	font-size: 12px;
	color: #d8b4fe;
	transition: all 0.2s;
	text-decoration: none;
}

.tag-chip:hover {
	background: rgba(168, 85, 247, 0.25);
	border-color: rgba(168, 85, 247, 0.5);
	transform: translateY(-1px);
}

.tag-chip-more {
	background: rgba(75, 85, 99, 0.3);
	border-color: rgba(75, 85, 99, 0.5);
	color: #9ca3af;
	cursor: default;
}

.tag-chip-more:hover {
	background: rgba(75, 85, 99, 0.3);
	border-color: rgba(75, 85, 99, 0.5);
	transform: none;
}

/* Дата на превью карточки */
.blog-card-date {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	color: white;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 500;
	z-index: 2;
	pointer-events: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
}