/**
 * Blog Page Section Styles
 * Based on Figma design: https://www.figma.com/design/HdhVruCm1xwQDVCTo1yHyd/Website-TAM-dental?node-id=606-7414
 */

.blog-page-section {
    padding: 64px 32px;
    background: #ffffff;
}

.blog-page-section .container {
    max-width: 1216px;
    margin: 0 auto;
}

/* Header Section */
.blog-page-header {
    margin-bottom: 32px;
}

.blog-page-header .page-title {
    color: #181D27;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.56;
    letter-spacing: -1px;
    margin: 0 0 32px 0;
}

/* Filters Wrapper */
.blog-filters-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FAFAFA;
    border: 1px solid #E9EAEB;
    border-radius: 8px;
    padding: 4px;
    overflow-x: auto;
}

/* RTL Support for Arabic */
[lang="ar"] .blog-page-section {
    direction: rtl;
}

[lang="ar"] .blog-page-section .page-title {
    text-align: right;
}

[lang="ar"] .blog-page-section .blog-posts-grid {
    direction: rtl;
}

[lang="ar"] .blog-page-section .blog-post-card {
    direction: rtl;
}


[lang="ar"] .blog-page-section .post-categories {
    justify-content: flex-start;
}

[lang="ar"] .blog-page-section .post-date,
[lang="ar"] .blog-page-section .post-title,
[lang="ar"] .blog-page-section .post-excerpt {
    text-align: right;
}

[lang="ar"] .blog-page-section .post-title a {
    line-height: 1.4;
    font-family: 'IBM Plex Sans Arabic', 'Poppins', sans-serif;
}

[lang="ar"] .blog-page-section .pagination-wrapper {
    flex-direction: row-reverse;
}

[lang="ar"] .blog-page-section .pagination-prev,
[lang="ar"] .blog-page-section .pagination-next {
    flex-direction: row-reverse;
}

.tab-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    min-height: 44px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: -0.2px;
    color: #717680;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #414651;
}

.tab-button.active {
    background: #FFFFFF;
    color: #414651;
    border: 1px solid #D5D7DA;
    box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
}

/* Sort Select */
.sort-select-wrapper {
    position: relative;
    display: inline-block;
}

.sort-select {
    appearance: none;
    background: #FFFFFF;
    border: 1px solid #D5D7DA;
    border-radius: 8px;
    padding: 10px 40px 10px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    color: #181D27;
    cursor: pointer;
    box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
    transition: border-color 0.2s ease;
}

.sort-select:hover {
    border-color: #B8BCC3;
}

.sort-select:focus {
    outline: none;
    border-color: #0B76AD;
    box-shadow: 0 0 0 3px rgba(11, 118, 173, 0.1);
}

.chevron-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Blog Posts Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 64px;
}

/* Blog Post Card */
.blog-post-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s ease;
}

.blog-post-card:hover {
    transform: translateY(-4px);
}

.blog-post-card:hover .post-title a {
    color: #14A2EB;
}

.blog-post-card:hover .arrow-icon {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* Post Image */
.post-image {
    width: 100%;
    height: 256px;
    border-radius: 16px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image:hover img {
    transform: scale(1.05);
}

.post-image.placeholder {
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
}

.placeholder-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
}

/* Post Content */
.post-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Post Meta */
.post-meta {
    margin-bottom: 8px;
}

.post-date {
    color: #0B76AD;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.2px;
}

/* Post Title */
.post-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.post-title {
    flex: 1;
    margin: 0;
}

.post-title a {
    color: #181D27;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.56;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.arrow-icon-wrapper {
    flex-shrink: 0;
    padding-top: 2px;
}

.arrow-icon {
    opacity: 0;
    transition: all 0.2s ease;
}

.blog-post-card:hover .arrow-icon-wrapper .arrow-icon {
    opacity: 1;
}

/* Post Excerpt */
.post-excerpt {
    color: #535862;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    margin: 4px 0 16px;
}

/* Post Categories */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.43;
    letter-spacing: -0.2px;
    text-align: center;
    background: #F6FBFD;
    color: #0B76AD;
    border: 1px solid #DBF0FB;
}

/* Category badge variations */
.category-badge.category-general {
    background: #F6FBFD;
    color: #0B76AD;
    border-color: #DBF0FB;
}

.category-badge.category-implant,
.category-badge.category-implants {
    background: #FFFAEB;
    color: #B54708;
    border-color: #FEDF89;
}

.category-badge.category-dental {
    background: #FDF2FA;
    color: #C11574;
    border-color: #FCCEEE;
}

.category-badge.category-kids-dental {
    background: #F0F9FF;
    color: #0369A1;
    border-color: #BAE6FD;
}

.category-badge.category-orthodontics {
    background: #F4F3FF;
    color: #5925DC;
    border-color: #D9D6FE;
}

/* Pagination */
.blog-pagination {
    border-top: 1px solid #E9EAEB;
    padding-top: 20px;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.pagination-prev,
.pagination-next {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #535862;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    color: #0B76AD;
}

.pagination-prev:hover svg path,
.pagination-next:hover svg path {
    stroke: #0B76AD;
}

.pagination-numbers {
    display: flex;
    gap: 2px;
}

.page-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.43;
    letter-spacing: -0.2px;
    color: #717680;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #F5F5F5;
    color: #414651;
}

.page-number.active {
    background: #F5F5F5;
    color: #414651;
    font-weight: 500;
}

.page-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    color: #717680;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

/* No posts message */
.no-posts-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #717680;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-page-section {
        padding: 48px 24px;
    }
    
    .blog-filters-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-tabs {
        width: 100%;
        justify-content: flex-start;
    }
    
    .sort-select-wrapper {
        width: 100%;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .pagination-wrapper {
        flex-wrap: wrap;
    }
    
    .pagination-numbers {
        overflow-x: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .blog-page-section {
        padding: 32px 16px;
    }
    
    .blog-page-header .page-title {
        font-size: 20px;
    }
    
    .tab-button {
        font-size: 14px;
        padding: 6px 10px;
        min-height: 36px;
    }
    
    .post-image {
        height: 200px;
    }
    
    .post-title a {
        font-size: 16px;
    }
    
    .post-excerpt {
        font-size: 14px;
    }
}