/* ============================================================
   GameFeed2 — редизайн GameChronicle
   Тёмная тема, карточки, Inter, акцент #6C7A91
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-page: #111315;
    --bg-card: #1A1D21;
    --bg-elevated: #1F2228;
    --border-line: #2C3036;
    --border-light: #262A30;
    --accent: #6C7A91;
    --accent-hover: #8A9BB5;
    --text-primary: #E8EDF2;
    --text-secondary: #9AA4B3;
    --text-muted: #6C7A8A;
    --container-max: 1280px;
    --radius-card: 12px;
    --radius-block: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: color 0.2s; }
img { max-width: 100%; height: auto; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

/* ========= HEADER ========= */
header {
    border-bottom: 1px solid var(--border-line);
    background: var(--bg-page);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 24px;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    flex-wrap: wrap;
    gap: 16px;
    max-width: var(--container-max);
    margin: 0 auto;
}
.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo i { color: var(--accent); font-size: 1.3rem; }
.logo span { font-weight: 400; color: var(--text-muted); }

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}
.nav-links a {
    font-weight: 450;
    font-size: 0.9rem;
    transition: color 0.2s;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
}
.nav-links a.active,
.nav-links a:hover { color: var(--text-primary); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
}
.nav-backdrop { display: none; }

/* ========= SECTION HEADERS ========= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 36px 0 20px 0;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-line);
}
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}
.section-badge {
    font-size: 0.7rem;
    background: var(--bg-elevated);
    padding: 4px 12px;
    border-radius: 16px;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

/* ========= NEWS GRID (CARDS) ========= */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin: 16px 0 20px;
}
.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    cursor: pointer;
}
.news-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-img {
    height: 140px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img i { font-size: 2.8rem; color: var(--text-muted); }
.card-img .image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 2.8rem;
}
.card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.7);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.card-content { padding: 16px; }
.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
}
.read-more {
    color: var(--accent);
    font-weight: 500;
    font-size: 0.75rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.read-more:hover { color: var(--accent-hover); }

/* ========= NEWS LIST ========= */
.news-list-container { margin: 30px 0 50px; }
.news-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
    cursor: pointer;
}
.news-list-item:hover {
    background: var(--bg-elevated);
    padding-left: 12px;
    margin-left: -12px;
    border-radius: 8px;
}
.news-list-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--bg-elevated);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-muted);
    overflow: hidden;
}
.news-list-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.news-list-content { flex: 1; }
.news-list-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.news-list-excerpt {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-list-meta {
    display: flex;
    gap: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.news-list-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.news-list-item:hover .news-list-arrow { opacity: 1; }

/* ========= PAGINATION ========= */
.pagination-block {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0 20px;
}
.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.15s;
    text-decoration: none;
}
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg-page); }
.page-btn:hover:not(.active) { background: var(--bg-elevated); }

/* ========= SINGLE NEWS PAGE ========= */
.news-single { max-width: 800px; margin: 40px auto; }
.news-header { margin-bottom: 28px; }
.news-header .breadcrumb-block {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 12px;
    align-items: center;
}
.news-header .breadcrumb-block a { color: var(--text-muted); }
.news-header .breadcrumb-block a:hover { color: var(--text-primary); }
.news-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 12px 0 10px;
    line-height: 1.3;
}
.news-meta-line {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-line);
    padding-bottom: 16px;
    align-items: center;
}
.news-body {
    background: var(--bg-card);
    border-radius: var(--radius-block);
    padding: 28px;
    border: 1px solid var(--border-light);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.news-body p { margin-bottom: 1rem; }
.news-body h2 { font-size: 1.4rem; color: var(--text-primary); margin: 28px 0 14px; font-weight: 600; }
.news-body h3 { font-size: 1.15rem; color: var(--text-primary); margin: 22px 0 10px; font-weight: 600; }
.news-body a { color: var(--accent); text-decoration: underline; }
.news-body a:hover { color: var(--accent-hover); }
.news-body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; display: block; }
.news-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* ========= VIDEO EMBED (НА ВСЮ ШИРИНУ СТАТЬИ) ========= */
.news-body .video-embed {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    padding-bottom: 57.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}
.news-body .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}
/* Если видео вставлено без обёртки, тоже растягиваем */
.news-body iframe {
    width: 100% !important;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 8px;
    margin: 0;
}

.news-body ul, .news-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.news-body li { margin-bottom: 0.4rem; color: var(--text-secondary); }

