/* ────────────────────────────────────────────────────────────
   SWCS Core Front-end Styles
   ──────────────────────────────────────────────────────────── */

/* Grid system */
.swcs-grid {
    display: grid;
    gap: 1.5rem;
}
.swcs-grid--2 { grid-template-columns: repeat(2, 1fr); }
.swcs-grid--3 { grid-template-columns: repeat(3, 1fr); }
.swcs-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .swcs-grid--2,
    .swcs-grid--3,
    .swcs-grid--4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .swcs-grid--3,
    .swcs-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Cards */
.swcs-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.swcs-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    border-color: #a7f3d0;
}
.swcs-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}
.swcs-card__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 .25rem;
    line-height: 1.3;
}
.swcs-card__title a {
    color: #0f172a;
    text-decoration: none;
    transition: color .15s ease;
}
.swcs-card__title a:hover { color: #047857; }
.swcs-card__agency { font-size: .875rem; color: #475569; margin: 0 0 .25rem; }
.swcs-card__position { font-size: .8125rem; color: #64748b; margin: 0 0 .5rem; }
.swcs-card__ref { font-size: .8125rem; color: #64748b; margin: 0 0 .25rem; }
.swcs-card__date { font-size: .75rem; color: #94a3b8; margin: 0 0 .5rem; }
.swcs-card__deadline { font-size: .75rem; color: #94a3b8; }
.swcs-card__excerpt { font-size: .875rem; color: #475569; line-height: 1.5; margin-bottom: 1rem; }
.swcs-card__footer {
    display: flex;
    gap: .5rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Badges */
.swcs-badge {
    display: inline-block;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.swcs-badge--active { background: #d1fae5; color: #065f46; }
.swcs-badge--expired { background: #fee2e2; color: #991b1b; }

/* Buttons */
.swcs-btn {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border-radius: 8px;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
    cursor: pointer;
    border: none;
}
.swcs-btn--primary { background: #059669; color: #fff; }
.swcs-btn--primary:hover { background: #047857; color: #fff; }
.swcs-btn--outline { background: transparent; border: 1px solid #cbd5e1; color: #334155; }
.swcs-btn--outline:hover { border-color: #059669; color: #047857; }
.swcs-btn--sm { padding: .25rem .625rem; font-size: .75rem; }

/* Document filter */
.swcs-doc-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.swcs-filter-btn {
    padding: .375rem .875rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.swcs-filter-btn:hover { border-color: #059669; color: #047857; }
.swcs-filter-btn--active { background: #059669; color: #fff; border-color: #059669; }

/* Document icon */
.swcs-doc-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .75rem;
}
.swcs-doc-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #059669;
}

/* Table */
.swcs-table-wrap { overflow-x: auto; }
.swcs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.swcs-table th,
.swcs-table td {
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.swcs-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .03em;
}
.swcs-table tr:hover td { background: #f0fdf4; }
.swcs-table a { color: #047857; text-decoration: none; font-weight: 600; }
.swcs-table a:hover { text-decoration: underline; }

/* Responsive table → card on mobile */
@media (max-width: 768px) {
    .swcs-table thead { display: none; }
    .swcs-table,
    .swcs-table tbody,
    .swcs-table tr,
    .swcs-table td { display: block; width: 100%; }
    .swcs-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: .75rem;
        padding: .5rem;
    }
    .swcs-table td {
        border: none;
        padding: .375rem 0;
    }
    .swcs-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: .75rem;
        display: block;
        margin-bottom: 2px;
    }
}

/* No results */
.swcs-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    font-size: .875rem;
}
