/* ==========================================================================
   Weedu — блог и статьи
   ========================================================================== */

/* ==========================================================================
   HERO статьи — только обложка
   ========================================================================== */
.weedu-article-hero {
    padding: 8px 0 32px;
}
.weedu-article-hero__cover {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}
.weedu-article-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@media (max-width: 768px) {
    .weedu-article-hero { padding: 0 0 24px; }
    .weedu-article-hero__cover { border-radius: 16px; }
}

/* ==========================================================================
   Заголовок статьи (под hero, в начале контента)
   ========================================================================== */
.weedu-article-head {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.weedu-article-head__title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--color-text-primary);
}

/* Meta-строка */
.weedu-article-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}
.weedu-article-head__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.weedu-article-head__icon {
    flex-shrink: 0;
    color: var(--color-text-secondary);
}
.weedu-article-head__meta-item--cat {
    text-decoration: none;
    color: var(--color-accent);
    font-weight: 600;
    transition: color 0.2s;
}
.weedu-article-head__meta-item--cat .weedu-article-head__icon {
    color: var(--color-accent);
}
.weedu-article-head__meta-item--cat:hover {
    color: var(--color-accent-hover);
    text-decoration: none;
}
.weedu-article-head__meta-item--cat:hover .weedu-article-head__icon {
    color: var(--color-accent-hover);
}
.weedu-article-head__meta-sep {
    color: #D1D5DB;
}

/* Лид */
.weedu-article-head__lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0;
}

@media (max-width: 768px) {
    .weedu-article-head { margin-bottom: 24px; padding-bottom: 20px; }
    .weedu-article-head__title { font-size: 28px; }
    .weedu-article-head__meta { font-size: 13px; gap: 8px; }
    .weedu-article-head__lead { font-size: 16px; }
}

/* ==========================================================================
   LAYOUT статьи
   ========================================================================== */
.weedu-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 340px;
    gap: 48px;
    align-items: start;
    padding-bottom: 48px;
}
.weedu-post-layout--full {
    grid-template-columns: minmax(0, 1fr);
    max-width: 820px;
    margin: 0 auto;
}
.weedu-post-main { min-width: 0; }
.weedu-post-sidebar__sticky {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (max-width: 1024px) {
    .weedu-post-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .weedu-post-sidebar__sticky { position: static; }
}

/* ==========================================================================
   КОНТЕНТ статьи
   ========================================================================== */
.weedu-post__content {
    font-size: 18px;
    line-height: 1.75;
    color: var(--color-text-primary);
}
.weedu-post__content p { margin: 0 0 1.2em; }

.weedu-post__content h2 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin: 2em 0 0.6em;
    padding-bottom: 0.4em;
    border-bottom: 1px dashed #E9E9E9;
}
.weedu-post__content h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 1.6em 0 0.5em;
}
.weedu-post__content h4 {
    font-size: 20px;
    font-weight: 700;
    margin: 1.4em 0 0.4em;
}

.weedu-post__content ul,
.weedu-post__content ol {
    margin: 1em 0 1.5em;
    padding-left: 1.6em;
}
.weedu-post__content ul { list-style: disc; }
.weedu-post__content ol { list-style: decimal; }
.weedu-post__content li {
    margin-bottom: 0.55em;
    line-height: 1.75;
}
.weedu-post__content li::marker {
    color: var(--color-accent);
    font-weight: 700;
}

.weedu-post__content a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.weedu-post__content a:hover {
    color: var(--color-accent-hover);
}

.weedu-post__content blockquote {
    position: relative;
    margin: 1.6em 0;
    padding: 1.2em 1.6em 1.2em 3em;
    background: linear-gradient(135deg, #F5F7FF 0%, #FAFBFF 100%);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 14px 14px 0;
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-text-primary);
}
.weedu-post__content blockquote::before {
    content: "\201C";
    position: absolute;
    left: 12px;
    top: 6px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 52px;
    line-height: 1;
    color: var(--color-accent);
    opacity: 0.35;
}
.weedu-post__content blockquote p:last-child { margin-bottom: 0; }

.weedu-post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.4em 0;
    display: block;
}
.weedu-post__content figure { margin: 1.6em 0; }
.weedu-post__content figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: center;
}

.weedu-post__content table {
    width: 100%;
    margin: 1.6em 0;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    font-size: 16px;
}
.weedu-post__content table th,
.weedu-post__content table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.weedu-post__content table th {
    background: #F7F8FF;
    font-weight: 700;
}
.weedu-post__content table tr:last-child th,
.weedu-post__content table tr:last-child td { border-bottom: none; }

