/*
Theme Name:   AI-panda
Theme URI:    https://ai-panda.ru
Description:  Тема для каталога нейросетей и промтов
Author:       Ваше имя
Author URI:   https://ваш-сайт.ru
Version:      1.0.0
Text Domain:  ai-panda
*/

/* ========== ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ========== */
:root {
    --color-primary-start: #0ABAB5;
    --color-primary-end: #1E6FD9;
    --primary-gradient: linear-gradient(135deg, var(--color-primary-start), var(--color-primary-end));
    --color-text-primary: #111111;
    --color-text-secondary: #4B5563;
    --color-text-muted: #6B7280;
    --color-text-on-dark: #FFFFFF;
    --color-link: var(--color-primary-start);
    --color-link-hover: #0A9D99;
    --color-link-visited: #6C5CE7;
    --color-link-active: #088580;
    --color-bg-primary: #FFFFFF;
    --color-bg-light: #F7FAFC;
    --color-bg-page: #F8FAFE;
    --color-border: #E5E7EB;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-btn: 12px;
    --radius-btn-cta: 40px;
    --shadow-card: 0 4px 12px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-btn: 0 4px 16px rgba(10, 186, 181, 0.3);
}

body {
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
}

a {
    color: var(--color-link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}
a:hover { color: var(--color-link-hover); text-decoration: underline; }
a:visited { color: var(--color-link-visited); }
a:active { color: var(--color-link-active); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: var(--color-text-primary);
}

p, li, .entry-content {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-primary);
}

code, pre {
    font-family: var(--font-mono);
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* ============================================================
   ОФОРМЛЕНИЕ СПИСКОВ
   ============================================================ */
.entry-content ul,
.entry-content ol,
.single-content ul,
.single-content ol,
.page-content ul,
.page-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.entry-content ul,
.single-content ul,
.page-content ul {
    list-style: disc;
}

.entry-content ol,
.single-content ol,
.page-content ol {
    list-style: decimal;
}

.entry-content li,
.single-content li,
.page-content li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul,
.single-content ul ul,
.single-content ol ol,
.single-content ul ol,
.single-content ol ul,
.page-content ul ul,
.page-content ol ol,
.page-content ul ol,
.page-content ol ul {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

/* Стили для списков в виджетах сайдбара */
.sidebar-widget ul,
.sidebar-widget ol {
    margin: 0;
    padding-left: 1.2em;
    list-style: disc;
}

.sidebar-widget li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.sidebar-widget ul ul,
.sidebar-widget ol ol {
    margin: 0.3em 0;
    padding-left: 1.2em;
}

/* ============================================================
   СКРЫВАЕМ ОПИСАНИЕ КАТЕГОРИИ, ЕСЛИ ОНО ПУСТОЕ (для динамики)
   ============================================================ */
.taxonomy-description--bottom {
    display: block; /* по умолчанию показываем, но JS может скрыть */
}

/* Для страниц каталога, где нет таксономии, описание скрыто через JS */

/* Базовые кнопки */
button, .button, .btn,
input[type="submit"],
input[type="button"] {
    background: var(--primary-gradient);
    color: var(--color-text-on-dark);
    border: none;
    border-radius: var(--radius-btn);
    padding: 10px 20px;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

/* ========== SOCIAL BUTTONS ========== */
.social-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    transition: background 0.2s, transform 0.2s;
    text-decoration: none;
}
.social-button:hover {
    transform: translateY(-2px);
    background: #e0e0e0;
}
.social-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}



/* CTA-кнопки */
.cta-button, .ai-btn {
    border-radius: var(--radius-btn-cta);
    padding: 14px 35px;
    font-weight: 600;
    display: inline-block;
    text-decoration: none;
    background: var(--primary-gradient);
    color: var(--color-text-on-dark);
    transition: background 0.2s;
}
.cta-button:hover, .ai-btn:hover {
    background: var(--color-link-hover);
    color: var(--color-text-on-dark);
    text-decoration: none;
}

/* Карточки */
.card, .post-card, .ai-card, .prompt-card, .ai-rating-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s, transform 0.2s;
    border: 1px solid var(--color-border);
}
.card:hover, .post-card:hover, .ai-card:hover, .prompt-card:hover, .ai-rating-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* Поля ввода */
input[type="text"], input[type="search"], input[type="email"], input[type="url"],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--color-primary-start);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 186, 181, 0.12);
}

