/* 
 * Bluworks Archive/Category Page Styles 
 * Supports LTR and RTL automatically
 */

/* --- Fonts & RTL Support --- */
:lang(ar) body.archive, 
:lang(ar) body.category,
:lang(ar) .blu-hero-title,
:lang(ar) .blu-newsletter-title,
:lang(ar) .blu-section-title,
:lang(ar) .blu-card-title-sm {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif !important;
}

/* --- Layout & Background --- */
body.archive, body.category {
    background-color: #f2f9fe;
}

.blu-blog-section {
    padding-top: 48px;
    padding-bottom: 48px;
}

.blu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Hero Section --- */
.blu-blog-hero {
    padding-top: 80px;
    padding-bottom: 80px;
    text-align: center;
    background-color: #f2f9fe;
}

.blu-hero-title {
    font-size: 48px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    line-height: 1.2;
}

:lang(ar) .blu-hero-title {
    font-weight: 600; /* Arabic often looks better slightly lighter */
}

.blu-hero-desc {
    font-size: 18px;
    color: #4b5563;
    margin-bottom: 40px;
    max-width: 768px;
    margin-inline: auto; /* Centers in both LTR/RTL */
    line-height: 1.5;
}

/* --- Newsletter Box --- */
.blu-hero-newsletter {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 672px;
    margin: 0 auto;
    text-align: start; /* Smart alignment: Left in LTR, Right in RTL */
}

.blu-newsletter-title {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}

.blu-newsletter-text {
    font-size: 16px;
    color: #4b5563;
    margin: 0 0 24px 0;
}

.blu-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blu-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    text-align: start; /* Input text aligns correctly */
}

.blu-input:focus {
    border-color: #1570EF;
    box-shadow: 0 0 0 2px rgba(21, 112, 239, 0.2);
}

.blu-btn-primary {
    background: linear-gradient(256deg, rgb(6, 87, 208) 0%, rgb(31, 120, 255) 148%);
    color: white;
    font-weight: 500;
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.blu-btn-primary:hover {
    opacity: 0.9;
}

/* --- Filter Bar --- */
.blu-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 20px;
}

.blu-section-title {
    font-size: 30px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.blu-cats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.blu-cat-link {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
    background-color: transparent;
}

.blu-cat-link:hover, 
.blu-cat-link.active {
    color: #1570EF;
    background-color: #eff6ff;
}

/* --- Grid Layout --- */
.blu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.blu-post-card {
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(20, 93, 252, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    text-align: start; /* Ensures content aligns correctly in RTL */
}

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

.blu-card-img {
    height: 200px;
    width: 100%;
}

.blu-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.blu-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blu-badge-sm {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #1570EF;
    background-color: rgba(20, 93, 252, 0.1);
    border-radius: 9999px;
    margin-bottom: 12px;
    width: fit-content;
}

.blu-card-title-sm {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.blu-card-title-sm a {
    text-decoration: none;
    color: inherit;
}

.blu-card-title-sm a:hover {
    color: #1570EF;
}

.blu-card-excerpt-sm {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.blu-meta-sm {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
}

.blu-sep {
    margin: 0 8px;
}

/* --- Pagination --- */
.blu-pagination-wrapper {
    margin-top: 48px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.page-numbers {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 500;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.2s;
}

.page-numbers:hover, 
.page-numbers.current {
    background: linear-gradient(256deg, rgb(6, 87, 208) 0%, rgb(31, 120, 255) 148%);
    color: white;
}

/* --- Responsive --- */
@media (min-width: 640px) {
    .blu-newsletter-form { flex-direction: row; }
}

@media (min-width: 768px) {
    .blu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .blu-grid { grid-template-columns: repeat(3, 1fr); }
}