/**
 * Modern Blog & Archive Styles
 * Contemporary design with clean aesthetics
 */

/* ==========================================
   Blog Archive / Category Pages
   ========================================== */

.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
    background: transparent;
}

/* Modern Blog Header */
.blog-header {
    margin-bottom: 80px;
}

.blog-header h1,
.archive-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.archive-description {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 600px;
    line-height: 1.6;
}

/* Masonry-style Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

/* Modern Blog Card */
.blog-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, transparent, transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    border-color: rgba(59, 130, 246, 0.1);
}

.blog-card:hover::before {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    opacity: 1;
}

.blog-card-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.blog-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 32px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.blog-card-category {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    font-size: 0.813rem;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.blog-card-category:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

.blog-card-date {
    font-size: 0.875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.blog-card-title a {
    color: #0f172a;
    text-decoration: none;
    background: linear-gradient(to right, #3b82f6 0%, #3b82f6 100%);
    background-size: 0 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease;
}

.blog-card-title a:hover {
    background-size: 100% 2px;
    color: #1e40af;
}

.blog-card-excerpt {
    font-size: 1rem;
    color: #475569;
    line-height: 1.7;
    margin-bottom: 24px;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: #64748b;
}

.blog-card-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: gap 0.3s ease;
}

.blog-card-read-more:hover {
    gap: 10px;
    color: #2563eb;
}

/* ==========================================
   Single Post Layout
   ========================================== */

.single-post-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 24px 100px;
}

.single-post-container article {
    background: #ffffff;
    border-radius: 20px;
    padding: 60px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.single-post-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 2px solid #f1f5f9;
}

.single-post-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.single-post-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.938rem;
    color: #64748b;
    font-weight: 500;
}

.single-post-meta svg {
    width: 16px;
    height: 16px;
    stroke: #94a3b8;
}

.single-post-date,
.single-post-author,
.single-post-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.938rem;
    color: #64748b;
}

.single-post-category {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.single-post-category:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

.single-post-featured-image-wrap {
    margin: 0 -60px 48px -60px;
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

.single-post-featured-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Rich Typography for Content */
.single-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
    font-weight: 400;
}

.single-post-content > * {
    margin-bottom: 1.5em;
}

.single-post-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.single-post-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2em;
    margin-bottom: 0.75em;
    letter-spacing: -0.01em;
}

.single-post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #334155;
    margin-top: 1.75em;
    margin-bottom: 0.5em;
}

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

.single-post-content strong {
    font-weight: 600;
    color: #1e293b;
}

.single-post-content a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

.single-post-content a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

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

.single-post-content li {
    margin-bottom: 0.75em;
    line-height: 1.7;
}

.single-post-content ul li::marker {
    color: #3b82f6;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5em 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.single-post-content blockquote {
    margin: 2.5em 0;
    padding: 1.5em 2em;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    font-size: 1.125rem;
    font-style: normal;
    color: #475569;
    position: relative;
}

.single-post-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #cbd5e1;
    position: absolute;
    top: -10px;
    left: 10px;
    line-height: 1;
}

.single-post-content code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 500;
}

.single-post-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2em 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.single-post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: 0.938rem;
}

/* Modern Tags Section */
.post-tags {
    margin-top: 60px;
    padding: 32px;
    background: #f8fafc;
    border-radius: 16px;
}

.post-tags-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.post-tag {
    display: inline-flex;
    padding: 8px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Modern Post Navigation */
.post-navigation {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid #e2e8f0;
}

.post-navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.nav-previous,
.nav-next {
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.nav-previous:hover,
.nav-next:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
    transform: translateY(-4px);
}

.nav-previous a,
.nav-next a {
    text-decoration: none;
    display: block;
}

.nav-label {
    font-size: 0.813rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.nav-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.nav-previous:hover .nav-title,
.nav-next:hover .nav-title {
    color: #3b82f6;
}

/* Modern Comments Section */
#comments {
    margin-top: 80px;
    padding: 48px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.comments-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comments-title::before {
    content: "💬";
    font-size: 1.5rem;
}

.comment-list,
.commentlist {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0;
    margin: 0;
}

.comment-list li,
.commentlist li {
    list-style: none !important;
    list-style-type: none !important;
}

.comment {
    padding: 32px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.comment:hover {
    background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.02), transparent);
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    border-radius: 12px;
}

.comment:last-child {
    border-bottom: none;
}

.comment-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.comment-author.vcard {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    margin-bottom: 0;
}

.comment-author img.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #f1f5f9;
    transition: all 0.3s ease;
}

.comment:hover .comment-author img.avatar {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.comment-author .fn {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.comment-author .fn a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author .fn a:hover {
    color: #3b82f6;
}

.comment-author .says {
    display: none;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
}

.comment-metadata a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-metadata a:hover {
    color: #3b82f6;
}

.comment-metadata .edit-link {
    margin-left: 12px;
}

.comment-metadata .edit-link a {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 500;
    color: #64748b;
}

.comment-metadata .edit-link a:hover {
    background: #e2e8f0;
    color: #475569;
}

.comment-content {
    margin-left: 72px;
    color: #475569;
    line-height: 1.7;
    font-size: 0.938rem;
}

.comment-content p {
    margin: 0 0 12px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.comment-content a:hover {
    border-bottom-color: #3b82f6;
}

.reply {
    margin-left: 72px;
    margin-top: 12px;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.comment-reply-link::before {
    content: "↩";
    font-size: 1rem;
}

.comment-reply-link:hover {
    background: #3b82f6;
    color: #ffffff;
    transform: translateX(4px);
}

/* Nested Comments */
.children {
    list-style: none;
    padding-left: 48px;
    margin-top: 24px;
}

.children .comment {
    position: relative;
}

.children .comment::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 32px;
    width: 2px;
    height: calc(100% - 32px);
    background: linear-gradient(to bottom, #e2e8f0, transparent);
}

/* Comment Form */
.comment-respond {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid #e2e8f0;
}

.comment-reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 24px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    font-size: 0.938rem;
}

.comment-form .form-submit {
    margin-top: 24px;
}

.comment-form .submit {
    padding: 14px 32px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 80px;
}

.pagination a,
.pagination span {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pagination .current {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-container {
        padding: 60px 24px;
    }

    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-header {
        margin-bottom: 48px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-content {
        padding: 24px;
    }

    .single-post-container {
        padding: 60px 20px 80px;
    }

    .single-post-container article {
        padding: 40px 28px;
        border-radius: 16px;
    }

    .single-post-featured-image-wrap {
        margin: 0 -28px 32px -28px;
    }

    .single-post-content {
        font-size: 1rem;
    }

    #comments {
        padding: 32px 24px;
    }

    .comment-content {
        margin-left: 0;
    }

    .comment-reply-link {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .blog-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .single-post-meta {
        flex-direction: column;
        gap: 12px;
    }

    .pagination {
        gap: 6px;
    }

    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.875rem;
    }
}
