/* ==========================================================================
   СТРАНИЦА КАТЕГОРИИ - КОМПАКТНЫЕ КАРТОЧКИ
   ========================================================================== */

/* Основной контейнер категории */
.category-template .site-main,
.archive .site-main {
    padding: 40px 0 80px;
    background: var(--bg-primary);
}

/* Заголовок категории */
.category-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.category-title {
    font-size: 48px;
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.category-description {
    font-size: 18px;
    font-size: clamp(16px, 2vw, 18px);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Сетка компактных карточек */
.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

/* Компактная карточка */
.mosaic-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Акцентная полоса слева */
.mosaic-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mosaic-tile:hover::before {
    transform: scaleY(1);
}

.mosaic-tile:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Заголовок карточки */
.mosaic-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.mosaic-tile-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.mosaic-tile-category:hover {
    opacity: 0.8;
}

.mosaic-tile-date {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Заголовок поста */
.mosaic-tile-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mosaic-tile-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mosaic-tile-title a:hover {
    color: var(--accent-color);
}

/* Краткое описание */
.mosaic-tile-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Мета информация */
.mosaic-tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

.mosaic-tile-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.mosaic-tile-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-tertiary);
}

.mosaic-tile-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Пагинация */
.pagination-wrapper {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.pagination,
.page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
    list-style: none;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.page-numbers a {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.page-numbers a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.page-numbers .current {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
}

.page-numbers .prev,
.page-numbers .next {
    padding: 0 16px;
}

.page-numbers .dots {
    color: var(--text-tertiary);
}

/* Сообщение об отсутствии постов */
.no-posts-found {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-posts-found p {
    font-size: 18px;
    margin-bottom: 24px;
}

/* Специфичные стили для разных категорий */
/* НОВОСТИ - тёпло-оранжевая подсветка как в Калейдоскопе */
.category-news .mosaic-tile::before,
.category-novosti .mosaic-tile::before {
    background: #f97316; /* Тёплый оранжевый */
}

.category-news .mosaic-tile:hover,
.category-novosti .mosaic-tile:hover {
    border-color: #f97316;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.15);
}

.category-news .mosaic-tile-category,
.category-novosti .mosaic-tile-category {
    color: #f97316;
}

.category-news .mosaic-tile-title a:hover,
.category-novosti .mosaic-tile-title a:hover {
    color: #f97316;
}

/* КАЛЕЙДОСКОП - оранжевая подсветка */
.category-kaleidoscope .mosaic-tile::before,
.category-kalejdoskop .mosaic-tile::before {
    background: #f97316;
}

.category-kaleidoscope .mosaic-tile:hover,
.category-kalejdoskop .mosaic-tile:hover {
    border-color: #f97316;
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.15);
}

.category-kaleidoscope .mosaic-tile-category,
.category-kalejdoskop .mosaic-tile-category {
    color: #f97316;
}

.category-kaleidoscope .mosaic-tile-title a:hover,
.category-kalejdoskop .mosaic-tile-title a:hover {
    color: #f97316;
}

/* Другие категории */
.category-society .mosaic-tile::before {
    background: #2563eb;
}

.category-sport .mosaic-tile::before {
    background: #16a34a;
}

.category-culture .mosaic-tile::before {
    background: #9333ea;
}

.category-economy .mosaic-tile::before {
    background: #f59e0b;
}

/* Темная тема */
body.dark-theme .mosaic-tile {
    background: var(--dark-bg-card);
    border-color: var(--dark-border-color);
}

body.dark-theme .mosaic-tile:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body.dark-theme .mosaic-tile-meta,
body.dark-theme .author-avatar {
    border-top-color: var(--dark-border-color);
    background: var(--dark-bg-secondary);
}

/* Тёплый оранжевый для новостей и калейдоскопа в тёмной теме */
body.dark-theme .category-news .mosaic-tile::before,
body.dark-theme .category-novosti .mosaic-tile::before,
body.dark-theme .category-kaleidoscope .mosaic-tile::before,
body.dark-theme .category-kalejdoskop .mosaic-tile::before {
    background: #fb923c; /* Более яркий оранжевый для тёмной темы */
}

body.dark-theme .category-news .mosaic-tile:hover,
body.dark-theme .category-novosti .mosaic-tile:hover,
body.dark-theme .category-kaleidoscope .mosaic-tile:hover,
body.dark-theme .category-kalejdoskop .mosaic-tile:hover {
    border-color: #fb923c;
    box-shadow: 0 4px 20px rgba(251, 146, 60, 0.25);
}

body.dark-theme .category-news .mosaic-tile-category,
body.dark-theme .category-novosti .mosaic-tile-category,
body.dark-theme .category-kaleidoscope .mosaic-tile-category,
body.dark-theme .category-kalejdoskop .mosaic-tile-category {
    color: #fb923c;
}

body.dark-theme .category-news .mosaic-tile-title a:hover,
body.dark-theme .category-novosti .mosaic-tile-title a:hover,
body.dark-theme .category-kaleidoscope .mosaic-tile-title a:hover,
body.dark-theme .category-kalejdoskop .mosaic-tile-title a:hover {
    color: #fb923c;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .category-template .site-main,
    .archive .site-main {
        padding: 24px 0 60px;
    }
    
    .category-header {
        margin-bottom: 40px;
    }
    
    .category-title {
        font-size: 32px;
    }
    
    .category-description {
        font-size: 16px;
    }
    
    .mosaic-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 40px;
    }
    
    .mosaic-tile {
        padding: 20px;
    }
    
    .mosaic-tile-title {
        font-size: 17px;
    }
    
    .mosaic-tile-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
        margin-bottom: 12px;
    }
    
    .mosaic-tile-meta {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }
    
    .mosaic-tile-stats {
        width: 100%;
        justify-content: flex-start;
    }
    
    .pagination-wrapper {
        margin-top: 40px;
    }
    
    .page-numbers a,
    .page-numbers span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .page-numbers .prev,
    .page-numbers .next {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .mosaic-tile {
        padding: 16px;
    }
    
    .mosaic-tile-header {
        margin-bottom: 8px;
    }
    
    .mosaic-tile-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .mosaic-tile-date {
        font-size: 12px;
    }
}

/* Планшеты */
@media (min-width: 768px) and (max-width: 1024px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Большие экраны */
@media (min-width: 1400px) {
    .mosaic-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Анимация появления карточек */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mosaic-tile {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.mosaic-tile:nth-child(1) { animation-delay: 0s; }
.mosaic-tile:nth-child(2) { animation-delay: 0.05s; }
.mosaic-tile:nth-child(3) { animation-delay: 0.1s; }
.mosaic-tile:nth-child(4) { animation-delay: 0.15s; }
.mosaic-tile:nth-child(5) { animation-delay: 0.2s; }
.mosaic-tile:nth-child(6) { animation-delay: 0.25s; }
.mosaic-tile:nth-child(7) { animation-delay: 0.3s; }
.mosaic-tile:nth-child(8) { animation-delay: 0.35s; }

/* Состояние загрузки */
.mosaic-tile.loading {
    pointer-events: none;
}

.mosaic-tile.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}