/**
 * Blog Post Styles - ShopBit.co
 * OnCrawl-inspired clean design for single post pages
 */

/* ROOT VARIABLES - Blog specific */
:root {
    --blog-content-width: 900px;
    --blog-hero-gradient: linear-gradient(135deg, #f0f4ff, #e0e7ff);
    --blog-hero-border: #c7d2fe;
    --blog-background: #fefefe;
    --blog-toc-background: #f9fafb;
}

/* GLOBAL BLOG OVERRIDES */
.single-post body {
    background: var(--blog-background);
    font-size: 19px;
    line-height: 1.8;
}

/* READING PROGRESS BAR */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--success-green));
    z-index: 9999;
    transition: width 0.3s ease;
}

/* MAIN BLOG LAYOUT - Single Column */
.blog-container {
    max-width: var(--blog-content-width);
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
}

/* ARTICLE CONTENT - Integrated seamless design */
.article-content {
    background: transparent;
    border-radius: 0;
    padding: 60px 0;
    box-shadow: none;
    border: none;
    position: relative;
}

/* HERO SECTION - OnCrawl inspired above-the-fold */
.article-hero {
    background: var(--blog-hero-gradient);
    border-radius: 20px;
    padding: 60px 50px;
    margin: -60px -20px 60px -20px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--blog-hero-border);
}

.article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

/* CATEGORY TAG */
.category-tag {
    background: rgba(37,99,235,0.1);
    color: var(--primary-blue);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
    border: 1px solid rgba(37,99,235,0.2);
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-tag:hover {
    background: rgba(37,99,235,0.15);
    transform: translateY(-1px);
}

/* ARTICLE TITLE AND SUBTITLE */
.article-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #1e40af;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 20px;
}

.article-subtitle {
    font-size: 1.3rem;
    color: #475569;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ARTICLE META INFORMATION */
.article-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item::after {
    content: "•";
    margin-left: 16px;
    color: var(--gray-300);
}

.meta-item:last-child::after {
    display: none;
}

.read-time {
    color: var(--primary-blue);
    font-weight: 600;
}

.author-name {
    color: var(--text-primary);
    font-weight: 600;
}

.author-name a {
    color: inherit;
    text-decoration: none;
}

.author-name a:hover {
    color: var(--primary-blue);
}

/* TABLE OF CONTENTS - Much more compact */
.table-of-contents {
    background: var(--blog-toc-background);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 30px 0;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.table-of-contents.expanded {
    padding: 24px 20px;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    min-height: 20px;
}

.table-of-contents.expanded .toc-header {
    margin-bottom: 18px;
}

.toc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--primary-blue);
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.2s ease;
    padding: 2px;
    line-height: 1;
}

.toc-toggle.collapsed {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: decimal;
    padding-left: 20px;
    margin: 0;
}

.toc-list li {
    margin: 8px 0;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    display: block;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.toc-list a:hover,
.toc-list a.active {
    background: white;
    color: var(--primary-blue);
    border-left-color: var(--primary-blue);
    transform: translateX(4px);
}

.toc-list .toc-h3 {
    margin-left: 20px;
    list-style: lower-alpha;
}

.toc-list .toc-h3 a {
    font-size: 0.85rem;
}

/* ARTICLE CONTENT ELEMENTS */
.article-body h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 50px 0 24px 0;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.article-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 60px 0 24px 0;
    line-height: 1.3;
    letter-spacing: -0.3px;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 12px;
}

.article-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 45px 0 20px 0;
    line-height: 1.4;
}

.article-body h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 35px 0 16px 0;
    line-height: 1.4;
}

.article-body h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 14px 0;
    line-height: 1.4;
}

.article-body h6 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 25px 0 12px 0;
    line-height: 1.4;
}

