/**
 * Blog Page Styles
 * Includes: Blog listing, single post, comments, sidebar
 */

/* ==========================================================================
   Blog Hero Section
   ========================================================================== */

.blog-hero-section {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    text-align: center;
}

body:has(.top-bar) .blog-hero-section { padding-top: 176px; }

.blog-hero-content { max-width: 700px; margin: 0 auto; }

.blog-hero-section .hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(var(--accent-orange-rgb), 0.15);
    border: 1px solid rgba(var(--accent-orange-rgb), 0.3);
    border-radius: 30px;
    color: var(--accent-orange);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.blog-hero-section h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero-subtitle { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; }

.blog-hero-stats { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }

.blog-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
}

.blog-stat-icon { font-size: 18px; }
.blog-stat-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }

@media (max-width: 768px) {
    .blog-hero-section { padding: 120px 0 40px; }
    body:has(.top-bar) .blog-hero-section { padding-top: 156px; }
    .blog-hero-section h1 { font-size: clamp(2rem, 4vw, 2.5rem); }
    .blog-hero-subtitle { font-size: 1rem; }
    .blog-hero-stats { gap: 15px; }
    .blog-stat { padding: 8px 14px; }
}

/* ==========================================================================
   Featured Post Card
   ========================================================================== */

.featured-post-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 50px;
    transition: all 0.3s;
}

.featured-post-card:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.featured-post-thumbnail {
    display: block;
    overflow: hidden;
    min-height: 100%;
}

.featured-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.featured-post-card:hover .featured-post-thumbnail img { transform: scale(1.05); }

.featured-post-content {
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post-title { font-size: 1.6rem; line-height: 1.3; margin-bottom: 12px; }
.featured-post-title a { color: var(--text-primary); text-decoration: none; transition: color 0.2s; }
.featured-post-title a:hover { color: var(--accent-orange); }

.featured-post-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-post-content .btn { align-self: flex-start; }

@media (max-width: 768px) {
    .featured-post-card { grid-template-columns: 1fr; }
    .featured-post-thumbnail { max-height: 250px; }
    .featured-post-content { padding: 25px; }
    .featured-post-title { font-size: 1.4rem; }
}

/* ==========================================================================
   Blog Layout & Posts Grid
   ========================================================================== */

.blog-section-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-layout { display: grid; grid-template-columns: 1fr 320px; gap: 50px; }

@media (max-width: 992px) { .blog-layout { grid-template-columns: 1fr; } }

.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.posts-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 992px) { .posts-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .posts-grid, .posts-grid-3 { grid-template-columns: 1fr; } }

/* ==========================================================================
   Post Card
   ========================================================================== */

.post-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.post-card:hover {
    border-color: var(--accent-orange);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.post-thumbnail { display: block; aspect-ratio: 16/10; overflow: hidden; }

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-thumbnail img { transform: scale(1.05); }

.post-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
}

.post-thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.3;
}

.post-content { padding: 25px; }
.post-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }

.post-category {
    padding: 4px 10px;
    background: rgba(var(--accent-orange-rgb), 0.1);
    border-radius: 20px;
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
}

.post-category:hover { background: var(--accent-orange); color: #fff; }
.post-date { color: var(--text-muted); }
.post-title { font-size: 1.2rem; line-height: 1.4; margin-bottom: 12px; }
.post-title a { color: var(--text-primary); text-decoration: none; }
.post-title a:hover { color: var(--accent-orange); }
.post-excerpt { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin-bottom: 15px; }
.post-footer { display: flex; align-items: center; justify-content: space-between; }
.post-reading-time { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; }

.post-read-more {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-orange);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.post-read-more:hover { gap: 8px; }

/* Blog Pagination */
.blog-pagination { margin-top: 50px; }
.blog-pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 8px; }

.blog-pagination a,
.blog-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.blog-pagination a:hover { border-color: var(--accent-orange); color: var(--accent-orange); }
.blog-pagination .current { background: var(--accent-orange); border-color: var(--accent-orange); }

/* No Posts */
.no-posts { text-align: center; padding: 80px 40px; background: var(--bg-card); border-radius: 16px; }
.no-posts svg { color: var(--text-muted); opacity: 0.3; margin-bottom: 20px; }
.no-posts h3 { margin-bottom: 10px; }
.no-posts p { color: var(--text-muted); }

/* ==========================================================================
   Single Post
   ========================================================================== */

.single-post-thumbnail {
    padding-top: 100px;
    background: var(--bg-dark);
}

