/**
 * Blog System Styles for Levi Law Website
 * Professional blog styling with RTL support
 */

/* Blog Index Page Styles */
.blog-hero {
    background: linear-gradient(135deg, var(--law-primary) 0%, var(--law-primary-light) 100%);
    color: var(--text-white);
    padding: 60px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.blog-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
}

/* Blog Grid Layout */
.blog-container {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.blog-main {
    flex: 1;
    min-width: 0;
}

.blog-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* Category Filter */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-button {
    padding: 10px 20px;
    border: 2px solid var(--law-medium-gray);
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-button:hover {
    border-color: var(--law-primary);
    color: var(--law-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.filter-button.active {
    background: var(--law-primary);
    border-color: var(--law-primary);
    color: white;
}

.filter-button .count {
    display: inline-block;
    margin-right: 6px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Blog Post Cards */
.blog-posts-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.blog-post-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.blog-post-image {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, var(--law-primary-light) 0%, var(--law-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    position: relative;
    overflow: hidden;
}

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

.blog-post-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.blog-post-meta .category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--law-gold-light);
    color: var(--law-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.blog-post-meta .date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-post-meta .read-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-post-meta .author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.blog-post-card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--law-primary);
    line-height: 1.4;
}

.blog-post-card h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post-card h2 a:hover {
    color: var(--law-primary-light);
}

.blog-post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

.blog-post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--law-primary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: var(--law-primary-light);
    transform: translateX(-3px);
}

.read-more-btn::after {
    content: '←';
    font-size: 1.2rem;
}

/* Featured Post */
.blog-post-card.featured {
    border: 3px solid var(--law-gold);
    position: relative;
}

.blog-post-card.featured::before {
    content: '⭐ מאמר מומלץ';
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--law-gold);
    color: white;
    padding: 6px 15px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10;
}

/* Blog Sidebar Widgets */
.blog-sidebar .widget {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.blog-sidebar .widget h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--law-primary);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--law-gold);
}

.blog-sidebar .widget ul {
    list-style: none;
}

.blog-sidebar .widget ul li {
    margin-bottom: 12px;
}

.blog-sidebar .widget ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.blog-sidebar .widget ul li a::before {
    content: '◀';
    color: var(--law-gold);
    font-size: 0.8rem;
}

.blog-sidebar .widget ul li a:hover {
    color: var(--law-primary);
    padding-right: 5px;
}

/* Recent Posts Widget */
.recent-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--law-medium-gray);
}

