@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --blog-primary: #da291c;
    /* Changed to match red theme */
    --blog-accent: #333333;
    --blog-green: #2e7d32;
    --blog-text: #1a1a1a;
    --blog-text-muted: #666;
    --blog-bg: #ffffff;
    --blog-border: #f0f0f0;
    --blog-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --blog-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
    --blog-font: 'Outfit', sans-serif;
}

.blog-hero {
    position: relative;
    background: #f8f9fa !important;
    overflow: hidden;
    padding: 60px 0 40px;
    z-index: 1;
    border-bottom: 1px solid var(--blog-border);
}

.blog-hero h2 {
    font-family: var(--blog-font);
    font-size: 42px;
    font-weight: 800;
    color: var(--blog-text);
    margin: 0;
    text-align: center;
    letter-spacing: -1.5px;
}

.blog-hero:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(218, 41, 28, 0.03) 0%, transparent 70%);
    z-index: -1;
}

/* Post Grid */
.blog-posts {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 60px 0;
    padding: 0;
    list-style: none;
}

.blog-posts .blog-post {
    flex: 1 1 calc(33.333% - 20px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--blog-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.blog-posts .blog-post:hover {
    box-shadow: var(--blog-shadow-hover);
    transform: translateY(-8px);
}

.blog-posts .blog-post .blog-post-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.blog-posts .blog-post .blog-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.blog-posts .blog-post .blog-post-info {
    padding: 24px;
    flex-grow: 1;
}

.blog-post-date {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--blog-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.blog-post-link a {
    font-family: var(--blog-font);
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
    color: var(--blog-text);
    text-decoration: none;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.blog-post-link a:hover {
    color: var(--blog-primary);
}

/* Single Post */
.blog-post-single-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    margin: 60px 0;
}

.blog-post-single {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    border: none;
}

.blog-post-content {
    font-family: var(--blog-font);
    font-size: 18px;
    line-height: 1.8;
    color: #444;
}

.blog-post-content h2,
.blog-post-content h3 {
    color: var(--blog-text);
    margin: 40px 0 20px;
    font-weight: 700;
}

.blog-post-content blockquote {
    background: #fdf7ff;
    border-left: 4px solid var(--blog-primary);
    padding: 30px;
    margin: 40px 0;
    font-size: 22px;
    font-weight: 500;
    color: var(--blog-primary);
    border-radius: 0 16px 16px 0;
}

/* Sidebar Widgets */
.blog-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.blog-widget {
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--blog-shadow);
}

.blog-widget h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--blog-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 60px 0;
    padding: 0;
    list-style: none;
}

.blog-pagination li {
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 10px;
    transition: all 0.2s;
}

.blog-pagination li a {
    display: block;
    padding: 8px 16px;
    color: var(--blog-text);
    font-weight: 600;
    text-decoration: none;
}

.blog-pagination li.active {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
}

.blog-pagination li.active a {
    color: #fff;
}

.blog-pagination li:hover:not(.active) {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
}

/* Newsletter */
.blog-subscribe-form {
    background: #f9f9f9;
    padding: 100px 0;
    text-align: center;
    border-radius: 40px;
    margin: 80px 0;
    border: 1px solid #eee;
}

.blog-subscribe-form h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
}

.blog-subscribe-form .subscribe_form>form {
    max-width: 500px;
    margin: 30px auto 0;
    background: #fff;
    padding: 8px;
    border-radius: 50px;
    display: flex;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.blog-subscribe-form input {
    flex-grow: 1;
    border: none;
    padding: 16px 24px;
    font-size: 16px;
    outline: none;
    background: transparent;
}

.blog-subscribe-form button {
    background: var(--blog-primary);
    color: #fff;
    border: none;
    padding: 0 32px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.blog-subscribe-form button:hover {
    opacity: 0.9;
}

/* Category Spotlights */
.blog-category-spotlight {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: -30px 0 40px;
    position: relative;
    z-index: 10;
}

.spotlight-item {
    background: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    color: var(--blog-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spotlight-item span {
    font-size: 20px;
}

.spotlight-item:hover {
    border-color: var(--blog-primary);
    color: var(--blog-primary);
    transform: translateY(-3px);
    box-shadow: var(--blog-shadow-hover);
}

/* Trending List */
.trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trending-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--blog-border);
}

.trending-list li:last-child {
    border-bottom: none;
}

.trending-list li a {
    text-decoration: none;
    display: block;
}

.trending-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--blog-text);
    margin-bottom: 4px;
}

