/* WP External Jobs — RTL-first frontend styles */

/* ========== Archive Header ========== */
.jobs-archive-header {
    width: 100%;
    max-width: 1732px;
    margin: 0 auto 43px;
    background: #2A3762;
    box-sizing: border-box;
}

.ej-single-job .jobs-archive-header {
    margin: 0 auto 20px;
}

.jobs-archive-title {
    font-family: 'almoni-tzar-aaa';
    font-weight: 400;
    font-size: 63.85px;
    line-height: 130%;
    text-align: center;
    color: #fff;
    min-height: 77px;
    margin: 0;
    padding: 0;
}

/* ========== Widget Container ========== */
#ej-jobs-widget {
    max-width: 1732px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
    direction: rtl;
}

/* ========== Search Row ========== */
.ej-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 56px;
}

.ej-search-row .ej-search-wrap {
    margin-bottom: 0;
}

/* ========== Gallery ========== */
.ej-gallery {
    display: flex;
    align-items: center;
    gap: 66px;
    flex-shrink: 0;
}

.ej-gallery-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* ========== Search ========== */
.ej-search-wrap {
    position: relative;
    max-width: 494px;
    width: 100%;
    margin-bottom: 20px;
}

.ej-search-icon {
    position: absolute;
    inset-inline-start: 17px;
    top: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    height: 100%;
}

#ej-search {
    background: #E2E2E266;
    padding: clamp(10px, 1.8vw, 13.78px) clamp(12px, 2.2vw, 17.06px);
    padding-inline-start: 50px;
    border-radius: 50px;
    min-height: 62px;
    max-width: 494px;
    width: 100%;
    border: none;
    box-sizing: border-box;
    font-family: 'Heebo', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 2.5vw, 26px);
    line-height: 135%;
    direction: rtl;
}

#ej-search:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

#ej-search::placeholder {
    font-family: 'Heebo', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 2.5vw, 26px);
    line-height: 135%;
    color: #A9A9A9;
}

/* ========== Pill Filters ========== */
.ej-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
    margin-bottom: 24px;
}

.ej-pill {
    background-color: #E2E2E266;
    padding: clamp(8px, 1.5vw, 12.66px) clamp(14px, 2.5vw, 22.51px);
    border-radius: 33.77px;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 135%;
    color: #000000;
}

.ej-pill:hover {
    background-color: #E2E2E266;
    color: #0073aa;
    border: none;
}

.ej-pill.active {
    background-color: #E0E0E0;
    color: #000000;
}

/* ========== Job Cards ========== */
.ej-jobs-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 63px;
}

.ej-jobs-list.ej-fade-enabled {
    transition: opacity .3s ease;
}

.ej-jobs-list.ej-fading {
    opacity: 0;
}

.ej-job-card {
    flex: 0 0 25%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    border: none;
    border-inline-end: 1px solid #0000001F;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.ej-job-card:nth-child(4n),
.ej-job-card:last-child {
    border-inline-end: none;
}

.ej-job-card:hover {
    box-shadow: none;
}

.ej-job-card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 0;
    border-bottom: 1.34px solid #0000001F;
}

.ej-job-code {
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    font-size: 20.05px;
    line-height: 135%;
    letter-spacing: -0.5%;
    color: #00000080;
    margin-bottom: 4px;
}

.ej-job-title {
    font-family: 'Heebo', sans-serif;
    font-weight: 400;
    font-size: 24px;
    letter-spacing: -2.5%;
    color: #1B281E;
    margin-bottom: 8px;
}

.ej-job-excerpt {
    font-family: 'Heebo', sans-serif;
    font-weight: 300;
    font-size: 20.05px;
    line-height: 135%;
    letter-spacing: -0.5%;
    color: inherit;
    margin-bottom: 16px;
}

.ej-job-btn {
    margin-top: auto;
    align-self: flex-start;
    background-color: #E2E2E266;
    border-radius: 360px;
    padding: 10.5px 17px;
    font-family: 'Heebo', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 135%;
    text-align: center;
    color: #5B8E49;
    text-decoration: none;
}

.ej-no-jobs {
    text-align: center;
    color: #999;
    padding: 40px 0;
    font-size: 16px;
}

/* ========== Single Job View ========== */
.ej-single-job {
    padding-inline: 5.4%;
    margin: 0 auto 15vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
    direction: rtl;
}

.ej-single-header {
    display: flex;
    flex-direction: row-reverse;
}

.ej-back-link {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 5px;
    
    color: #fff;
    background: #5B8E49;

    text-decoration: none;
    border: 1.74px solid #FFFFFFB2;
    padding: 7px 22px;
    border-radius: 32px;

    font-family: Heebo;
    font-weight: 700;
    font-size: 16px;
    line-height: 135%;

}

