/* ========================================================================
   BLOG PAGE STYLES
   Organized by section order as they appear in Blog views
   Hero section styles are in shared.css
   ======================================================================== */

/* ============================================
   1. BLOG MAIN SECTION
   ============================================ */

.blog-main-section {
    padding: 4.5rem 0 5.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
    position: relative;
    border-top: 1px solid rgba(15, 36, 70, 0.06);
}

/* ============================================
   2. BLOG GRID - VERTICAL CARD LAYOUT (2 per row)
   ============================================ */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 767px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Blog Card - Vertical */
.blog-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(15, 36, 70, 0.08);
    overflow: hidden;
    text-decoration: none;
    position: relative;
    box-shadow: 0 4px 20px rgba(15, 36, 70, 0.04);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(15, 36, 70, 0.12);
    border-color: rgba(29, 159, 218, 0.35);
}

/* Placeholder card */
.blog-card--placeholder {
    opacity: 0.85;
    cursor: default;
}

.blog-card--placeholder:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(15, 36, 70, 0.04);
    border-color: rgba(15, 36, 70, 0.08);
}

/* Image */
.blog-card__image {
    position: relative;
    height: 240px;
    overflow: hidden;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__image img {
    transform: scale(1.06);
}

.blog-card__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--main-color-rgb), 0.15), transparent 60%);
    pointer-events: none;
}

.blog-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-lighter, #1a3a6b) 100%);
}

.blog-card__logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.3;
    filter: brightness(0) invert(1);
}

.blog-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--accent-color), #4aa32e);
    color: #ffffff;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 4px 14px rgba(97, 178, 58, 0.35);
}

[dir="rtl"] .blog-card__badge {
    right: auto;
    left: 12px;
}

/* Content */
.blog-card__content {
    flex: 1;
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.blog-card__meta i {
    margin-inline-end: 0.3rem;
    color: #1d9fda;
}

.blog-card__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--main-color);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}

.blog-card:hover .blog-card__title {
    color: #1d9fda;
}

.blog-card__summary {
    color: #5a6a85;
    line-height: 1.8;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.92rem;
}

.blog-card__footer {
    margin-top: auto;
}

.blog-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1d9fda;
    font-weight: 700;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.blog-card__cta--muted {
    color: #94a3b8;
}

.blog-card:hover .blog-card__cta {
    color: var(--main-color);
    transform: translateX(4px);
}

[dir="rtl"] .blog-card:hover .blog-card__cta {
    transform: translateX(-4px);
}

/* Accent Line */
.blog-card__accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--main-color), #1d9fda, var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card__accent {
    transform: scaleX(1);
}

/* ============================================
   3. BLOG PAGINATION
   ============================================ */

.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 3.5rem;
}

.page-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(15, 36, 70, 0.08);
    color: #0f2446;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(15, 36, 70, 0.04);
    transition: all 0.25s ease;
}

.page-btn:hover {
    background: rgba(2, 132, 199, 0.05);
    color: #0284c7;
    border-color: #0284c7;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.2);
}

.page-btn.active {
    background: linear-gradient(135deg, #0f2446, #1d9fda);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(29, 159, 218, 0.35);
}

/* ============================================
   3b. SIDEBAR - LATEST PROJECTS
   ============================================ */

.sidebar-projects {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.sidebar-projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-project-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    padding: 0.65rem;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-project-card:hover {
    background: #fff;
    border-color: rgba(var(--accent-color-rgb, 97, 178, 58), 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transform: translateX(-3px);
}

[dir="rtl"] .sidebar-project-card:hover {
    transform: translateX(3px);
}

.sidebar-project-image {
    position: relative;
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sidebar-project-card:hover .sidebar-project-image img {
    transform: scale(1.08);
}

.sidebar-project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--main-color-rgb), 0.1), transparent);
    pointer-events: none;
}

.sidebar-project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--main-color), var(--main-color-lighter, #1a3a6b));
}

.sidebar-project-placeholder img {
    width: 32px;
    height: 32px;
    opacity: 0.4;
    filter: brightness(0) invert(1);
}

.sidebar-project-info {
    flex: 1;
    min-width: 0;
}

.sidebar-project-info h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--main-color);
    margin: 0 0 0.25rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-project-info p {
    font-size: 0.78rem;
    color: var(--color-neutral-gray, #6c757d);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-projects-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--main-color), var(--main-color-lighter, #1a3a6b));
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-projects-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--main-color-rgb), 0.3);
    color: #fff;
}