/* ========= RELATED NEWS ========= */
.related-section { margin-top: 40px; }
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.related-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card-img {
    height: 120px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.related-card-img img { width: 100%; height: 100%; object-fit: cover; }
.related-card-img i { font-size: 2rem; color: var(--text-muted); }
.related-card-body { padding: 12px 14px; }
.related-card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }

/* ========= COMMENTS ========= */
.comments-section {
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-block);
    border: 1px solid var(--border-light);
    padding: 24px;
}
.comments-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; }
.moderation-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(108, 122, 138, 0.08);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.moderation-notice i {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}
.comment-form { margin-bottom: 32px; }
.form-group { margin-bottom: 14px; }
input, textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: 0.15s;
    font-family: 'Inter', sans-serif;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--bg-page); }

.comments-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item {
    background: var(--bg-elevated);
    border-radius: 10px;
    padding: 14px;
}
.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.comment-date { font-size: 0.6rem; color: var(--text-muted); font-weight: normal; }
.comment-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.empty-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.comment-reply { margin-left: 24px; border-left: 2px solid var(--border-light); padding-left: 14px; }
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.comment-reply-btn:hover { color: var(--accent); }
.comment-badge-editor {
    font-size: 0.55rem;
    background: var(--border-light);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}
.reply-indicator {
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    margin-bottom: 14px;
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    border-radius: 0 6px 6px 0;
}

/* ========= CATEGORY PAGE ========= */
.category-header-block {
    background: var(--bg-card);
    border-radius: var(--radius-block);
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 24px;
}
.category-header-block h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.category-header-block p { color: var(--text-muted); font-size: 0.85rem; }
.subcat-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.subcat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    text-decoration: none;
}
.subcat-link:hover { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }

/* ========= SIDEBAR ========= */
.main-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    margin: 20px 0;
}
.news-main { min-width: 0; }
.news-sidebar { min-width: 0; }
.sidebar-block {
    background: var(--bg-card);
    border-radius: var(--radius-block);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-block h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}
.sidebar-block h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin-top: 6px;
    border-radius: 2px;
}
.popular-list { display: flex; flex-direction: column; gap: 12px; }
.popular-item { display: flex; gap: 10px; align-items: center; }
.popular-index {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}
.popular-thumb {
    width: 44px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-elevated);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}
.popular-meta { font-size: 0.65rem; color: var(--text-muted); }
.latest-comments-list { display: flex; flex-direction: column; gap: 12px; }
.latest-comment-item {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
    font-size: 0.8rem;
}
.latest-comment-item:last-child { border-bottom: none; padding-bottom: 0; }
.latest-comment-author { font-weight: 600; color: var(--text-primary); font-size: 0.75rem; margin-bottom: 4px; }
.latest-comment-text { color: var(--text-secondary); }
.latest-comment-link { color: var(--text-muted); font-size: 0.65rem; }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-link {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    font-size: 0.7rem;
    transition: all 0.2s;
}
.tag-link:hover { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }

/* ========= FOOTER ========= */
footer {
    margin-top: 60px;
    border-top: 1px solid var(--border-line);
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}
footer a { color: var(--text-secondary); }
footer a:hover { color: var(--text-primary); }

/* ========= SCROLL TO TOP ========= */
#scroll-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 50;
}
#scroll-to-top.show { opacity: 1; visibility: visible; }
#scroll-to-top:hover { background: var(--accent); color: var(--bg-page); border-color: var(--accent); }

/* ========= RESPONSIVE ========= */
@media (max-width: 991px) {
    .nav-links { display: none; }
    .nav-toggle { display: inline-flex; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-page);
        border-bottom: 1px solid var(--border-line);
        padding: 16px 24px;
        gap: 12px;
        align-items: stretch;
    }
    .nav-backdrop { display: none; }
    .nav-backdrop.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: -1;
    }
    .main-with-sidebar { grid-template-columns: 1fr; }
    .news-header h1 { font-size: 1.4rem; }
    .news-body { padding: 20px; }
    .section-header { flex-direction: column; gap: 8px; }
}

@media (max-width: 700px) {
    .container { padding: 0 16px; }
    .header-inner { flex-direction: row; }
    .news-grid { grid-template-columns: 1fr; }
    .news-list-item { gap: 12px; }
    .news-list-icon { width: 40px; height: 40px; font-size: 1rem; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
}
