/* Blog Styles - Starnbuy Dark Theme */

/* Override buy_section.css .tm-main width for blog pages */
.tm-main.main-container-wide {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* ==================== BLOG LAYOUT ==================== */
.blog-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 50px;
}

@media (max-width: 1700px) {
    .blog-container {
        max-width: 100%;
        padding: 20px 30px;
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 15px 20px;
    }
}

.blog-header {
    margin-bottom: 40px;
    text-align: center;
}

.blog-header h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.blog-header .lead {
    font-size: 1.1rem;
    color: var(--text-color);
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.blog-main {
    min-width: 0;
}

.blog-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* ==================== FEATURED ARTICLES ==================== */
.featured-section {
    margin-bottom: 50px;
}

.featured-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==================== ARTICLES GRID ==================== */
.articles-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==================== ARTICLE CARD ==================== */
.article-card {
    background: var(--field-bg-color);
    border-radius: var(--popup-border-radius);
    overflow: hidden;
    transition: transform var(--def-transition), box-shadow var(--def-transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.article-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-color);
}

.article-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--field-bg-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 3rem;
}

.article-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.article-card-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--accent-bg-color);
    color: var(--accent-color);
}

.article-card-date {
    color: var(--field-second-color);
}

.article-card-reading-time {
    color: var(--field-second-color);
}

.article-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.article-card-views {
    font-size: 0.85rem;
    color: var(--field-second-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-card-read-more {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* Featured card variant */
.article-card.featured {
    position: relative;
}

.article-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #9b59b6);
}

/* ==================== SIDEBAR WIDGETS ==================== */
.sidebar-widget {
    background: var(--field-bg-color);
    border-radius: var(--popup-border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Categories widget */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: var(--def-border-radius);
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--def-transition);
}

.category-list a:hover,
.category-list a.active {
    background: var(--accent-bg-color);
    color: var(--accent-color);
}

.category-list .category-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Popular articles widget */
.popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popular-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-item-number {
    width: 28px;
    height: 28px;
    background: var(--accent-bg-color);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.popular-item-content {
    flex: 1;
    min-width: 0;
}

.popular-item-title {
    display: block;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-item-title:hover {
    color: var(--accent-color);
}

.popular-item-views {
    font-size: 0.8rem;
    color: var(--field-second-color);
    margin-top: 4px;
}

/* ==================== SINGLE ARTICLE ==================== */
.article-single {
    max-width: 100%;
}

.article-single-header {
    margin-bottom: 30px;
}

.article-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.article-single-title {
    font-size: 2rem;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 25px;
    max-width: 720px;
}

@media (max-width: 600px) {
    .article-single-title {
        font-size: 1.6rem;
    }
}

.article-single-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--popup-border-radius);
    margin-bottom: 30px;
}

/* Article content typography */
.article-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #b8c5d1;
    max-width: 720px;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: #fff;
    margin-top: 2em;
    margin-bottom: 0.8em;
}

.article-content h2 {
    font-size: 1.6rem;
}

.article-content h3 {
    font-size: 1.3rem;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.article-content a:hover {
    text-decoration: none;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--def-border-radius);
    margin: 1.5em 0;
}

.article-content ul,
.article-content ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content blockquote {
    border-left: 4px solid var(--accent-color);
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: var(--field-bg-color);
    border-radius: 0 var(--def-border-radius) var(--def-border-radius) 0;
    font-style: italic;
}

.article-content code {
    background: var(--field-bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--field-bg-color);
    padding: 1em;
    border-radius: var(--def-border-radius);
    overflow-x: auto;
    margin: 1.5em 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.article-content th,
.article-content td {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.article-content th {
    background: var(--field-bg-color);
    color: #fff;
}

/* Article footer */
.article-single-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.article-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--field-bg-color);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--def-transition);
}

.article-tag:hover {
    background: var(--accent-bg-color);
    color: var(--accent-color);
}

/* Related articles */
.related-articles {
    margin-top: 60px;
}

.related-articles h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #fff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

/* ==================== PAGINATION ==================== */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--field-bg-color);
    color: var(--text-color);
    border-radius: var(--def-border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--def-transition);
}

.pagination a:hover {
    background: var(--accent-bg-color);
    color: var(--accent-color);
}

.pagination .active span {
    background: var(--btn-primary-bg-color);
    color: #fff;
}

.pagination .disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== BREADCRUMBS ==================== */
.breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    padding: 0;
    width: auto;
}

.breadcrumbs a {
    color: var(--text-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

.breadcrumbs .separator {
    color: var(--field-second-color);
}

.breadcrumbs .current {
    color: var(--accent-color);
}

/* ==================== EMPTY STATE ==================== */
.blog-empty {
    text-align: center;
    padding: 60px 20px;
}

.blog-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.blog-empty h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
}

.blog-empty p {
    color: var(--text-color);
}

/* ==================== CTA SECTION ==================== */
.blog-cta {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(155, 89, 182, 0.15) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: var(--popup-border-radius);
    padding: 30px;
    text-align: center;
    margin-top: 40px;
}

.blog-cta h3 {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 10px;
}

.blog-cta p {
    color: var(--text-color);
    margin-bottom: 20px;
}

.blog-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--btn-primary-bg-color);
    color: #fff;
    border-radius: var(--def-border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--def-transition);
}

.blog-cta .btn:hover {
    background: var(--btn-primary-bg-hover-color);
    transform: translateY(-2px);
}

/* ==================== COMMENTS SECTION ==================== */
.comments-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 720px;
}

.comments-section h2 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 25px;
}

.comments-login-prompt {
    background: var(--field-bg-color);
    border-radius: var(--popup-border-radius);
    padding: 30px;
    text-align: center;
}

.comments-login-prompt p {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1rem;
}

.comments-login-prompt .btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: #2AABEE;
    color: #fff;
    border-radius: var(--def-border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--def-transition);
}

.comments-login-prompt .btn-telegram:hover {
    background: #229ED9;
    transform: translateY(-2px);
}

.comments-login-prompt .btn-telegram svg {
    width: 22px;
    height: 22px;
}

.comments-list {
    margin-top: 30px;
}

.comment {
    background: var(--field-bg-color);
    border-radius: var(--def-border-radius);
    padding: 20px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-weight: 600;
}

.comment-author {
    font-weight: 600;
    color: #fff;
}

.comment-date {
    color: var(--field-second-color);
    font-size: 0.85rem;
}

.comment-body {
    color: var(--text-color);
    line-height: 1.6;
}