/* Empty State - Using shared empty-state from shared.css */


/* ========================================================================
   BLOG POST DETAIL PAGE STYLES
   ======================================================================== */

/* ============================================
   4. POST META BADGES
   ============================================ */

.post-meta-section {
    background: #ffffff;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(15, 36, 70, 0.06);
}

.post-meta-badges {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-meta-badges .meta-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    color: var(--main-color, #0f2446);
    padding: 0.5rem 1.15rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(15, 36, 70, 0.08);
    box-shadow: 0 2px 8px rgba(15, 36, 70, 0.04);
}

.post-meta-badges .meta-badge i {
    color: var(--accent-color);
}


/* ============================================
   5. BLOG POST SECTION
   ============================================ */

.blog-post-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
    border-bottom: 1px solid rgba(15, 36, 70, 0.06);
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

/* Blog Content Typography */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: var(--main-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.blog-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1rem 0;
}


/* ============================================
   6. POST NAVIGATION
   ============================================ */

.post-navigation {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.nav-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    border: 1px solid rgba(15, 36, 70, 0.08);
    box-shadow: 0 4px 18px rgba(15, 36, 70, 0.04);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(15, 36, 70, 0.1);
    border-color: rgba(29, 159, 218, 0.35);
}

.nav-direction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-neutral-gray);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.next-card .nav-direction {
    justify-content: flex-end;
}

.nav-post-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.next-card .nav-post-info {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .next-card .nav-post-info {
    text-align: left;
}

.nav-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-thumb .thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-lighter) 100%);
}

.nav-post-info h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    color: var(--main-color);
}


/* ============================================
   7. POST SIDEBAR
   ============================================ */

.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(15, 36, 70, 0.08);
    box-shadow: 0 10px 35px rgba(15, 36, 70, 0.05);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--main-color);
    color: #fff;
}

.sidebar-header i {
    font-size: 1.25rem;
    color: var(--accent-color);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

/* Related Posts List */
.related-posts-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-post-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    text-decoration: none;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.related-post-card:hover {
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

[dir="rtl"] .related-post-card:hover {
    transform: translateX(-5px);
}

.related-thumb {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-thumb .thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-lighter) 100%);
}

.thumb-icon {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

[dir="rtl"] .thumb-icon {
    right: auto;
    left: -5px;
}

.thumb-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.thumb-icon i {
    font-size: 0.7rem;
    color: var(--accent-color);
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--main-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-date {
    color: var(--color-neutral-gray);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Back Link */
.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #fff;
    border-radius: 10px;
    color: var(--main-color);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: var(--main-color);
    color: #fff;
}

/* ============================================
   8. RELATED POSTS SECTION (Bottom)
   ============================================ */

.related-posts-section {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
}

.related-posts-section .related-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-lighter) 100%);
    z-index: 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
    z-index: 10;
}

.related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.related-card .card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.related-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-card:hover .card-image img {
    transform: scale(1.1);
}

.related-card .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.4);
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-lighter) 100%);
}

.related-card .image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

.related-card .card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
}

[dir="rtl"] .related-card .card-badge {
    right: auto;
    left: 10px;
}

.related-card .card-icon {
    position: absolute;
    bottom: -20px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .related-card .card-icon {
    right: auto;
    left: 15px;
}

.related-card .card-icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.related-card .card-icon i {
    font-size: 1rem;
    color: var(--accent-color);
}

.related-card .card-content {
    padding: 1.5rem;
    padding-top: 1.75rem;
}

.related-card .card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-neutral-gray);
}

.related-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--main-color);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card p {
    color: var(--color-neutral-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.related-card .card-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-color);
}

.related-card .card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--main-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.related-card:hover .card-accent {
    transform: scaleX(1);
}

/* ============================================
   9. RESPONSIVE STYLES
   ============================================ */

@media (max-width: 991px) {
    .post-layout {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-row {
        flex-direction: column !important;
        min-height: auto;
    }

    .blog-row__image {
        flex: none;
        max-width: 100%;
        height: 220px;
    }
}

@media (max-width: 767px) {

    .blog-main-section,
    .blog-post-section,
    .related-posts-section {
        padding: 3rem 0;
    }

    .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .blog-row__content {
        padding: 1.5rem;
    }

    .blog-row__title {
        font-size: 1.2rem;
    }
}

@media (max-width: 575px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}