.weedu-post__content code {
    padding: 2px 6px;
    background: #F3F4F6;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9em;
    color: #B91C1C;
}
.weedu-post__content pre {
    background: #1F2937;
    color: #F9FAFB;
    padding: 16px 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    margin: 1.4em 0;
}
.weedu-post__content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.weedu-post__content hr {
    border: none;
    border-top: 1px dashed #E9E9E9;
    margin: 2em 0;
}

.weedu-post__pagination {
    margin: 24px 0;
    font-weight: 600;
}
.weedu-post__pagination a {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    border-radius: 8px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    text-decoration: none;
}

@media (max-width: 768px) {
    .weedu-post__content { font-size: 17px; }
    .weedu-post__content h2 { font-size: 24px; }
    .weedu-post__content h3 { font-size: 20px; }
    .weedu-post__content blockquote {
        padding: 1em 1.2em 1em 2.4em;
        font-size: 17px;
    }
    .weedu-post__content blockquote::before {
        font-size: 40px;
        left: 8px;
    }
}

/* ==========================================================================
   CTA после статьи
   ========================================================================== */
.weedu-article-cta {
    margin: 48px 0 32px;
    padding: 32px 40px;
    background: linear-gradient(135deg, #635BFF 0%, #5148E5 100%);
    border-radius: 20px;
    color: #fff;
}
.weedu-article-cta__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.weedu-article-cta__text { flex: 1; min-width: 0; }
.weedu-article-cta__title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
}
.weedu-article-cta__subtitle {
    font-size: 15px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.55;
}
.weedu-article-cta .weedu-btn--primary {
    background: #fff;
    color: var(--color-accent) !important;
    padding: 14px 28px;
}
.weedu-article-cta .weedu-btn--primary:hover {
    background: #F7F8FA;
    color: var(--color-accent-hover) !important;
}
@media (max-width: 768px) {
    .weedu-article-cta { padding: 24px; }
    .weedu-article-cta__title { font-size: 20px; }
    .weedu-article-cta .weedu-btn--primary { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Похожие статьи
   ========================================================================== */
.weedu-article-related {
    margin: 40px 0;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.weedu-article-related__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
}
.weedu-article-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 768px) {
    .weedu-article-related__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Навигация по статьям
   ========================================================================== */
.weedu-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 40px 0;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.weedu-post-nav__item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.weedu-post-nav__item:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(99, 91, 255, 0.08);
    color: inherit;
}
.weedu-post-nav__item--next { text-align: right; }
.weedu-post-nav__item--empty { visibility: hidden; }
.weedu-post-nav__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.weedu-post-nav__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}
@media (max-width: 768px) {
    .weedu-post-nav { grid-template-columns: 1fr; }
    .weedu-post-nav__item--next { text-align: left; }
}

/* ==========================================================================
   Карточка статьи (универсальная)
   ========================================================================== */
.weedu-article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-card);
    height: 100%;
}
.weedu-article-card:hover {
    border-color: rgba(99, 91, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    text-decoration: none;
    color: inherit;
}
.weedu-article-card__cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    display: block;
    overflow: hidden;
}
.weedu-article-card__img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.weedu-article-card__placeholder {
    display: block;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}
.weedu-article-card__cover .weedu-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #fff;
    color: var(--color-accent);
}
.weedu-article-card__body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.weedu-article-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}
.weedu-article-card__title a {
    color: var(--color-text-primary);
    text-decoration: none;
}
.weedu-article-card__title a:hover {
    color: var(--color-accent);
    text-decoration: none;
}
.weedu-article-card__excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.weedu-article-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
}
.weedu-article-card__meta-sep { color: #D1D5DB; }
.weedu-article-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    margin-top: 4px;
    transition: gap 0.2s;
}
.weedu-article-card:hover .weedu-article-card__link { gap: 10px; }

/* ==========================================================================
   Sidebar статьи
   ========================================================================== */
.weedu-widget {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
}
.weedu-widget__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}
.weedu-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.weedu-widget li {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
}
.weedu-widget li:last-child { margin-bottom: 0; }
.weedu-widget a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.weedu-widget a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* ==========================================================================
   Комментарии
   ========================================================================== */
.weedu-post__comments {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.weedu-post__comments .comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.weedu-post__comments .comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
}

/* ==========================================================================
   Мелкие элементы блога
   ========================================================================== */
.weedu-intro__badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}
.weedu-intro__description {
    font-size: 17px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    max-width: 720px;
    margin: 12px 0 16px;
}

