* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    width: 220px;
    height: 85px;
    background: url('/test4/manager/templates/default/images/modx-logo-color.svg') no-repeat center;
    background-size: contain;
    display: block;
    text-indent: -9999px;
    margin: 0 auto;
    font-size: 2rem;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 18px;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
}

.page-title {
    font-size: 2.5rem;
    margin: 40px 0 30px;
    color: #333;
    text-align: center;
}

/* News List - каталог с карточками */
.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.news-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Обёртка для контента новости */
.news-content-wrapper {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1rem;
    margin: 0 0 15px;
    line-height: 1.3;
}

.news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.news-title a:hover {
    color: #667eea;
}

/* Мета-информация с иконками */
.news-meta {
    padding: 0 0 15px;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

.news-date::before,
.news-author::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
}

.news-date::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
}

.news-author::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
}

.news-preview {
    padding: 0;
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
    font-size: 15px;
    flex: 1;
}

/* Обёртка для изображения */
.news-image-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.news-item:hover .news-image {
    transform: scale(1.05);
}

/* Блок с изображением (перед заголовком) - квадрат 50×50 */
.news-image-block {
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
.news-image-block img{
    border-radius: 8px;
}
.news-image-block .news-title{
    width: calc(100% - 75px);
}

.news-image-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

/* Плейсхолдер (цветной квадратик) */
.news-image-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.news-image-placeholder::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.85;
    z-index: -1;
}

.news-image-letter {
    position: relative;
    z-index: 2;
    color: white;
}

.news-read-more {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: bold;
    align-self: flex-start;
}

.news-read-more:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653d90 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Pagination */
.pagination-wrapper {
    margin: 60px 0 40px;
    text-align: center;
}

.pagination {
    list-style: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 15px;
    min-width: 40px;
    text-align: center;
}

.pagination-current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    font-weight: bold;
}

.pagination a:hover:not(.pagination-current) {
    background: #f0f0f0;
    color: #667eea;
    border-color: #667eea;
}

.pagination-prev,
.pagination-next {
    padding: 10px 20px;
    background: #f8f9fa;
    font-weight: bold;
}

.pagination-prev:hover,
.pagination-next:hover {
    background: #e8e9ea;
}

/* News Detail */
.news-detail {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-detail-image {
    text-align: center;
    margin-bottom: 30px;
}

.news-detail-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-detail-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
}

.news-detail-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.news-detail-content {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.news-detail-content p {
    margin-bottom: 20px;
}

.news-detail-tags {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 15px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.news-detail-back {
    padding-top: 20px;
}

.news-detail-back a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.news-detail-back a:hover {
    color: #5568d3;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
    .news-list {
        grid-template-columns: 1fr;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .news-detail {
        padding: 20px;
    }
    
    .news-image-wrapper {
        height: 160px;
    }
    
    .news-image-placeholder {
        font-size: 50px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }
    
    .news-title {
        font-size: 1.2rem;
    }
    
    .news-preview {
        font-size: 14px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 6px;
    }
    
    .pagination a,
    .pagination span {
        width: 100%;
        padding: 10px;
    }
}
/* Блок тегов с разделительной линией */
.news-tags {
    border-top: 1px solid #e0e0e0;
    padding: 16px 0px;
    margin: 16px 0px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Стиль для каждого тега-кнопочки */
.news-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.news-tag:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border-color: #90caf9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: default;
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-tags {
        gap: 6px;
    }
    .news-tag {
        padding: 5px 12px;
        font-size: 12px;
    }
}

/* Вариант с цветными тегами (по желанию) */
.news-tag:nth-child(5n+1) { background: linear-gradient(135deg, #e3f2fd, #bbdefb); color: #0d47a1; border-color: #90caf9; }
.news-tag:nth-child(5n+2) { background: linear-gradient(135deg, #f3e5f5, #e1bee7); color: #4a148c; border-color: #ce93d8; }
.news-tag:nth-child(5n+3) { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); color: #1b5e20; border-color: #a5d6a7; }
.news-tag:nth-child(5n+4) { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #e65100; border-color: #ffcc80; }
.news-tag:nth-child(5n+5) { background: linear-gradient(135deg, #e0f7fa, #b2ebf2); color: #006064; border-color: #80deea; }

.news-detail-content ul{
    margin-left:40px;
}