/*
	Блоги: вложения со «Скачать» и «ВирусТОТАЛ», лайки и дизлайки,
	комментарии, отметка о прочтении и репост статьи на стену.
*/

.blog-post-page,
.blog-post-page .Panel,
.blog-rate,
.blog-comments,
.blog-files,
.blog-checkin-button,
.blog-repost-button,
.blog-card-rate,
.blog-attach-field {
	--be-surface: #fff;
	--be-surface-raised: #f7f8fc;
	--be-border: #e6e8f0;
	--be-text: #252c3b;
	--be-muted: #737d90;
	--be-accent: #6d5ce6;
	--be-accent-soft: rgba(109, 92, 230, .1);
	--be-like: #2f9e6f;
	--be-like-soft: rgba(47, 158, 111, .12);
	--be-dislike: #e2732f;
	--be-dislike-soft: rgba(226, 115, 47, .14);
}

html[data-bs-theme="dark"] .blog-post-page,
html[data-bs-theme="dark"] .blog-rate,
html[data-bs-theme="dark"] .blog-comments,
html[data-bs-theme="dark"] .blog-files,
html[data-bs-theme="dark"] .blog-card-rate {
	--be-surface: #1c1e2c;
	--be-surface-raised: #222436;
	--be-border: #2b2f45;
	--be-text: #e8eaf2;
	--be-muted: #9aa2b4;
	--be-accent-soft: rgba(139, 124, 240, .16);
}

/* ---------------- Лайки и дизлайки ---------------- */

.blog-rate {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.blog-rate-button,
.blog-card-rate {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 5px 11px;
	border: 1px solid var(--be-border);
	border-radius: 999px;
	background: var(--be-surface);
	color: var(--be-muted);
	font-size: 12px;
	font-weight: 650;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform .15s ease;
}

.blog-rate-button:hover,
.blog-card-rate:hover {
	transform: translateY(-1px);
}

.blog-rate-button.is-like:hover,
.blog-card-rate.is-like:hover {
	border-color: var(--be-like);
	color: var(--be-like);
}

.blog-rate-button.is-dislike:hover,
.blog-card-rate.is-dislike:hover {
	border-color: var(--be-dislike);
	color: var(--be-dislike);
}

.blog-rate-button.is-active.is-like,
.blog-card-rate.is-active.is-like {
	border-color: transparent;
	background: var(--be-like-soft);
	color: var(--be-like);
	box-shadow: inset 0 0 0 1.5px var(--be-like);
}

.blog-rate-button.is-active.is-dislike,
.blog-card-rate.is-active.is-dislike {
	border-color: transparent;
	background: var(--be-dislike-soft);
	color: var(--be-dislike);
	box-shadow: inset 0 0 0 1.5px var(--be-dislike);
}

.blog-rate-button[disabled],
.blog-card-rate[disabled] {
	opacity: .6;
	cursor: default;
	transform: none;
}

.blog-panel-stat {
	display: inline-flex;
	gap: 5px;
	align-items: center;
	color: var(--be-muted);
	font-size: 12px;
}

/* ---------------- Вложения ---------------- */

.blog-files {
	display: grid;
	gap: 10px;
	margin: 18px 0 0;
}

.blog-file {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid var(--be-border);
	border-radius: 16px;
	background: var(--be-surface);
}

.blog-file.is-image,
.blog-file.is-video,
.blog-file.is-embed {
	flex-direction: column;
	align-items: stretch;
}

.blog-file-preview {
	display: block;
	overflow: hidden;
	border-radius: 12px;
	background: var(--be-surface-raised);
}

.blog-file-preview img {
	display: block;
	width: 100%;
	max-height: 460px;
	object-fit: contain;
}

.blog-file-video {
	width: 100%;
	max-height: 460px;
	border-radius: 12px;
	background: #000;
}

.blog-file-audio {
	width: 100%;
}

.blog-file-embed {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 12px;
	background: #000;
	aspect-ratio: 16 / 9;
}

.blog-file-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.blog-file-body {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.blog-file-head {
	display: flex;
	gap: 10px;
	align-items: center;
	min-width: 0;
}

.blog-file-head > i {
	display: grid;
	flex: none;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 11px;
	background: var(--be-accent-soft);
	color: var(--be-accent);
	font-size: 15px;
}

.blog-file-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.blog-file-info > strong {
	overflow: hidden;
	max-width: 46vw;
	font-size: 13px;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.blog-file-info > small {
	color: var(--be-muted);
	font-size: 11px;
}

.blog-file-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.blog-file-action {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	padding: 7px 12px;
	border: 1px solid var(--be-border);
	border-radius: 10px;
	background: var(--be-surface-raised);
	color: var(--be-text);
	font-size: 12px;
	font-weight: 650;
	text-decoration: none;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.blog-file-action:hover {
	border-color: var(--be-accent);
	color: var(--be-accent);
}

.blog-file-action.is-vt {
	border-color: rgba(47, 158, 111, .45);
	color: #2f9e6f;
}

.blog-file-action.is-vt:hover {
	background: rgba(47, 158, 111, .1);
	border-color: #2f9e6f;
}

.blog-file-action.is-ghost {
	color: var(--be-muted);
}

.blog-file-action.is-danger {
	padding: 7px 9px;
	color: #e5484d;
	border-color: rgba(229, 72, 77, .35);
}

.blog-file-action.is-danger:hover {
	background: rgba(229, 72, 77, .1);
	border-color: #e5484d;
}

/* ---------------- Отметка и репост ---------------- */

.blog-post-actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin: 20px 0 0;
	padding: 14px 16px;
	border: 1px dashed var(--be-border);
	border-radius: 16px;
	background: var(--be-surface-raised);
}

.blog-checkin-button.is-done,
.blog-repost-button.is-done {
	border-color: transparent;
	background: var(--be-accent-soft);
	color: var(--be-accent);
}

.blog-checkin-button[disabled],
.blog-repost-button[disabled] {
	opacity: 1;
}

.blog-checkin-hint {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	color: var(--be-muted);
	font-size: 11.5px;
	line-height: 1.45;
}

.blog-checkin-hint > i {
	color: #f0a63f;
}

.blog-repost-button {
	margin-left: auto;
}

.blog-repost-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 12px;
	padding: 14px 16px;
	border: 1px solid var(--be-border);
	border-radius: 16px;
	background: var(--be-surface);
}

.blog-repost-form[hidden] {
	display: none;
}

.blog-repost-form-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

/* ---------------- Комментарии ---------------- */

.blog-comments {
	margin: 22px 0 0;
	padding: 18px;
	border: 1px solid var(--be-border);
	border-radius: 18px;
	background: var(--be-surface);
}

.blog-comments-head {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--be-border);
}

.blog-comments-head h2 {
	margin: 0;
	font-size: 16px;
	font-weight: 750;
}

.blog-comments-head span {
	color: var(--be-muted);
	font-size: 11.5px;
}

.blog-comments-head > i {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 11px;
	background: var(--be-accent-soft);
	color: var(--be-accent);
}

.blog-comment-form {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 16px;
}

.blog-comment-form-avatar {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 13px;
	object-fit: cover;
}

.blog-comment-form-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.blog-comment-form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
}

