/**
 * Blog Styles - Archive + Single Post
 * EpicDecks design with conversion-focused elements
 */

/* ============================================
   WRAPPER & SHARED
   ============================================ */

.epicdecks-blog-wrapper {
    width: 1400px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.epicdecks-blog-wrapper *,
.epicdecks-blog-wrapper *::before,
.epicdecks-blog-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   BLOG HEADER
   ============================================ */

.blog-header {
    text-align: center;
    padding: 40px 0 28px;
}

.blog-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 8px;
}

.blog-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
    max-width: 560px;
    margin: 0 auto;
}

/* ============================================
   CATEGORY FILTER PILLS
   ============================================ */

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding-bottom: 28px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 28px;
}

.blog-cat-pill {
    padding: 7px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s;
    background: #fff;
}

.blog-cat-pill:hover {
    border-color: #3BC1F4;
    color: #3BC1F4;
}

.blog-cat-pill.is-active {
    background: #3BC1F4;
    border-color: #3BC1F4;
    color: #fff;
}

/* ============================================
   LAYOUT: MAIN + SIDEBAR
   ============================================ */

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

.blog-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* ============================================
   BLOG GRID (archive)
   ============================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Featured first card spans full width */
.blog-card-featured {
    grid-column: 1 / -1;
}

/* ============================================
   BLOG CARD
   ============================================ */

.blog-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.blog-card-image {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-card-featured .blog-card-image {
    aspect-ratio: 21/9;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.blog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    background: #f9fafb;
}

.blog-card-body {
    padding: 18px 20px 20px;
}

.blog-card-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #3BC1F4;
    text-decoration: none;
    margin-bottom: 8px;
}

.blog-card-cat:hover {
    text-decoration: underline;
}

.blog-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px;
}

.blog-card-featured .blog-card-title {
    font-size: 22px;
}

.blog-card-title a {
    color: #111827;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: #3BC1F4;
}

.blog-card-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 12px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: #9ca3af;
}

.blog-card-readtime::before {
    content: '·';
    margin-right: 16px;
}

/* ============================================
   INLINE CTA BANNER (between posts)
   ============================================ */

.blog-inline-cta {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0ea5e9 0%, #3BC1F4 50%, #67d4f8 100%);
    border-radius: 14px;
    padding: 32px 36px;
    color: #fff;
}

.blog-cta-content {
    max-width: 500px;
}

.blog-cta-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.blog-inline-cta h3 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 8px;
}

.blog-inline-cta p {
    font-size: 15px;
    opacity: 0.9;
    margin: 0 0 18px;
    line-height: 1.5;
}

.blog-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #fff;
    color: #0ea5e9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.blog-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   PAGINATION
   ============================================ */

.blog-pagination {
    margin-top: 32px;
    text-align: center;
}

.blog-pagination .page-numbers {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.blog-pagination .page-numbers li {
    display: inline;
}

.blog-pagination .page-numbers a,
.blog-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}

.blog-pagination .page-numbers a:hover {
    border-color: #3BC1F4;
    color: #3BC1F4;
}

.blog-pagination .page-numbers .current {
    background: #3BC1F4;
    border-color: #3BC1F4;
    color: #fff;
}

/* ============================================
   BLOG EMPTY
   ============================================ */

.blog-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.blog-empty h2 {
    font-size: 20px;
    color: #374151;
    margin: 16px 0 8px;
}

.blog-empty p {
    font-size: 15px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.blog-sidebar {
    position: sticky;
    top: calc(var(--ed-masthead-h, 121px) + var(--wp-admin--admin-bar--height, 0px) + 16px);
}

.sidebar-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

/* Sidebar CTA */
.sidebar-cta-box {
    background: linear-gradient(135deg, #eaf8fd 0%, #dbeafe 100%);
    border-color: #bae6fd;
    text-align: center;
}

.sidebar-cta-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.sidebar-cta-box h3 {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 6px;
}

.sidebar-cta-box p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.5;
}

.sidebar-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 20px;
    background: #3BC1F4;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-cta-btn:hover {
    background: #2aa5d1;
    transform: translateY(-1px);
}

/* Sidebar Products */
.sidebar-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-product {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.sidebar-product:hover {
    background: #f9fafb;
}

.sidebar-product-img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

.sidebar-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-product-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 3px;
}

.sidebar-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #3BC1F4;
}

.sidebar-product-price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

.sidebar-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #3BC1F4;
    text-decoration: none;
}

.sidebar-link:hover {
    text-decoration: underline;
}

/* Sidebar Categories */
.sidebar-cat-list {
    display: flex;
    flex-direction: column;
}

.sidebar-cat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: color 0.15s;
}

.sidebar-cat-item:last-child {
    border-bottom: none;
}

.sidebar-cat-item:hover {
    color: #3BC1F4;
}

.sidebar-cat-count {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 100px;
}

/* Sidebar Newsletter */
.sidebar-newsletter {
    text-align: center;
}

.sidebar-newsletter p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

/* Newsletter subscribed state */
.newsletter-subscribed {
    text-align: center;
}

.newsletter-subscribed svg {
    margin-bottom: 8px;
}

