/* ============================================
   Модуль Новости — фронт
   ============================================ */

/* ---------- Базовые ---------- */
.sponews-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    color: #1d2327;
    box-sizing: border-box;
}
.sponews-page *,
.sponews-feed * {
    box-sizing: border-box;
}

/* ---------- Заголовок страницы ---------- */
.sponews-page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.sponews-page-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #111;
}
.sponews-page-count {
    color: #666;
    font-size: 14px;
}

/* ---------- Пустое состояние ---------- */
.sponews-empty,
.sponews-feed-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    background: #fafafa;
    border: 1px dashed #d0d0d0;
    border-radius: 8px;
}
.sponews-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}
.sponews-empty-text {
    font-size: 16px;
}

/* ============================================
   КАРТОЧКА НОВОСТИ (общая для всех видов)
   ============================================ */
.sponews-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    height: 100%;
}
.sponews-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: #0078d4;
}
.sponews-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
    overflow: hidden;
    flex-shrink: 0;
}
.sponews-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.sponews-card:hover .sponews-card-cover img {
    transform: scale(1.05);
}
.sponews-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
    background: #f5f5f5;
}
.sponews-card-pin {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.sponews-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.sponews-card-date {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}
.sponews-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sponews-card-excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sponews-card-more {
    margin-top: auto;
    font-size: 13px;
    color: #0078d4;
    font-weight: 500;
    padding-top: 4px;
}
.sponews-card:hover .sponews-card-more {
    text-decoration: underline;
}

/* ============================================
   СПИСОК /news/ — сетка
   ============================================ */
.sponews-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ============================================
   КАРУСЕЛЬ
   ============================================ */
.sponews-carousel {
    position: relative;
    margin: 20px 0;
}
.sponews-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sponews-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 2px;
    flex: 1;
    scrollbar-width: thin;
}
.sponews-carousel-track::-webkit-scrollbar {
    height: 8px;
}
.sponews-carousel-track::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}
.sponews-carousel-track::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}
.sponews-carousel-track::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}
.sponews-carousel-track > .sponews-card {
    flex: 0 0 280px;
    width: 280px;
}
.sponews-carousel-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    background: #fff;
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.sponews-carousel-nav:hover {
    background: #0078d4;
    color: #fff;
    border-color: #0078d4;
}
.sponews-carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   ТАБЛИЦА / СЕТКА (view=table)
   ============================================ */
.sponews-table-view {
    margin: 20px 0;
}
.sponews-table-grid {
    display: grid;
    gap: 16px;
}
.sponews-table-grid.sponews-cols-1 { grid-template-columns: 1fr; }
.sponews-table-grid.sponews-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sponews-table-grid.sponews-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sponews-table-grid.sponews-cols-4 { grid-template-columns: repeat(4, 1fr); }
.sponews-table-grid.sponews-cols-5 { grid-template-columns: repeat(5, 1fr); }
.sponews-table-grid.sponews-cols-6 { grid-template-columns: repeat(6, 1fr); }
.sponews-table-grid.sponews-cols-7 { grid-template-columns: repeat(7, 1fr); }
.sponews-table-grid.sponews-cols-8 { grid-template-columns: repeat(8, 1fr); }

.sponews-table-view.sponews-loading .sponews-table-grid {
    opacity: 0.5;
    pointer-events: none;
}

.sponews-table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 12px 0;
    flex-wrap: wrap;
}
.sponews-page-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.sponews-page-btn:hover:not(:disabled) {
    background: #0078d4;
    color: #fff;
    border-color: #0078d4;
}
.sponews-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.sponews-page-info {
    font-size: 14px;
    color: #666;
}

/* ============================================
   СТРАНИЦА ОДНОЙ НОВОСТИ
   ============================================ */
.sponews-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}
.sponews-breadcrumb a {
    color: #0078d4;
    text-decoration: none;
}
.sponews-breadcrumb a:hover {
    text-decoration: underline;
}

.sponews-article {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.sponews-article-head {
    margin-bottom: 20px;
}
.sponews-article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
    color: #111;
}
.sponews-article-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
    align-items: center;
}
.sponews-article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sponews-status-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.sponews-status-draft { background: #fff3cd; color: #856404; }
.sponews-status-archived { background: #e2e3e5; color: #383d41; }
.sponews-badge-pinned {
    display: inline-block;
    padding: 4px 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.sponews-article-cover {
    margin: 20px -30px;
    overflow: hidden;
}
.sponews-article-cover img {
    width: 100%;
    display: block;
    max-height: 520px;
    object-fit: cover;
}

.sponews-article-excerpt {
    font-size: 17px;
    line-height: 1.6;
    color: #555;
    padding: 16px 20px;
    margin: 20px 0;
    background: #f8f9fa;
    border-left: 4px solid #0078d4;
    border-radius: 4px;
}

.sponews-article-content {
    font-size: 16px;
    line-height: 1.7;
    color: #222;
    margin-top: 24px;
}
.sponews-article-content p {
    margin: 0 0 16px;
}
.sponews-article-content h2 {
    font-size: 24px;
    margin: 28px 0 14px;
    color: #111;
}
.sponews-article-content h3 {
    font-size: 20px;
    margin: 24px 0 12px;
    color: #111;
}
.sponews-article-content h4 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: #111;
}
.sponews-article-content ul,
.sponews-article-content ol {
    margin: 0 0 16px 24px;
    padding: 0;
}
.sponews-article-content li {
    margin-bottom: 6px;
}
.sponews-article-content blockquote {
    margin: 20px 0;
    padding: 12px 20px;
    background: #f8f9fa;
    border-left: 4px solid #0078d4;
    font-style: italic;
    color: #555;
}
.sponews-article-content a {
    color: #0078d4;
}
.sponews-article-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 30px 0;
}
.sponews-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.sponews-article-content th,
.sponews-article-content td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}
.sponews-article-content th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ---------- Блоки ---------- */
.sponews-block {
    margin: 20px 0;
}
.sponews-block:first-child {
    margin-top: 0;
}

