/* ==========================================================================
   BLOG CSS - POLYBITS THEME
   Blog Archive, Single Post, and Related Styles
   ========================================================================== */

/* ==========================================
   BLOG ARCHIVE
   ========================================== */
.blog-archive {
    padding: 60px 0;
}

@media (max-width: 767px) {
    .blog-archive {
        padding: 40px 0;
    }
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 60px;
}

.page-header .page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-primary);
    margin-bottom: 16px;
}

.page-header .page-description {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 991px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 575px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* With Sidebar Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

@media (max-width: 991px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

.blog-main {
    min-width: 0;
}

/* ==========================================
   POST CARD
   ========================================== */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

/* Thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

/* No thumbnail placeholder */
.post-thumbnail-placeholder {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    color: #ccc;
}

/* Card Content */
.post-card-content {
    padding: 24px;
}

.post-card .entry-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.post-card .entry-category a {
    color: inherit;
}

.post-card .entry-title {
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-card .entry-title a {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.post-card .entry-title a:hover {
    color: var(--accent-primary);
}

.post-card .entry-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Entry Meta */
.entry-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.entry-meta .posted-on,
.entry-meta .byline,
.entry-meta .reading-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.entry-meta a {
    color: var(--text-muted);
}

.entry-meta a:hover {
    color: var(--accent-primary);
}

/* ==========================================
   SINGLE POST
   ========================================== */
.single-post {
    padding: 60px 0;
}

.single-post .container {
    max-width: 800px;
}

/* Post Header */
.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-header .entry-category {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.post-header .entry-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 24px;
    line-height: 1.2;
}

.post-header .entry-meta {
    justify-content: center;
    font-size: 14px;
}

/* Featured Image */
.post-featured-image {
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

/* Post Content */
.post-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--text-primary);
    margin-top: 48px;
    margin-bottom: 24px;
}

.post-content h2 {
    font-size: 28px;
}

.post-content h3 {
    font-size: 22px;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-decoration-color: rgba(255, 75, 75, 0.3);
    text-underline-offset: 4px;
}

.post-content a:hover {
    text-decoration-color: var(--accent-primary);
}

.post-content ul,
.post-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    border-left: 4px solid var(--accent-primary);
    background: var(--bg-secondary);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-primary);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.post-content pre {
    background: #1a1a1a;
    color: #f0f0f0;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.6;
}

.post-content code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Post Footer */
.post-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-tags span {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.post-tags span:hover {
    background: var(--accent-primary);
    color: #fff;
}

.post-tags a {
    color: inherit;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.blog-sidebar {
    position: sticky;
    top: calc(var(--nav-height-desktop) + 30px);
}

@media (max-width: 991px) {
    .blog-sidebar {
        position: static;
    }
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-primary);
    color: var(--text-primary);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin-bottom: 10px;
}

.widget ul li a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.3s ease;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget ul li a:hover {
    color: var(--accent-primary);
    padding-left: 8px;
}

.widget ul li:last-child a {
    border-bottom: none;
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.pagination-list {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-item a,
.pagination-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-item a:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.pagination-item .current {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* ==========================================
   COMMENTS
   ========================================== */
.comments-area {
    margin-top: 60px;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
}

.comments-title {
    font-size: 24px;
    margin-bottom: 32px;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.comment-content p {
    margin-bottom: 12px;
}

/* Comment Form */
.comment-respond {
    margin-top: 40px;
}

.comment-reply-title {
    font-size: 20px;
    margin-bottom: 24px;
}

.comment-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    margin-bottom: 20px;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form .submit {
    background: var(--accent-primary);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-family: var(--font-heading);
    font-size: 16px;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form .submit:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

/* ==========================================
   NO POSTS MESSAGE
   ========================================== */
.no-posts {
    text-align: center;
    padding: 80px 40px;
}

.no-posts h2 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.no-posts p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ==========================================
   SEARCH RESULTS
   ========================================== */
.search-results .page-title {
    margin-bottom: 40px;
}

.search-results .page-title span {
    color: var(--accent-primary);
}