.trending-store {
    display: block;
    font-size: 12px;
    color: var(--blog-primary);
    font-weight: 700;
}

.trending-list li a:hover .trending-title {
    color: var(--blog-primary);
}

/* Post Meta */
.blog-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--blog-border);
    font-size: 14px;
    color: var(--blog-text-muted);
}

.meta-author strong {
    color: var(--blog-primary);
}

.meta-date {
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

.blog-tldr {
    background: #f3e5f5;
    border-radius: 16px;
    padding: 24px;
    margin: 30px 0;
    border-left: 6px solid var(--blog-primary);
}

.blog-tldr h5 {
    margin: 0 0 10px;
    color: var(--blog-primary);
    font-size: 16px;
    font-weight: 800;
}

.blog-tldr p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #4a148c;
}

.blog-faq-item {
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--blog-shadow);
}

.blog-faq-item h6 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--blog-text);
}

.faq-answer {
    font-size: 15px;
    color: var(--blog-text-muted);
}

/* Transparency */
.transparency-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transparency-links li {
    margin-bottom: 8px;
}

.transparency-links li a {
    font-size: 14px;
    color: var(--blog-text-muted);
    text-decoration: none;
}

.transparency-links li a:hover {
    color: var(--blog-primary);
}

.disclosure {
    margin-top: 15px;
    color: #999;
}

/* Admin Enhancements */
.twocols {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.twocols>div:first-child {
    flex-grow: 1;
}

.twocols>div:last-child {
    width: 320px;
}

.blog-ai-sidebar {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.ai-widget {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ai-widget:last-child {
    border-bottom: none;
}

.ai-widget h4 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 800;
    color: #333;
}

.ai-status-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 15px;
}

.ai-status-pill.active {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.ai-status-pill.inactive {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.shortcode-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shortcode-list li {
    font-size: 13px;
    margin-bottom: 8px;
    color: #666;
}

.shortcode-list code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    color: #d81b60;
}

.status-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.status-list li {
    font-size: 14px;
    margin-bottom: 10px;
    color: #444;
}

@media (max-width: 992px) {
    .blog-post-single-layout {
        grid-template-columns: 1fr;
    }

    .blog-posts .blog-post {
        flex: 1 1 calc(50% - 15px);
    }
}

@media (max-width: 600px) {
    .blog-posts .blog-post {
        flex: 1 1 100%;
    }

    .blog-hero h2 {
        font-size: 32px;
    }
}

/* ========================================
   COUPON CARDS (from [coupon id=X] shortcodes)
   ======================================== */
.blog-coupon-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border: 2px solid var(--blog-border);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px 0;
    transition: all 0.3s ease;
    box-shadow: var(--blog-shadow);
}

.blog-coupon-card:hover {
    border-color: var(--blog-primary);
    box-shadow: var(--blog-shadow-hover);
    transform: translateY(-3px);
}

.coupon-store-logo {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coupon-store-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.coupon-content {
    flex-grow: 1;
    min-width: 0;
}

.coupon-content .coupon-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--blog-text);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.coupon-content .coupon-store {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--blog-primary);
    margin-bottom: 6px;
}

.coupon-content .coupon-code {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    margin-right: 10px;
    border: 1px dashed #ccc;
}

.coupon-content .coupon-discount {
    display: inline-block;
    background: var(--blog-green);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-right: 10px;
}

