/* Category Hero Responsive Design */
.category-hero {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    padding: 0;
    margin: 0;
    min-height: 216px;
    height: 216px;
}

.category-hero .hero-background {
    position: relative;
    padding: 0;
    margin: 0;
    line-height: 0;
    font-size: 0;
 height:240px; object-fit: cover;

}

/* Special Hero Classes */
.hero-rounded-12 {
    border-radius: 12px;
    overflow: hidden;
}

.hero-minimal-spacing {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.hero-light-overlay .hero-overlay {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.3) 100%) !important;
}

.hero-full-cover {
    object-fit: cover !important;
    object-position: center center !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Height remains as defined in responsive styles - no override */
}

.hero-count-badge {
    font-size: 0.875rem;
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    z-index: 10;
}

.category-hero .hero-image {
    height: 180px;
    transition: height 0.3s ease;
    object-fit: cover;
    width: 100%;
}

.category-hero .hero-overlay {
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.6) 100%);
}

.category-hero .hero-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    position: relative;
    z-index: 10;
}

.category-hero .hero-title {
    font-size: 1.75rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    word-break: break-word;
}

.category-hero .hero-description {
    font-size: 1rem;
    line-height: 1.5;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    max-width: 80%;
    margin: 0 auto;
    word-break: break-word;
}

.category-hero .hero-badge {
    font-size: 0.9rem;
    border-radius: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: inline-block;
    white-space: nowrap;
}

/* Responsive Design for Category Hero */
@media (max-width: 992px) {
    .category-hero {
        min-height: 200px;
        height: 200px;
    }

    .category-hero .hero-content {
        min-height: 200px;
        height: 200px;
    }

    .category-hero .hero-image {
        height: 200px;
    }

    .category-hero .hero-title {
        font-size: 1.6rem;
    }

    .category-hero .hero-description {
        font-size: 1rem;
        max-width: 90%;
    }

    .hero-content-solid {
        min-height: 200px;
        padding: 2rem 0;
    }
}