.sponews-block-image {
    margin: 24px 0;
    text-align: center;
}
.sponews-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}
.sponews-block-image figcaption {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}
.sponews-align-left { text-align: left; }
.sponews-align-left img { margin-left: 0; }
.sponews-align-right { text-align: right; }
.sponews-align-right img { margin-right: 0; }
.sponews-align-center { text-align: center; }
.sponews-align-full img {
    width: 100%;
    border-radius: 6px;
}

.sponews-block-gallery {
    display: grid;
    gap: 10px;
    margin: 24px 0;
}
.sponews-block-gallery.sponews-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sponews-block-gallery.sponews-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sponews-block-gallery.sponews-cols-4 { grid-template-columns: repeat(4, 1fr); }
.sponews-gallery-item {
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
}
.sponews-gallery-item img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.sponews-gallery-item:hover img {
    transform: scale(1.05);
}

.sponews-block-iframe {
    margin: 24px 0;
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}
.sponews-block-iframe iframe {
    width: 100%;
    display: block;
    border: 0;
}
.sponews-iframe-blocked {
    padding: 20px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffe69c;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
}

.sponews-block-html {
    margin: 20px 0;
}

/* ============================================
   БЛОК «ДРУГИЕ НОВОСТИ»
   ============================================ */
.sponews-related {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}
.sponews-related-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #111;
}
.sponews-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.sponews-related-card {
    display: flex;
    gap: 12px;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    border: 1px solid #e8e8e8;
}
.sponews-related-card:hover {
    background: #f0f0f0;
    border-color: #0078d4;
}
.sponews-related-cover {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
}
.sponews-related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sponews-related-body {
    padding: 10px 12px 10px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}
.sponews-related-date {
    font-size: 11px;
    color: #999;
}
.sponews-related-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   ПАГИНАЦИЯ /news/ (список)
   ============================================ */
.sponews-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.sponews-pagination .sponews-page-btn {
    text-decoration: none;
    display: inline-block;
}

/* ============================================
   АДАПТИВ
   ============================================ */
@media (max-width: 900px) {
    .sponews-table-grid.sponews-cols-3,
    .sponews-table-grid.sponews-cols-4,
    .sponews-table-grid.sponews-cols-5,
    .sponews-table-grid.sponews-cols-6,
    .sponews-table-grid.sponews-cols-7,
    .sponews-table-grid.sponews-cols-8 {
        grid-template-columns: repeat(2, 1fr);
    }
    .sponews-block-gallery.sponews-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .sponews-article {
        padding: 20px;
    }
    .sponews-article-cover {
        margin: 20px -20px;
    }
    .sponews-article-title {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .sponews-page {
        padding: 16px 12px;
    }
    .sponews-page-title {
        font-size: 24px;
    }
    .sponews-table-grid.sponews-cols-2,
    .sponews-table-grid.sponews-cols-3,
    .sponews-table-grid.sponews-cols-4,
    .sponews-table-grid.sponews-cols-5,
    .sponews-table-grid.sponews-cols-6,
    .sponews-table-grid.sponews-cols-7,
    .sponews-table-grid.sponews-cols-8 {
        grid-template-columns: 1fr;
    }
    .sponews-carousel-track > .sponews-card {
        flex: 0 0 240px;
        width: 240px;
    }
    .sponews-carousel-nav {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .sponews-block-gallery.sponews-cols-2,
    .sponews-block-gallery.sponews-cols-3,
    .sponews-block-gallery.sponews-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .sponews-related-card {
        flex-direction: column;
    }
    .sponews-related-cover {
        width: 100%;
        height: 160px;
    }
    .sponews-related-body {
        padding: 10px 12px 12px;
    }
    .sponews-article {
        padding: 16px;
        border-radius: 0;
    }
    .sponews-article-cover {
        margin: 16px -16px;
    }
    .sponews-article-title {
        font-size: 22px;
    }
    .sponews-article-content {
        font-size: 15px;
    }
}
.sponews-block-video {
    margin: 24px 0;
    text-align: center;
}
.sponews-block-video video {
    max-width: 100%;
    width: 100%;
    border-radius: 8px;
    background: #000;
    display: block;
    margin: 0 auto;
}
.sponews-video-caption {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}