/* css/news_single.css */



/* --- Layout & Header --- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER STYLE */
.news-page-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 30px;
}

.news-page-header h1 {
    font-size: 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
}

.news-page-header h1 i {
    color: var(--primary-color);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.breadcrumbs a:hover { color: var(--primary-color); }
.breadcrumbs .sep { font-size: 0.7rem; opacity: 0.5; }
.breadcrumbs .current { color: var(--text-color); font-weight: 500; }

/* --- Main Grid --- */
.news-single-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

/* --- Article Card --- */
.news-article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.article-cover {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background-color: #202025;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-cover:hover img { transform: scale(1.02); }

.article-cover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, var(--card-bg) 0%, transparent 60%);
}

.category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2;
}

.article-content-wrapper {
    padding: 30px 40px;
    position: relative;
    margin-top: -20px;
    z-index: 2;
}

.article-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.article-header h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.author-info { display: flex; align-items: center; gap: 10px; }
.author-info img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-color); }
.author-info span { font-weight: 600; color: var(--text-color); }
.meta-sep { opacity: 0.3; }

.article-body { color: var(--text-color); font-size: 1.05rem; line-height: 1.8; margin-bottom: 40px; }
.article-body p { margin-bottom: 20px; }
.article-body h2, .article-body h3 { margin-top: 30px; margin-bottom: 15px; }
.article-body img { max-width: 100%; border-radius: 12px; margin: 20px 0; }
.article-body ul { list-style: disc; padding-left: 20px; margin-bottom: 20px; }
.article-body a { color: var(--primary-color); text-decoration: underline; }

