/**
 * Paylocity Jobs — front-end styles.
 *
 * All brand colors are exposed as CSS variables on .plj-board so they can be
 * overridden from Elementor (per-widget Custom CSS or a site-wide snippet)
 * to match each project's color system.
 */

.plj-board {
    --plj-card-a-bg: #d9f3ea;      /* mint card */
    --plj-card-b-bg: #eeeafa;      /* lavender card */
    --plj-ink: #2d2364;            /* dark purple text */
    --plj-accent: #5b3fc4;         /* purple accent / button */
    --plj-accent-ink: #ffffff;
    --plj-field-bg: #f1edfa;
    --plj-radius: 12px;
    --plj-gap: 24px;

    color: var(--plj-ink);
    font-family: inherit;
}

/* ---------- Toolbar ---------- */

.plj-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: var(--plj-gap);
    flex-wrap: wrap;
}

.plj-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--plj-field-bg);
    border: 1px solid var(--plj-accent);
    border-radius: 8px;
    padding: 10px 16px;
    min-width: 260px;
    flex: 0 1 320px;
}

.plj-search-icon {
    color: var(--plj-accent);
    flex-shrink: 0;
}

.plj-search-input {
    border: 0;
    background: transparent;
    outline: none;
    font-weight: 700;
    font-size: 15px;
    color: var(--plj-ink);
    width: 100%;
    padding: 0;
    box-shadow: none;
}

.plj-search-input::placeholder {
    color: var(--plj-ink);
    opacity: 0.9;
}

/* ---------- Filter dropdown ---------- */

.plj-filter {
    position: relative;
}

.plj-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--plj-accent);
    color: var(--plj-accent-ink);
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.plj-filter-toggle:hover,
.plj-filter-toggle:focus-visible {
    filter: brightness(1.12);
}

.plj-filter-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    min-width: 240px;
    background: #ffffff;
    border-radius: var(--plj-radius);
    box-shadow: 0 12px 32px rgba(45, 35, 100, 0.18);
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* Open on hover (desktop) and via the .is-open class (click/touch). */
.plj-filter:hover .plj-filter-panel,
.plj-filter:focus-within .plj-filter-panel,
.plj-filter.is-open .plj-filter-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.plj-filter-group {
    border: 0;
    padding: 0;
    margin: 0 0 14px;
}

.plj-filter-group legend {
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    color: var(--plj-accent);
}

.plj-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 4px 0;
    cursor: pointer;
}

.plj-filter-option input {
    accent-color: var(--plj-accent);
    margin: 0;
}

.plj-filter-clear {
    background: transparent;
    border: 0;
    color: var(--plj-accent);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ---------- Cards ---------- */

.plj-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--plj-gap);
}

.plj-card {
    border-radius: var(--plj-radius);
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(45, 35, 100, 0.08);
}

/* Checkerboard alternation like the mockup: A B / B A */
.plj-card:nth-child(4n + 1),
.plj-card:nth-child(4n + 4) {
    background: var(--plj-card-a-bg);
}

.plj-card:nth-child(4n + 2),
.plj-card:nth-child(4n + 3) {
    background: var(--plj-card-b-bg);
}

.plj-card-date {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.plj-card-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.plj-card-apply {
    font-size: 16px;
    font-weight: 800;
    color: var(--plj-ink);
    text-decoration: none;
    margin-top: 6px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.plj-card-apply:hover,
.plj-card-apply:focus-visible {
    color: var(--plj-accent);
    border-bottom-color: var(--plj-accent);
}

/* ---------- Pagination ---------- */

.plj-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: calc(var(--plj-gap) + 8px);
}

.plj-page-btn,
.plj-page-num {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    color: var(--plj-ink);
    padding: 4px 6px;
    line-height: 1;
}

.plj-page-num[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.plj-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--plj-accent);
    box-shadow: 0 2px 8px rgba(45, 35, 100, 0.15);
    transition: filter 0.15s ease;
}

.plj-page-btn:hover:not(:disabled) {
    filter: brightness(0.95);
}

.plj-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.plj-page-ellipsis {
    font-weight: 800;
}

/* ---------- Messages ---------- */

.plj-empty,
.plj-no-results {
    font-weight: 600;
    text-align: center;
    padding: 32px 0;
}

.plj-error {
    color: #b3261e;
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .plj-grid {
        grid-template-columns: 1fr;
    }

    /* Simple alternation on a single column */
    .plj-card:nth-child(4n + 1),
    .plj-card:nth-child(4n + 4),
    .plj-card:nth-child(4n + 2),
    .plj-card:nth-child(4n + 3) {
        background: var(--plj-card-b-bg);
    }

    .plj-card:nth-child(odd) {
        background: var(--plj-card-a-bg);
    }

    .plj-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .plj-filter {
        align-self: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plj-filter-panel,
    .plj-filter-toggle,
    .plj-card-apply,
    .plj-page-btn {
        transition: none;
    }
}