/* ========== ПЕРЕОПРЕДЕЛЕНИЕ КОНТЕЙНЕРА ========== */
.fixed.site-content {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}
.site-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== СТИЛИ ДЛЯ СТАНДАРТНЫХ ЗАПИСЕЙ (статьи) ========== */
.entry-content h2 {
    font-size: 1.5em;
    margin-bottom: .77419355em;
    border-bottom: 1px solid var(--color-border);
    padding: 0 0 10px 0;
    color: var(--color-text-primary);
}

/* Убираем неразрывный пробел над шапкой */
.aipanda-header {
    margin-top: 0 !important;
}
body > p:empty,
body > div:empty {
    display: none;
}

/* Архив постов — 2 колонки */
.archive-post-wrapper .post-cards--vertical {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
@media (max-width: 768px) {
    .archive-post-wrapper .post-cards--vertical {
        grid-template-columns: 1fr;
    }
}

/* Карточка статьи */
.post-card {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}
.post-card__thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.post-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.post-card:hover .post-card__thumbnail img {
    transform: scale(1.05);
}
.post-card__category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary-gradient);
    color: var(--color-text-on-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    z-index: 2;
}
.post-card__category-badge:hover {
    background: var(--color-link-hover);
}
.post-card__body {
    padding: 16px;
}
.post-card__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}
.post-card__title a {
    color: var(--color-text-primary);
    text-decoration: none;
}
.post-card__title a:hover {
    color: var(--color-link);
}
.post-card__excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.post-card__avatar {
    border-radius: 50%;
    width: 24px;
    height: 24px;
}
.post-card__date::before {
    content: "·";
    margin-right: 8px;
}

/* Похожие записи для статей */
.related-posts__header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    margin-top: 60px;
    text-align: center;
}
.related-posts .post-cards--vertical {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 768px) {
    .related-posts .post-cards--vertical {
        grid-template-columns: 1fr;
    }
}

