/**
 * Xpert Energy - Modern Blog Styles
 * Clean, crisp, professional design
 * 
 * @package Xpert_Energy
 * @since 4.9.0
 */

/* =====================================================
   CSS VARIABLES - Blog Specific
   ===================================================== */
:root {
    --xe-blog-radius: 12px;
    --xe-blog-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --xe-blog-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
    --xe-blog-transition: all 0.3s ease;
    --xe-blog-gap: 24px;
    --xe-text-primary: #1a1a1a;
    --xe-text-secondary: #666;
    --xe-text-muted: #999;
    --xe-border-light: #eee;
}

/* =====================================================
   SVG Icon Size Fix
   ===================================================== */
.xe-post-meta svg,
.xe-post-date svg,
.xe-reading-time svg,
.xe-article-details svg,
.xe-related-card-reading-time svg {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0 !important;
}

/* =====================================================
   BLOG PAGE LAYOUT
   ===================================================== */
.xe-blog-page {
    padding: 60px 0 80px;
    background: #f8f8f8;
    min-height: 60vh;
}

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

.xe-blog-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--xe-text-primary);
    margin: 0 0 12px;
}

.xe-blog-header p {
    font-size: 16px;
    color: var(--xe-text-secondary);
    margin: 0;
}

/* =====================================================
   FEATURED POST (HERO)
   ===================================================== */
.xe-featured-post {
    margin-bottom: 48px;
}

.xe-featured-post .xe-featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    background: #fff;
    border-radius: var(--xe-blog-radius);
    overflow: hidden;
    box-shadow: var(--xe-blog-shadow);
    transition: var(--xe-blog-transition);
}

.xe-featured-post .xe-featured-card:hover {
    box-shadow: var(--xe-blog-shadow-hover);
}

.xe-featured-image {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.xe-featured-image a {
    display: block;
    height: 100%;
}

.xe-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.xe-featured-card:hover .xe-featured-image img {
    transform: scale(1.03);
}

.xe-featured-content {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.xe-featured-content .xe-post-category {
    margin-bottom: 16px;
}

.xe-featured-content .xe-post-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 16px;
}

.xe-featured-content .xe-post-excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: var(--xe-text-secondary);
    margin-bottom: 24px;
}

.xe-featured-content .xe-post-meta {
    margin-top: auto;
}

/* =====================================================
   POST GRID
   ===================================================== */
.xe-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--xe-blog-gap);
}

/* =====================================================
   POST CARD
   ===================================================== */
.xe-post-card {
    background: #fff;
    border-radius: var(--xe-blog-radius);
    overflow: hidden;
    box-shadow: var(--xe-blog-shadow);
    transition: var(--xe-blog-transition);
}

.xe-post-card:hover {
    box-shadow: var(--xe-blog-shadow-hover);
    transform: translateY(-4px);
}

/* Thumbnail */
.xe-post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}

.xe-post-thumbnail a {
    display: block;
    height: 100%;
}

.xe-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.xe-post-card:hover .xe-post-thumbnail img {
    transform: scale(1.05);
}

/* No thumbnail placeholder */
.xe-post-thumbnail.no-thumbnail {
    background: linear-gradient(135deg, #fb8104 0%, #e67300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.xe-post-thumbnail.no-thumbnail svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    fill: #fff;
}

/* Category Badge */
.xe-post-category {
    display: inline-block;
}

.xe-post-category a {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    background: #fb8104;
    color: #fff;
    border-radius: 4px;
    transition: var(--xe-blog-transition);
}

.xe-post-category a:hover {
    background: #e67300;
    color: #fff;
}

/* Thumbnail overlay category */
.xe-post-thumbnail .xe-post-category {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
}

/* Card Content */
.xe-post-content {
    padding: 24px;
}

.xe-post-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px;
    color: var(--xe-text-primary);
}

.xe-post-title a {
    color: inherit;
    transition: color 0.2s ease;
}

.xe-post-title a:hover {
    color: #fb8104;
}

.xe-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--xe-text-secondary);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Post Meta */
.xe-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--xe-text-muted);
}

.xe-post-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.xe-post-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.xe-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xe-post-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.xe-post-author span {
    font-weight: 500;
    color: var(--xe-text-primary);
}

.xe-post-date {
    color: var(--xe-text-muted);
}

.xe-reading-time {
    color: var(--xe-text-muted);
}

/* =====================================================
   LOAD MORE BUTTON
   ===================================================== */
.xe-load-more-wrap {
    text-align: center;
    margin-top: 48px;
}