.ej-back-link:hover {
    color: #5B8E49;
    background: #fff;
    border: 1.74px solid #5B8E49;
}
.ej-back-link svg path {
    transition: stroke 0.2s ease-in;
}

.ej-back-link:hover svg path {
    stroke: #5B8E49;;
}

.ej-single-page-title {
    font-size: 24px;
    margin: 0;
}

.ej-single-content {
    display: block;
    max-width: 1479px;
    margin-inline: auto;
}

.ej-single-content-body {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    align-items: flex-start;

    background: #F5F5F5;
    border-right: 13px solid #2A3762;
    padding-inline: 30px;
    padding-block: 14px 27px;
}

.ej-single-details {
    max-width: 60%;
}

.ej-single-job-header {
    margin-right: 38px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #00000014;
}

.ej-single-job-title {
    font-size: 96px;
    font-weight: 400;
    font-size: 96px;
    line-height: 80%;
    letter-spacing: -2px;
}

.ej-single-job-code {
    display: inline-block;
    color: #5B8E49;
    font-family: Heebo;
    font-weight: 700;
    font-size: 15px;
    line-height: 135%;
    letter-spacing: -0.5px;
    margin-bottom: 0;
}

.ej-single-job-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.ej-single-job-desc p {
    margin: 0 0 12px 0;
}

/* ========== Application Form ========== */
.ej-single-form-wrap {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.ej-application-form {
    margin: 62px 62px 28px 40px;
    min-width: 361px;
}

.ej-form-title {
    margin: 0 0 16px 0;
    font-weight: 400;
    font-size: 30px;
    line-height: 130%;
    letter-spacing: -1%;
}

.ej-form-field {
    margin-bottom: 14px;
}

.ej-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.ej-form-field input[type="text"],
.ej-form-field input[type="email"],
.ej-form-field input[type="tel"] {
    width: 100%;
    padding: 12px 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    direction: rtl;
    box-sizing: border-box;
    box-shadow: 0px 1px 4px 0px #00000026;
}

.ej-form-field input[type="text"]::placeholder,
.ej-form-field input[type="email"]::placeholder,
.ej-form-field input[type="tel"]::placeholder {
    color: #A9A9A9;
    font-family: Heebo;
    font-weight: 400;
    font-size: 16px;
    line-height: 135%;
}

/* ========== Custom Upload Container ========== */
.ej-upload-container {
    position: relative;
    width: 100%;
    background: #fff;
    border: 1px dashed #A9A9A9;
    box-sizing: border-box;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.ej-form-field .ej-upload-container {
    box-shadow: 0px 1px 4px 0px #00000026;
}

.ej-upload-container.ej-drag-over {
    border-color: #5B8E49;
    background: #f9fff7;
}

.ej-upload-title {
    font-family: Heebo;
    font-weight: 400;
    font-size: 16px;
    line-height: 135%;
    color: #A9A9A9;
    text-align: right;
}

.ej-upload-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.ej-upload-pill {
    display: inline-block;
    background: #E2E2E266;
    border-radius: 33.77px;
    padding: 3px 16px;
    font-family: Heebo;
    font-weight: 400;
    font-size: 16px;
    line-height: 135%;
    color: #A9A9A9;
}

.ej-upload-instruction {
    font-family: Heebo;
    font-weight: 400;
    font-size: 12px;
    line-height: 135%;
    color: #A9A9A9;
}

.ej-upload-file-row {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.ej-upload-file-row.ej-has-file {
    display: flex;
}

.ej-upload-filename {
    font-family: 'Heebo', sans-serif;
    font-size: 14px;
    color: #0073aa;
    word-break: break-all;
}

.ej-upload-remove {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #E0E0E0;
    color: #e74c3c;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ej-upload-remove:hover {
    background: #ccc;
}

.ej-upload-hidden-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.ej-form-hint {
    font-size: 12px;
    color: #999;
    margin: 4px 0 0 0;
}

.ej-submit-btn {
    padding: 8px 23px;
    background: #5B8E49;
    color: #fff;
    border: 2px solid #FFFFFFB2;
    border-radius: 32px;
    cursor: pointer;
    transition: background 0.2s ease-in, color 0.2s ease-in, border 0.2s ease-in;

    font-family: Heebo;
    font-weight: 700;
    font-size: 16px;
    line-height: 135%;
    display: block;
    margin-right: auto;
}

.ej-submit-btn:hover {
    background: #fff;
    color: #5B8E49;
    border: 2px solid #5B8E49;
}

.ej-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ej-form-messages {
    margin-bottom: 12px;
}

.ej-form-messages .ej-error {
    color: #e74c3c;
    font-size: 14px;
    margin-bottom: 4px;
}

.ej-form-messages .ej-success {
    color: #2ecc71;
    font-size: 14px;
    font-weight: 500;
}

/* ========== Popup Modal ========== */
.ej-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ej-popup-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    direction: rtl;
    padding: 32px;
    position: relative;
}

.ej-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.ej-popup-title {
    font-size: 22px;
    margin: 0;
}

.ej-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.ej-popup-close:hover {
    color: #333;
}

.ej-popup-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

/* ========== Not Found ========== */
.ej-not-found {
    text-align: center;
    padding: 40px 0;
}

.ej-not-found a {
    color: #0073aa;
}

/* ========== Loading State ========== */
.ej-loading {
    text-align: center;
    padding: 40px 0;
    color: #999;
}

/* ========== Responsive ========== */
@media (max-width: 1366px) {
    #ej-jobs-widget {
        padding-inline: 2%;
    }
}

@media (max-width: 1200px) {
    
    #ej-jobs-widget {
        padding-inline: 0;
    }
    
    .ej-job-card {
        flex: 0 0 33.333%;
    }

    .ej-job-card:nth-child(4n) {
        border-inline-end: 1px solid #0000001F;
    }

    .ej-job-card:nth-child(3n),
    .ej-job-card:last-child {
        border-inline-end: none;
    }
}