/* ========== RELATED POSTS GRID ========== */
.post-cards--vertical {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 992px) {
    .post-cards--vertical {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .post-cards--vertical {
        grid-template-columns: 1fr;
    }
}

/* Одиночная запись */
.single-post .content-area {
    padding-right: 30px;
}
@media (max-width: 768px) {
    .single-post .content-area {
        padding-right: 0;
    }
}

/* Страница сравнения */
.compare-page {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--font-primary);
}
.compare-page__title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    font-weight: 700;
}
.compare-page__empty {
    text-align: center;
    padding: 60px;
    color: var(--color-text-muted);
    font-size: 18px;
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.compare-table th, .compare-table td {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}
.compare-table th {
    background: var(--color-bg-light);
    font-weight: 600;
}
.compare-table td img {
    max-width: 80px;
    border-radius: var(--radius-sm);
}

/* Страница избранного */
.favorites-page {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--font-primary);
}
.favorites-page__title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 36px;
    font-weight: 700;
}
.favorites-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 18px;
}
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.favorites-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s, transform 0.2s;
}
.favorites-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
.favorites-card__img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}
.favorites-card__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}
.favorites-card__excerpt {
    font-size: 14px;
    color: var(--color-text-muted);
}
.favorites-card__rating {
    color: #F59E0B;
    font-weight: 600;
    margin: 8px 0;
}
.favorites-card__link {
    color: var(--color-primary-start);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.favorites-card__link:hover {
    color: var(--color-link-hover);
}

/* ========== УНИФИКАЦИЯ КАТАЛОГОВ ========== */
.fixed.site-content .catalog-wrapper,
.fixed.site-content .single-wrapper,
.fixed.site-content .compare-page,
.fixed.site-content .favorites-page,
.fixed.site-content .ai-rating__container {
    max-width: 1400px !important;
}

/* Общий контейнер-обёртка для любого каталога */
.catalog-wrapper {
    max-width: 1400px;
    margin: 60px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
}
.catalog-wrapper .catalog-primary {
    flex: 1;
    max-width: 100%;
}
.catalog-wrapper .catalog-sidebar {
    width: 300px;
    flex-shrink: 0;
}
@media (min-width: 961px) {
    .catalog-wrapper .catalog-sidebar {
        order: -1;
    }
}
@media (max-width: 960px) {
    .catalog-wrapper {
        flex-direction: column;
    }
    .catalog-wrapper .catalog-sidebar {
        width: 100%;
        order: 0;
    }
}

.single-content-wrapper {
    margin-top:50px;
}

/* Универсальная сетка карточек */
.catalog-grid {
    display: grid;
    gap: 20px;
}
.catalog-grid--3cols {
    grid-template-columns: repeat(3, 1fr);
}
.catalog-grid--4cols {
    grid-template-columns: repeat(4, 1fr);
}
.catalog-grid--2cols {
    grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 992px) {
    .catalog-grid--3cols,
    .catalog-grid--4cols {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .catalog-grid--3cols,
    .catalog-grid--4cols,
    .catalog-grid--2cols {
        grid-template-columns: 1fr;
    }
}

/* ========== СЕТКИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ ========== */
.home-catalog__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
.home-prompts__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
.home-articles__grid--3cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
@media (max-width: 992px) {
    .home-catalog__grid,
    .home-prompts__grid,
    .home-articles__grid--3cols {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .home-catalog__grid,
    .home-prompts__grid,
    .home-articles__grid--3cols {
        grid-template-columns: 1fr;
    }
}

.catalog-page-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-text-primary);
}
.catalog-breadcrumbs {
    margin-bottom: 20px;
}

/* ========== SINGLE POST STYLES ========== */
.single-wrapper {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}
.single-container {
    display: flex;
    gap: 30px;
}
.single-main {
    flex: 1;
    min-width: 0;
}
.single-sidebar {
    width: 300px;
    flex-shrink: 0;
}
@media (max-width: 960px) {
    .single-container {
        flex-direction: column;
    }
    .single-sidebar {
        width: 100%;
    }
}

/* Hero блок */
.single-hero {
    margin-bottom: 30px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-light);
}
.single-hero__image {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}
.single-hero__img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}
.single-hero__caption {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
    padding: 8px;
    background: rgba(0,0,0,0.05);
}
.single-hero__content {
    padding: 24px 30px;
}
.single-title {
    font-size: 2.2em;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--color-text-primary);
    line-height: 1.2;
}
.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--color-text-muted);
}
.single-meta__item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.single-meta__item svg {
    stroke: currentColor;
}
.single-meta__item a {
    color: var(--color-text-muted);
    text-decoration: none;
}
.single-meta__item a:hover {
    color: var(--color-link);
}

.single-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: 30px;
}
.single-content h2,
.single-content h3,
.single-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.single-content p {
    margin-bottom: 1.2em;
}
.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}
.single-content .wp-caption-text {
    font-size: 13px;
    color: var(--color-text-muted);
}

.single-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}
.single-tags__label {
    font-weight: 600;
    color: var(--color-text-primary);
}
.single-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-bg-light);
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: 0.2s;
}
.single-tag:hover {
    background: var(--primary-gradient);
    color: #fff;
}

@media (max-width: 768px) {
    .single-hero__content {
        padding: 16px 20px;
    }
    .single-title {
        font-size: 1.8em;
    }
    .single-meta {
        gap: 12px;
        font-size: 12px;
    }
}