.newsletter-subscribed .sidebar-title {
    color: #059669;
    border: none;
    padding: 0;
}

.newsletter-subscribed p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

.sidebar-unsub-btn {
    display: inline-block;
    padding: 6px 16px;
    background: none;
    color: #9ca3af;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.sidebar-unsub-btn:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

.sidebar-cta-btn {
    border: none;
    cursor: pointer;
}

/* ============================================
   SINGLE POST - BREADCRUMBS
   ============================================ */

.blog-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 20px 0 16px;
    font-size: 13px;
}

.blog-breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
}

.blog-breadcrumbs a:hover {
    color: #3BC1F4;
}

.bc-sep {
    color: #d1d5db;
}

.bc-current {
    color: #111827;
    font-weight: 600;
}

/* ============================================
   SINGLE POST - HEADER
   ============================================ */

.blog-single-header {
    margin-bottom: 24px;
}

.blog-single-title {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    line-height: 1.3;
    margin: 8px 0 16px;
}

.blog-single-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: #6b7280;
}

.blog-meta-date,
.blog-meta-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-meta-date svg,
.blog-meta-read svg {
    color: #9ca3af;
}

/* ============================================
   SINGLE POST - HERO IMAGE
   ============================================ */

.blog-single-hero {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
}

.blog-single-hero img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   SINGLE POST - CONTENT
   ============================================ */

.blog-single-content {
    font-size: 16px;
    line-height: 1.85;
    color: #374151;
}

.blog-single-content p {
    margin: 0 0 1.4em;
}

.blog-single-content h2 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin: 2em 0 0.8em;
}

.blog-single-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 1.6em 0 0.6em;
}

.blog-single-content a {
    color: #3BC1F4;
    text-decoration: none;
    font-weight: 600;
}

.blog-single-content a:hover {
    text-decoration: underline;
}

.blog-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1em 0;
}

.blog-single-content blockquote {
    border-left: 4px solid #3BC1F4;
    padding: 16px 24px;
    margin: 1.5em 0;
    background: #f0f9ff;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #374151;
}

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

.blog-single-content li {
    margin-bottom: 6px;
}

/* ============================================
   SINGLE POST - PRODUCT BANNER
   ============================================ */

.blog-product-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 36px 0;
}

.blog-banner-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.blog-banner-text {
    flex: 1;
}

.blog-banner-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.blog-banner-text p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.blog-banner-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #3BC1F4;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.blog-banner-btn:hover {
    background: #2aa5d1;
    transform: translateY(-1px);
}

/* ============================================
   SINGLE POST - TAGS
   ============================================ */

.blog-single-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 28px;
}

.tags-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.blog-tag {
    padding: 4px 12px;
    background: #f3f4f6;
    border-radius: 100px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}

.blog-tag:hover {
    background: #e0f2fe;
    color: #3BC1F4;
}

/* ============================================
   SINGLE POST - SHARE
   ============================================ */

.blog-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}

.share-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.share-fb:hover { background: #1877f2; color: #fff; }
.share-tw:hover { background: #111; color: #fff; }
.share-copy:hover { background: #3BC1F4; color: #fff; }

/* ============================================
   SINGLE POST - AUTHOR
   ============================================ */

.blog-author-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 24px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 24px 0 36px;
}

.blog-author-avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #3BC1F4;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
}

.blog-author-info strong {
    display: block;
    font-size: 15px;
    color: #111827;
    margin-bottom: 4px;
}

.blog-author-info p {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   SINGLE POST - RELATED PRODUCTS
   ============================================ */

.blog-related-products {
    margin: 36px 0;
    padding: 28px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.blog-rp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.blog-rp-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.blog-rp-link {
    font-size: 13px;
    font-weight: 600;
    color: #3BC1F4;
    text-decoration: none;
}

.blog-rp-link:hover {
    text-decoration: underline;
}

.blog-rp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.blog-rp-card {
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-rp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.blog-rp-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-rp-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-rp-info {
    padding: 10px 12px;
}

.blog-rp-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-rp-price {
    font-size: 14px;
    font-weight: 700;
    color: #3BC1F4;
}

.blog-rp-price del {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

/* ============================================
   SINGLE POST - RELATED POSTS
   ============================================ */

.blog-related-posts {
    margin-top: 36px;
}

.blog-related-posts h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 18px;
}

.blog-rp-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.blog-rpost-card {
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-rpost-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.blog-rpost-img {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-rpost-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-rpost-body {
    padding: 14px 16px;
}

.blog-rpost-body h3 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-rpost-body time {
    font-size: 12px;
    color: #9ca3af;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .blog-layout,
    .blog-single-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
    }
    
    .blog-sidebar-single {
        display: none;
    }
    
    .blog-rp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .epicdecks-blog-wrapper {
        padding: 0 16px 40px;
    }
    
    .blog-header {
        padding: 24px 0 20px;
    }
    
    .blog-header h1 {
        font-size: 24px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-card-featured .blog-card-image {
        aspect-ratio: 16/9;
    }
    
    .blog-single-title {
        font-size: 24px;
    }
    
    .blog-single-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .blog-product-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .blog-rp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-rp-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-categories {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .blog-cat-pill {
        white-space: nowrap;
    }
}
