/* Unified Article Styles: News, Blog, Wiki */

/* Wide container and Spacing */
@media (min-width: 1200px) {
    .container-wide {
        max-width: 1400px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

.content-wrapper {
    margin: 0 auto;
    width: 100%;
}

.container-wide.my-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
}

/* Breadcrumb Compact Style */
.breadcrumb-item {
    font-size: 0.75rem !important;
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #6c757d !important;
    text-decoration: none;
}

.breadcrumb-item+.breadcrumb-item {
    padding-right: 0.35rem !important;
}

.breadcrumb-item+.breadcrumb-item::before {
    padding-left: 0.35rem !important;
    padding-right: 0 !important;
    content: "/" !important;
    color: #dee2e6 !important;
    float: right !important;
    /* RTL support */
}

.card.shadow-sm.mb-3 {
    /* Breadcrumb Card Wrapper */
    margin-bottom: 0.75rem !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.card.shadow-sm.mb-3 .p-2 {
    padding: 0.4rem 0.75rem !important;
}

/* Article Meta Design */
.article-meta {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #495057;
}

.meta-item i {
    color: #0d6efd;
    font-size: 1.1rem;
}

.meta-item span {
    font-weight: 500;
}

.meta-item a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
}

/* Article Content Typography */
.article-content {
    line-height: 2;
    color: #1c1e21;
    font-size: 1.15rem !important;
    /* Unified size for all */
    word-wrap: break-word;
    text-align: justify;
    /* Justified as requested */
    text-justify: inter-word;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
}

.article-content h2 {
    color: #135c7d;
    font-size: 1.75rem;
    border-right: 4px solid #135c7d;
    padding-right: 15px;
}

.article-content h3 {
    color: #c00000;
    font-size: 1.5rem;
}

.article-content h4 {
    color: #2c3e50;
    font-size: 1.25rem;
}

.article-content h5 {
    color: #16a085;
    font-size: 1.1rem;
}

/* Content Table Styling */
.article-content table {
    width: 100% !important;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-content table th {
    background-color: #f8f9fa;
    color: #135c7d;
    font-weight: 700;
    padding: 1rem;
    text-align: right;
    border-bottom: 2px solid #dee2e6;
}

.article-content table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    color: #444;
}

.article-content table tr:last-child td {
    border-bottom: none;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.featured-image-old {
    width: 100%;
    height: auto;
}

/* Article Hero Modern Design */
.article-hero {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.article-hero img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.article-hero:hover img {
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 3rem 2rem 2rem;
    color: #fff;
}

.hero-overlay h1 {
    font-size: 2.25rem !important;
    font-weight: 850 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.4;
}

.reading-time-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.reading-time-badge i {
    color: #3182ce;
}

/* Enhanced Author Box */
.author-card {
    background: #fdfdfd;
    border: 1px solid #edf2f7;
    border-radius: 20px;
    padding: 2.5rem;
    margin: 4rem 0 3rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.author-avatar-large {
    width: 110px;
    height: 110px;
    border-radius: 30px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.author-info-content {
    flex: 1;
}

.author-name-link {
    font-size: 1.4rem;
    font-weight: 800;
    color: #2d3748;
    text-decoration: none;
    margin-bottom: 0.75rem;
    display: block;
    transition: color 0.2s;
}

.author-name-link:hover {
    color: #3182ce;
}

.author-bio-text {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 0;
}

.publish-date-footer {
    font-size: 0.85rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed #e2e8f0;
}

/* Unified Sidebar Styling */
.sidebar-card {
    border: none !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05) !important;
}

.sidebar-widget-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #212529;
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f3f5;
}

.sidebar-widget-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 60px;
    height: 2px;
    background: #0d6efd;
}

.sidebar-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
}

.sidebar-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-item-title {
    font-size: 0.95rem !important;
    font-weight: 600;
    line-height: 1.5;
    color: #343a40;
    margin: 0;
}

/* Related Articles Grid & Cards */
.article-card-hover {
    border-radius: 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    border: 1px solid #f1f3f5 !important;
}

.article-card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08) !important;
}

.article-card-hover .card-img-top {
    border-radius: 16px 16px 0 0 !important;
    transition: transform 0.5s ease;
}

.article-card-hover:hover .card-img-top {
    transform: scale(1.05);
}

.article-card-hover .card-body {
    padding: 1.25rem !important;
}

.article-card-hover .fs-6 {
    font-size: 0.95rem !important;
    line-height: 1.6;
    font-weight: 700 !important;
    color: #2d3748;
}

@media (max-width: 768px) {
    .container-wide {
        padding-left: 15px;
        padding-right: 15px;
    }

    .article-meta {
        padding: 1rem;
        gap: 1rem;
    }

    .meta-item {
        width: 100%;
        border-bottom: 1px dashed #dee2e6;
        padding-bottom: 0.5rem;
    }

    .article-content {
        font-size: 1.05rem !important;
        line-height: 1.8;
    }

    .display-5 {
        font-size: 1.75rem !important;
    }

    /* Mobile 2-column grid for related posts */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .col-md-3 {
        width: 50% !important;
        /* Forces 2 cards per row on mobile */
        padding: 0.5rem;
    }

    .article-card-hover {
        border-radius: 12px !important;
    }

    .article-card-hover .card-img-top {
        height: 120px !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .article-card-hover .card-body {
        padding: 0.75rem !important;
    }

    .article-card-hover .fs-6 {
        font-size: 0.8rem !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* Listing Page Additions */
.listing-hero-card {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.3s ease;
}

.listing-hero-card:hover {
    transform: translateY(-5px);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    z-index: 2;
    transition: all 0.3s ease;
}

.listing-hero-card:hover .hero-overlay {
    padding-bottom: 2rem;
}

.category-title {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #212529 !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title::before {
    content: "";
    width: 4px;
    height: 24px;
    background: #0d6efd;
    border-radius: 4px;
}

/* Horizontal List Card */
.article-list-card {
    border: none !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-bottom: 1.5rem !important;
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .article-list-card {
        height: 260px;
    }

    .article-list-card .row.g-0 {
        height: 100%;
        flex-wrap: nowrap;
    }

    .article-list-card .col-md-4,
    .article-list-card .col-md-8 {
        height: 100%;
    }
}

.article-list-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
    transform: translateX(5px);
}

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

.article-list-img-wrapper {
    height: 100%;
    min-height: 200px;
    overflow: hidden;
    border-radius: 16px 0 0 16px;
}

@media (min-width: 992px) {
    .article-list-img-wrapper {
        min-height: 260px;
    }
}

[dir="rtl"] .article-list-img-wrapper {
    border-radius: 0 16px 16px 0;
}

@media (max-width: 767.98px) {
    .article-list-img-wrapper {
        border-radius: 16px 16px 0 0;
    }
}

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

.article-list-card:hover .article-list-img {
    transform: scale(1.05);
}

.article-list-card .h4,
.article-list-card .h5 {
    font-size: 1.3rem !important;
    color: #1a202c !important;
    font-weight: 850 !important;
    line-height: 1.4 !important;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-list-card .card-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

@media (max-width: 768px) {

    .article-list-card .h4,
    .article-list-card .h5 {
        font-size: 1.4rem !important;
    }
}

.article-list-card:hover .h4,
.article-list-card:hover .h5 {
    color: #0d6efd !important;
}

/* Pagination Styling */
.pagination .page-link {
    border: none !important;
    margin: 0 4px;
    border-radius: 8px !important;
    color: #4a5568 !important;
    font-weight: 600;
    padding: 8px 16px;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

.pagination .page-link:hover {
    background-color: #edf2f7 !important;
}