:root {
    --bg-dark: #1e1e1e;
    --text-light: #f5f5f5;
    --text-gray: #a0a0a0;
    --accent-yellow: #ffd600;
}
#pum-2806{
    padding: 50px 15px;
}
#pum-2806 > #popmake-2806{
    position: relative;
    max-width: 600px !important;
    width: 100%;
    inset: 0 !important;
    margin: auto;
}
@media (max-width: 767px) {
    #pum-2806 .pum-close{
        top: -30px;
        right: 0;
    }
}
.site-wrapper{
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0!important;
}
.main-content{
    flex: 1;
    background-color: var(--bg-dark, #1e1e1e);
    color: var(--text-light, #f5f5f5);
    font-family: sans-serif;
}
.cat-hero {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    align-items: flex-start;
}

.cat-hero__image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #313131;
    border-radius: 12px;
    overflow: hidden;
}

.cat-hero__image-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.badge-white {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #fff;
    color: #000;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 0 5px 2px #ddd;
    font-size: 12px;
    font-weight: bold;
}

.cat-hero__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cat-meta {
    width: 100%;
    display: flex;
    justify-content: space-between;
    color: #fff;
    opacity: 0.7;
    font-size: 14px;
    margin-bottom: 8px;
}

.cat-hero__title {
    font-size: clamp(24px, 3vw ,28px);
    margin: 0 0 24px;
    line-height: 1.25;
    text-wrap: balance;
}

.cat-hero__excerpt {
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.5;
    text-wrap: balance;
    max-height: calc(4em * 1.5);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}
.cat-hero__excerpt p{
    margin: 0;
}

/* --- Toolbar (Заголовок и поиск) --- */
.cat-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.cat-search {
    display: flex;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    padding: 5px 15px;
}

.cat-search input {
    color: #000;
    border: none;
    outline: none;
    padding: 10px;
    transition: 99999s;
}

.cat-search button {
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Сетка карточек --- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}
@media (max-width: 991px) {
    .cat-grid{
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 767px) {
    .cat-hero{
        flex-direction: column;
        gap: 24px;
    }
    .cat-hero__image-wrap{
        width: 100%;
    }
    .cat-toolbar{
        flex-direction: column;
        gap: 24px;
    }
    .cat-search{
        width: 100%;
    }
}
@media (max-width: 575px) {
    .cat-grid{
        grid-template-columns: 1fr;
    }
}
.cat-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit!important;
    transition: 0.3s;
}
.cat-card:hover{
    transform: translateY(-4px);
}
.cat-card:hover .cat-card__title {
    color: #fed700;
}
.cat-card__image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    background: #313131;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.cat-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-card__title {
    font-size: clamp(18px, 3vw ,20px);
    line-height: 1.3;
    margin: 0 0 8px;
    transition: 0.3s;
}

.cat-card__excerpt {
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.5;
    max-height: calc(4em * 1.5);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* --- Пагинация --- */
.cat-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.cat-pagination .page-numbers {
    color: var(--text-gray);
    text-decoration: none;
    padding: 5px 10px;
}

.cat-pagination .current {
    color: #000;
    background-color: var(--accent-yellow);
    border-radius: 4px;
    font-weight: bold;
}
.site-main{
    padding: 40px 0;
}
@media (max-width: 991px) {
    .site-main{
        padding: 30px 0;
    }
}
/*-----articles---------*/
/* Ограничиваем ширину для читабельности */
.single-container {
    max-width: 900px;
    margin: 0 auto;
}
/* --- Шапка статьи --- */
.single-header {
    text-align: center;
    margin-bottom: 40px;
}
.categories-list{
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin: 0 0 30px;
}
.categories-list li a {
    display: inline-block;
    background-color: #fff;
    color: #000;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.categories-list li.current-cat a{
    background: #fed700;
}
/* Стилизация стандартного вывода the_category() */
.single-categories ul.post-categories {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.single-categories ul.post-categories li a {
    display: inline-block;
    background-color: #fff;
    color: #000;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.single-title {
    font-size: clamp(24px, 5vw ,40px);
    line-height: 1.25;
    text-wrap: balance;
    margin: 0;
}

.single-hero-image {
    width: 100%;
    margin-bottom: 40px;
}

.single-hero-image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

/* --- Мета: Автор и дата --- */
.single-meta-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap-reverse;
    gap: 16px;
    margin-bottom: 40px;
}

.single-author {
    max-width: 300px;
    display: flex;
    align-items: center;
    gap: 15px;
}
.single-author__avatar{
    width: 64px;
    height: 64px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    flex-shrink: 0;
}
.single-author__avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.single-author__info {
    display: flex;
    flex-direction: column;
}

.single-author__name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.single-author__role {
    color: var(--text-gray);
    font-size: 13px;
}

.single-date-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.single-date {
    font-weight: bold;
    font-size: 16px;
}

.single-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}
@media (max-width: 575px) {
    .single-date-actions{
        width: 100%;
        justify-content: space-between;
    }
}
/* --- Контент статьи (the_content) --- */
.single-content {
    font-size: clamp(14px, 3vw ,16px);
    line-height: 1.5;
    color: #fff;
}

.single-content p {
    margin-bottom: 20px;
}

.single-content h2,
.single-content h3 {
    color: #fff;
    margin: 40px 0 20px;
}
.single-content a{
    color: #fed700!important;
    word-break: break-word;
}
.related-articles {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Опциональный разделитель */
    font-family: inherit;
}
.related-articles__heading {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 32px;
    font-weight: bold;
}
.related-articles__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: 0.3s;
    border-radius: 10px;
}
.related-card:hover {
    transform: translateY(-4px);
}
.related-card:hover .related-card__title {
    color: #fed700;
}
.related-card__image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #313131;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 16/9;
}
.related-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}
.related-card__title {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin: 0 0 12px 0;
    line-height: 1.3;
    transition: color 0.2s ease;
    /* Обрезка текста до 3 строк с многоточием */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card__excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    /* Обрезка описания до 3 строк с многоточием */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 992px) {
    .related-articles__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .related-card {
        /* Скрываем 3-ю карточку на планшетах для ровной сетки */
    }
    .related-card:nth-child(3) {
        display: none;
    }
}
@media (max-width: 576px) {
    .related-articles__grid {
        grid-template-columns: 1fr;
    }
    .related-card:nth-child(3) {
        display: flex;
    }
}

/* --- Кнопка "Наверх" --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(50px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding: 0;
}

.scroll-to-top svg {
    width: 28px;
    height: 28px;
}

.scroll-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

@media (max-width: 767px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
    .scroll-to-top svg {
        width: 24px;
        height: 24px;
    }
}

/* --- Лайтбокс --- */
.custom-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.custom-lightbox.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.custom-lightbox.is-visible .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

.lightbox-close:hover {
    color: var(--accent-yellow, #ffd600);
}
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 2;
    transition: background 0.3s ease, color 0.3s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-yellow, #ffd600);
    color: #000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* На мобильных устройствах кнопки делаем чуть меньше */
@media (max-width: 768px) {
    .lightbox-prev { left: 5px; padding: 10px 15px; font-size: 24px; }
    .lightbox-next { right: 5px; padding: 10px 15px; font-size: 24px; }
}