body:has(.top-bar) .single-post-thumbnail { padding-top: 136px; }

/* When no thumbnail, header gets the top padding instead */
.single-post:not(:has(.single-post-thumbnail)) .single-post-header {
    padding-top: 140px;
}

body:has(.top-bar) .single-post:not(:has(.single-post-thumbnail)) .single-post-header {
    padding-top: 176px;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0 0 16px 16px;
}

.single-post-header {
    padding: 40px 0 20px;
    background: var(--bg-dark);
}

.container-narrow { max-width: 800px; margin: 0 auto; }

.single-post-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.3;
    margin-bottom: 20px;
    color: #ffffff;
}

.single-post-header .post-meta { color: rgba(255, 255, 255, 0.7); }
.single-post-header .post-category { color: var(--accent-orange); }
.single-post-header .post-date,
.single-post-header .post-reading-time { color: rgba(255, 255, 255, 0.6); }

.single-post-excerpt { font-size: 1.2rem; color: rgba(255, 255, 255, 0.7); line-height: 1.6; }

.single-post-section { padding-top: 40px; }
.single-post-layout { display: grid; grid-template-columns: 1fr 320px; gap: 50px; }

@media (max-width: 992px) { .single-post-layout { grid-template-columns: 1fr; } }

@media (max-width: 768px) {
    .single-post-thumbnail { padding-top: 80px; }
    body:has(.top-bar) .single-post-thumbnail { padding-top: 116px; }
    .single-post-header { padding: 30px 0 15px; }
    .single-post:not(:has(.single-post-thumbnail)) .single-post-header { padding-top: 120px; }
    body:has(.top-bar) .single-post:not(:has(.single-post-thumbnail)) .single-post-header { padding-top: 156px; }
    .single-post-title { font-size: clamp(1.5rem, 4vw, 2rem); }
    .single-post-thumbnail img { border-radius: 0 0 12px 12px; }
}

.single-post-content { max-width: 100%; }

/* Post Body */
.post-body { font-size: 1.1rem; line-height: 1.8; color: var(--text-secondary); }
.post-body h2, .post-body h3, .post-body h4 { color: var(--text-primary); margin: 40px 0 20px; }
.post-body p { margin-bottom: 24px; }
.post-body a { color: var(--accent-orange); }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 30px 0; }
.post-body ul, .post-body ol { margin-bottom: 24px; padding-left: 24px; }
.post-body li { margin-bottom: 10px; }

.post-body blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    background: rgba(var(--accent-orange-rgb), 0.05);
    border-left: 4px solid var(--accent-orange);
    border-radius: 0 12px 12px 0;
    font-style: italic;
}

.post-body pre { background: var(--bg-card); padding: 20px; border-radius: 12px; overflow-x: auto; margin: 30px 0; }
.post-body code { background: rgba(255, 255, 255, 0.05); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* Post Tags */
.post-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
}

.post-tags > span { color: var(--text-muted); font-size: 14px; }