.xe-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--xe-blog-transition);
}

.xe-load-more-btn:hover {
    background: #333;
    color: #fff;
}

.xe-load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.xe-load-more-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: xe-spin 0.8s linear infinite;
    display: none;
}

.xe-load-more-btn.loading .spinner {
    display: block;
}

@keyframes xe-spin {
    to { transform: rotate(360deg); }
}

/* Standard Pagination */
.xe-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.xe-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--xe-text-primary);
    background: #fff;
    border-radius: 8px;
    transition: var(--xe-blog-transition);
}

.xe-pagination .page-numbers:hover {
    background: #fb8104;
    color: #fff;
}

.xe-pagination .page-numbers.current {
    background: #fb8104;
    color: #fff;
}

.xe-pagination .page-numbers.dots {
    background: transparent;
    pointer-events: none;
}

/* =====================================================
   SINGLE POST - ARTICLE
   ===================================================== */
.xe-single-post {
    padding: 0 0 80px;
    background: #fff;
}

/* Progress Bar */
.xe-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #fb8104;
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Article Header */
.xe-article-header {
    padding: 60px 0 40px;
    background: #f8f8f8;
}

.xe-article-header .container {
    max-width: 800px;
}

.xe-article-meta-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.xe-article-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--xe-text-primary);
    margin: 0 0 24px;
}

.xe-article-meta-bottom {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--xe-border-light);
}

.xe-article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xe-article-author img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.xe-article-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xe-article-author-name {
    font-weight: 600;
    color: var(--xe-text-primary);
    font-size: 14px;
}

.xe-article-author-label {
    font-size: 12px;
    color: var(--xe-text-muted);
}

.xe-article-details {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--xe-text-secondary);
}

.xe-article-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.xe-article-details svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* Featured Image */
.xe-article-featured-image {
    margin: -20px auto 48px;
    max-width: 1000px;
    padding: 0 20px;
}

.xe-article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--xe-blog-radius);
    box-shadow: var(--xe-blog-shadow-hover);
}

/* Article Content */
.xe-article-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.xe-article-content p {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 24px;
}

.xe-article-content h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 48px 0 20px;
    color: var(--xe-text-primary);
}

.xe-article-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 16px;
    color: var(--xe-text-primary);
}

.xe-article-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--xe-text-primary);
}

.xe-article-content ul,
.xe-article-content ol {
    margin: 0 0 24px 24px;
    font-size: 17px;
    line-height: 1.8;
}

.xe-article-content li {
    margin-bottom: 8px;
}

.xe-article-content blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    background: #f8f8f8;
    border-left: 4px solid #fb8104;
    border-radius: 0 var(--xe-blog-radius) var(--xe-blog-radius) 0;
    font-size: 18px;
    font-style: italic;
    color: var(--xe-text-secondary);
}

.xe-article-content blockquote p:last-child {
    margin-bottom: 0;
}

.xe-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.xe-article-content a {
    color: #fb8104;
    text-decoration: underline;
    text-decoration-color: rgba(251, 129, 4, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.xe-article-content a:hover {
    text-decoration-color: #fb8104;
}

/* =====================================================
   SINGLE POST - TAGS
   ===================================================== */
.xe-article-tags {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 32px 20px;
    border-top: 1px solid var(--xe-border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.xe-article-tags-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--xe-text-primary);
}

.xe-article-tags a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--xe-text-secondary);
    background: #f5f5f5;
    border-radius: 6px;
    transition: var(--xe-blog-transition);
}

.xe-article-tags a:hover {
    background: #fb8104;
    color: #fff;
}

/* =====================================================
   SINGLE POST - RELATED POSTS
   ===================================================== */
.xe-related-posts {
    background: #f8f8f8;
    padding: 60px 0;
    margin-top: 60px;
}

.xe-related-posts-header {
    text-align: center;
    margin-bottom: 40px;
}

.xe-related-posts-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--xe-text-primary);
    margin: 0;
}

.xe-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--xe-blog-gap);
}

/* Related Post Cards - New Clean Style */
.xe-related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.xe-related-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.xe-related-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.xe-related-card-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.xe-related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.xe-related-card:hover .xe-related-card-image img {
    transform: scale(1.05);
}

.xe-related-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fb8104 0%, #e67300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.xe-related-card-placeholder svg {
    width: 48px;
    height: 48px;
    fill: rgba(255, 255, 255, 0.3);
}

.xe-related-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    background: #fb8104;
    color: #fff;
    border-radius: 4px;
}

