/* Job listings — used on index.html and beta.html */

/* ── Section ── */
.open-jobs {
    margin: 60px 0 50px;
    overflow: visible;
    padding-bottom: 20px;
    display: block;
}
.open-jobs-header {
    text-align: center;
    margin-bottom: 40px;
}
.open-jobs-header h2 {
    background: linear-gradient(81.5deg, #E03741 0%, #E06037 91.05%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #E04637;
    font-size: 36px;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
}
.open-jobs-header p {
    color: #717171;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
}

/* ── Grid ── */
.ms-jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ── Card ── */
.ms-job-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}
.ms-job-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.09);
}
.ms-job-card-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 42px;
}

/* ── Icon circle ── */
.ms-job-icon-circle {
    width: 50px;
    height: 50px;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ms-job-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ── Info block (location + title + tags) ── */
.ms-job-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ms-job-location-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7c7c7c;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: -13px; /* tighten gap to title, matches Figma 3px */
}
.ms-job-pin {
    flex-shrink: 0;
}
.ms-job-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #313131;
    line-height: 1.2;
    margin: 0;
    overflow-wrap: anywhere; /* long unbroken titles must never clip against the card edge */
}

/* ── Tags ── */
.ms-job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ms-job-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f6f6f6;
    padding: 8px;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #535353;
    line-height: 1;
}
.ms-job-tag svg {
    flex-shrink: 0;
}

/* ── Footer (salary + apply button) ── */
.ms-job-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 0 0;
    display: flex;
    gap: 16px;
    align-items: center;
}
.ms-job-salary-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ms-job-salary {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #313131;
    line-height: 1;
    white-space: nowrap;
}
.ms-job-salary-label {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #7c7c7c;
    line-height: 1;
}
.ms-job-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 14px;
}
.ms-job-details {
    flex: 1 0 auto;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #343434;
    font: 600 14px 'Poppins', sans-serif;
    cursor: pointer;
}
.ms-job-details:hover { background: #f6f6f6; }
.ms-job-apply {
    flex: 1 0 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid #a72b28;
    border-radius: 6px;
    background: #a72b28;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.ms-job-apply:hover {
    background: #851f1d;
    color: #fff;
}

/* ── Skeleton shimmer ── */
@keyframes ms-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.ms-skeleton-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.07);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 42px;
    min-height: 100%;
}
.ms-skel {
    border-radius: 8px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 600px 100%;
    animation: ms-shimmer 1.4s infinite linear;
}
.ms-skel-icon { width: 50px; height: 50px; border-radius: 9999px; }
.ms-skel-body { display: flex; flex-direction: column; gap: 16px; }
.ms-skel-meta { height: 14px; width: 45%; }
.ms-skel-title { height: 26px; width: 80%; }
.ms-skel-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-skel-tag { height: 32px; width: 60%; }
.ms-skel-tag.short { width: 35%; }
.ms-skel-footer {
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 0 0;
    display: flex;
    gap: 16px;
    align-items: center;
}
.ms-skel-salary-col { flex: 1 1 0; display: flex; flex-direction: column; gap: 12px; }
.ms-skel-salary { height: 16px; width: 55%; }
.ms-skel-salary-label { height: 14px; width: 75%; }
.ms-skel-btn { flex: 1 1 0; height: 44px; border-radius: 6px; }

/* ── Empty ── */
.ms-jobs-empty {
    text-align: center;
    color: #717171;
    font-style: italic;
    font-family: 'Roboto', sans-serif;
    padding: 20px 0;
}

