/* =========================
   ОБЩЕЕ
========================= */

.authors-list,
.author-profile {
    margin-top: 30px;
}

.page-subtitle {
    margin-top: 10px;
    font-size: 16px;
    color: #666;
}

/* =========================
   СПИСОК АВТОРОВ
========================= */

.authors-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* .author-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    border: 1px solid #e5e5e5;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
} */

.author-card {
    display: flex;           /* карточка — flex */
    gap: 20px;
    align-items: flex-start; /* ВАЖНО! Не stretch */
    padding: 24px;
    border: 1px solid #e5e5e5;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.author-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
} 

.author-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;      /* круг */
    overflow: hidden;
    background: #f2f2f2;
}

.author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.author-info h2 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.3;
}

.author-info a {
    color: #222;
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: none;
}

.author-position {
    font-weight: 600;
    margin-bottom: 6px;
}

.author-experience {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

.author-specialization {
    font-size: 14px;
    color: #444;
}

.author-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0056b3 !important; 
    text-decoration: none !important;
}

.author-link:hover {
    text-decoration: underline !important;
}

/* =========================
   СТРАНИЦА АВТОРА
========================= */

.author-profile {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.author-profile-photo {
    width: 170px;
    height: 170px;
    border-radius: 5%;      /* круг */
    overflow: hidden;
    background: #f2f2f2;
}

.author-profile .author-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.author-details p {
    margin-bottom: 10px;
    font-size: 15px;
}

.author-details strong {
    font-weight: 600;
}

.author-bio {
    max-width: 800px;
}

.author-bio h2 {
    margin-bottom: 12px;
    font-size: 22px;
}

.author-bio p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* =========================
   ХЛЕБНЫЕ КРОШКИ
========================= */

/* .breadcrumbs {
    background: #f7f7f7;
    padding: 12px 0;
    margin-bottom: 30px;
}

.breadcrumbs .bc {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.breadcrumbs .bc li {
    font-size: 14px;
}

.breadcrumbs .bc li a {
    color: #0056b3;
    text-decoration: none;
}

.breadcrumbs .bc li a:hover {
    text-decoration: underline;
}

.breadcrumbs .bc li.active {
    color: #666;
} */

/* =========================
   СТАТЬИ
========================= */

/* Основной блок статьи */
.article-page {
    padding: 50px 0;
    background: #F9FAFB; /* светлый фон для контраста */
    font-family: 'Inter', sans-serif;
    color: #111827;

    column-width: auto !important;
    -moz-column-width: auto !important;
    -webkit-column-width: auto !important;

    column-gap: normal !important;
    -moz-column-gap: normal !important;
    -webkit-column-gap: normal !important;

    column-rule: none !important;
    -moz-column-rule: none !important;
    -webkit-column-rule: none !important;
}

/* Контейнер */
.article-page .container {
    max-width: 800px;   /* ограничиваем ширину текста */
    margin: 0 auto;     /* центрируем по горизонтали */
    padding: 0 15px;
    box-sizing: border-box;
}

/* Заголовок статьи */
.article-page h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.3;
}

/* Мета-информация (автор, дата) */
.article-page .article-meta {
    display: flex;
    justify-content: space-around; /* центрируем по горизонтали */
    /* gap: 15px; */
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 30px;
}

.article-page .article-meta a {
    color: #3B82F6;
    text-decoration: none;
}

.article-page .article-meta a:hover {
    text-decoration: underline;
}

/* Контент статьи */
.article-page .article-content {
    line-height: 1.7;
    font-size: 16px;
    text-align: left; /* читаемость лучше слева */
    color: #111827;
}

/* Абзацы */
.article-page .article-content p {
    margin-bottom: 16px;
}

/* Заголовки внутри контента */
.article-page .article-content h2,
.article-page .article-content h3 {
    margin: 24px 0 12px;
    font-weight: 600;
    color: #111827;
}