.article-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px; border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--secondary-background);
    border: 1px solid var(--border-color);
    color: var(--text-muted); padding: 10px 20px;
    border-radius: 12px; cursor: pointer; transition: all 0.2s;
    font-size: 1rem; font-weight: 600;
}
.action-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.like-btn.active { background: rgba(234, 84, 85, 0.1); border-color: #EA5455; color: #EA5455; }

.footer-right { display: flex; align-items: center; gap: 10px; }
.share-label { color: var(--text-muted); font-size: 0.9rem; margin-right: 5px; }
.social-btn {
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--secondary-background); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.social-btn.vk:hover { background: #0077FF; color: white; border-color: #0077FF; }
.social-btn.tg:hover { background: #0088cc; color: white; border-color: #0088cc; }

/* --- Comments --- */
.comments-section {
    margin-top: 40px; background: var(--card-bg);
    border: 1px solid var(--border-color); border-radius: 20px;
    padding: 30px 40px;
}
.comments-header { margin-bottom: 25px; display: flex; align-items: center; }
.comments-header h3 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.count-badge {
    background: var(--secondary-background); border: 1px solid var(--border-color);
    padding: 2px 10px; border-radius: 12px; font-size: 0.9rem; color: var(--text-muted);
}

.comment-form-card { margin-bottom: 30px; }
.form-row { display: flex; gap: 15px; align-items: flex-start; }

.user-avatar-mini {
    width: 45px; height: 45px; flex-shrink: 0;
    border-radius: 50%; overflow: hidden;
    background: var(--secondary-background);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.5rem;
    border: 1px solid var(--border-color);
}
.user-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

.input-wrapper { flex-grow: 1; position: relative; }
.input-wrapper textarea {
    width: 100%; background: var(--secondary-background);
    border: 1px solid var(--border-color); border-radius: 12px;
    padding: 15px 55px 15px 15px; color: var(--text-color);
    resize: vertical; min-height: 80px; /* УВЕЛИЧЕНА ВЫСОТА */
    font-family: inherit; transition: border-color 0.2s;
}
.input-wrapper textarea:focus { outline: none; border-color: var(--primary-color); }
.send-btn {
    position: absolute; right: 12px; bottom: 12px;
    background: var(--primary-color);
    border: none; color: white;
    cursor: pointer; font-size: 1rem;
    width: 35px; height: 35px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.send-btn:hover { transform: scale(1.05); }

.auth-placeholder {
    text-align: center; padding: 20px;
    border: 1px dashed var(--border-color);
    border-radius: 12px; color: var(--text-muted);
}
.auth-placeholder a { color: var(--primary-color); }

.comments-list { display: flex; flex-direction: column; gap: 20px; }

/* Comment Item Redesign */
.comment-item {
    display: flex; gap: 20px;
    animation: fadeIn 0.3s ease;
}

.comment-avatar { flex-shrink: 0; width: 45px; height: 45px; }
.comment-avatar img {
    width: 100%; height: 100%; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border-color);
}

.comment-content {
    background: var(--secondary-background); padding: 15px 20px;
    border-radius: 0 16px 16px 16px; flex-grow: 1;
    border: 1px solid var(--border-color);
    position: relative;
}

.comment-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}

.comment-info { display: flex; flex-direction: column; }
.author-name { font-weight: 700; color: var(--text-color); font-size: 0.95rem; }
.comment-date { color: var(--text-muted); font-size: 0.75rem; margin-top: 2px; }

.comment-actions { display: flex; gap: 8px; }

.edit-comment-btn, .delete-comment-btn {
    background: transparent; border: none;
    cursor: pointer; font-size: 0.9rem;
    padding: 5px; opacity: 0.5; transition: all 0.2s;
}
.edit-comment-btn { color: var(--text-color); }
.edit-comment-btn:hover { opacity: 1; color: var(--primary-color); }
.delete-comment-btn { color: var(--error-color); }
.delete-comment-btn:hover { opacity: 1; }

.comment-text { font-size: 0.95rem; line-height: 1.6; color: var(--text-color); }

/* Edit Mode */
.edit-mode-wrapper textarea {
    width: 100%; background: var(--card-bg);
    border: 1px solid var(--primary-color); border-radius: 8px;
    padding: 10px; color: var(--text-color);
    min-height: 60px; font-family: inherit;
    margin-bottom: 10px;
}
.edit-actions { display: flex; gap: 10px; }
.btn-save-comment {
    padding: 6px 12px; background: var(--success-color); color: white;
    border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}
.btn-cancel-edit {
    padding: 6px 12px; background: transparent; color: var(--text-muted);
    border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; font-size: 0.85rem;
}

.empty-comments { text-align: center; padding: 30px; color: var(--text-muted); }
.empty-icon { font-size: 2rem; margin-bottom: 10px; opacity: 0.5; }

/* Sidebar */
.news-sidebar { position: sticky; top: 20px; }
.sidebar-widget {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 20px; padding: 25px;
}
.widget-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px; margin-bottom: 20px;
}
.widget-header h4 { margin: 0; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.related-list { display: flex; flex-direction: column; gap: 20px; }
.related-item { display: flex; gap: 15px; text-decoration: none; transition: transform 0.2s; }
.related-item:hover { transform: translateX(5px); }
.related-img { width: 80px; height: 80px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: #202025; }
.related-img img { width: 100%; height: 100%; object-fit: cover; }
.related-info { display: flex; flex-direction: column; justify-content: center; }
.related-info h5 {
    font-size: 0.95rem; line-height: 1.4; margin-bottom: 5px;
    color: var(--text-color); display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.related-date { font-size: 0.8rem; color: var(--text-muted); }

.reading-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: transparent; z-index: 9999; }
.reading-progress-bar { height: 100%; background: var(--primary-color); width: 0%; transition: width 0.1s; }

@media (max-width: 1024px) {
    .news-single-layout { grid-template-columns: 1fr; }
    .news-sidebar { display: none; }
    .article-content-wrapper { padding: 20px; }
}

@media (max-width: 768px) {
    .article-cover { height: 250px; }
    .article-header h1 { font-size: 1.6rem; }
    .comments-section { padding: 20px; }
}