/* ==========================================================================
   NearJobs Job Categories — style.css v2.5.1 (SEO & Mobile Fixed)
   ========================================================================== */

.njjc-section {
    width: 100%;
    padding: 20px 0;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.njjc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    overflow: hidden;
}

.njjc-grid {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 2px 12px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    content-visibility: auto;
    contain-intrinsic-size: auto 60px;
}

/* Custom Scrollbar */
.njjc-grid::-webkit-scrollbar {
    height: 6px;
}
.njjc-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.njjc-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.njjc-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Card Basic Structure */
.njjc-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px 14px;
    flex: 0 0 auto; 
    min-width: 170px;
    max-width: 240px;
    height: 58px;
    gap: 10px;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    will-change: transform, box-shadow;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
}

.njjc-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--njjc-color, #2563eb);
    border-radius: 6px 0 0 6px;
}

.njjc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: #ffffff;
}

.njjc-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex-grow: 1;
}

/* SEO FIX: Mobile-friendly text wrapping */
.njjc-card-title {
    font-size: 13px;
    font-weight: 650;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
    white-space: normal; /* අකුරු පිටතට පැනීම වැළැක්වීමට */
    word-break: keep-all;
    overflow: hidden;
}

.njjc-card-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.njjc-card-icon svg {
    width: 34px;
    height: 34px;
    display: block;
}

/* ── VISIBILITY CONTROLS ── */
@media (min-width: 768px) {
    .njjc-hide-laptop {
        display: none !important;
    }
}

/* ── MOBILE OPTIMIZATION ── */
@media (max-width: 767px) {
    .njjc-hide-mobile {
        display: none !important;
    }

    .njjc-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        overflow-x: hidden;
        padding: 5px 0;
        contain-intrinsic-size: auto 170px;
    }
    
    .njjc-card {
        flex: unset;
        min-width: unset;
        max-width: unset;
        padding: 8px 10px;
        height: 54px; /* Text පේළි 2කට ඉඩ දීමට පොඩ්ඩක් වැඩි කළා */
    }
    
    .njjc-card-title {
        font-size: 11px;
        line-height: 1.2;
        padding-right: 2px;
        white-space: normal;
    }
    
    .njjc-card-icon {
        width: 24px;
        height: 24px;
    }
    
    .njjc-card-icon svg {
        width: 24px;
        height: 24px;
    }
}