@media (max-width: 768px) {
    .category-hero {
        border-radius: 0.5rem;
        margin-bottom: 1.5rem;
        min-height: 230px;
        height: 230px;
    }

    .category-hero .hero-content {
        min-height: 230px;
        height: 230px;
        padding: 1rem 1rem;
    }

    .hero-rounded-12 {
        border-radius: 12px;
    }

    .hero-minimal-spacing {
        margin-bottom: 1rem;
    }

    .category-hero .hero-image {
        height: 230px;
    }

    .category-hero .hero-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        text-align: center;
        line-height: 1.1;
    }

    .category-hero .hero-description {
        font-size: 0.85rem;
        max-width: 95%;
        margin-bottom: 0.75rem;
        text-align: center;
    }

    .category-hero .hero-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    .category-hero .hero-content .container-sm {
        padding-left: 1rem;
        padding-right: 1rem;
        text-align: center;
    }

    .hero-breadcrumb {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 0.75rem;
        list-style: none;
        padding-left: 0;
    }

    .hero-count-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin: 0.75rem;
    }

    /* Categories page spacing */
    .categories-page .container,
    .categories-page .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .categories-page .row {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .categories-page .row > * {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Hero section modern */
    .hero-section-modern {
        padding: 0.75rem 0;
        margin-bottom: 1rem;
    }

    .hero-icon-wrapper {
        width: 50px;
        height: 50px;
    }

    .hero-icon-wrapper i {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        display: none;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .hero-content-solid {
        min-height: 230px;
        padding: 1.5rem 0;
    }

    .hero-content-solid h1 {
        font-size: 1.4rem;
        line-height: 1.1;
        margin-bottom: 0.75rem;
    }

    .hero-content-solid .lead {
        font-size: 0.95rem;
        line-height: 1.3;
        margin-bottom: 1.25rem;
    }

    .hero-content-solid .hero-breadcrumb {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }

    .hero-content .display-4 {
        font-size: 1.4rem;
        line-height: 1.1;
    }

    .hero-content .lead {
        font-size: 0.95rem;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .category-hero {
        min-height: 210px;
        height: 210px;
        margin-left: 6px;
        margin-right: 6px;
    }

    .category-hero .hero-content {
        min-height: 210px;
        height: 210px;
        padding: 0.5rem 0.75rem;
    }

    .category-hero .hero-image {
        height: 210px;
    }

    .category-hero .hero-title {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
        text-align: center;
        line-height: 1.1;
    }

    .category-hero .hero-description {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 0.6rem;
        text-align: center;
    }

    .category-hero .hero-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    .category-hero .hero-content .container-sm {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        text-align: center;
    }

    .hero-breadcrumb {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        margin-bottom: 0.5rem;
        display: flex !important;
        visibility: visible !important;
        list-style: none;
        padding-left: 0;
    }

    /* Mobile hero-breadcrumb optimization */
    .category-hero .hero-breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
        padding: 0.3rem 0.6rem;
        justify-content: center;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        list-style: none;
        padding-left: 0;
    }

    .category-hero .hero-breadcrumb-item {
        margin-bottom: 0;
    }

    /* Categories page spacing */
    .categories-page .container,
    .categories-page .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .categories-page .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .categories-page .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Hero section modern */
    .hero-section-modern {
        padding: 0.5rem 0;
        margin-bottom: 0.75rem;
    }

    .hero-content .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .hero-icon-wrapper {
        width: 45px;
        height: 45px;
        margin: 0 auto 1rem auto;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 0.95rem;
        display: none;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .hero-content-solid {
        min-height: 210px;
        height: 210px;
        padding: 0.75rem 0;
    }

    .hero-content-solid h1 {
        font-size: 1.4rem;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }

    .hero-content-solid .lead {
        font-size: 0.9rem;
        line-height: 1.25;
        margin-bottom: 1rem;
    }

    .hero-content-solid .hero-breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .hero-content .display-4 {
        font-size: 1.4rem;
        line-height: 1.1;
    }

    .hero-content .lead {
        font-size: 0.9rem;
        line-height: 1.25;
    }
}

/* Extra small devices optimization */
@media (max-width: 480px) {
    .category-hero {
        margin-bottom: 1rem;
        min-height: 190px;
        height: 190px;
    }

    .category-hero .hero-content {
        min-height: 190px;
        height: 190px;
        padding: 0.5rem 0.5rem;
    }

    .hero-minimal-spacing {
        margin-bottom: 0.5rem;
    }

    .category-hero .hero-image {
        height: 190px;
    }

    .category-hero .hero-title {
        font-size: 1rem;
        margin-bottom: 0.3rem;
        line-height: 1.1;
        text-align: center;
    }

    .category-hero .hero-description {
        font-size: 0.75rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
        max-width: 100%;
        text-align: center;
    }

    .category-hero .hero-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    .category-hero .hero-content .container-sm {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        text-align: center;
    }

    .hero-breadcrumb {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.375rem;
        display: flex !important;
        visibility: visible !important;
        list-style: none;
        padding-left: 0;
    }

    /* Mobile hero-breadcrumb optimization */
    .category-hero .hero-breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
        padding: 0.25rem 0.5rem;
        justify-content: center;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .hero-count-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        margin: 0.5rem;
    }

    .hero-content-solid {
        min-height: 169px;
        height: 169px;
        padding: 0.5rem 0;
    }

    .hero-content-solid h1 {
        font-size: 1.6rem;
        line-height: 1.25;
        margin-bottom: 0.6rem;
    }

    .hero-content-solid .lead {
        font-size: 0.95rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }

    .hero-content-solid .hero-breadcrumb {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .hero-content-solid .badge {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .hero-content .display-4 {
        font-size: 1.6rem;
        line-height: 1.25;
    }

    .hero-content .lead {
        font-size: 0.95rem;
        line-height: 1.3;
    }
}

/* Mobile Hero Component Spacing */
@media (max-width: 768px) {
    .hero-breadcrumb {
        padding: 3px 1rem;
        margin-left: 2px;
        margin-right: 2px;
    }

    .category-hero .hero-breadcrumb {
        padding: 3px 0.8rem;
        margin-left: 2px;
        margin-right: 2px;
    }
}

@media (max-width: 576px) {
    .hero-breadcrumb {
        padding: 3px 0.6rem;
        margin-left: 2px;
        margin-right: 2px;
    }

    .category-hero .hero-breadcrumb {
        padding: 3px 0.6rem;
        margin-left: 2px;
        margin-right: 2px;
    }
}

@media (max-width: 480px) {
    .hero-breadcrumb {
        padding: 3px 0.5rem;
        margin-left: 2px;
        margin-right: 2px;
    }

    .category-hero .hero-breadcrumb {
        padding: 3px 0.5rem;
        margin-left: 2px;
        margin-right: 2px;
    }
}

/* ============================================================================
   RESPONSIVE TYPOGRAPHY CLASSES
   ============================================================================ */

/* Responsive Font Sizes */
.fs-responsive-xl {
    font-size: 2.5rem;
}

.fs-responsive-lg {
    font-size: 2rem;
}

.fs-responsive-md {
    font-size: 1.5rem;
}

.fs-responsive-sm {
    font-size: 1.25rem;
}

.fs-responsive-xs {
    font-size: 1rem;
}

/* Mobile First Responsive Typography */
@media (max-width: 576px) {
    .fs-responsive-xl {
        font-size: 1.75rem !important;
    }

    .fs-responsive-lg {
        font-size: 1.5rem !important;
    }

    .fs-responsive-md {
        font-size: 1.25rem !important;
    }

    .fs-responsive-sm {
        font-size: 1.1rem !important;
    }

    .fs-responsive-xs {
        font-size: 0.9rem !important;
    }

    /* Mobile specific hero typography */
    .hero-title-mobile {
        font-size: 1.4rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.3rem !important;
    }

    .hero-description-mobile {
        font-size: 0.9rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 480px) {
    .fs-responsive-xl {
        font-size: 1.5rem !important;
    }

    .fs-responsive-lg {
        font-size: 1.3rem !important;
    }

    .fs-responsive-md {
        font-size: 1.1rem !important;
    }

    .fs-responsive-sm {
        font-size: 1rem !important;
    }

    .fs-responsive-xs {
        font-size: 0.85rem !important;
    }

    /* Extra small screen hero typography */
    .hero-title-mobile {
        font-size: 1.2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }

    .hero-description-mobile {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.4rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .fs-responsive-xl {
        font-size: 2.2rem !important;
    }

    .fs-responsive-lg {
        font-size: 1.8rem !important;
    }
}

@media (min-width: 992px) {
    .fs-responsive-xl {
        font-size: 2.8rem !important;
    }

    .fs-responsive-lg {
        font-size: 2.3rem !important;
    }
}

/* Text Scaling Utilities */
.text-scale-mobile {
    transform: scale(0.9);
    transform-origin: center;
}

@media (max-width: 480px) {
    .text-scale-mobile {
        transform: scale(0.85);
    }
}

/* Line Height Utilities */
.lh-tight {
    line-height: 1.2 !important;
}

.lh-mobile {
    line-height: 1.3 !important;
}

.lh-relaxed {
    line-height: 1.6 !important;
}

/* Categories page spacing improvements */
.categories-page .container,
.categories-page .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

.categories-page .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.categories-page .row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Ensure text doesn't overflow in hero section */
.hero-content-solid h1,
.hero-content .display-4 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero-content-solid .lead,
.hero-content .lead {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Alternative: Global page spacing improvement */
body .container:not(.navbar .container):not(.modal .container),
body .container-fluid:not(.navbar .container-fluid):not(.modal .container-fluid) {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 768px) {
    body .container:not(.navbar .container):not(.modal .container),
    body .container-fluid:not(.navbar .container-fluid):not(.modal .container-fluid) {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1200px) {
    body .container:not(.navbar .container):not(.modal .container),
    body .container-fluid:not(.navbar .container-fluid):not(.modal .container-fluid) {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

/* Modern Hero Section Styles for Categories */
.hero-section-modern {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 40%, #03a9f4 70%, #ff6b35 85%, #f7931e 100%);
    position: relative;
    overflow: hidden;
    padding: 1rem 0;
}

.hero-section-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" fill-opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    color: white;
    font-weight: 700;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.75);
}

.text-white-90 {
    color: rgba(255, 255, 255, 0.9);
}

.stat-card {
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
}

.stat-number {
    color: white;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-weight: 500;
    font-size: 0.95rem;
}



.hero-background-solid {
    background: linear-gradient(135deg, #1582b4 0%, #29b6f6 40%, #03a9f4 70%, #1151a5 85%, #2c7edd 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.hero-overlay-solid {
    background: rgba(138, 138, 138, 0.062);
    z-index: 2;
}

.hero-content-solid {
    position: relative;
    z-index: 3;
    min-height: 150px;
    display: flex;
    align-items: center;
}

.hero-content-solid .hero-breadcrumb-item a:hover {
    text-decoration: underline !important;
}

.hero-content-solid .hero-breadcrumb-item.active {
    font-weight: 500;
}

.hero-content-solid .badge {
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.sort-body{
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-image {
    filter: brightness(0.7);
    transition: transform 0.3s ease;
}

.hero-content {
    z-index: 10;
}

.hero-stats .badge {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Hero Breadcrumbs in Hero */
.hero-breadcrumb {
    --bs-hero-breadcrumb-divider: '>';
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 20;
    list-style: none;
    padding-left: 0;
}

.hero-breadcrumb-item {
    list-style: none;
    display: flex;
    align-items: center;
    margin-right: 0.15rem;
    padding: 0.2rem 0.2rem;
}

.hero-breadcrumb-item:last-child {
    margin-right: 0;
}

.hero-breadcrumb-item a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
}

.hero-breadcrumb-item.active {
    color: white;
    font-weight: 600;
}

.hero-breadcrumb-item a:hover {
    text-decoration: underline !important;
    opacity: 0.8;
    color: white;
}

.hero-breadcrumb-item + .hero-breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.7);
    content: var(--bs-hero-breadcrumb-divider, '>');
    margin-right: 0.4rem;
    margin-left: 0.4rem;
    font-weight: 500;
}

.sticky-sidebar {
    position: sticky;
    top: 2rem;
    z-index: 100;
}

.sidebar-card {
    border-radius: 1rem;
    overflow: hidden;
}

.sidebar-card .card-header {
    background:#fcfcfc;
    color: rgb(49, 49, 49);
    border: none;
    padding: 1rem;
    font-weight: 600;
}

.list-group-item {
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.list-group-item.bg-primary:hover {
    background-color: #0056b3 !important;
}

/* Articles Grid Enhancements */
.articles-grid .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.articles-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.articles-grid .card-img-top {
    transition: transform 0.3s ease;
    border-radius: 1rem 1rem 0 0;
}

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

/* Sort Filter Card */
.sort-filter-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .category-hero {
        margin-bottom: 2rem;
    }

    .hero-content .display-4 {
        font-size: 2.5rem;
    }

    .category-hero .hero-image {
        height: 140px;
    }
}

/* Additional improvements for hero text readability */
.hero-content .hero-breadcrumb {
    margin-bottom: 1rem;
}

.hero-content .badge {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Ensure proper spacing between hero elements */
.hero-content .display-4 + .lead {
    margin-top: 0.5rem;
}

.hero-content .lead + .hero-stats {
    margin-top: 1rem;
}

/* Text contrast improvements */
.hero-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
}

/* ============================================================================
   MOBILE CATEGORY CARD COMPACT MODE (Categories Index)
   Reduces overall card footprint for small screens while keeping readability.
   ============================================================================ */
/* Category card body (custom class) - base (desktop/tablet) */
.categories-page .category-card .category-card-body {
    background: #ffffff; /* restored normal background */
    padding: 1rem 1rem 1.1rem !important; /* base padding now that p-4 removed */
}

/* Overlay badge positioning & shrink */
.categories-page .category-card .articles-count-overlay {
    font-size: 0.6rem;
    padding: 0.3rem 0.45rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Make image container fixed aspect for consistent heights */
.categories-page .category-card .category-image-container { aspect-ratio: 16/9; }
.categories-page .category-card .category-image-container .category-image { height: 100%; width:100%; object-fit: cover; }

@media (max-width: 576px) {
    .categories-page .category-card .category-image-container { aspect-ratio: 16/9; }
    .categories-page .category-card .category-card-header { margin-bottom: .3rem !important; }
    .categories-page .category-card .category-desc { display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
}

@media (max-width: 480px) {
    .categories-page .category-card .category-desc { display:none !important; }
    .categories-page .category-card .category-card-body { padding-top:.4rem !important; padding-bottom:.45rem !important; }
}

@media (max-width: 576px) {
    .categories-page .category-card .card { border-radius: 0.85rem; }
    .categories-page .category-card .card-img-top.category-image {
        height: 110px !important; /* slightly increased for better visual balance */
        object-fit: cover;
        border-radius: 12px 12px 0 0;
    }
    .categories-page .category-card .card { border-radius: 12px !important; }
    .categories-page .category-card .category-image-container { border-radius: 12px 12px 0 0; overflow:hidden; }
    .categories-page .category-card .category-card-body { border-radius: 0 0 12px 12px; }
    /* Use custom class to override Bootstrap's .card-body padding reliably */
    .categories-page .category-card .category-card-body { padding: 0.5rem 0.45rem 0.55rem !important; }
    .categories-page .category-card .card-body:not(.category-card-body) { padding: 0.65rem 0.55rem 0.7rem; }
    .categories-page .category-card .card-body .card-title { font-size: 0.8rem; line-height:1.12; margin-bottom:0.4rem; }
    .categories-page .category-card .articles-count { font-size: 0.6rem; padding: 0.22rem 0.4rem; }
    .categories-page .category-card .card-text { font-size: 0.6rem; margin-bottom: 0.4rem; line-height:1.2; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
    .categories-page .category-card .category-stats { font-size: 0.55rem; }
    .categories-page .category-card .category-stats i { font-size: 0.6rem; }
    .categories-page .row.g-4 { --bs-gutter-x: .55rem; --bs-gutter-y: .75rem; }
}

/* Extra small tweaks <480px for category cards */
@media (max-width: 480px) {
    .categories-page .category-card .card-img-top.category-image { height: 100px !important; }
    .categories-page .category-card .category-card-body { padding: 0.45rem 0.4rem 0.5rem !important; }
    .categories-page .category-card .card-body .card-title { font-size: 0.75rem; }
    .categories-page .category-card .card-text { font-size: 0.58rem; }
}

/* Hero background image improvements */
.hero-background .hero-image {
    filter: brightness(0.8) contrast(1.1);
}

/* ============================================================================
   MOBILE CATEGORIES MODAL STYLES
   ============================================================================ */

/* Category Image Mobile */
.category-image-mobile {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

/* Category Placeholder Mobile */
.category-placeholder-mobile {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

/* Category Icon Styling */
.category-icon {
    font-size: 1.2rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

/* Mobile Categories Modal Specific Styles */
.categories-modal-body .list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.875rem 1.25rem;
    transition: all 0.3s ease;
    background: transparent;
}

.categories-modal-body .list-group-item:last-child {
    border-bottom: none;
}

.categories-modal-body .list-group-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(4px);
    padding-left: 1.5rem;
}

.categories-modal-body .list-group-item a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.categories-modal-body .list-group-item:hover a {
    color: #10afdf;
    font-weight: 600;
}

.categories-modal-body .list-group-item a:hover .category-image-mobile {
    border-color: #10afdf;
    transform: scale(1.05);
}

.categories-modal-body .list-group-item a:hover .category-placeholder-mobile {
    background: linear-gradient(135deg, #10afdf, #059c9c);
    color: white;
    border-color: #10afdf;
    transform: scale(1.05);
}

.categories-modal-body .list-group-item a:hover .category-icon {
    color: white;
    transform: scale(1.1);
}

.categories-modal-body .list-group-item.bg-light {
    background: linear-gradient(135deg, #10afdf 0%, #059c9c 100%) !important;
    color: white;
    font-weight: 600;
}

.categories-modal-body .list-group-item.bg-light a {
    color: white !important;
    font-weight: 600;
}

.categories-modal-body .list-group-item.bg-light .category-image-mobile {
    border-color: white;
}

.categories-modal-body .list-group-item.bg-light .category-placeholder-mobile {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: white;
}

.categories-modal-body .list-group-item.bg-light .category-icon {
    color: white;
}

.categories-modal-body .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #10afdf !important;
    font-weight: 600;
}

.categories-modal-body .list-group-item.bg-light .badge {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #10afdf !important;
}

/* ============================================================================
   DESKTOP SIDEBAR CATEGORIES STYLES
   ============================================================================ */

/* Category Image Small (Desktop Sidebar) */
.category-image-small {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

/* Category Placeholder Small (Desktop Sidebar) */
.category-placeholder-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

/* Desktop Sidebar List Group Items */
.sidebar-card .list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.875rem 1.25rem;
    transition: all 0.3s ease;
    background: transparent;
}

.sidebar-card .list-group-item:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translateX(4px);
    padding-left: 1.5rem;
}

.sidebar-card .list-group-item:last-child {
    border-bottom: none;
}

.sidebar-card .list-group-item a {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar-card .list-group-item:hover a {
    color: #10afdf;
    font-weight: 600;
}

.sidebar-card .list-group-item a:hover .category-image-small {
    border-color: #10afdf;
    transform: scale(1.05);
}

.sidebar-card .list-group-item a:hover .category-placeholder-small {
    background: linear-gradient(135deg, #10afdf, #059c9c);
    color: white;
    border-color: #10afdf;
    transform: scale(1.05);
}

.sidebar-card .list-group-item a:hover .category-icon {
    color: white;
    transform: scale(1.1);
}

.sidebar-card .list-group-item.active {
    background: linear-gradient(135deg, #10afdf 0%, #059c9c 100%);
    color: white;
    font-weight: 600;
}

.sidebar-card .list-group-item.active a {
    color: white !important;
    font-weight: 600;
}

.sidebar-card .list-group-item.active .category-image-small {
    border-color: white;
}

.sidebar-card .list-group-item.active .category-placeholder-small {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: white;
}

.sidebar-card .list-group-item.active .category-icon {
    color: white;
}

.sidebar-card .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: #10afdf !important;
    color: white !important;
    font-weight: 600;
}

.sidebar-card .list-group-item.active .badge {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #10afdf !important;
}

/* Hero Breadcrumb Mobile Spacing */
.hero-breadcrumb-mobile-spacing {
    margin-bottom: 0.2rem;
}

@media (max-width: 576px) {
    .hero-breadcrumb-mobile-spacing {
        margin-bottom: 0.15rem;
    }
}

@media (max-width: 480px) {
    .hero-breadcrumb-mobile-spacing {
        margin-bottom: 0.1rem;
    }
}

/* Mobile Hero Stats Spacing - Removed for mobile, keeping original spacing */

/* Tablet Category Hero Stats Spacing - Only for tablet range */
@media (min-width: 577px) and (max-width: 768px) {
    .category-hero-stats {
        margin-bottom: 4.5rem !important;
        padding-bottom: 2rem !important;
    }

    .category-hero-stats.mb-0 {
        margin-bottom: 4.5rem !important;
        padding-bottom: 2rem !important;
    }

    .category-hero-stats .badge {
        font-size: 0.9rem !important;
        padding: 0.5rem 1rem !important;
        margin-bottom: 2rem !important;
        display: block !important;
    }
}

/* Desktop Spacing Improvements */
@media (min-width: 768px) {
    /* Increase spacing between breadcrumbs and title on desktop */
    .hero-content-solid .hero-title {
        margin-top: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Reduce spacing between badge and bottom on desktop */
    .hero-content-solid .hero-stats {
        margin-bottom: 0.25rem;
    }

    /* Better breadcrumb spacing on desktop */
    .hero-content-solid .hero-breadcrumb {
        margin-bottom: 0.5rem;
    }

    /* Better title size for 768px+ screens */
    .hero-content-solid h1 {
        font-size: 1.6rem;
        line-height: 1.15;
    }

    .hero-content .display-4 {
        font-size: 1.6rem;
        line-height: 1.15;
    }

    .category-hero .hero-title {
        font-size: 1.6rem;
        line-height: 1.15;
    }
}

@media (min-width: 992px) {
    /* Even better spacing for larger desktop screens */
    .hero-content-solid .hero-title {
        margin-top: 1rem;
        margin-bottom: 1.25rem;
    }

    .hero-content-solid .hero-stats {
        margin-bottom: 0.5rem;
    }

    /* Larger title for big desktop screens */
    .category-hero .hero-title {
        font-size: 1.8rem;
        line-height: 1.15;
    }
}