/* Списки */
.article-page .article-content ul,
.article-page .article-content ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

/* Ссылки */
.article-page .article-content a {
    color: #3B82F6;
    text-decoration: none;
}

.article-page .article-content a:hover {
    text-decoration: underline;
}

/* Изображения */
.article-page .article-content img {
    max-width: 100%;
    display: block;
    margin: 20px auto;
}

/* Адаптив */
@media (max-width: 768px) {
    .article-page h1 {
        font-size: 28px;
    }

    .article-page .article-meta {
        flex-direction: column;
        gap: 8px;
    }

    .article-page .article-content {
        font-size: 15px;
    }
}

/* .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 200px;
    max-height: 64px;
    overflow: hidden;
    margin: 0 auto; 
    justify-content: center;
}
.article-tags .tag {
    /* display: inline-block;
    background: #55BC74;
    color: #fff;
    padding: 2px 8px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background 0.3s; *
    white-space: nowrap;
    color: #3B82F6;
    text-decoration: none;
}
.article-tags .tag:hover {
    text-decoration: underline;
} */

.article-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;

    padding: 30px;
    margin-bottom: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;

    background: #fff;

    transition: 
        background-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.article-card:hover {
    background-color: #fafafa;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.article-card h3 a {
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.article-card h3 a:hover {
    color: #2563EB;
}

.article-status {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;

    font-size: 0.75rem;
    font-weight: 600;

    color: #fff;
    background: #DC2626;

    border-radius: 6px;
}

/* .article-card > * {
    break-inside: avoid;
    /* -webkit-column-break-inside: avoid;
    page-break-inside: avoid; *
} */

.article-body {
    display: contents;
}

/* .article-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
} */

/* .article-excerpt {
    order: 1;
} */

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
    max-width: 100%;
    justify-content: center;
    /* order: 2; */
}

/* .article-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #374151;
    background: #F3F4F6;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
} */

.article-tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #374151;
    background: #F3F4F6;
    border-radius: 999px;
    text-decoration: none;
}

.article-tag:hover {
    background: #DBEAFE;
    color: #1D4ED8;
    text-decoration: none;
}

/* @media (min-width: 1200px) {
    .article-tags {
        order: 1;
    }

    .article-excerpt {
        order: 2;
    }
} */

/* Форма фильтра всегда сверху */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    background: #f9fafb;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.filter-form input,
.filter-form select,
.filter-form button {
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;
    font-size: 14px;
    line-height: 40px;
    flex: 1 1 200px;
}

.filter-form button {
    flex: 0 0 auto;
}

/* Основная сетка */
.layout-with-sidebar {
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: row; /* контент слева, кнопка справа */
    width: 250px;        /* ширина sidebar */
    flex-shrink: 0;
    transition: width 0.3s ease;
    margin-top: 0;
    padding: 0;
}

/* Контент внутри sidebar */
.sidebar-inner {
    flex: 1;
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
    margin-right: 5px;
}

/* Кнопка toggle */
.sidebar-toggle {
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: #2563EB; */
    border: none;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    transition: transform 0.3s ease, background 0.3s ease;
    z-index: 10;
}

