.blog-actions {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.blog-actions .button {
	white-space: nowrap;
}

.blog-actions .search-wrap {
	flex-grow: 1;
}

#new_post_wrap{
	margin: 1rem 0;
	overflow: hidden;
	max-height: 0px;
	transition: max-height .5s ease;
}
#new_post_wrap.active{
	max-height: 1000vh;
}

#quill-editor {
	padding: 2px 8px 5px;
	min-height: 50vh;
	opacity: .25;
}

#quill-editor.ql-container {
	padding: 0;
	opacity: 1;
}

.main-area .article {
	transition: opacity .5s ease;
}

.main-area:has(.new-blog-post-form-wrap.active) .article{
	opacity: 0;
}

.social-post-form input[name='post_title']{
    display: block;
	width: 100%;
	margin-bottom: 10px;
}

.social-post-form .ql-editor {
    min-height: 50vh;
	letter-spacing: 0;
}

.social-post-form .button-diary {
	margin-top: 10px;
}

.social-post-form .post-settings {
	display: flex;
	gap: 5px 1em;
	flex-wrap: wrap;
}

.social-posts-pagination{
    display: flex;
    justify-content: center;
}

.editor-toolbar button {
    margin-right: 5px;
    padding: 5px 10px;
    background: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
}

.upload-section {
    margin: 15px 0;
}

.visibility-options label {
    display: inline-block;
    margin-right: 15px;
}

.form-actions button {
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    cursor: pointer;
}

.cancel-link {
    margin-left: 10px;
    color: #666;
    text-decoration: underline;
}

.social-post {
    background: var(--widget-bg);
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
}

.post-content {
    margin: 10px 0;
    line-height: 1.6;
}

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.comment-btn{
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9em;
}

.comment .children .children .children {
	margin-left: 0;
}

.comment .children .comment {
	display: none;
}

.expanded.comment .children .comment,
.comment .children .comment[data-thread-order="1"],
.comment .children .comment[data-thread-order="2"],
.comment .children .comment[data-thread-order="3"] {
	display: block;
}

.btn-expand-comments {
	float: left;
	display: block;
	margin-bottom: 1rem;
}

.comments-list .children .comment:not(:has(.children)):where(:not(:is(.children > .comment:not(:last-child), .children > .comment:not(:last-child) *))) .btn-expand-comments {
  display: none;
}	/* исключение когда кнопка выпала на последний коммент */

.title-wrap .time{
	font-size: 1rem;
	opacity: .6;
	margin-left: 10px;
}

@media (max-width: 768px) {
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .post-actions {
        flex-wrap: wrap;
    }
}

.ql-container {
	margin-bottom: 10px;
	font-size: inherit!important;
}

.ql-snow .ql-tooltip[data-mode=link] {
	left:0!important;
	width: 100%;
	display: flex;
}

.ql-snow .ql-tooltip.ql-hidden {
	display: none!important;
}

.ql-snow .ql-tooltip::before {
    content: "";
    line-height: 26px;
    margin-right: 0;
}

.ql-snow .ql-tooltip[data-mode=link]::before {
    content: "";
}

.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
    border-right: 0;
    content: '✔';
    padding-right: 0;
}

.ql-snow .ql-tooltip a.ql-action::after {
	content: '\270E';
}

.ql-snow .ql-tooltip a.ql-remove::before {
	content: '✖';
}

.ql-snow .ql-tooltip.ql-editing input[type="text"] {
	flex-grow: 1;
}

.ql-align-center {
    text-align: center;
}

.ql-align-justify {
    text-align: justify;
}

.ql-align-right {
    text-align: right;
}



.post-content img,
.comment-content img {
	width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    box-sizing: border-box;
    display: block;
    margin: auto;
}