.article-body p {
    margin-bottom: 28px;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.article-body p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body p em {
    font-style: italic;
    color: var(--text-secondary);
}

/* LINKS STYLING */
.article-body a {
    color: var(--primary-blue);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.article-body a:hover {
    border-bottom-color: var(--primary-blue);
    background: linear-gradient(135deg, #eff6ff, transparent);
    padding: 2px 4px;
    border-radius: 4px;
}

.external-link::after {
    content: "↗";
    font-size: 0.8rem;
    margin-left: 4px;
    opacity: 0.7;
}

/* CITATION LINKS */
.citation {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.8rem;
    vertical-align: super;
    font-weight: 600;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 2px;
    transition: all 0.2s ease;
}

.citation:hover {
    background: var(--primary-blue);
    color: white;
}

/* LIST STYLING */
.article-body ul {
    padding-left: 0;
    list-style: none;
    margin: 24px 0;
}

.article-body ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    line-height: 1.7;
}

.article-body ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

.article-body ol {
    padding-left: 30px;
    margin: 24px 0;
}

.article-body ol li {
    margin-bottom: 12px;
    line-height: 1.7;
}

/* BLOCKQUOTES AND PULL QUOTES */
.article-body blockquote {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-left: 4px solid var(--primary-blue);
    padding: 24px 32px;
    margin: 32px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-primary);
    position: relative;
}

.article-body blockquote::before {
    content: '"';
    font-size: 3rem;
    color: var(--primary-blue);
    position: absolute;
    top: 8px;
    left: 16px;
    opacity: 0.3;
}

.pull-quote {
    background: transparent;
    border-left: 4px solid var(--primary-blue);
    padding: 24px 0 24px 32px;
    margin: 50px 0;
    border-radius: 0;
    position: relative;
}

.pull-quote p {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    font-style: italic;
    margin: 0;
    line-height: 1.7;
}

.pull-quote .quote-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: normal;
    margin-top: 16px;
    font-weight: 500;
}

.pull-quote .quote-author::before {
    content: "— ";
    color: var(--gray-400);
}

/* IMAGES AND MEDIA */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.wp-caption {
    max-width: 100%;
    margin: 32px 0;
}

.wp-caption img {
    width: 100%;
    margin: 0;
}

.wp-caption-text {
    background: var(--gray-100);
    padding: 16px 20px;
    border-radius: 0 0 12px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: left;
    margin-top: -12px;
    line-height: 1.5;
}

