/* Qadwilliam Jobs & Apply — Frontend Styles */

.cp-jobs-listings-wrap {
    margin: 24px 0 40px;
}

.cp-jobs-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cp-job-card {
    margin: 0;
    min-width: 0;
    height: 100%;
}

.cp-job-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, transform 0.2s;
    box-sizing: border-box;
}

.cp-job-card:hover .cp-job-card-inner {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.cp-job-header {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.cp-job-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    line-height: 1.35;
    min-height: 2.7em;
    color: #1a1a2e;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cp-job-title a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.cp-job-title a:hover {
    color: #0073aa;
}

.cp-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    max-height: 56px;
    overflow: hidden;
}

.cp-meta-tag {
    display: inline-block;
    max-width: 100%;
    background: #f4f6ff;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.cp-meta-tag.cp-type   { background: #e8f4fd; color: #2980b9; }
.cp-meta-tag.cp-salary { background: #eafaf1; color: #27ae60; }
.cp-meta-tag.cp-deadline { background: #fef9e7; color: #d68910; }

.cp-job-excerpt {
    flex: 1 1 auto;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: 4.65em;
}

.cp-job-excerpt--empty {
    visibility: hidden;
}

.cp-job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
    flex-shrink: 0;
}

.cp-job-actions .cp-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.82rem;
}

/* Pagination */
.cp-jobs-pagination {
    margin-top: 36px;
    text-align: center;
}

.cp-jobs-pagination-summary {
    margin: 0 0 16px;
    color: #666;
    font-size: 0.9rem;
}

.cp-jobs-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 4px;
    padding: 0 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.cp-jobs-pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.cp-jobs-pagination .page-numbers:hover:not(.current) {
    background: #f4f6ff;
}

.cp-jobs-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cp-jobs-pagination li {
    margin: 0;
    padding: 0;
}

/* Buttons */
.cp-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.cp-btn-primary {
    background: #0073aa;
    color: #fff;
}
.cp-btn-primary:hover { background: #005f8a; color: #fff; transform: translateY(-1px); }

.cp-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 2px solid #0073aa;
}
.cp-btn-outline:hover { background: #0073aa; color: #fff; }

.cp-btn-lg { padding: 14px 32px; font-size: 1em; }

/* Application Form */
.cp-apply-form-wrap {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 36px;
    margin: 30px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 740px;
}

.cp-form-title {
    margin: 0 0 28px;
    font-size: 1.5em;
    color: #1a1a2e;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 14px;
}

.cp-form-section {
    margin-bottom: 30px;
}

.cp-form-section h3 {
    font-size: 1em;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8em;
}

.cp-form-row.cp-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cp-field {
    margin-bottom: 18px;
}

.cp-field label {
    display: block;
    font-weight: 600;
    font-size: 0.88em;
    color: #444;
    margin-bottom: 6px;
}

.cp-required { color: #e74c3c; }

.cp-field input[type="text"],
.cp-field input[type="email"],
.cp-field input[type="tel"],
.cp-field input[type="url"],
.cp-field textarea,
.cp-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cp-field input:focus,
.cp-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.cp-file-upload {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-file-hint {
    font-size: 0.8em;
    color: #888;
}

.cp-form-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 24px;
    margin-top: 10px;
}

/* Alerts */
.cp-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.95em;
    font-weight: 500;
}

.cp-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.cp-alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.cp-application-form noscript .cp-alert { display: block; }

.cp-no-jobs {
    text-align: center;
    padding: 40px;
    color: #888;
    background: #fafafa;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
}

/* Single job (plugin template) */
.cp-job-single-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.cp-job-single-header {
    margin-bottom: 28px;
}

.cp-job-single-back {
    margin: 0 0 12px;
    font-size: 0.9em;
}

.cp-job-single-back a {
    color: #0073aa;
    text-decoration: none;
}

.cp-job-single-title {
    margin: 0 0 14px;
    font-size: 2em;
    color: #1a1a2e;
}

.cp-job-single-meta {
    margin-bottom: 0;
}

.cp-job-single-content {
    margin-bottom: 32px;
    line-height: 1.7;
    color: #444;
}

.cp-apply-closed .cp-form-title {
    margin-bottom: 16px;
}

@media (max-width: 1024px) {
    .cp-jobs-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .cp-jobs-list {
        grid-template-columns: 1fr;
    }

    .cp-job-card-inner {
        min-height: 0;
    }

    .cp-job-actions .cp-btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 600px) {
    .cp-form-row.cp-two-col { grid-template-columns: 1fr; }
    .cp-apply-form-wrap { padding: 20px; }
    .cp-job-single-title { font-size: 1.5em; }
}
