/* I Mates public careers portal: dropdown and job-list refinements. */

:root {
    --im-green: #138a55;
    --im-green-dark: #0d6840;
    --im-green-soft: #eff9f3;
    --im-ink: #17352a;
    --im-muted: #62746c;
    --im-border: #d9e6df;
    --im-shadow: 0 14px 34px rgba(22, 66, 47, 0.09);
}

/* Consistent native controls across Chrome, Safari, Firefox and mobile. */
.public-body .form-select,
.public-body select {
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px;
    width: 100%;
    padding: 0.72rem 2.8rem 0.72rem 0.95rem;
    border: 1px solid var(--im-border);
    border-radius: 12px;
    background-color: #fff;
    color: var(--im-ink);
    font: inherit;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2317352a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m3.5 6 4.5 4 4.5-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.95rem center;
    background-size: 16px 16px;
    box-shadow: 0 1px 2px rgba(20, 54, 40, 0.03);
    transition: border-color 160ms ease, box-shadow 160ms ease,
        background-color 160ms ease;
}

.public-body .form-select:hover,
.public-body select:hover {
    border-color: #9ccab2;
    background-color: #fcfffd;
}

.public-body .form-select:focus,
.public-body select:focus {
    border-color: var(--im-green);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(19, 138, 85, 0.12);
}

.public-body .form-select:disabled,
.public-body select:disabled {
    background-color: #f1f4f2;
    color: #829087;
    cursor: not-allowed;
    opacity: 1;
}

/* Safari keeps a separate rounding and text-rendering path for controls. */
.public-body select::-ms-expand {
    display: none;
}

/* Desktop macOS custom select. The native select remains in the form so
   submitted names, values and server-side filtering stay unchanged. */
.im-custom-select {
    position: relative;
    width: 100%;
}

.im-custom-select > select.im-native-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.im-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.72rem 0.9rem 0.72rem 0.95rem;
    border: 1px solid var(--im-border);
    border-radius: 12px;
    background: #fff;
    color: var(--im-ink);
    font: inherit;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(20, 54, 40, 0.03);
    transition: border-color 160ms ease, box-shadow 160ms ease,
        background-color 160ms ease;
}

.im-select-trigger:hover {
    border-color: #9ccab2;
    background: #fcfffd;
}

.im-select-trigger:focus-visible,
.im-custom-select.is-open .im-select-trigger {
    border-color: var(--im-green);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(19, 138, 85, 0.12);
}

.im-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.im-select-chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin: -4px 4px 0 8px;
    border-right: 2px solid #315846;
    border-bottom: 2px solid #315846;
    transform: rotate(45deg);
    transition: transform 150ms ease;
}

.im-custom-select.is-open .im-select-chevron {
    margin-top: 4px;
    transform: rotate(225deg);
}

.im-select-menu {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 7px);
    left: 0;
    display: none;
    width: 100%;
    min-width: 190px;
    max-height: 290px;
    margin: 0;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    border: 1px solid #cfe0d7;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(18, 57, 40, 0.18);
    -webkit-overflow-scrolling: touch;
}

.im-custom-select.is-open .im-select-menu {
    display: block;
}

.im-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 42px;
    padding: 0.62rem 0.75rem;
    border-radius: 9px;
    color: #294b3c;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.im-select-option:hover,
.im-select-option.is-focused {
    background: var(--im-green-soft);
    color: var(--im-green-dark);
}

.im-select-option[aria-selected="true"] {
    background: #e5f5eb;
    color: var(--im-green-dark);
    font-weight: 700;
}

.im-select-option[aria-selected="true"]::after {
    flex: 0 0 auto;
    color: var(--im-green);
    font-weight: 800;
    content: "\2713";
}

.im-select-option.is-disabled {
    color: #97a49d;
    cursor: not-allowed;
    background: transparent;
}

.im-select-group {
    padding: 0.6rem 0.75rem 0.3rem;
    color: #718079;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.im-custom-select.is-disabled .im-select-trigger {
    background: #f1f4f2;
    color: #829087;
    cursor: not-allowed;
}

.advanced-search-form label {
    display: block;
    margin-bottom: 0.48rem;
    color: var(--im-ink);
    font-size: 0.84rem;
    font-weight: 700;
}

.advanced-search-form .form-control {
    min-height: 52px;
    border-color: var(--im-border);
    border-radius: 12px;
}

.advanced-search-form .form-control:focus {
    border-color: var(--im-green);
    box-shadow: 0 0 0 4px rgba(19, 138, 85, 0.12);
}

.advanced-search-form small {
    display: block;
    margin-top: 0.4rem;
    color: var(--im-muted);
    line-height: 1.45;
}

/* Home-page opportunity cards. */
.corp-job-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.corp-job-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--im-border) !important;
    border-radius: 20px !important;
    background: #fff;
    box-shadow: 0 8px 24px rgba(22, 66, 47, 0.06);
    transition: transform 180ms ease, box-shadow 180ms ease,
        border-color 180ms ease;
}

