/* Лента новостей в стиле X (Twitter) — сайт и админка */

.news-feed {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0,0,0,.08));
    border-radius: 16px;
    overflow: hidden;
}

.news-post {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
    text-align: left;
}
.news-post:last-child { border-bottom: none; }
.news-feed .news-post:hover { background: rgba(13, 148, 136, .03); }

.news-post-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0;
}

.news-post-main { min-width: 0; flex: 1; }

.news-post-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    font-size: 0.92rem;
}
.news-post-head strong { color: var(--text, #0f172a); font-weight: 700; }
.news-post-handle,
.news-post-time {
    color: var(--text-muted, #64748b);
    font-size: 0.88rem;
}
.news-post-dot { color: #94a3b8; }

.news-post-text {
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text, #0f172a);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0 0 10px;
}
.news-post-text:empty { display: none; }

.news-inline-link {
    color: #1d9bf0;
    text-decoration: none;
    word-break: break-all;
}
.news-inline-link:hover { text-decoration: underline; }

.news-link-card {
    display: block;
    margin-top: 8px;
    border: 1px solid var(--border, rgba(0,0,0,.08));
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card, #fff);
}
.news-link-card:hover { background: rgba(13, 148, 136, .04); }
.news-link-card-media {
    display: block;
    aspect-ratio: 1.91 / 1;
    background: #e2e8f0;
    overflow: hidden;
}
.news-link-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-link-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border, rgba(0,0,0,.08));
}
.news-link-card-domain {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: lowercase;
}
.news-link-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text, #0f172a);
    line-height: 1.3;
}
.news-link-card-desc {
    font-size: 0.84rem;
    color: #64748b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-photos {
    display: grid;
    gap: 3px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(0,0,0,.08));
    margin-top: 4px;
}
.news-photos[data-count="1"] { grid-template-columns: 1fr; }
.news-photos[data-count="2"],
.news-photos[data-count="4"] { grid-template-columns: 1fr 1fr; }
.news-photos[data-count="3"] {
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: 1fr 1fr;
    min-height: 260px;
}
.news-photos[data-count="3"] .news-photo:first-child {
    grid-row: 1 / span 2;
}
.news-photos[data-count="5"],
.news-photos[data-count="6"],
.news-photos[data-count="7"],
.news-photos[data-count="8"],
.news-photos[data-count="9"],
.news-photos[data-count="10"] {
    grid-template-columns: repeat(3, 1fr);
}

.news-photo {
    display: block;
    position: relative;
    overflow: hidden;
    background: #0f172a;
    aspect-ratio: 1;
}
.news-photos[data-count="1"] .news-photo { aspect-ratio: 16 / 10; }
.news-photos[data-count="3"] .news-photo { aspect-ratio: auto; min-height: 0; height: 100%; }
.news-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
}

.news-empty-feed {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted, #64748b);
}
.news-empty-feed strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text, #0f172a);
    margin-bottom: 6px;
}

.info-page.news-page .info-view-body,
#ajax-page-container .info-page.news-page .info-view-body {
    max-width: 600px;
    padding: 0 0 36px;
}
.info-page.news-page .info-view-body > .news-feed,
#ajax-page-container .info-page.news-page .info-view-body > .news-feed {
    border-radius: 0;
    border-left: none;
    border-right: none;
}
@media (min-width: 640px) {
    .info-page.news-page .info-view-body,
    #ajax-page-container .info-page.news-page .info-view-body {
        padding: 12px 16px 36px;
    }
    .info-page.news-page .info-view-body > .news-feed,
    #ajax-page-container .info-page.news-page .info-view-body > .news-feed {
        border-radius: 16px;
        border: 1px solid var(--border, rgba(0,0,0,.08));
    }
}
