/*
 * Front-end styles for the ETRE Job Manager plugin.
 */

/* Job details table styling */
/*
 * Job details table styling
 * Use a neutral background and alternating row shading similar to the tender module for better readability.
 */
.etre-job-details-table-wrapper {
    margin-bottom: 25px;
    background: #fdfdfd;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 20px;
}
.etre-job-details-heading {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
}
.etre-job-details-table {
    width: 100%;
    border-collapse: collapse;
}
.etre-job-details-table th,
.etre-job-details-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
.etre-job-details-table th {
    width: 40%;
    font-weight: 600;
    background-color: #f7f7f7;
}
.etre-job-details-table tr.even {
    background-color: #ffffff;
}
.etre-job-details-table tr.odd {
    background-color: #f9f9f9;
}

/* Hide Jetpack or theme social share icons on job pages */
.sharedaddy, .sharedaddy + .sharedaddy {
    display: none !important;
}

/* Job listing grid */
/* Filter form: compact, centered controls. Each select/button has auto width with a minimum size. */
.etre-job-filter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}
.etre-job-filter-control select,
.etre-job-filter-control button {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    width: auto;
    min-width: 140px;
}
.etre-job-filter-control button {
    cursor: pointer;
}
.etre-job-filter-button {
    background-color: #0073aa !important;
    color: #ffffff !important;
    border-color: #0073aa !important;
}
.etre-job-filter-button:hover {
    background-color: #006799 !important;
    border-color: #006799 !important;
}

/* Listing grid: show 3 cards per row on large screens, 2 on medium, 1 on small */
.etre-job-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.etre-job-card {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.etre-job-card-inner {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.etre-job-card-status {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 6px;
    color: #fff;
}
/* Status badge colours */
.status-open .etre-job-card-status { background-color: #28a745; }
.status-closed .etre-job-card-status { background-color: #ffc107; color: #333; }
.status-cancelled .etre-job-card-status { background-color: #17a2b8; }
.status-expired .etre-job-card-status { background-color: #dc3545; }

.etre-job-card-reference {
    font-size: 12px;
    color: #777;
    margin-bottom: 4px;
}
.etre-job-card-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
    line-height: 1.3;
}
.etre-job-card-title a {
    text-decoration: none;
    color: #0073aa;
}
.etre-job-card-title a:hover {
    text-decoration: underline;
}
.etre-job-card-excerpt {
    flex-grow: 1;
    font-size: 14px;
    margin-bottom: 10px;
    color: #444;
}
.etre-job-card-closing {
    font-size: 13px;
    margin-bottom: 10px;
    color: #333;
}
.etre-job-card-link {
    margin-top: auto;
    align-self: flex-start;
    display: inline-block;
    padding: 6px 12px;
    background-color: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}
.etre-job-card-link:hover {
    background-color: #006799;
}

/* Empty state */
.etre-job-empty {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-top: 30px;
}

@media (max-width: 600px) {
    .etre-job-filter-form {
        flex-direction: column;
        align-items: center;
    }
    .etre-job-filter-control {
        width: 100%;
        max-width: 300px;
    }
}

/* Responsive columns */
@media (max-width: 900px) {
    .etre-job-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .etre-job-list {
        grid-template-columns: 1fr;
    }
}