/* ========== Единый сайдбар ========== */
.single-sidebar {
    width: 300px;
    flex-shrink: 0;
}
.single-sidebar .widget {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
}
.single-sidebar .widget-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-gradient);
    display: inline-block;
}
.ai-favorite-widget {
    text-align: center;
}
.ai-favorite-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-btn-cta);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.ai-favorite-button:hover {
    background: var(--color-link-hover);
}
.single-sidebar .widget_nav_menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.single-sidebar .widget_nav_menu li {
    margin-bottom: 10px;
}
.single-sidebar .widget_nav_menu a {
    display: block;
    padding: 8px 12px;
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: 0.2s;
}
.single-sidebar .widget_nav_menu a:hover {
    background: var(--primary-gradient);
    color: white;
}

/* Блок «Направления» (категории нейросетей) */
.ai-directions-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-gradient);
    display: inline-block;
}
.ai-directions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-directions-list li {
    margin: 0;
}
.ai-directions-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}
.ai-directions-list a:hover {
    background: var(--primary-gradient);
    color: #fff;
    transform: translateX(4px);
}
.ai-directions-list a:hover svg {
    stroke: #fff;
    fill: #fff;
}
.ai-directions-list svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 1.5;
    transition: stroke 0.2s, fill 0.2s;
}
.ai-directions-list a:hover svg path,
.ai-directions-list a:hover svg rect,
.ai-directions-list a:hover svg circle,
.ai-directions-list a:hover svg polygon {
    stroke: #fff;
    fill: #fff;
}
@media (max-width: 768px) {
    .ai-directions-widget {
        padding: 16px;
    }
    .ai-directions-list a {
        padding: 8px 10px;
        font-size: 13px;
    }
    .ai-directions-list svg {
        width: 20px;
        height: 20px;
    }
}

/* ========== FOOTER ========== */
.site-footer-container {
    background: #26252d;
}
.site-footer {
    background: #26252d;
    color: #ffffff;
    padding: 30px 0;
}
.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-info {
    font-size: 14px;
    color: #ffffff;
}
.footer-info a {
    color: #ffffff;
    text-decoration: none;
}
.footer-info a:hover {
    text-decoration: underline;
}
.footer-counters {
    font-size: 14px;
    color: #ffffff;
}
@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ========== HERO BLOCK ========== */
.ai-hero__img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
    border-radius: var(--radius-md);
}
.ai-hero__placeholder {
    width: 100%;
    height: 200px;
    background: var(--color-border);
    border-radius: var(--radius-md);
}
@media (max-width: 992px) {
    .ai-hero__img {
        max-height: 300px;
    }
}
@media (max-width: 576px) {
    .ai-hero__img {
        max-height: 200px;
    }
}

/* ========== RATING STYLES ========== */
.wp-star-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wp-star-rating .star-rating-item {
    display: inline-block;
    cursor: pointer;
}
.wp-star-rating .star-rating-item svg {
    width: 20px;
    height: 20px;
    stroke: #ccc;
    transition: fill 0.2s;
}
.wp-star-rating .star-rating-text {
    margin-left: 10px;
    font-size: 14px;
    color: #6B7280;
}
.wp-star-rating.disabled .star-rating-item {
    cursor: default;
}

/* ============================================================
   НОВЫЕ ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (расширенные)
   ============================================================ */
:root {
    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Ширина контейнера */
    --container-max-width: 1400px;
    --container-padding: 20px;

    /* Ширина сайдбара */
    --sidebar-width: 300px;

    /* Кнопки */
    --btn-padding-y: 12px;
    --btn-padding-x: 24px;
    --btn-font-size: 16px;
    --btn-border-radius: 40px;
}

/* ============================================================
   ЕДИНЫЙ КОНТЕЙНЕР
   ============================================================ */
.container {
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    box-sizing: border-box;
}

/* ============================================================
   ЕДИНЫЕ КНОПКИ
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--btn-padding-y) var(--btn-padding-x);
    font-size: var(--btn-font-size);
    font-weight: 600;
    border: none;
    border-radius: var(--btn-border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
    font-family: var(--font-primary);
    line-height: 1.2;
    white-space: nowrap;
}
.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-link-hover);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: var(--color-warning);
    color: #fff;
}
.btn-secondary:hover {
    background: #d97706;
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary-start);
    border: 2px solid var(--color-primary-start);
}
.btn-outline:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    text-decoration: none;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* ============================================================
   ЕДИНЫЕ ПОЛЯ ВВОДА
   ============================================================ */