.tag {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

/* Post Share */
.post-share { display: flex; align-items: center; gap: 15px; padding: 20px 0 30px; }
.post-share > span { color: var(--text-muted); font-size: 14px; }
.share-buttons { display: flex; gap: 10px; }

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.share-btn svg { width: 18px; height: 18px; }
.share-btn:hover { border-color: currentColor; }
.share-twitter:hover { color: #1da1f2; background: rgba(29, 161, 242, 0.1); }
.share-facebook:hover { color: #4267b2; background: rgba(66, 103, 178, 0.1); }
.share-whatsapp:hover { color: #25d366; background: rgba(37, 211, 102, 0.1); }
.share-copy:hover { color: var(--accent-orange); background: rgba(var(--accent-orange-rgb), 0.1); }

/* Author Box */
.author-box {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin: 30px 0;
}

.author-avatar img { width: 80px; height: 80px; border-radius: 50%; }
.author-label { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.author-name { font-size: 1.2rem; margin-bottom: 10px; }
.author-bio { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* Post Navigation */
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }

.post-nav-item {
    padding: 25px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.post-nav-item:hover { border-color: var(--accent-orange); }
.nav-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent-orange); margin-bottom: 8px; }
.nav-label svg { width: 16px; height: 16px; }
.nav-title { display: block; color: var(--text-primary); font-weight: 500; line-height: 1.4; }
.post-nav-next { text-align: right; }
.post-nav-next .nav-label { justify-content: flex-end; }

@media (max-width: 576px) {
    .post-navigation { grid-template-columns: 1fr; }
    .post-nav-next { text-align: left; }
    .post-nav-next .nav-label { justify-content: flex-start; }
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area { margin-top: 50px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.comments-title { font-size: 1.5rem; margin-bottom: 30px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .comment { margin-bottom: 25px; }

.comment-body {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.comment-author-avatar img { width: 60px; height: 60px; border-radius: 50%; }
.comment-content-wrap { flex: 1; }
.comment-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.comment-author-name { font-weight: 600; color: var(--text-primary); }
.comment-author-name a { color: var(--text-primary); text-decoration: none; }
.comment-author-name a:hover { color: var(--accent-orange); }
.comment-date { font-size: 13px; color: var(--text-muted); }
.comment-text { color: var(--text-secondary); line-height: 1.7; margin-bottom: 15px; }
.comment-text p { margin: 0 0 10px; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-actions { display: flex; gap: 15px; }
.comment-actions a, .comment-actions span a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.comment-actions a:hover { color: var(--accent-orange); }
.comment-awaiting-moderation { font-size: 13px; color: var(--accent-orange); font-style: italic; margin-bottom: 10px; }
.comment-list .children { list-style: none; padding-left: 40px; margin-top: 20px; }

/* Comment form */
.comment-form { margin-top: 40px; }
.comment-form label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-primary); }
.comment-form .required { color: var(--accent-orange); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(var(--accent-orange-rgb), 0.1);
}

.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form p { margin-bottom: 20px; }
.comment-form .submit-comment { margin-top: 10px; }
.comment-reply-title { font-size: 1.3rem; margin-bottom: 20px; }
.comment-reply-title small { font-size: 14px; margin-left: 10px; }
.comment-reply-title small a { color: var(--accent-orange); }
.comment-navigation { margin: 30px 0; }
.comment-navigation .nav-links { display: flex; justify-content: space-between; }
.comment-navigation a { color: var(--accent-orange); text-decoration: none; }
.no-comments { color: var(--text-muted); font-style: italic; }

@media (max-width: 576px) {
    .comment-body { flex-direction: column; gap: 15px; }
    .comment-list .children { padding-left: 20px; }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.blog-sidebar { display: flex; flex-direction: column; gap: 30px; }

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
}

.widget-title {
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-cta {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(var(--accent-orange-rgb), 0.05) 100%);
    border-color: rgba(var(--accent-orange-rgb), 0.2);
    text-align: center;
}

.sidebar-cta .cta-icon { margin-bottom: 15px; }
.sidebar-cta .cta-icon svg { color: var(--accent-orange); }
.sidebar-cta h3 { font-size: 1.25rem; margin-bottom: 10px; }
.sidebar-cta p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* Search Widget */
.search-input-wrapper {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-input { flex: 1; padding: 12px 15px; background: transparent; border: none; color: var(--text-primary); font-size: 14px; outline: none; }
.search-submit { padding: 12px 15px; background: var(--accent-orange); border: none; color: #fff; cursor: pointer; transition: background 0.2s; }
.search-submit:hover { background: var(--accent-red); }
.search-submit svg { width: 18px; height: 18px; }

/* Recent Posts Widget */
.recent-posts-list { list-style: none; padding: 0; margin: 0; }
.recent-post-item { display: flex; gap: 15px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-post-thumb { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-title { display: block; color: var(--text-primary); font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none; margin-bottom: 6px; }
.recent-post-title:hover { color: var(--accent-orange); }
.recent-post-date { font-size: 12px; color: var(--text-muted); }

/* Categories Widget */
.categories-list { list-style: none; padding: 0; margin: 0; }
.categories-list li { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.categories-list li:last-child { border-bottom: none; }
.categories-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.categories-list a:hover { color: var(--accent-orange); }
.cat-count { padding: 2px 10px; background: rgba(255, 255, 255, 0.05); border-radius: 20px; font-size: 12px; color: var(--text-muted); }

/* Tags Cloud */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* Quick Links Widget */
.quick-links-list { list-style: none; padding: 0; margin: 0; }
.quick-links-list li { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.quick-links-list li:last-child { border-bottom: none; }
.quick-links-list a { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.quick-links-list a:hover { color: var(--accent-orange); }
.quick-links-list svg { width: 18px; height: 18px; color: var(--text-muted); }
.quick-links-list a:hover svg { color: var(--accent-orange); }