/* ==========================================================================
   Виджеты сайдбара статей
   ========================================================================== */

/* Категории статей */
.weedu-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.weedu-cat-list__item {
    margin: 0 0 6px;
}
.weedu-cat-list__item--depth-0 > a {
    font-weight: 600;
}
.weedu-cat-list__item[class*="depth-1"],
.weedu-cat-list__item[class*="depth-2"] {
    padding-left: 16px;
    font-size: 14px;
}
.weedu-cat-list__item a {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.weedu-cat-list__item a:hover {
    background: var(--color-accent-light);
    color: var(--color-accent);
    text-decoration: none;
}
.weedu-cat-list__item.is-active > a {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
}
.weedu-cat-list__count {
    color: var(--color-text-secondary);
    font-size: 12px;
    margin-left: 4px;
}
.weedu-cat-list__item.is-active .weedu-cat-list__count {
    color: rgba(255, 255, 255, 0.7);
}
.weedu-cat-list__more {
    list-style: none;
    margin: 8px 0 0;
}
.weedu-cat-list__toggle {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}
.weedu-cat-list__toggle:hover {
    text-decoration: underline;
}
.weedu-cat-list--hidden {
    margin-top: 8px;
    padding-left: 0;
}

/* Мини-карточки статей */
.weedu-mini-posts {
    list-style: none;
    margin: 0;
    padding: 0;
}
.weedu-mini-posts__item {
    margin: 0 0 12px;
}
.weedu-mini-posts__item:last-child {
    margin-bottom: 0;
}
.weedu-mini-posts__link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: 6px;
    margin: -6px;
    border-radius: 10px;
    transition: background 0.15s;
}
.weedu-mini-posts__link:hover {
    background: var(--color-accent-light);
    text-decoration: none;
    color: inherit;
}
.weedu-mini-posts__thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}
.weedu-mini-posts__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.weedu-mini-posts__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}
.weedu-mini-posts__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.weedu-mini-posts__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.weedu-mini-posts__meta {
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Чипы в сайдбаре */
.weedu-chip-group__list--sidebar {
    flex-wrap: wrap;
    gap: 6px;
}
.weedu-chip-group__list--sidebar .weedu-chip {
    font-size: 13px;
    padding: 6px 12px;
}

/* CTA-виджет */
.weedu-cta-widget {
    background: linear-gradient(135deg, #635BFF 0%, #5148E5 100%);
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    text-align: left;
}
.weedu-cta-widget__title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px;
    line-height: 1.3;
}
.weedu-cta-widget__text {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 16px;
}
.weedu-cta-widget__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #fff;
    color: var(--color-accent) !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.weedu-cta-widget__btn:hover {
    background: #F7F8FA;
    color: var(--color-accent-hover) !important;
    text-decoration: none;
}

/* ==========================================================================
   Архив рубрики (category.php)
   ========================================================================== */

/* Intro */
.weedu-cat-intro {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}
.weedu-cat-intro__title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    margin: 8px 0 12px;
    color: var(--color-text-primary);
}
.weedu-cat-intro__counter {
    display: inline-block;
    padding: 6px 14px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

/* Сетка статей — 3 колонки */
.weedu-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 8px;
}
@media (max-width: 1024px) {
    .weedu-articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
    .weedu-articles-grid { grid-template-columns: 1fr; }
}

/* Подрубрики (после пагинации) */
.weedu-cat-children {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}
.weedu-cat-children__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--color-text-primary);
}
.weedu-cat-children__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.weedu-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.weedu-cat-chip:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-light);
    text-decoration: none;
}
.weedu-cat-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.weedu-cat-chip:hover .weedu-cat-chip__count {
    background: var(--color-accent);
    color: #fff;
}

/* Описание категории */
.weedu-cat-description {
    margin-top: 40px;
    padding: 32px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}
.weedu-cat-description__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--color-text-primary);
}
.weedu-cat-description__text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-secondary);
}
.weedu-cat-description__text p { margin: 0 0 1em; }
.weedu-cat-description__text p:last-child { margin-bottom: 0; }
.weedu-cat-description__text a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: none;
}
.weedu-cat-description__text a:hover {
    color: var(--color-accent-hover);
    text-decoration: none;
}
.weedu-cat-description__text ul,
.weedu-cat-description__text ol {
    margin: 1em 0;
    padding-left: 1.6em;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .weedu-cat-intro__title { font-size: 28px; }
    .weedu-cat-description { padding: 24px; }
    .weedu-cat-description__title { font-size: 18px; }
}