.blog-comment-form-hint {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	color: var(--be-muted);
	font-size: 11px;
}

.blog-comments-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.blog-comment {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid var(--be-border);
	border-radius: 14px;
	background: var(--be-surface-raised);
}

.blog-comment-avatar img {
	width: 40px;
	height: 40px;
	border-radius: 13px;
	object-fit: cover;
}

.blog-comment-body {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	flex: 1 1 auto;
}

.blog-comment-head {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.blog-comment-author {
	font-size: 13px;
	font-weight: 700;
}

.blog-comment-author a {
	color: inherit;
	text-decoration: none;
}

.blog-comment-date {
	color: var(--be-muted);
	font-size: 11px;
}

.blog-comment-remove {
	margin-left: auto;
	padding: 3px 7px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--be-muted);
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}

.blog-comment-remove:hover {
	background: rgba(229, 72, 77, .1);
	color: #e5484d;
}

.blog-comment-text {
	color: var(--be-text);
	font-size: 13px;
	line-height: 1.6;
	word-break: break-word;
}

.blog-comments-empty,
.blog-comments-login {
	display: flex;
	gap: 9px;
	align-items: center;
	justify-content: center;
	padding: 18px;
	border: 1px dashed var(--be-border);
	border-radius: 14px;
	color: var(--be-muted);
	font-size: 12.5px;
}

.blog-comments-empty > i {
	color: var(--be-accent);
	font-size: 18px;
}

.blog-comments-login a {
	color: var(--be-accent);
}

/* ---------------- Карточка статьи ---------------- */

.blog-card-stats {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.blog-card-rate {
	padding: 3px 8px;
	font-size: 11px;
	text-decoration: none;
}

.blog-card-rate.is-static,
.blog-card-rate.is-link {
	cursor: default;
	color: var(--be-muted);
}

.blog-card-rate.is-link:hover {
	border-color: var(--be-accent);
	color: var(--be-accent);
}

/* ---------------- Форма ---------------- */

.blog-attach-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.blog-edit-files {
	margin-top: 10px;
}

.blog-edit-files:empty {
	display: none;
}

/* ---------------- Мобильные экраны ---------------- */

@media (max-width: 767.98px) {
	.blog-post-page .Panel {
		flex-wrap: wrap;
		gap: 8px;
	}

	.blog-post-actions-row {
		flex-direction: column;
		align-items: stretch;
	}

	.blog-repost-button {
		margin-left: 0;
		width: 100%;
	}

	.blog-checkin-hint {
		order: 3;
	}

	.blog-file {
		padding: 11px 12px;
	}

	.blog-file-info > strong {
		max-width: 60vw;
	}

	.blog-file-actions {
		width: 100%;
	}

	.blog-file-action {
		flex: 1 1 auto;
		justify-content: center;
	}

	.blog-comment-form {
		flex-direction: column;
	}

	.blog-comment-form-avatar {
		display: none;
	}

	.blog-comments {
		padding: 14px;
	}

	.blog-comment {
		padding: 11px;
	}
}

@media (max-width: 575.98px) {
	.blog-file-info > strong {
		max-width: 70vw;
	}

	.blog-rate-button {
		padding: 5px 9px;
	}

	.blog-card-stats {
		width: 100%;
	}

	.blog-repost-form-actions {
		flex-direction: column-reverse;
	}

	.blog-repost-form-actions .btn {
		width: 100%;
	}
}