@media (max-width: 992px) {
    .ej-job-card {
        flex: 0 0 50%;
    }

    .ej-job-card:nth-child(3n) {
        border-inline-end: 1px solid #0000001F;
    }

    .ej-job-card:nth-child(2n),
    .ej-job-card:last-child {
        border-inline-end: none;
    }
}

@media (max-width: 768px) {
    .ej-search-row {
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .ej-search-row .ej-gallery {
        order: -1;
        width: auto;
        gap: 40px;
        margin: 0 auto 10px;
        justify-content: center;
    }

    .ej-gallery-img {
        max-height: 44px;
    }

    .ej-search-row .ej-search-wrap {
        order: 1;
        width: 100%;
    }

    .ej-search-row .ej-search-wrap {
        padding-inline: 16px;
    }

    .ej-search-icon {
        inset-inline-start: 33px;
    }

    #ej-search::placeholder {
        font-size: 16px;
    }

    .ej-pills-wrap {
        gap: 18px;
        padding-inline: 16px;
    }

    .ej-pill {
        font-size: 15px;
        font-weight: 500;
        background-color: #F5F5F5;
    }

    .ej-pill.active {
        background-color: #E0E0E0;
    }

    .ej-job-code {
        font-size: 13px;
        font-weight: 600;
    }

    .ej-job-title {
        font-size: 16px;
        font-weight: 400;
    }

    .ej-job-excerpt {
        font-size: 14px;
        font-weight: 300;
    }

    .ej-job-btn {
        font-size: 14px;
        font-weight: 700;
    }

    .ej-single-content-body,
    .ej-popup-body {
        grid-template-columns: 1fr;
    }

    .ej-single-form-wrap {
        position: static;
    }

    .ej-popup-modal {
        padding: 20px;
    }
}

@media (min-width: 768px) {
    .jobs-archive-header {
        margin-top: 30px;
    }
}

@media (max-width: 767px) {
    .jobs-archive-header {
        margin-top: 0;
        margin-bottom: 12px;
    }

    .ej-single-job {
        padding-inline: 0;
    }

    .ej-single-header {
        padding-inline: 15px;
    }

    .ej-single-job-header {
        margin-inline: 0;
    }
    
    .ej-single-content {
        margin-inline: 15px;
    }

    .ej-single-content-body {
        flex-direction: column;
    }

    .ej-single-details {
        max-width: 100%;
    }

    .ej-application-form {
        margin: 0;
        width: 100%;
        min-width: unset;
    }

    .ej-single-job-title {
        font-size: 40px;
    }

    .jobs-archive-title {
        font-size: 45px;
    }

    .ej-single-job-code {
        font-size: 13px;
    }

    .ej-single-job-desc {
        font-size: 16px;
    }

    .ej-single-content-body {
        background: #fff;
    }

    .ej-single-content-body {
        border: none;
        padding:0;
    }

    .ej-single-details {
        border-right: 3px solid #2A3762;
        background: #F5F5F5;
        padding-right: 12px;
    }

    .jobs-archive-title {
        position: relative;
        min-height: unset;
        line-height: 100%;
        padding-block: 15px;
    }

    .jobs-archive-title::after {
        content: '';
        position: absolute;
        bottom: -4px;
        right: 0;
        width: calc(50% - 10px);
        height: 8px;
        background-color: #5B8E49;
    }

    .ej-back-link {
        padding: 6px 7.5px;
        font-size: 13px;
    }
    
    .ej-single-content-body {
        gap: 20px;
    }

    .ej-submit-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
}