/**
 * Invoice Reader Theme - Blog Specific Styles
 * Enhanced version with better typography, RTL support, and visual elements
 */

/* General Blog Styling */
.blog-content {
    font-family: 'Cairo', sans-serif;
    line-height: 1.8;
    color: #374151;
}

/* Enhanced Typography */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    position: relative;
    padding-right: 1rem;
}

.blog-content h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 4px;
    background: linear-gradient(to bottom, #ef4444, #f87171);
    border-radius: 2px;
}

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
    padding-right: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: rgba(239, 68, 68, 0.05);
    border-right: 4px solid #ef4444;
    border-radius: 0 0.375rem 0.375rem 0;
    font-size: 1.1em;
    color: #4b5563;
}

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

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.blog-content code {
    background-color: #fee2e2;
    color: #b91c1c;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Table of Contents Styling */
#content-toc {
    background: linear-gradient(to bottom right, #fef2f2, #fff1f2);
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

#content-toc:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#content-toc h3 {
    color: #b91c1c;
    font-size: 1.25rem;
    margin-top: 0;
    padding-right: 0;
}

#toc-container ul {
    padding-right: 1.25rem;
    margin-bottom: 0;
}

#toc-container li {
    margin-bottom: 0.5rem;
}

#toc-container a {
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 0.25rem 0;
}

#toc-container a:hover {
    color: #ef4444;
}

/* Reading Progress Bar */
#reading-progress {
    background: linear-gradient(to right, #ef4444, #f87171);
    height: 4px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Author Section */
.author-bio-section {
    display: flex;
    align-items: center;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.author-avatar {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    margin-left: 1.5rem;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.author-info h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.author-info p {
    margin-bottom: 0.5rem;
    color: #6b7280;
}

/* Social Share Buttons */
.social-share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.social-share-icons a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-share-icons a i {
    margin-left: 0.5rem;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
}

.related-posts-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-right: 1rem;
}

.related-posts-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 4px;
    background: linear-gradient(to bottom, #ef4444, #f87171);
    border-radius: 2px;
}

.related-post-card {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Comment Section */
.comment-respond {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 2rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.comment-form input[type="submit"] {
    background-color: #ef4444;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    padding: 0.75rem 1.5rem;
    border: none;
    transition: background-color 0.2s ease;
}

.comment-form input[type="submit"]:hover {
    background-color: #dc2626;
}

/* RTL Specific Styling */
.rtl .blog-content {
    text-align: right;
}

.rtl .blog-content h2::before {
    right: 0;
    left: auto;
}

.rtl .blog-content ul,
.rtl .blog-content ol {
    padding-right: 2rem;
    padding-left: 0;
}

.rtl .blog-content blockquote {
    border-right: 4px solid #ef4444;
    border-left: none;
    border-radius: 0 0.375rem 0.375rem 0;
}

.rtl .author-avatar {
    margin-left: 1.5rem;
    margin-right: 0;
}

.rtl .social-share-icons a i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Print Styles */
@media print {
    .blog-content {
        font-size: 12pt;
    }
    
    #content-toc,
    .social-share-icons,
    .related-posts,
    .comment-respond {
        display: none;
    }
    
    .blog-content a {
        text-decoration: underline;
        color: #000;
    }
    
    .blog-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes highlightHeading {
    0% { background-color: rgba(239, 68, 68, 0.1); }
    50% { background-color: rgba(239, 68, 68, 0.2); }
    100% { background-color: transparent; }
}

.blog-content {
    animation: fadeIn 0.5s ease-out;
}

.highlight-heading {
    animation: highlightHeading 2s ease-out;
    border-radius: 0.25rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Reading Position Indicator */
#reading-position-indicator {
    transition: opacity 0.3s ease;
}

#reading-position-indicator div {
    cursor: pointer;
}

/* Print Button */
.print-button-container {
    text-align: right;
}

.rtl .print-button-container {
    text-align: left;
}

/* Copy Link Button */
.copy-link-button {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.copy-link-button i {
    margin-right: 0.5rem;
}

.rtl .copy-link-button i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .blog-content h1 {
        font-size: 1.75rem;
    }
    
    .blog-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-content h3 {
        font-size: 1.25rem;
    }
    
    .author-bio-section {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar {
        margin-left: 0;
        margin-bottom: 1rem;
    }
}
