/*body { margin:0; padding:0; background:#f5f7fa; }*/
.layout {
	display:flex; max-width:1600px; margin:0 auto; padding:20px;
}

/* LEFT MENU */
.sidebar {
	width:280px; margin-right:20px;
	background:#fff; padding:20px;
	border-radius:10px; box-shadow:0 0 10px rgba(0,0,0,0.06);
}
.sidebar h3 { margin-top:0; }
.sidebar ul { list-style:none; padding:0; margin:0; }
.sidebar li { padding:5px 0; display:flex; justify-content:space-between; }
.sidebar a { color:#333; text-decoration:none; }
.sidebar .edit-btn { cursor:pointer; color:#5a8fff; font-size:14px; }

/* MAIN */
.main {
	flex:1;
}

.header {
	display:flex; justify-content:space-between; align-items:center;
	margin-bottom:20px;
}
.header h1 {
	font-size:28px; margin:0;
}

/* SECTION BLOCK */
.section-block {
	background:#fff; padding:20px;
	border-radius:10px; margin-bottom:30px;
	box-shadow:0 0 10px rgba(0,0,0,0.06);
}

.section-head {
	display:flex; justify-content:space-between; align-items:center;
}
.section-head h2 { margin:0; font-size:22px; }
.section-head a { color:#5a8fff; text-decoration:none; }

.section-controls {
	display:flex; gap:10px;
}
.section-controls button {
	background:#eee; border:0; padding:5px 10px;
	border-radius:5px; cursor:pointer;
}

/* POSTS GRID */
.post-grid {
	display:flex; gap:15px; margin-top:15px;
}

.post-item, .post-empty {
	width:32%; background:#f8f8f8; border:1px solid #ddd;
	border-radius:8px; padding:10px; position:relative;
}

.post-item .edit-post,
.post-item .delete-post {
	position:absolute; top:8px; width:22px; height:22px;
	text-align:center; line-height:20px; font-size:16px;
	border-radius:50%; cursor:pointer;
}
.edit-post { right:35px; background:#5a8fff; color:#fff; }
.delete-post { right:8px; background:#ff5a5a; color:#fff; }

.post-title { 
	font-size:18px; 
	margin:10px 0; 
	height:50px; 
	overflow:hidden;
	background: rgba(255, 255, 255, .8);
    padding: 5px;
    border-radius: 5px; 
}
.post-excerpt { font-size:14px; height:60px; overflow:hidden; color:#555; }

.post-empty {
	display:flex; justify-content:center; align-items:center;
	font-size:40px; color:#bbb; cursor:pointer;
	border-style:dashed;
}
.section-disabled {
	opacity: 0.4;
	pointer-events: none;
}

.section-disabled .section-controls {
	pointer-events: auto; /* чтобы кнопки работали */
	opacity: 1;
}
.post-grid.collapsed {
	display: none;
}

.section-controls button {
	cursor: pointer;
}
.dragging {
	opacity: 0.5;
}
.post-status {
	font-size: 12px;
	padding: 2px 6px;
	border-radius: 4px;
	margin-left: 6px;
}

.post-status.is-draft {
	background: #ffe4e4;
	color: #a40000;
}

.post-status.is-published {
	background: #e6f4ea;
	color: #137333;
}
.post-item.is-draft {
	opacity: .6;
}
.section-head h2 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.section-head h2 a:hover {
    text-decoration: underline;
}

.blog-search {
	width: 100%;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	margin-bottom: 16px;
	font-size: 14px;
}

.blog-search:focus {
	outline: none;
	border-color: #6366f1;
}

.blog-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.blog-tag {
	font-size: 13px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #eef2ff;
	color: #4338ca;
	text-decoration: none;
	transition: background .15s;
}

.blog-tag:hover {
	background: #e0e7ff;
}

.blog_pagination {
    margin: 30px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.blog_pag_link {
    padding: 8px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    transition: 0.3s;
}
.blog_pag_link:hover {
    background: #f0f0f0;
}
.blog_pag_link.active {
    background: #2196F3;
    color: #fff;
    border-color: #2196F3;
}

.blog_pagination_container {
    margin-top: 40px;
    padding-bottom: 40px;
    width: 100%;
}
.blog_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.blog_pag_numbers {
    display: flex;
    gap: 8px;
	flex-wrap: wrap;
}
.blog_pag_num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: 0.2s;
}
.blog_pag_num:hover {
    border-color: #2196F3;
    color: #2196F3;
}
.blog_pag_num.is-active {
    background-color: #2196F3;
    border-color: #2196F3;
    color: #fff;
}
.blog_pag_btn {
    text-decoration: none;
    color: #2196F3;
    font-weight: 500;
}
.blog_pag_btn:hover {
    text-decoration: underline;
}

/* Контейнер для центрирования */
.blog_load_more_wrapper {
    margin-top: 30px;
    margin-bottom: 50px;
    display: flex;
    justify-content: center;
}

/* Стили самой кнопки */
#loadMore {
    background-color: #2196F3; /* Основной синий цвет как в пагинации */
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    outline: none;
    min-width: 180px; /* Чтобы кнопка не прыгала при смене текста */
}

/* Эффект при наведении */
#loadMore:hover {
    background-color: #1976D2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* Эффект при нажатии */
#loadMore:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Состояние "Загрузка" или когда постов больше нет */
#loadMore:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.is-loading {
    position: relative;
    color: transparent !important; /* Прячем текст */
}

.is-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.anim-no-visible{
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.anim-no-visible.is-visible {
    opacity: 1;
    transform: translateY(0);
}