/* AUTHOR BIO - Seamlessly integrated */
.author-bio {
    background: transparent;
    border-top: 2px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 32px 0;
    margin: 60px 0;
    display: flex;
    gap: 20px;
    align-items: center;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.author-title {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.author-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 8px 0 0 0;
    font-size: 0.9rem;
}

.author-social {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.author-social a {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    color: var(--gray-500);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.author-social a:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
}

/* RELATED ARTICLES */
.related-articles {
    margin: 60px 0;
    padding: 40px 0;
    border-top: 2px solid var(--gray-200);
}

.related-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.related-card {
    background: #fafbfc;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: var(--primary-blue);
}

.related-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-content {
    padding: 20px;
}

.related-category {
    color: var(--primary-blue);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.related-title-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    display: block;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.related-title-link:hover {
    color: var(--primary-blue);
}

.related-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.related-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.related-read-time {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* BACK TO TOP BUTTON */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
    display: none;
}

.back-to-top:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}

/* WORDPRESS SPECIFIC STYLING */
.post-navigation {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-previous a,
.nav-next a {
    display: block;
    padding: 16px 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
    background: var(--gray-100);
    border-color: var(--primary-blue);
    transform: translateY(-1px);
}

.nav-next a {
    text-align: right;
}

/* PAGE LINKS (for paginated posts) */
.page-links {
    margin: 30px 0;
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--gray-200);
}

.page-links-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
}

.page-links span {
    display: inline-block;
    margin: 0 4px;
    padding: 8px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-links a span {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.page-links a:hover span {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

/* COMMENTS STYLING */
.comments-area {
    margin: 60px 0;
    padding: 40px 0;
    border-top: 2px solid var(--gray-200);
}

.comments-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.comment {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.comment-content p {
    margin-bottom: 16px;
    font-size: 0.95rem;
}

/* MOBILE RESPONSIVE - Blog Specific */
@media (max-width: 768px) {
    .blog-container {
        padding: 20px 16px;
    }

    .article-content {
        padding: 0;
    }

    .article-hero {
        margin: -20px -16px 40px -16px;
        padding: 40px 24px;
        border-radius: 16px;
    }

    .article-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .article-subtitle {
        font-size: 1.2rem;
    }

    .single-post body {
        font-size: 17px;
    }

    .author-bio {
        padding: 32px 0;
        gap: 16px;
    }

    .author-social {
        margin-left: 0;
    }

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

    .post-navigation {
        flex-direction: column;
    }

    .nav-next a {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .blog-container {
        padding: 16px 12px;
    }

    .article-hero {
        margin: -16px -12px 32px -12px;
        padding: 32px 20px;
        border-radius: 12px;
    }

    .article-title {
        font-size: 1.9rem;
        letter-spacing: -0.5px;
    }

    .article-subtitle {
        font-size: 1.1rem;
    }

    .article-body h2 {
        font-size: 1.6rem;
    }

    .article-body h3 {
        font-size: 1.3rem;
    }

    .article-meta {
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-item::after {
        display: none;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */
.toc-toggle:focus,
.back-to-top:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* PRINT STYLES */
@media print {
    .reading-progress,
    .back-to-top,
    .author-social,
    .related-articles {
        display: none;
    }
    
    .article-hero {
        background: white !important;
        border: 1px solid #000;
    }
    
    .article-title {
        color: #000 !important;
    }
    
    .article-body a {
        color: #000;
        text-decoration: underline;
    }
}

/* HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    .article-hero {
        background: #fff;
        border: 2px solid #000;
    }
    
    .article-title {
        color: #000;
    }
    
    .table-of-contents {
        background: #fff;
        border: 2px solid #000;
    }
}

/* NEWSLETTER FUNCTIONALITY */
.newsletter-signup {
    background: linear-gradient(135deg, var(--success-green), #059669);
    color: white;
    padding: 50px 40px;
    border-radius: 16px;
    margin: 60px 0;
    text-align: center;
    box-shadow: 0 8px 32px rgba(16,185,129,0.15);
    position: relative;
    overflow: hidden;
}

.newsletter-signup::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.newsletter-signup h4 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.newsletter-signup p {
    opacity: 0.95;
    margin-bottom: 30px;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.newsletter-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.newsletter-submit {
    background: white;
    color: var(--success-green);
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.newsletter-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.newsletter-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.newsletter-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.newsletter-message.newsletter-success {
    background: rgba(16,185,129,0.2);
    color: #065f46;
    border: 1px solid rgba(16,185,129,0.3);
}

.newsletter-message.newsletter-error {
    background: rgba(239,68,68,0.2);
    color: #991b1b;
    border: 1px solid rgba(239,68,68,0.3);
}

.newsletter-disclaimer {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 16px;
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}

/* FAQ SYSTEM STYLING */
.faq-section {
    margin: 60px 0;
}

.faq-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 40px;
    border-bottom: none;
    padding-bottom: 0;
}

.faq-item {
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.faq-item.expanded {
    border-color: var(--primary-blue);
}

.faq-question {
    background: #f9fafb;
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    font-weight: 600;
    color: var(--text-primary);
}

.faq-question:hover {
    background: #f1f5f9;
}

.faq-question i {
    color: var(--primary-blue);
    transition: transform 0.2s ease;
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
}

.faq-answer.active {
    padding: 20px 24px;
    max-height: 500px;
}

.faq-answer p {
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .reading-progress,
    .back-to-top,
    .related-card,
    .toc-toggle,
    .newsletter-signup::before {
        transition: none;
        animation: none;
    }
    
    .article-hero::before {
        animation: none;
    }
}