.coupon-expires {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.coupon-expires.today {
    background: #ffebee;
    color: #c62828;
}

.coupon-expires.soon {
    background: #fff3e0;
    color: #e65100;
}

.blog-coupon-card .coupon-btn {
    flex-shrink: 0;
    background: var(--blog-primary);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.blog-coupon-card .coupon-btn:hover {
    background: #b71c1c;
    transform: scale(1.05);
}

.blog-coupon-placeholder {
    background: #f5f5f5;
    color: #999;
    padding: 16px 24px;
    border-radius: 10px;
    text-align: center;
    font-style: italic;
    margin: 16px 0;
}

/* ========================================
   BLOG CONTENT ELEMENTS
   ======================================== */
.blog-list {
    margin: 20px 0;
    padding-left: 24px;
}

.blog-list li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.blog-link {
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.blog-link:hover {
    border-bottom-color: var(--blog-primary);
}

.blog-divider {
    border: none;
    border-top: 2px solid var(--blog-border);
    margin: 40px 0;
}

.blog-image-placeholder {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px dashed #90caf9;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    margin: 24px 0;
    color: #1976d2;
    font-style: italic;
}

.blog-image-placeholder span {
    display: block;
    font-size: 16px;
}

/* Code blocks in blog content */
.blog-post-content pre {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.blog-post-content pre code {
    color: #d4d4d4;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

.blog-post-content code {
    background: #f5f5f5;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Internal links from store auto-linking */
.blog-internal-link {
    color: var(--blog-primary);
    font-weight: 600;
    text-decoration: none;
}

.blog-internal-link:hover {
    text-decoration: underline;
}

/* Responsive coupon cards */
@media (max-width: 600px) {
    .blog-coupon-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .coupon-store-logo {
        width: 60px;
        height: 60px;
    }

    .blog-coupon-card .coupon-btn {
        width: 100%;
        text-align: center;
    }
}

/* Logo placeholder when no image */
.logo-placeholder {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Browse coupons fallback */
.blog-coupon-browse {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #f0c040;
    border-radius: 12px;
    padding: 20px 24px;
    margin: 20px 0;
}

.blog-coupon-browse span {
    font-size: 16px;
    font-weight: 600;
    color: #856404;
}

.blog-coupon-browse .browse-btn {
    background: #f0c040;
    color: #6d4c00;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.blog-coupon-browse .browse-btn:hover {
    background: #e0a800;
    transform: scale(1.05);
}

/* Blog heading styles */
.blog-heading {
    color: var(--blog-text);
    margin: 32px 0 16px;
    font-weight: 700;
    line-height: 1.3;
}

.blog-post-content h2.blog-heading {
    font-size: 28px;
    border-bottom: 2px solid var(--blog-border);
    padding-bottom: 12px;
}

.blog-post-content h3.blog-heading {
    font-size: 22px;
}

/* Inline code */
.inline-code {
    background: #f5f5f5;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: monospace;
}

/* Blog quote */
.blog-quote {
    background: #f8f4ff;
    border-left: 4px solid var(--blog-primary);
    padding: 16px 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    border-radius: 0 8px 8px 0;
}

/* Blog code block */
.blog-code {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.blog-code code {
    color: #d4d4d4;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    background: none;
    padding: 0;
}

/* ============================================
   AUTHOR PROFILE PAGE STYLES
   ============================================ */

.author-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    background: linear-gradient(135deg, #f8f4ff 0%, #fff 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
    border: 1px solid #e8e0f0;
}

.author-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 20px rgba(156, 39, 176, 0.2);
}

.author-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(156, 39, 176, 0.3);
}

.author-profile-info {
    flex: 1;
}

.author-profile-info h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--blog-text);
    margin: 0 0 8px;
}

.author-role {
    display: inline-block;
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: #fff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.author-expertise {
    color: #666;
    font-size: 14px;
    margin: 12px 0;
}

.author-bio {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    margin: 16px 0;
}

.author-social {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.author-social .social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.author-social .social-link.twitter {
    background: #e8f4fd;
    color: #1da1f2;
}

.author-social .social-link.twitter:hover {
    background: #1da1f2;
    color: #fff;
}

.author-social .social-link.linkedin {
    background: #e8f0f8;
    color: #0077b5;
}

.author-social .social-link.linkedin:hover {
    background: #0077b5;
    color: #fff;
}

.author-articles {
    margin-top: 40px;
}

.author-articles h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--blog-text);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--blog-border);
}

/* Reading time meta */
.meta-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 13px;
}

.meta-reading-time::before {
    content: '⏱️';
}

/* Author link in meta */
.meta-author a {
    color: var(--blog-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.meta-author a:hover {
    color: #7b1fa2;
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .author-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 30px 20px;
    }

    .author-avatar-large,
    .author-avatar-placeholder {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .author-profile-info h1 {
        font-size: 26px;
    }

    .author-social {
        justify-content: center;
    }
}

/* ============================================
   AUTHOR BIO BOX (Below Post Content)
   ============================================ */

.author-bio-box {
    display: flex;
    align-items: center;
    gap: 35px;
    padding: 35px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 28px;
    margin: 60px 0 40px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.author-bio-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--blog-primary, #9333ea);
}

.author-bio-avatar {
    flex-shrink: 0;
}

.author-bio-avatar img,
.author-bio-avatar .author-initial {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 12px 24px -6px rgba(147, 51, 234, 0.2);
    border: 3px solid #fff;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.author-bio-avatar .author-initial {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: #fff;
    font-size: 38px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.author-bio-content {
    flex: 1;
}

.author-bio-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9333ea;
    margin-bottom: 8px;
    background: #f5f3ff;
    padding: 2px 10px;
    border-radius: 6px;
}

.author-bio-content h4 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #111827;
}

.author-bio-content h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.author-bio-content h4 a:hover {
    color: #9333ea;
}

.author-bio-role {
    display: inline-block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 15px;
}

.author-bio-text {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
    margin-bottom: 24px;
}

.author-bio-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    border-top: 1px solid #f3f4f6;
    padding-top: 20px;
}

.author-bio-social {
    display: flex;
    gap: 12px;
}

.author-social-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.author-social-btn:hover {
    background: #9333ea;
    color: #fff !important;
    border-color: #9333ea;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px -4px rgba(147, 51, 234, 0.3);
}

.view-author-posts {
    font-size: 14px;
    font-weight: 700;
    color: #9333ea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.view-author-posts:after {
    content: '→';
    transition: transform 0.2s;
}

.view-author-posts:hover {
    color: #7c3aed;
}

.view-author-posts:hover:after {
    transform: translateX(5px);
}

.author-bio-content p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 12px 0;
}

