/* ===========================================
   BLOG CSS STYLES
   Public blog pages styling
   =========================================== */

/* Blog Hero Section */
.blog-hero {
    padding: 140px 0 60px;
    text-align: center;
    position: relative;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(67, 97, 238, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    filter: blur(50px);
}

.blog-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.blog-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Blog Section */
.blog-section {
    padding: 60px 0 100px;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.loading-placeholder,
.no-posts,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* Post Card */
.post-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.post-image {
    display: block;
    position: relative;
    overflow: hidden;
    padding-top: 60%;
}

.post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-image .no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    color: var(--text-muted);
    font-size: 2rem;
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.post-content {
    padding: 20px;
}

.post-category {
    display: inline-block;
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.post-category:hover {
    background: var(--primary);
    color: white;
}

.post-content h2 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.post-content h2 a {
    color: var(--text);
    text-decoration: none;
}

.post-content h2 a:hover {
    color: var(--primary);
}

.post-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-meta i {
    margin-right: 5px;
}

/* Featured Post */
.featured-post {
    margin-bottom: 50px;
}

.featured-article {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

@media (max-width: 768px) {
    .featured-article {
        grid-template-columns: 1fr;
    }
}

.featured-image {
    display: block;
    position: relative;
    min-height: 300px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.featured-content {
    padding: 40px 40px 40px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .featured-content {
        padding: 30px;
    }
}

.featured-label {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    width: fit-content;
}

.featured-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.featured-content h2 a {
    color: var(--text);
    text-decoration: none;
}

.featured-content h2 a:hover {
    color: var(--primary);
}

.featured-content p {
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.7;
}

/* Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 25px;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.sidebar-widget h3 i {
    margin-right: 8px;
    color: var(--primary);
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text);
    font-size: 0.95rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box button {
    background: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 0 18px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.category-list a:hover,
.category-list a.active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
}

.category-list .count {
    background: var(--dark);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Popular Posts */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-post,
.related-post {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.popular-post:hover,
.related-post:hover {
    color: var(--primary);
}

.popular-post img,
.related-post img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.no-thumb {
    width: 70px;
    height: 50px;
    background: var(--dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.popular-info h4,
.related-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-info span,
.related-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.blog-pagination button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.blog-pagination button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.blog-pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.blog-pagination .dots {
    padding: 10px 8px;
    color: var(--text-muted);
}

/* ===========================================
   ARTICLE PAGE STYLES
   =========================================== */

.blog-article {
    padding: 120px 0 60px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }
}

.article-main {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

@media (max-width: 768px) {
    .article-main {
        padding: 25px;
    }
}

.article-header {
    margin-bottom: 30px;
}

.article-category {
    display: inline-block;
    background: rgba(67, 97, 238, 0.2);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 15px;
    text-decoration: none;
}

.article-header h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.article-meta i {
    margin-right: 8px;
}

.article-thumbnail {
    margin: 0 -40px 30px;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .article-thumbnail {
        margin: 0 -25px 25px;
    }
}

/* Article Content Styles */
.article-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--text);
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 35px 0 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.article-content h3 {
    font-size: 1.3rem;
    margin: 25px 0 15px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-content blockquote {
    background: rgba(67, 97, 238, 0.1);
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.article-content code {
    background: var(--dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--darker);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content a {
    color: var(--primary);
}

.article-content a:hover {
    text-decoration: underline;
}

.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

/* Article Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Share Widget */
.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.copy {
    background: var(--gray);
}

/* Related Posts */
.related-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ===========================================
   COMMENTS SECTION
   =========================================== */

.comments-section {
    padding: 0 0 80px;
}

.comments-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.comments-container h3 {
    font-size: 1.3rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.comments-container h3 i {
    margin-right: 10px;
    color: var(--primary);
}

/* Comment Form */
.comment-form {
    margin-bottom: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.comment-form .form-group {
    margin-bottom: 15px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-comments {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

.comment {
    display: flex;
    gap: 15px;
}

.comment-reply {
    border-left: 2px solid var(--border);
    padding-left: 15px;
}

.comment-avatar {
    flex-shrink: 0;
    font-size: 2.5rem;
    color: var(--text-muted);
}

.comment-body {
    flex: 1;
    background: var(--dark);
    padding: 20px;
    border-radius: 12px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-header strong {
    font-size: 1rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-content {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 10px;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
}

.reply-btn:hover {
    text-decoration: underline;
}