/**
 * Blog Archive Styles
 * Enhanced Search, Recent Posts, Categories, Tags Widgets
 * Version: 1.0
 */

/* ==========================================================================
   Blog Container & Layout
   ========================================================================== */

.blog-container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .blog-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .blog-sidebar {
        order: 2;
    }
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

.blog-sidebar {
    position: sticky;
    top: 100px;
}

@media (max-width: 992px) {
    .blog-sidebar {
        position: static;
    }
}

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.widget-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #2596be;
    color: #1a1a2e;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #2596be, #1976a3);
}

/* ==========================================================================
   Search Widget
   ========================================================================== */

.search-widget .search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.search-field:focus {
    border-color: #2596be;
    box-shadow: 0 0 0 4px rgba(37, 150, 190, 0.1);
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #2596be, #1976a3);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background: linear-gradient(135deg, #1976a3, #15577a);
    transform: translateY(-50%) scale(1.05);
}

.search-submit i {
    font-size: 16px;
}

/* ==========================================================================
   Recent Posts Widget
   ========================================================================== */

.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-post-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-item:first-child {
    padding-top: 0;
}

.recent-post-item:hover {
    transform: translateX(5px);
}

.recent-post-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.recent-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recent-post-thumbnail:hover img {
    transform: scale(1.1);
}

.recent-post-details {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.recent-post-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-title a:hover {
    color: #2596be;
}

.recent-post-date {
    font-size: 13px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 5px;
}

.recent-post-date i {
    color: #2596be;
    font-size: 12px;
}

/* ==========================================================================
   Categories Widget
   ========================================================================== */

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list li:last-child {
    margin-bottom: 0;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all 0.3s ease;
    gap: 10px;
}

.category-list a:hover {
    background: #2596be;
    color: #fff;
    transform: translateX(5px);
}

.category-list a i {
    color: #2596be;
    font-size: 14px;
    transition: color 0.3s ease;
}

.category-list a:hover i {
    color: #fff;
}

.category-list a span:first-of-type {
    flex: 1;
    font-weight: 500;
}

.category-count {
    background: #fff;
    color: #2596be;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.category-list a:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ==========================================================================
   Tags Widget
   ========================================================================== */

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 50px;
    text-decoration: none;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-item i {
    font-size: 11px;
    color: #2596be;
    transition: color 0.3s ease;
}

.tag-item:hover {
    background: #2596be;
    color: #fff;
    border-color: #2596be;
    transform: translateY(-2px);
}

.tag-item:hover i {
    color: #fff;
}

/* ==========================================================================
   Blog Posts Grid
   ========================================================================== */

.blog-main-content {
    width: 100%;
}

.blog-post-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.blog-post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 350px;
}

.blog-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-post-item:hover .blog-post-thumbnail img {
    transform: scale(1.05);
}

.blog-post-content {
    padding: 30px;
}

.blog-post-category {
    display: inline-block;
    background: linear-gradient(135deg, #2596be, #1976a3);
    color: #fff;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.blog-post-category:hover {
    background: linear-gradient(135deg, #1976a3, #15577a);
    transform: translateY(-2px);
}

.blog-post-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.blog-post-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post-title a:hover {
    color: #2596be;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #777;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-post-meta i {
    color: #2596be;
}

.blog-post-excerpt {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #2596be, #1976a3);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: linear-gradient(135deg, #1976a3, #15577a);
    transform: translateX(5px);
}

.read-more i {
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.pagination .nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: #fff;
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: linear-gradient(135deg, #2596be, #1976a3);
    color: #fff;
    border-color: #2596be;
    transform: translateY(-2px);
}

.pagination .page-numbers i {
    margin: 0 5px;
}

/* ==========================================================================
   No Posts Message
   ========================================================================== */

.no-posts-message {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
}

.no-posts-message i {
    font-size: 80px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.no-posts-message h3 {
    font-size: 28px;
    color: #1a1a2e;
    margin: 0 0 10px 0;
}

.no-posts-message p {
    color: #777;
    font-size: 16px;
}

/* ==========================================================================
   Archive Description
   ========================================================================== */

.archive-description {
    background: #f8f9fa;
    padding: 20px 30px;
    border-radius: 12px;
    border-left: 4px solid #2596be;
    color: #555;
    line-height: 1.7;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .widget-title::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .search-submit {
    right: auto;
    left: 5px;
}

[dir="rtl"] .recent-post-item:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .category-list a:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .read-more:hover {
    transform: translateX(-5px);
}

[dir="rtl"] .archive-description {
    border-left: none;
    border-right: 4px solid #2596be;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .blog-post-thumbnail {
        height: 250px;
    }

    .blog-post-content {
        padding: 20px;
    }

    .blog-post-title {
        font-size: 22px;
    }

    .blog-post-meta {
        font-size: 13px;
        gap: 15px;
    }

    .sidebar-widget {
        padding: 20px;
    }

    .widget-title {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .blog-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .blog-post-thumbnail {
        height: 200px;
    }

    .blog-post-title {
        font-size: 20px;
    }

    .blog-post-meta {
        flex-direction: column;
        gap: 10px;
    }

    .recent-post-thumbnail {
        width: 60px;
        height: 60px;
    }

    .recent-post-title {
        font-size: 14px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .blog-sidebar,
    .pagination,
    .read-more {
        display: none;
    }

    .blog-container {
        grid-template-columns: 1fr;
    }

    .blog-post-item {
        box-shadow: none;
        page-break-inside: avoid;
    }
}