.input,
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 16px;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary-start);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 186, 181, 0.12);
}

/* ============================================================
   ЕДИНЫЕ СЕТКИ
   ============================================================ */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 992px) {
    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ЕДИНЫЙ САЙДБАР
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}
@media (max-width: 960px) {
    .sidebar {
        width: 100%;
    }
}

.sidebar-widget {
    background: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--color-border);
}
.sidebar-widget__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-primary-start);
    display: inline-block;
}

/* Переопределение для ссылок-кнопок: убираем фиолетовый цвет посещённых */
.btn:visited,
.btn-primary:visited,
.btn-secondary:visited,
.btn-outline:visited,
.btn-lg:visited,
.btn-sm:visited {
    color: inherit; /* наследуем от родительского класса */
}
.btn-primary:visited {
    color: #fff;
}
.btn-secondary:visited {
    color: #fff;
}
.btn-outline:visited {
    color: var(--color-primary-start);
}
.btn-outline:hover:visited {
    color: #fff;
}

/* Убеждаемся, что у .home-badge скругление полное */
.home-badge {
    border-radius: var(--radius-full) !important;
}

/* Переопределение для ссылок-кнопок: убираем фиолетовый цвет посещённых */
.btn:visited,
.btn-primary:visited,
.btn-secondary:visited,
.btn-outline:visited,
.btn-lg:visited,
.btn-sm:visited {
    color: inherit; /* наследуем от родительского класса */
}
.btn-primary:visited {
    color: #fff;
}
.btn-secondary:visited {
    color: #fff;
}
.btn-outline:visited {
    color: var(--color-primary-start);
}
.btn-outline:hover:visited {
    color: #fff;
}

/* ============================================================
   ОФОРМЛЕНИЕ SINGLE.PHP
   ============================================================ */

/* Отступ для хлебных крошек */
.single-breadcrumbs {
    margin-bottom: var(--spacing-lg);
}

/* Уменьшаем заголовок */
.single-title {
    font-size: 2em; /* было 2.2em */
    margin-bottom: var(--spacing-md);
}

/* Блок с мета-информацией */
.single-meta-wrapper {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

/* Основная статья – с бордером и отступами */
.single-article {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-xl);
}

/* Отступы внутри контента */
.single-content {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}
.single-content p {
    margin-bottom: 1.2em;
}

/* Блок социальных кнопок и рейтинга перед комментариями */
.single-engagement {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) 0;
    margin: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.single-engagement__social {
    flex: 1;
}
.single-engagement__rating {
    flex-shrink: 0;
}

/* Комментарии – отступ сверху */
.comments-area {
    margin-top: var(--spacing-2xl);
}

/* Похожие записи – отступ сверху */
.related-posts {
    margin-top: var(--spacing-2xl);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .single-article {
        padding: var(--spacing-lg);
    }
    .single-title {
        font-size: 1.6em;
    }
    .single-engagement {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
}
/* ============================================================
   ВИДЖЕТ "ПОСЛЕДНИЕ ЗАПИСИ С ИЗОБРАЖЕНИЕМ"
   ============================================================ */
.recent-posts-widget {
    list-style: none;
    margin: 0;
    padding: 0;
}
.recent-posts-widget__item {
    margin-bottom: var(--spacing-sm);
}
.recent-posts-widget__link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: inherit;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}
.recent-posts-widget__link:hover {
    background: var(--color-bg-light);
}
.recent-posts-widget__thumb {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.recent-posts-widget__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recent-posts-widget__placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.recent-posts-widget__info {
    overflow: hidden;
}
.recent-posts-widget__title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-posts-widget__date {
    font-size: 12px;
    color: var(--color-text-muted);
}