.author-bio-social {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.author-bio-social .social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.author-bio-social .social-btn.twitter {
    background: #1a1a1a;
    color: #fff;
}

.author-bio-social .social-btn.twitter:hover {
    background: #333;
    transform: translateY(-2px);
}

.author-bio-social .social-btn.linkedin {
    background: #0077b5;
    color: #fff;
}

.author-bio-social .social-btn.linkedin:hover {
    background: #005885;
    transform: translateY(-2px);
}

.author-view-all {
    display: inline-block;
    color: #9333ea;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    transition: color 0.2s;
}

.author-view-all:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* ============================================
   RELATED POSTS WIDGET
   ============================================ */

.related-posts-widget {
    border-left: 4px solid #9333ea;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--blog-border);
}

.related-posts-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-posts-list li a {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
}

.related-posts-list .related-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--blog-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.related-posts-list li a:hover .related-title {
    color: #9333ea;
}

.related-posts-list .related-date {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Mobile responsive for author bio box */
@media (max-width: 600px) {
    .author-bio-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 20px;
    }

    .author-bio-avatar img,
    .author-bio-avatar .author-initial {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .author-bio-social {
        justify-content: center;
    }

    .author-bio-content h4 {
        font-size: 20px;
    }
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.blog-toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin: 24px 0 32px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
}

.toc-icon {
    font-size: 20px;
}

.toc-header strong {
    flex: 1;
    font-size: 15px;
    font-weight: 700;
}

.toc-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.blog-toc.collapsed .toc-nav {
    display: none;
}

.blog-toc.collapsed .toc-toggle {
    transform: rotate(0);
}

.blog-toc.collapsed .toc-toggle::before {
    content: '+';
}

.toc-nav {
    padding: 12px 0;
}

.toc-item {
    display: block;
    padding: 12px 20px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    line-height: 1.5;
}

.toc-item:hover {
    background: #fff;
    color: var(--blog-primary);
    border-left-color: var(--blog-primary);
    padding-left: 24px;
    box-shadow: inset 5px 0 15px -5px rgba(0, 0, 0, 0.05);
}

.toc-item-sub {
    padding-left: 36px;
    font-size: 13px;
    color: #64748b;
}

.toc-item-sub::before {
    content: '↳ ';
    color: #94a3b8;
}

/* ============================================
   SOCIAL SHARE BUTTONS
   ============================================ */

.blog-share-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    margin: 30px 0;
    border: 1px solid #e2e8f0;
}

.share-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.share-icons {
    display: flex;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.share-icon {
    font-size: 16px;
}

.share-twitter {
    background: #14171a;
    color: #fff;
}

.share-twitter:hover {
    background: #000;
}

.share-facebook {
    background: #1877f2;
    color: #fff;
}

.share-facebook:hover {
    background: #0d65d9;
}

.share-linkedin {
    background: #0a66c2;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.share-linkedin:hover {
    background: #084d93;
}

.share-pinterest {
    background: #bd081c;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.share-pinterest:hover {
    background: #a00718;
}

.share-copy {
    background: #64748b;
    color: #fff;
}

.share-copy:hover {
    background: #475569;
}

.share-copy.copied {
    background: #22c55e;
}

.share-copy.copied .share-icon::after {
    content: '✓';
}

/* ============================================
   RELATED POSTS BY CATEGORY WIDGET
   ============================================ */

.related-category-widget {
    border-left: 4px solid var(--blog-primary);
}

.related-category-widget .category-badge {
    display: inline-block;
    background: var(--blog-primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ============================================
   POST VIEW COUNTER
   ============================================ */

.meta-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 13px;
}

.meta-views::before {
    content: '👁️';
}

/* Mobile responsive for new elements */
@media (max-width: 600px) {
    .blog-toc {
        margin: 16px 0 24px;
    }

    .toc-item {
        padding: 8px 16px;
        font-size: 13px;
    }

    .toc-item-sub {
        padding-left: 28px;
    }

    .blog-share-buttons {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .share-icons {
        justify-content: center;
    }

    .share-btn {
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   BLOG SEARCH FORM
   ============================================ */

.blog-search-form {
    display: flex;
    max-width: 500px;
    margin: 24px auto 0;
    background: #fff;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.blog-search-form:focus-within {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--blog-primary);
}

.blog-search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-family: var(--blog-font);
    background: transparent;
    outline: none;
}

.blog-search-input::placeholder {
    color: #9ca3af;
}

.blog-search-btn {
    background: var(--blog-primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-search-btn:hover {
    background: #b71c1c;
    transform: scale(1.05);
}

/* Search Results Indicator */
.blog-search-results {
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-search-results span {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.blog-search-results .search-term {
    background: #fbbf24;
    color: #78350f;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    margin: 0 4px;
}

.blog-search-results .clear-search {
    color: #92400e;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(146, 64, 14, 0.1);
    transition: background 0.2s;
}

.blog-search-results .clear-search:hover {
    background: rgba(146, 64, 14, 0.2);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .blog-search-form {
        margin: 16px 10px 0;
    }

    .blog-search-input {
        padding: 10px 16px;
        font-size: 14px;
    }

    .blog-search-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .blog-search-results {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .author-bio-box {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
        gap: 20px;
    }

    .author-bio-box::before {
        width: 100%;
        height: 6px;
    }

    .author-bio-footer {
        flex-direction: column;
    }
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

#reading_progress_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 10001;
    pointer-events: none;
}

#reading_progress_bar {
    height: 100%;
    background: linear-gradient(to right, #9333ea, #ef4444);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.4);
}

/* ============================================
   SCROLL TO TOP
   ============================================ */

#scroll_to_top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #fff;
    color: #9333ea;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

#scroll_to_top.active {
    opacity: 1;
    visibility: visible;
}

#scroll_to_top:hover {
    background: #9333ea;
    color: #fff;
    border-color: #9333ea;
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(147, 51, 234, 0.3);
}

/* ============================================
   COMMENT SYSTEM
   ============================================ */

.blog-comments-area {
    margin-top: 60px;
    padding-top: 50px;
    border-top: 1px solid #f3f4f6;
}

.comments-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 40px;
    color: #111827;
}

.comment-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-item {
    margin-bottom: 32px;
    display: flex;
    gap: 20px;
}

.comment-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #f3f4f6;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #9ca3af;
    font-size: 20px;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 700;
    color: #111827;
    margin-right: 10px;
}

.comment-date {
    font-size: 13px;
    color: #9ca3af;
}

.comment-text {
    margin-top: 8px;
    color: #4b5563;
    line-height: 1.6;
    font-size: 15px;
}

.comment-respond {
    background: #f9fafb;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid #f3f4f6;
    margin-bottom: 50px;
}

.comment-form-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 24px;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.comment-form-full {
    grid-column: span 2;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #fff;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: #9333ea;
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.1);
}

.comment-button {
    background: #9333ea;
    color: #fff;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.comment-button:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(147, 51, 234, 0.4);
}

@media (max-width: 600px) {
    .comment-form {
        grid-template-columns: 1fr;
    }

    .comment-form-full {
        grid-column: auto;
    }

    .comment-respond {
        padding: 30px 20px;
    }
}

/* ============================================
   CATEGORY LANDING PAGE
   ============================================ */

.category-hero {
    text-align: center;
    padding: 80px 0;
    color: #fff;
    margin-bottom: 50px;
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.1) 0%, transparent 40%);
}

.category-badge-large {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.category-hero h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-description {
    font-size: 18px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.category-meta-info {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Grid Layout for Category Posts */
.blog-posts.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.grid-layout .blog-post {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #eef2f6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-layout .blog-post:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
}

.grid-layout .blog-post-image {
    height: 200px;
    width: 100%;
    margin: 0;
    border-radius: 0;
}

.grid-layout .blog-post-info {
    padding: 24px 24px 0;
}

.grid-layout .blog-post-link {
    padding: 10px 24px 15px;
    flex: 1;
}

.grid-layout .blog-post-link a {
    font-size: 20px;
    line-height: 1.4;
    font-weight: 700;
}

.post-excerpt {
    padding: 0 24px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.read-more {
    display: block;
    margin: 0 24px 24px;
    font-size: 14px;
    font-weight: 700;
    color: var(--blog-primary);
    text-decoration: none;
    transition: transform 0.2s;
}

.read-more:hover {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .category-hero {
        padding: 50px 20px;
    }

    .category-hero h2 {
        font-size: 32px;
    }

    .category-description {
        font-size: 16px;
    }

    .blog-posts.grid-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   WIDGETS: TLDR, FAQ, CALCULATOR
   ============================================ */

/* TLDR Box */
.blog-tldr {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(186, 230, 253, 0.2);
}

.tldr-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #0369a1;
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tldr-content {
    font-size: 15px;
    line-height: 1.6;
    color: #0c4a6e;
}

/* FAQ Accordion */
.blog-faq-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-question {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: #1f2937;
    transition: background 0.2s;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-icon {
    font-size: 20px;
    color: var(--blog-primary);
    transition: transform 0.3s;
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0, 1, 0, 1);
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.blog-faq-item.open {
    border-color: var(--blog-primary);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.08);
}

.blog-faq-item.open .faq-answer {
    max-height: 1000px;
    padding: 0 24px 24px;
    transition: all 0.3s cubic-bezier(1, 0, 1, 0);
}

.blog-faq-item.open .faq-icon {
    transform: rotate(45deg);
}

/* Savings Calculator */
.blog-savings-calculator {
    background: #1e293b;
    border-radius: 24px;
    padding: 30px;
    color: #fff;
    margin: 40px 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.blog-savings-calculator h4 {
    color: #fff;
    margin: 0 0 25px;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.calc-input label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}

.calc-input input {
    width: 100%;
    background: #334155;
    border: 1px solid #475569;
    padding: 12px 16px;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s;
}

.calc-input input:focus {
    border-color: #9333ea;
}

.calc-results {
    background: rgba(147, 51, 234, 0.1);
    border: 1px dashed rgba(147, 51, 234, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.calc-result-item span {
    display: block;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.calc-result-item strong {
    font-size: 24px;
    color: #fbbf24;
    font-weight: 800;
}

@media (max-width: 600px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}