.post-content a,
.comment-content a,
.post-content code,
.comment-content code {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.ql-code-block-container {
    background-color: #2222;
    overflow: visible;
}

.post-content li {
    list-style-type: none;
    padding-left: 1.5em;
    position: relative;
}

.ql-ui {
    position: absolute;
}

.ql-ui:before {
    display: inline-block;
    margin-left: -1.5em;
    margin-right: .3em;
    text-align: right;
    white-space: nowrap;
    width: 1.2em;
}

li[data-list=bullet] > .ql-ui:before {
    content: '\2022';
}

li[data-list=ordered] {
    counter-increment: list-0;
}

li[data-list=ordered] > .ql-ui:before {
    content: counter(list-0, decimal) '. ';
}

.post-settings-dropdown {
	position: relative;
}

.post-settings-menu {
	position: absolute;
    top: 100%;
    left: 0;
    background: var(--widget-bg);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
    min-width: 200px;
	display: none;
}

.post-settings-menu>strong{
	display: block;
}

.post-settings-menu textarea{
	display: block;
	width: 100%;
	margin-bottom: 5px;
}

.post-visibility-setting label, .post-comment-visibility-setting label,
.post-hide-setting {
    display: block;
    margin: 6px 0;
    font-size: 13px;
}

.post-visibility-setting input[type="radio"] {
    margin-right: 6px;
}

.hide-reason-input {
    font-size: 13px;
    padding: 4px;
    margin-top: 4px;
}

.ql-toolbar{
	width: 100%;
    display: flex;
    justify-content: center;
	position: sticky;
	top:0;
	background: var(--body-bg);
	z-index: 2;
}

.ql-toolbar.ql-snow {
	padding:0;
}

.ql-toolbar.ql-snow .ql-formats {
	margin-right: 0;
}

.ql-toolbar.ql-snow .ql-formats + .ql-formats {
	margin-left: 10px;
}

.ql-snow.ql-toolbar button, .ql-snow .ql-toolbar button {
	width: 28px;
	height: 28px;
}

[data-theme="dark"] .ql-toolbar {
	filter: brightness(3.5);
}

.ql-editor {
	min-height: 6em;
}

.post-title{
    font-size: 18px;
    font-weight: 600;
    opacity: 0.7;
}

.comment-edit-actions{
	margin: 10px 0;
}


.single .moderation-warning {
    border: .1px solid;
	border-radius: 5px;
	padding: 6px 10px 10px;
	margin-bottom: 10px;
	text-align: center;
}

.article.author-hidden .article-image,
.article.moderator-hidden .article-image {
	display: none;
}

.article.author-hidden .article-title,
.article.moderator-hidden .article-title {
	text-decoration: line-through;
}

.article.moderator-hidden .article-excerpt {
	color: #c00!important;
}

.article.author-hidden .article-excerpt {
	color: #cc0!important;
}

.moderated-text {
	border: 1px dashed #ccc;
	margin-bottom: 10px;
}

.single-post .article-single-image img {
	width: 70px;
	height: 70px;
}

.article-footer .post-actions {
	margin: 0 auto 0 0;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	opacity: 1;
}

.article-footer .post-actions .post-settings-btn,
.article-footer .post-actions>a {
	background: transparent;
	display: inline-block;
	padding: 0;
	height: auto;
	border: 0;
	width: 2em;
	text-align: center;
	opacity: .6;
}

.article-footer .post-actions .adm-view-visibility {
	opacity: .6;
}

.sticky-toggle.is-sticky {
	transform: rotate(180deg);
	display: inline-block;
}

/* Счётчики символов */
.char-counter-wrapper {
    margin-top: 6px;
    padding: 4px 12px;
    font-size: .8rem;
    text-align: right;
    transition: color 0.3s ease;
    background: var(--body-bg);
    border-top: 1px solid #ccc;
	position: sticky;
	bottom: .7cm;
}

.char-counter-number {
    font-weight: 600;
}

.char-counter-min {
    opacity: 0.7;
    margin-left: 4px;
}

/* Когда не набрали минимум */
.char-counter-wrapper.below-min {
    color: #6c757d;
    background-color: #e9ecef;
    border-top-color: #ced4da;
}

.char-counter-wrapper.below-min .char-counter-number {
    color: #6c757d;
}

/* Предупреждение (осталось мало) */
.char-counter-wrapper.warning {
    color: #856404;
    background-color: #fff3cd;
    border-top-color: #ffc107;
}

/* Опасность (0 символов осталось) */
.char-counter-wrapper.danger {
    color: #dc3545;
    background-color: #f8d7da;
    border-top-color: #dc3545;
    font-weight: 500;
}

/* Минимум достигнут */
.char-counter-wrapper.min-reached {
    border-left: 3px solid #28a745;
}

/* Flex-контейнер для Quill */
.ql-flex-container {
    display: block !important;
}

@media (min-width: 521px) {
	.blog-actions .search-wrap {
		max-width: 15em;
	}
}

@media (min-width: 921px) {
	.char-counter-wrapper {
		bottom: 0;
	}
}