@media (max-width: 600px) {
    .open-jobs { margin: 28px 0 32px; scroll-margin-top: 12px; }
    .open-jobs-header { margin-bottom: 18px; }
    .open-jobs-header h2 { font-size: 28px; }
    .open-jobs-header p { margin: 0; line-height: 1.5; }
    .ms-jobs-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ms-job-card-body {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 14px 12px;
    }
    .ms-job-icon-circle { width: 40px; height: 40px; }
    .ms-job-icon { width: 23px; height: 23px; }
    .ms-job-info { gap: 5px; }
    .ms-job-location-row { margin-bottom: 0; overflow-wrap: anywhere; }
    .ms-job-card-title { font-size: 19px; line-height: 1.3; }
    .ms-job-tag { line-height: 1.25; overflow-wrap: anywhere; }
    .ms-job-footer,
    .ms-job-actions { grid-column: 1 / -1; margin-top: 0; }
    .ms-job-footer { padding-top: 12px; }
    .ms-job-salary-col { gap: 5px; }
    .ms-job-salary { line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
    .ms-job-actions > * { box-sizing: border-box; min-height: 48px; }
    .ms-job-apply { line-height: 1.3; }
    .ms-skeleton-card { gap: 16px; }
    .alb-promo {
        flex-wrap: wrap;
        gap: 8px;
    }
    .alb-promo__logo {
        height: 15px;
    }
}

/* ── Embedded doc modal ── */
body.ms-doc-modal-open {
    overflow: hidden;
}
.ms-doc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.ms-doc-modal.is-open {
    display: block;
}
.ms-doc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.ms-doc-modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 94vw);
    height: min(85vh, 1000px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ms-doc-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.ms-doc-modal-heading {
    flex: 1;
    min-width: 0;
}
.ms-doc-modal-title {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #313131;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ms-doc-modal-date {
    margin: 3px 0 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #7c7c7c;
    line-height: 1.2;
}
.ms-doc-modal-print {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 0;
    background: #f6f6f6;
    color: #535353;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ms-doc-modal-print:hover {
    background: #e0433f;
    color: #fff;
}
.ms-doc-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #f6f6f6;
    color: #535353;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ms-doc-modal-close:hover {
    background: #e0433f;
    color: #fff;
}
.ms-doc-modal-body {
    flex: 1;
    min-height: 0;
    padding: 22px clamp(16px, 4vw, 32px);
    overflow: auto;
    font-size: 1rem;
    line-height: 1.55;
}
.ms-doc-modal-body p { margin: 0 0 .6em; overflow-wrap: anywhere; }
.ms-doc-modal-body h4 { margin: 1.2em 0 .45em; font-size: 1.05em; }
.ms-doc-modal-actions {
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid #ddd;
}
.ms-doc-modal-actions .ms-job-apply { flex: 0 1 auto; }
@media print {
    body.ms-doc-modal-open { height: auto; overflow: visible; }
    body.ms-doc-modal-open > :not(.ms-doc-modal),
    .ms-doc-modal-open .ms-doc-modal-backdrop,
    .ms-doc-modal-open .ms-doc-modal-print,
    .ms-doc-modal-open .ms-doc-modal-close { display: none !important; }
    .ms-doc-modal-open .ms-doc-modal,
    .ms-doc-modal-open .ms-doc-modal-dialog { position: static; transform: none; width: auto; max-width: none; height: auto; overflow: visible; box-shadow: none; }
    .ms-doc-modal-open .ms-doc-modal-body { padding-inline: 16px; overflow: visible; }
    .ms-doc-modal-open .ms-job-apply { color: #000; border: 0; padding: 0; text-decoration: underline; }
}
@media (max-width: 600px), (pointer: coarse) {
    .ms-doc-modal-print,
    .ms-doc-modal-close { width: 44px; height: 44px; }
}
@media screen and (max-width: 600px), screen and (max-height: 500px) and (pointer: coarse) {
    .ms-doc-modal-dialog {
        width: auto;
        height: 100vh;
        height: 100dvh;
        inset: 0;
        transform: none;
        border-radius: 0;
    }
    .ms-doc-modal-header {
        gap: 8px;
        padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    }
    .ms-doc-modal-title {
        font-size: 16px;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .ms-doc-modal-body {
        padding-block: 16px;
        overscroll-behavior: contain;
    }
    .ms-doc-modal-actions {
        padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .ms-doc-modal-actions .ms-job-apply { flex: 1; min-height: 48px; }
}

/* ── ALB cross-promotion callout ── */
.alb-promo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 0;
    border-top: 1px solid #e8e8e8;
    margin-top: 24px;
    text-align: center;
}
.alb-promo__logo {
    height: 18px;
    opacity: 0.75;
    flex-shrink: 0;
}
.alb-promo__text {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.5;
    font-family: 'Roboto', sans-serif;
}
.alb-promo__link {
    color: #E03741;
    font-weight: 600;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}
.alb-promo__link:hover {
    text-decoration: underline;
    color: #E03741;
}