.recent-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-post-icon {
    width: 60px;
    height: 60px;
    background: var(--law-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.recent-post-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.recent-post-info h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-info h4 a:hover {
    color: var(--law-primary);
}

.recent-post-info .date {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Categories Widget */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: var(--law-light-gray);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.category-list a:hover {
    background: var(--law-primary);
    color: white;
    transform: translateX(-5px);
}

.category-list .count {
    display: inline-block;
    padding: 2px 10px;
    background: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.category-list a:hover .count {
    background: var(--law-gold);
    color: white;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 25px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-btn {
    padding: 10px 16px;
    border: 2px solid var(--law-medium-gray);
    background: white;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.page-btn:hover {
    border-color: var(--law-primary);
    color: var(--law-primary);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--law-primary);
    border-color: var(--law-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Individual Blog Post Styles */
.blog-article {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.blog-article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--law-medium-gray);
}

.blog-article-header h1 {
    font-size: 2.5rem;
    color: var(--law-primary);
    margin-bottom: 20px;
    line-height: 1.3;
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    color: var(--text-light);
    font-size: 0.95rem;
}

.blog-article-meta .category-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--law-gold);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.blog-article-meta .author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.blog-article-meta .date-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-article-meta .read-time-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-article-content {
    line-height: 1.9;
    font-size: 1.1rem;
}

.blog-article-content h2 {
    font-size: 2rem;
    color: var(--law-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--law-gold);
}

.blog-article-content h3 {
    font-size: 1.5rem;
    color: var(--law-primary-light);
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-article-content p {
    margin-bottom: 20px;
}

.blog-article-content ul,
.blog-article-content ol {
    margin-bottom: 20px;
    padding-right: 25px;
}

.blog-article-content li {
    margin-bottom: 10px;
}

.blog-article-content blockquote {
    border-right: 4px solid var(--law-gold);
    padding: 20px 25px;
    margin: 30px 0;
    background: var(--law-light-gray);
    border-radius: var(--radius-md);
    font-style: italic;
    color: var(--text-secondary);
}

.blog-article-content table {
    width: 100%;
    margin: 30px 0;
    border-collapse: collapse;
}

.blog-article-content table th,
.blog-article-content table td {
    padding: 15px;
    text-align: right;
    border: 1px solid var(--law-medium-gray);
}

.blog-article-content table th {
    background: var(--law-primary);
    color: white;
    font-weight: 600;
}

.blog-article-content table tr:nth-child(even) {
    background: var(--law-light-gray);
}

/* Share Buttons */
.blog-share {
    margin: 40px 0;
    padding: 25px;
    background: var(--law-light-gray);
    border-radius: var(--radius-lg);
}

.blog-share h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--law-primary);
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.email {
    background: var(--law-secondary);
}

/* Author Bio */
.author-bio {
    margin: 40px 0;
    padding: 30px;
    background: white;
    border: 2px solid var(--law-medium-gray);
    border-radius: var(--radius-lg);
    display: flex;
    gap: 25px;
    align-items: start;
}

.author-avatar {
    width: 100px;
    height: 100px;
    background: var(--law-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 3rem;
    flex-shrink: 0;
}

.author-info-box {
    flex: 1;
}

.author-info-box h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--law-primary);
}

.author-info-box .author-title {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.author-info-box p {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.author-contact {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.author-contact a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--law-light-gray);
    color: var(--law-primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.author-contact a:hover {
    background: var(--law-primary);
    color: white;
}

/* Related Posts */
.related-posts {
    margin: 40px 0;
}

.related-posts h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--law-primary);
    text-align: center;
}

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

.related-post-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-post-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, var(--law-primary-light) 0%, var(--law-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.related-post-body {
    padding: 20px;
}

.related-post-body h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.related-post-body h4 a {
    color: var(--law-primary);
    text-decoration: none;
}

.related-post-body h4 a:hover {
    color: var(--law-primary-light);
}

.related-post-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.related-post-body .category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--law-gold-light);
    color: var(--law-primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Blog Navigation (Prev/Next) */
.blog-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
}

.blog-nav-item {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog-nav-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.blog-nav-item.prev {
    text-align: right;
}

.blog-nav-item.next {
    text-align: left;
    flex-direction: row-reverse;
}

.blog-nav-arrow {
    font-size: 2rem;
    color: var(--law-gold);
}

.blog-nav-content {
    flex: 1;
}

.blog-nav-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.blog-nav-title {
    font-size: 1.1rem;
    color: var(--law-primary);
    font-weight: 600;
    line-height: 1.4;
}

/* CTA Box in Articles */
.article-cta {
    margin: 40px 0;
    padding: 35px;
    background: linear-gradient(135deg, var(--law-primary) 0%, var(--law-primary-light) 100%);
    color: white;
    border-radius: var(--radius-lg);
    text-align: center;
}

.article-cta h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.article-cta p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.95;
}

.article-cta .cta-button {
    display: inline-block;
    padding: 15px 35px;
    background: var(--law-gold);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.article-cta .cta-button:hover {
    background: var(--law-gold-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Legal Disclaimer */
.blog-disclaimer {
    margin: 40px 0;
    padding: 20px;
    background: var(--law-light-gray);
    border-right: 4px solid var(--law-warning);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.blog-disclaimer strong {
    color: var(--law-primary);
}

/* Empty State */
.blog-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.blog-empty-state .empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.blog-empty-state h3 {
    font-size: 1.5rem;
    color: var(--law-primary);
    margin-bottom: 15px;
}

.blog-empty-state p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.blog-empty-state .clear-filters-btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--law-primary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.blog-empty-state .clear-filters-btn:hover {
    background: var(--law-primary-light);
    transform: translateY(-2px);
}

/* Loading State */
.blog-loading {
    text-align: center;
    padding: 60px 20px;
}

.blog-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--law-medium-gray);
    border-top-color: var(--law-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360px); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-container {
        flex-direction: column;
    }

    .blog-sidebar {
        width: 100%;
    }

    .related-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    .blog-article {
        padding: 25px;
    }

    .blog-article-header h1 {
        font-size: 1.8rem;
    }

    .blog-article-content {
        font-size: 1rem;
    }

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

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

    .author-bio {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author-contact {
        justify-content: center;
    }

    .blog-navigation {
        grid-template-columns: 1fr;
    }

    .blog-nav-item.next {
        flex-direction: row;
    }

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

    .blog-filters {
        justify-content: center;
    }

    .share-buttons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .blog-post-image {
        height: 180px;
        font-size: 3rem;
    }

    .blog-post-content {
        padding: 20px;
    }

    .blog-post-card h2 {
        font-size: 1.3rem;
    }

    .filter-button {
        flex: 1 1 auto;
        text-align: center;
        min-width: 120px;
    }

    .author-avatar {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

/* Print Styles */
@media print {
    .blog-filters,
    .blog-sidebar,
    .blog-share,
    .blog-navigation,
    .article-cta,
    header,
    footer {
        display: none;
    }

    .blog-article {
        box-shadow: none;
        padding: 0;
    }

    .blog-article-content {
        font-size: 12pt;
        line-height: 1.6;
    }
}