.corp-job-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #88c91c, var(--im-green));
    content: "";
}

.corp-job-card:hover {
    border-color: #b7d9c7 !important;
    box-shadow: var(--im-shadow);
    transform: translateY(-4px);
}

.corp-job-card .corp-job-body h3 a {
    color: var(--im-ink);
    text-decoration: none;
}

.corp-job-card .corp-job-body h3 a:hover {
    color: var(--im-green-dark);
}

.corp-job-summary {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.corp-job-footer {
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #edf3ef;
}

/* Full jobs-page results. */
.search-result-list {
    display: grid;
    gap: 1rem;
}

.search-result-card {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--im-border) !important;
    border-radius: 18px !important;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 66, 47, 0.05);
    transition: transform 170ms ease, box-shadow 170ms ease,
        border-color 170ms ease;
}

.search-result-card:hover {
    border-color: #acd5bf !important;
    box-shadow: var(--im-shadow);
    transform: translateY(-2px);
}

.result-title-row h3 a {
    display: inline;
    color: var(--im-ink);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.result-title-row h3 a:hover {
    color: var(--im-green-dark);
}

.result-summary {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    margin: 0.9rem 0 0;
    color: var(--im-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.result-main,
.result-title-row,
.result-title-row > div {
    min-width: 0;
}

.result-meta {
    row-gap: 0.55rem;
}

.result-meta span,
.job-tag-row span {
    overflow-wrap: anywhere;
}

.result-side {
    min-width: 128px;
}

.result-side .btn {
    min-width: 116px;
}

@media (max-width: 767.98px) {
    .public-body .form-select,
    .public-body select,
    .advanced-search-form .form-control {
        min-height: 50px;
        font-size: 16px; /* Prevents unwanted iOS input zoom. */
    }

    .search-result-card {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 0.8rem;
        padding: 1rem !important;
    }

    .result-logo {
        width: 48px !important;
        height: 48px !important;
    }

    .result-main {
        min-width: 0;
    }

    .result-title-row {
        align-items: flex-start;
        gap: 0.65rem;
    }

    .result-title-row h3 {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .result-meta {
        display: grid !important;
        gap: 0.5rem;
    }

    .result-summary {
        -webkit-line-clamp: 4;
    }

    .result-side {
        grid-column: 1 / -1;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        padding-top: 0.85rem;
        border-top: 1px solid #edf3ef;
    }

    .result-side .btn {
        min-width: 124px;
    }

    .corp-job-footer {
        align-items: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 767.98px) {
    .im-select-trigger {
        min-height: 50px;
        font-size: 16px;
    }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
    .corp-job-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .corp-job-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* macOS/iOS Safari-only refinements. */
@supports (-webkit-touch-callout: none) {
    .public-body .form-select,
    .public-body select {
        height: 52px;
        padding-top: 0;
        padding-bottom: 0;
        line-height: 52px;
        text-indent: 0.01px;
        -webkit-border-radius: 12px;
    }

    .search-result-card,
    .corp-job-card {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .search-result-card:hover,
    .corp-job-card:hover {
        -webkit-transform: translateY(-2px) translateZ(0);
        transform: translateY(-2px) translateZ(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .corp-job-card,
    .search-result-card,
    .public-body .form-select,
    .public-body select {
        transition: none;
    }
}

/* Footer access tab for I Mates employees. */
.footer-bottom-links .footer-employee-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 9px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease,
        transform 160ms ease;
}

/* Clean responsive brand presentation in the public header and footer. */
.public-header .public-brand-logo {
    display: inline-flex;
    align-items: center;
    flex: 0 1 360px;
    min-width: 0;
    padding: 4px 0;
    background: transparent;
}

.public-header .public-company-logo {
    display: block;
    width: min(360px, 30vw);
    height: 68px;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
    background: transparent;
}

.public-footer .footer-brand {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0;
    background: transparent;
}

.public-footer .footer-company-logo {
    display: block;
    width: min(390px, 100%);
    height: auto;
    max-height: 130px;
    object-fit: contain;
    object-position: left center;
    background: transparent;
}

@media (max-width: 991.98px) {
    .public-header .public-brand-logo {
        flex-basis: 285px;
    }

    .public-header .public-company-logo {
        width: min(285px, 62vw);
        height: 58px;
    }
}

@media (max-width: 575.98px) {
    .public-header .public-brand-logo {
        flex-basis: 230px;
    }

    .public-header .public-company-logo {
        width: min(230px, 67vw);
        height: 50px;
    }

    .public-footer .footer-company-logo {
        width: min(320px, 100%);
        max-height: 108px;
    }
}

.footer-bottom-links .footer-employee-login-btn:hover,
.footer-bottom-links .footer-employee-login-btn:focus-visible {
    border-color: #86c828;
    color: #ffffff;
    background: #168451;
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .footer-bottom-links .footer-employee-login-btn {
        width: 100%;
        margin-bottom: 0.35rem;
    }
}