/* Стрелка внутри кнопки */
.sidebar-toggle .arrow {
    width: 10px;
    height: 10px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(-135deg);
    transition: transform 0.3s ease;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.categories-list li a {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #1f2937;
    font-size: 14px;
    background: #f6fbf8;
    border: 1px solid #d1f0dc;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.1s ease;
}

/* .categories-list li a::before {
    content: "📂";
    margin-right: 8px;
    opacity: 0.7;
} */

/* Hover */
.categories-list li a:hover {
    background: #e9f7ef;
    border-color: #55BC74;
    color: #2f7d4b;
}

/* Active (текущая категория) */
.categories-list li.active a {
    background: #55BC74;
    color: #ffffff;
    border-color: #3C9D59;
    font-weight: 500;
}

/* Небольшой "нажим" */
.categories-list li a:active {
    transform: scale(0.97);
}

/* Main */
.main-content {
    flex: 1;
    transition: flex 0.3s ease, margin 0.3s ease;
}

/* ====================== COLLAPSED ====================== */
.sidebar.collapsed {
    width: 30px; /* оставляем место только под кнопку */
}

.sidebar.collapsed .sidebar-inner {
    width: 0;
    transform: translateX(-100%);
}

.sidebar.collapsed .sidebar-toggle .arrow {
    transform: rotate(45deg);
}

.category {
    display: none;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .category {
        display: block;
    }

    /* .layout-with-sidebar {
        position: relative; /* чтобы transform работал внутри *
        flex-direction: row;
    }

    .sidebar {
        width: 250px;          /* фактическая ширина контента *
        min-width: 0;
        height: auto;
        background: #f9fafb;
        box-shadow: 2px 0 6px rgba(0,0,0,0.1);
        transform: translateX(-100%); /* скрыт влево *
        transition: transform 0.3s ease;
        flex-shrink: 0;        /* не влияет на main *
    }

    /* Когда открыто *
    .sidebar.show {
        transform: translateX(0);
    }

    /* Кнопка toggle *
    .sidebar-toggle {
        align-self: flex-start;
        margin-left: -30px; /* чтобы кнопка была на краю *
        z-index: 10;
    } */
}

/* ================== Десктоп / мобильные ================== */
/* @media (min-width: 1200px) {
    /* Свернутый sidebar *
    .sidebar.collapsed {
        width: 30px;
        overflow: hidden;
    }

    .sidebar.collapsed .sidebar-inner {
        transform: translateX(-100%);
    }

    .sidebar .sidebar-toggle {
        transform: translateX(+100%);
    }
}

/* Мобильная версия *
@media (max-width: 1200px) {
    .sidebar {
        flex-direction: row-reverse;
    }
} */

.article-category {
    margin-bottom: 6px;
}

.article-category a {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #2563EB;
    background: #EFF6FF;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.article-category a:hover {
    background: #DBEAFE;
    color: #1D4ED8;
}

.article-excerpt {
    text-align: justify;
}

/* Первая колонка */
.article-category {
    grid-column: 1;
    grid-row: 1;
}

.article-card h3 {
    grid-column: 1;
    grid-row: 2;
}

/* Вторая колонка */
.article-tags {
    grid-column-start: 1;
    grid-column-end: 4;
    grid-row: 3;
}

.article-excerpt {
    grid-column-start: 2;
    grid-column-end: 4;
    grid-row: 2;
}

/* Третья колонка */
.article-meta {
    grid-column: 3;
    /* grid-row: 1 / span 2; растянуть на две строки */
    grid-row: 1
}

@media (max-width: 1200px) {

    .article-card {
        grid-template-columns: 1fr 1fr;
    }

    /* Первая колонка */
    .article-category {
        grid-column: 1;
        grid-row: 1;
    }

    .article-card h3 {
        grid-column: 1;
        grid-row: 2;
    }

    .article-tags {
        grid-column-start: 1;
        grid-column-end: 3;
        grid-row: 3;
    }

    /* Вторая колонка */
    .article-excerpt {
        grid-column: 2;
        grid-row: 2;
    }

    .article-meta {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 768px) {

    .article-card {
        grid-template-columns: 1fr;
    }

    .article-category {
        grid-column: 1;
        grid-row: 1;
    }

    .article-card h3 {
        grid-column: 1;
        grid-row: 2;
    }

    .article-tags {
        grid-column: 1;
        grid-row: 5;
    }

    .article-excerpt {
        grid-column: 1;
        grid-row: 3;
    }

    .article-meta {
        grid-column: 1;
        grid-row: 4;
    }
}

/* =========================
   АДАПТИВ
========================= */

@media (max-width: 768px) {

    .authors-list {
        grid-template-columns: 1fr;
    }

    .author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-details {
        margin-top: 20px;
    }
}

/* =========================
   ADMIN EDITOR
========================= */

.admin-editor {
    display: flex;
    flex-direction: column;
    margin: 16px 0;
}

/* Toolbar */
.admin-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.admin-editor-toolbar button {
    padding: 6px 10px;
    font-size: 15px;
    border: 1px solid #D1D5DB;
    background: #fff;
    cursor: pointer;
    border-radius: 6px;
}

.admin-editor-toolbar button:hover {
    background: #E5E7EB;
}

.admin-editor-sep {
    width: 1px;
    height: 22px;
    background: #D1D5DB;
    margin: 0 6px;
}

.admin-editor-toolbar p {
    margin: 0;
    font-size: 13px;
    color: #374151;
}

/* Editor area */
.admin-editor-area {
    min-height: 160px;
    padding: 12px;
    font-size: 16px;
    line-height: 1.6;
    border: 1px solid #E5E7EB;
    border-top: none;
    border-radius: 0 0 8px 8px;
    outline: none;
    background: #fff;
    color: #111827;
    white-space: pre-wrap;
}

.admin-editor-area p {
    margin: 0 0 8px;
}

.admin-editor-area:empty:before {
    content: attr(placeholder);
    color: #9CA3AF;
}

.admin-editor-area table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.admin-editor-area table td,
.admin-editor-area table th {
    border: 1px solid #ccc;
    padding: 6px;
}

.admin-editor-area img {
    max-width: 100%;
    display: block;
    margin-bottom: 15px;
}

.admin-editor table.is-selected {
    outline: 2px solid #55BC74;
}

.admin-editor img.is-selected {
    outline: 2px solid #55BC74;
}

.admin-editor td.is-selected,
.admin-editor th.is-selected {
    outline: 2px solid #55BC74;
    outline-offset: -2px;
}

.admin-editor tr.is-selected td {
    background: rgba(85, 188, 116, 0.08);
}

.admin-editor table.is-selected {
    outline: 2px solid #55BC74;
    outline-offset: 2px;
}

.admin-editor td,
.admin-editor th {
    position: relative;
}

.admin-editor .col-resizer {
    position: absolute;
    top: 0;
    right: -2px;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
}

/* =========================
   ADMIN FORM COMMON
========================= */

.admin-panel {
    /* margin-top: 40px;
    padding-top: 30px;
    border-top: 2px dashed #E5E7EB; */
    margin: 16px 0; 
    padding: 0; 
    overflow: hidden; 
    background: #808080; 
    color: #F5F5F5; 
    border-radius: 12px;
    margin-right: auto;
    margin-left: auto;
}

@media(min-width: 768px) {
    .admin-panel {
        width:750px
    }
}

@media(min-width: 992px) {
    .admin-panel {
        width:970px
    }
}

@media(min-width: 1200px) {
    .admin-panel {
        width:1170px
    }
}

.admin-panel h2 {
    margin-bottom: 20px;
}

/* Inputs */
.admin-panel .input-100 {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    background: #fff;
    color: #222;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin: 16px 0 0 0;
}

.admin-panel .input-100:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

/* Button */
.admin-panel button,
.admin-panel .btn {
    padding: 10px 16px;
    border-radius: 0.375rem;
    border: 1px solid #E5E7EB;
    cursor: pointer;
}

.btn-primary {
    background-color: #55BC74; 
    color: #fff; 
}

.btn-primary:hover {
    background-color: #3C9D59;
}

.admin-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .admin-editor-toolbar {
        gap: 4px;
        padding: 6px;
    }

    .admin-editor-toolbar button {
        padding: 4px 8px;
        font-size: 13px;
    }

    .admin-editor-toolbar p {
        width: 100%;
        font-size: 12px;
        margin-top: 6px;
    }

    .admin-editor-sep {
        height: 18px;
        margin: 0 4px;
    }

    .admin-editor-area {
        font-size: 15px;
    }
}