.xe-related-card-content {
    padding: 20px;
}

.xe-related-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--xe-text-primary);
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xe-related-card:hover .xe-related-card-title {
    color: #fb8104;
}

.xe-related-card-excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: var(--xe-text-secondary);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xe-related-card-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--xe-text-muted);
}

.xe-related-card-reading-time svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* Related Posts Responsive */
@media (max-width: 991px) {
    .xe-related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .xe-related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .xe-related-posts {
        padding: 40px 0;
        margin-top: 40px;
    }
    
    .xe-related-posts-header {
        margin-bottom: 24px;
    }
    
    .xe-related-posts-header h3 {
        font-size: 20px;
    }
}

/* =====================================================
   ARCHIVE / CATEGORY HEADER
   ===================================================== */
.xe-archive-header {
    padding: 60px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    text-align: center;
    color: #fff;
}

.xe-archive-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fb8104;
    margin-bottom: 12px;
}

.xe-archive-title {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 12px;
}

.xe-archive-description {
    font-size: 16px;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

/* =====================================================
   NO POSTS FOUND
   ===================================================== */
.xe-no-posts {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: var(--xe-blog-radius);
}

.xe-no-posts svg {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.xe-no-posts h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--xe-text-primary);
}

.xe-no-posts p {
    font-size: 16px;
    color: var(--xe-text-secondary);
    margin-bottom: 24px;
}

/* Search Form in No Results */
.xe-search-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 8px;
}

.xe-search-form input[type="search"] {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
    border: 1px solid var(--xe-border-light);
    border-radius: 50px;
    outline: none;
    transition: border-color 0.2s ease;
}

.xe-search-form input[type="search"]:focus {
    border-color: #fb8104;
}

.xe-search-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #fb8104;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.xe-search-form button:hover {
    background: #e67300;
}

.xe-search-form button svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* =====================================================
   RESPONSIVE - TABLET
   ===================================================== */
@media (max-width: 991px) {
    .xe-featured-post .xe-featured-card {
        grid-template-columns: 1fr;
    }
    
    .xe-featured-image {
        min-height: 300px;
    }
    
    .xe-featured-content {
        padding: 32px;
    }
    
    .xe-featured-content .xe-post-title {
        font-size: 24px;
    }
    
    .xe-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .xe-related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .xe-article-title {
        font-size: 30px;
    }
}

/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */
@media (max-width: 767px) {
    .xe-blog-page {
        padding: 40px 0 60px;
    }
    
    .xe-blog-header {
        margin-bottom: 32px;
    }
    
    .xe-blog-header h1 {
        font-size: 26px;
    }
    
    .xe-featured-post {
        margin-bottom: 32px;
    }
    
    .xe-featured-content {
        padding: 24px;
    }
    
    .xe-featured-content .xe-post-title {
        font-size: 20px;
    }
    
    .xe-featured-content .xe-post-excerpt {
        display: none;
    }
    
    .xe-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .xe-post-content {
        padding: 20px;
    }
    
    .xe-post-title {
        font-size: 17px;
    }
    
    .xe-article-header {
        padding: 40px 0 30px;
    }
    
    .xe-article-title {
        font-size: 24px;
    }
    
    .xe-article-meta-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .xe-article-content p {
        font-size: 16px;
    }
    
    .xe-article-content h2 {
        font-size: 22px;
    }
    
    .xe-related-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .xe-archive-header {
        padding: 40px 0;
    }
    
    .xe-archive-title {
        font-size: 28px;
    }
}

/* =====================================================
   SIDEBAR STYLES (when active)
   ===================================================== */
.xe-blog-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.xe-blog-with-sidebar .xe-posts-grid {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 991px) {
    .xe-blog-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .xe-blog-with-sidebar .xe-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .xe-blog-with-sidebar .xe-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Widget Styling */
.xe-sidebar .widget {
    background: #fff;
    padding: 24px;
    border-radius: var(--xe-blog-radius);
    margin-bottom: 24px;
    box-shadow: var(--xe-blog-shadow);
}

.xe-sidebar .widget-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #fb8104;
}

.xe-sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xe-sidebar .widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid var(--xe-border-light);
}

.xe-sidebar .widget ul li:last-child {
    border-bottom: none;
}

.xe-sidebar .widget ul li a {
    color: var(--xe-text-secondary);
    transition: color 0.2s ease;
}

.xe-sidebar .widget ul li a:hover {
    color: #fb8104;
}
