/* ==========================================================================
   Blog Section
   ========================================================================== */

   .blog-section {
    /* background: #FEF6F0; */
    padding: 37px 0 48px;
}

.blog-section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header */
.blog-section-header {
    text-align: center;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.blog-section.animate-in .blog-section-header {
    opacity: 1;
    transform: translateY(0);
}

.blog-section-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 16px;
    line-height: 1.2;
}

.blog-section-description {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tabs */
.blog-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

.blog-section.animate-in .blog-tabs-wrapper {
    opacity: 1;
    transform: translateY(0);
    margin-bottom: 20px !important;
}

.blog-tabs {
    display: inline-flex;
    background: white;
    border-radius: 100px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    gap: 4px;
}

.blog-tab {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: #666;
    background: transparent;
    border: 2px solid #E0E0E0;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s 
ease;
    white-space: nowrap;
    margin: 0 2px;
}

.blog-tab:hover {
    color: #C97E53;
}

.blog-tab.active {
    background: #F6B38D;
    color: white;
    border-color: unset;
}

/* Search */
.blog-search-bar {
    display: flex;
    justify-content: center;
    margin: 0 auto 32px;
    max-width: 595px;
    width: 100%;
}

.blog-search-input {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 4rem;
}

.blog-search-input input {
    direction: rtl;
    width: 100%;
    padding: 8px 56px 8px 126px;
    border: none;
    min-height: 3.2rem;
    border-radius: 999px;
    font-size: 16px;
    line-height: 1;
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.blog-search-btn {
    /* left: 0; */
    /* right: auto; */
    position: absolute;
    inset-inline-start: 10px;
    color: white;
    top: 14px;
    height: calc(100% - 28px);
    min-width: 103px;
    padding: 0 30px;
    width: max-content;
    border: none;
    border-radius: 999px;
    background: #1f3948;
    /* transform: translate(-50%, -50%); */ /* This is a shorthand of;;color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    /* transition: transform 0.15s ease, box-shadow 0.15s ease; */
    z-index: 2;
    right: unset;
    left: 1rem;
}

.blog-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.16);
}

.blog-search-icon {
    position: absolute;
    inset-inline-end: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    z-index: 1;
    right: 24px;
    left: unset;
}

.blog-search-loader {
    position: absolute;
    inset-inline-end: 48px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #153C6D;
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.blog-search-loader.active {
    opacity: 1;
    animation: blogSpin 0.8s linear infinite;
}

@keyframes blogSpin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Content */
.blog-content-wrapper {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.blog-section.animate-in .blog-content-wrapper {
    opacity: 1;
    transform: translateY(0);
}

.blog-tab-content {
    display: none;
}

.blog-tab-content.active {
    display: block;
}

/* Slider */
.blog-slider {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.blog-slider-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    transition: transform 0.4s ease;
}

.blog-slider-track.centered {
    justify-content: center;
}

/* Grid mode (page template) */
.blog-page-section .blog-tab-content {
    display: none;
}

.blog-page-section .blog-tab-content.active {
    display: block;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.blog-grid-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.blog-grid .blog-card {
    flex: none;
    min-width: 0;
}

.blog-grid-empty {
    text-align: center;
    color: #888;
    font-weight: 600;
}

/* Blog Card */
.blog-card {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 320px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

.blog-card-line {
    height: 4px;
    background: linear-gradient(90deg, #F6B38D 0%, #F9B26B 100%);
}

.blog-card-content {
    padding: 24px;
    text-align: right;
}

.blog-card-date {
    font-size: 14px;
    color: #F6B38D;
    font-weight: 500;
    margin-bottom: 12px;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: var(--color-primary, #153C6D);
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.3s ease;
}

.blog-card-link:hover {
    background: #0f2d52;
    transform: translateY(-2px);
}

.grid-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.grid-page-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #E5E5E5;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: rotate(180deg);
}

.grid-page-btn:hover:not(.disabled):not(:disabled) {
    background: var(--color-primary, #153C6D);
    color: #fff;
    border-color: var(--color-primary, #153C6D);
}

.grid-page-btn:disabled,
.grid-page-btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.grid-page-btn-next svg {
    transform: rotate(180deg);
}

.grid-page-indicator {
    font-weight: 700;
    color: var(--color-primary, #153C6D);
}

.grid-pagination[data-single-page="1"] {
    display: none;
}

/* Navigation */
.blog-slider-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.blog-nav-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1a1a1a;
}

.blog-nav-arrow:hover:not(.disabled) {
    background: #1a1a1a;
    color: white;
}

.blog-nav-arrow.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-nav-arrow svg {
    width: 20px;
    height: 20px;
}

/* Rotate arrows for RTL */
.blog-nav-prev {
    transform: rotate(180deg);
}

.blog-nav-prev:hover:not(.disabled) {
    transform: rotate(180deg) scale(1.05);
}

.blog-nav-next {
    transform: rotate(180deg);
}

.blog-nav-next:hover:not(.disabled) {
    transform: rotate(180deg) scale(1.05);
}

/* Footer */
.blog-section-footer {
    text-align: center;
    margin-top: 40px;
}

.blog-all-posts-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #F6B38D;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-all-posts-link:hover {
    color: #C97E53;
}

.blog-all-posts-link svg {
    width: 16px;
    height: 16px;
}

/* No posts message */
.no-posts {
    text-align: center;
    padding: 48px;
    color: #999;
    font-size: 16px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .blog-section-container {
        padding: 0 32px;
    }
    
    .blog-card {
        flex: 0 0 calc(50% - 12px);
        min-width: 300px;
    }

    .blog-grid-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .blog-section {
        padding: 60px 0 80px;
    }
    
    .blog-section-title {
        font-size: 36px;
    }
    
    .blog-section-description {
        font-size: 16px;
    }
    
    .blog-card {
        flex: 0 0 calc(50% - 12px);
        min-width: 280px;
    }
    
    .blog-card-image {
        height: 180px;
    }

    .blog-grid-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .blog-section {
        padding: 48px 0 70px;
    }
    
    .blog-section-container {
        padding: 0 24px;
    }
    
    .blog-section-title {
        font-size: 28px;
    }
    
    .blog-section-description {
        font-size: 15px;
    }
    
    .blog-tabs-wrapper {
        margin-bottom: 32px;
    }
    
    .blog-tabs {
        padding: 4px;
    }
    
    .blog-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .blog-slider-track {
        gap: 16px;
    }
    
    .blog-card {
        flex: 0 0 calc(100vw - 64px);
        min-width: calc(100vw - 64px);
        max-width: calc(100vw - 64px);
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-slider-nav {
        margin-top: 32px;
    }
    
    .blog-nav-arrow {
        width: 44px;
        height: 44px;
    }

    .blog-grid-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-section {
        padding: 40px 0 60px;
    }
    
    .blog-section-container {
        padding: 0 16px;
    }
    
    .blog-section-title {
        font-size: 24px;
    }
    
    .blog-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        border-radius: 16px;
    }
    
    .blog-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .blog-card {
        flex: 0 0 calc(100vw - 48px);
        min-width: calc(100vw - 48px);
        max-width: calc(100vw - 48px);
    }
    
    .blog-card-content {
        padding: 20px;
    }
    
    .blog-card-title {
        font-size: 16px;
    }
    
    .blog-card-desc {
        font-size: 13px;
    }
    
    .blog-card-link {
        padding: 10px 24px;
        font-size: 13px;
    }
    
    .blog-nav-arrow {
        width: 40px;
        height: 40px;
    }
    
    .blog-all-posts-link {
        font-size: 14px;
    }
}

