/* ============================================================
   JUST2MINUTES CATEGORY PAGE
   Page-specific image layout.
   Keeps the complete source image visible — no cropping.
   ============================================================ */

.category-page-shell .category-featured-image-wrap {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    background: #f3f5f3;
    overflow: hidden;
    line-height: 0;
}

.category-page-shell .category-featured-image-wrap img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: none !important;
    object-fit: contain !important;
}

.category-page-shell .category-post-image-wrap {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    background: #f3f5f3;
    overflow: hidden;
    line-height: 0;
}

.category-page-shell .category-post-image-wrap img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    max-height: none !important;
    object-fit: contain !important;
}

/* Placeholder follows the natural card width without forcing a crop frame. */
.category-page-shell .category-post-image-placeholder {
    min-height: 150px;
    display: grid;
    place-items: center;
    background: #f2f4f2;
    color: #9aa29c;
    line-height: 1;
}

/* Keep category cards clean when source images have different proportions. */
.category-page-shell .frontend-post-card {
    overflow: hidden;
}

.category-page-shell .frontend-post-card .card-body {
    padding: 16px;
}

/* Do not allow any older global image-frame rules to crop category images. */
.category-page-shell .frontend-post-grid .image-wrap,
.category-page-shell .frontend-post-grid .category-post-image-wrap {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

@media (max-width: 767px) {
    .category-page-shell .category-featured-image-wrap,
    .category-page-shell .category-post-image-wrap {
        height: auto !important;
    }
}


/* ============================================================
   RELATED CATEGORIES - CATEGORY PAGE ONLY
   ============================================================ */
.category-page-shell .category-related-widget {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e9e6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(20, 40, 28, 0.06);
    margin-bottom: 24px;
}

.category-page-shell .category-related-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 18px;
    background: #2d8b57;
    color: #fff;
    border-bottom: 3px solid #f05a4f;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.category-page-shell .category-related-heading i {
    font-size: 1rem;
}

.category-page-shell .category-related-list {
    list-style: none;
    margin: 0;
    padding: 10px 18px;
}

.category-page-shell .category-related-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #edf0ee;
}

.category-page-shell .category-related-list li:last-child {
    border-bottom: 0;
}

.category-page-shell .category-related-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 6px 2px;
    color: #18201b;
    text-decoration: none;
    font-size: .95rem;
    transition: color .2s ease, padding-left .2s ease;
}

.category-page-shell .category-related-list a:hover {
    color: #198754;
    padding-left: 5px;
}

.category-page-shell .category-related-name {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.category-page-shell .category-related-name i {
    width: 22px;
    flex: 0 0 22px;
    text-align: center;
    color: #078b18;
    font-size: .95rem;
}

.category-page-shell .category-related-name span {
    overflow-wrap: anywhere;
}

.category-page-shell .category-related-count {
    flex: 0 0 auto;
    min-width: 34px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf7f0;
    color: #198754;
    font-size: .76rem;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 767px) {
    .category-page-shell .category-related-widget {
        border-radius: 12px;
    }
}

/* ============================================================
   CATEGORY SIDEBAR - KEEP EXISTING WIDGETS
   ============================================================ */
.category-page-shell .sidebar-widget {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.category-page-shell .sidebar-widget .widget-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    display: inline-block;
    padding-bottom: .4rem;
    border-bottom: 3px solid var(--brand-accent);
    margin-bottom: 1rem;
}

.category-page-shell .sidebar-widget .widget-title i {
    color: var(--brand-primary);
    margin-right: 8px;
}

.category-page-shell .explore-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-page-shell .explore-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #1a1a1a;
    font-size: .9rem;
}

.category-page-shell .explore-list a:last-child {
    border-bottom: 0;
}

.category-page-shell .explore-list a > i {
    width: 20px;
    color: var(--brand-primary);
    text-align: center;
    flex-shrink: 0;
}

.category-page-shell .category-sidebar-name {
    flex: 1;
    min-width: 0;
}

.category-page-shell .explore-list a .cat-count {
    background: #f0f0f0;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: .72rem;
    color: #6c757d;
    font-weight: 600;
    flex-shrink: 0;
}

.category-page-shell .popular-post-item,
.category-page-shell .latest-post-item {
    display: flex;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    align-items: center;
}

.category-page-shell .popular-post-item:last-child,
.category-page-shell .latest-post-item:last-child {
    border-bottom: 0;
}

.category-page-shell .popular-rank {
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-primary);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.category-page-shell .popular-rank.gold { color: #FFD700; }
.category-page-shell .popular-rank.silver { color: #C0C0C0; }
.category-page-shell .popular-rank.bronze { color: #CD7F32; }

.category-page-shell .popular-thumb {
    width: 60px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.category-page-shell .popular-thumb img,
.category-page-shell .latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-page-shell .popular-content,
.category-page-shell .latest-content {
    flex: 1;
    min-width: 0;
}

.category-page-shell .popular-title,
.category-page-shell .latest-title {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
}

.category-page-shell .popular-meta,
.category-page-shell .latest-date {
    font-size: .7rem;
    color: #999;
}

.category-page-shell .latest-thumb {
    width: 52px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .category-page-shell .sidebar-widget {
        padding: 16px;
    }
}

/* ============================================================
   CATEGORY SIDEBAR — FULL-WIDTH WIDGET HEADERS
   Keep the existing widget markup; only correct the header layout.
   ============================================================ */
.category-page-shell .category-page-sidebar .sidebar-widget {
    padding: 0 20px 18px !important;
    overflow: hidden;
}

.category-page-shell .category-page-sidebar .sidebar-widget .widget-title {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    width: calc(100% + 40px) !important;
    min-height: 46px !important;
    margin: 0 -20px 12px !important;
    padding: 0 18px !important;
    box-sizing: border-box !important;
    background: #2d8b57 !important;
    color: #fff !important;
    border: 0 !important;
    border-bottom: 3px solid #f05a4f !important;
    border-radius: 0 !important;
    font-size: .94rem !important;
    font-weight: 800 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
}

.category-page-shell .category-page-sidebar .sidebar-widget .widget-title i {
    color: #fff !important;
    margin: 0 !important;
    flex: 0 0 auto;
}

/* Popular/Latest list content should start immediately below the full header. */
.category-page-shell .category-page-sidebar .popular-post-item,
.category-page-shell .category-page-sidebar .latest-post-item {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Related Categories already has its own full-width header. Keep it aligned
   with Popular Posts and Latest Posts. */
.category-page-shell .category-page-sidebar .category-related-widget {
    margin-top: 0 !important;
}

@media (max-width: 767px) {
    .category-page-shell .category-page-sidebar .sidebar-widget {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .category-page-shell .category-page-sidebar .sidebar-widget .widget-title {
        width: calc(100% + 32px) !important;
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}
