/* =====================================================================
   Job Cards Widget – Front-end Styles
   Mirrors the design of the React JobCard component.
   ===================================================================== */

/* ── Container ───────────────────────────────────────────────────── */
.jcw-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Card ────────────────────────────────────────────────────────── */
.jcw-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.jcw-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    border-color: #d1d5db;
}

/* ── Inner link (whole card is clickable) ────────────────────────── */
.jcw-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
}

.jcw-card-inner:hover {
    text-decoration: none;
    color: inherit;
}

/* ── Logo ────────────────────────────────────────────────────────── */
.jcw-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.jcw-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.jcw-logo-initials {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ── Card body ───────────────────────────────────────────────────── */
.jcw-card-body {
    flex: 1;
    min-width: 0;
}

/* ── Header row: title + workplace badge ─────────────────────────── */
.jcw-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.jcw-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Workplace badge ─────────────────────────────────────────────── */
.jcw-workplace-badge {
    flex-shrink: 0;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}

.jcw-workplace-on_site {
    background: #dbeafe;
    color: #1d4ed8;
}

.jcw-workplace-remote {
    background: #d1fae5;
    color: #065f46;
}

.jcw-workplace-hybrid {
    background: #fef3c7;
    color: #92400e;
}

/* ── Meta row: company + location ───────────────────────────────── */
.jcw-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.jcw-card-company,
.jcw-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.jcw-card-company span,
.jcw-card-location span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jcw-card-company svg,
.jcw-card-location svg {
    flex-shrink: 0;
    opacity: .7;
}

/* ── Description ─────────────────────────────────────────────────── */
.jcw-card-description {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    /* Clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Posted time ─────────────────────────────────────────────────── */
.jcw-card-posted {
    margin: 6px 0 0 !important;
    padding: 0 !important;
    font-size: 12px !important;
    color: #9ca3af !important;
}

/* ── No results / loading ────────────────────────────────────────── */
.jcw-no-results,
.jcw-loading {
    font-size: 14px;
    color: #9ca3af;
    text-align: center;
    padding: 24px 0;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .jcw-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .jcw-card-header {
        flex-wrap: wrap;
    }
}
