/* 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: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--brand);
    font-size: 36px;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 10px;
}
.open-jobs-header p {
    color: var(--ink-soft);
    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;
    color: var(--brand);
}
.ms-job-pin {
    color: var(--brand);
}

/* ── 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: var(--ink);
    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: var(--ink);
    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-apply {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid var(--brand);
    border-radius: 6px;
    background: #fff;
    color: var(--brand);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.ms-job-apply:hover {
    background: var(--brand);
    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: var(--ink-soft);
    font-style: italic;
    font-family: 'Roboto', sans-serif;
    padding: 20px 0;
}

@media (max-width: 600px) {
    .ms-jobs-grid { grid-template-columns: 1fr; }
    .open-jobs-header h2 { font-size: 28px; }
    .cross-promo {
        flex-wrap: wrap;
        gap: 8px;
    }
    .cross-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: var(--ink);
    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-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: var(--brand);
    color: #fff;
}
.ms-doc-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #fff;
}
/* Typography for the posting HTML injected from HireHive. Scoped tightly so
   third-party markup cannot inherit anything unexpected from the page. */
.ms-doc-modal-content {
    padding: 22px 26px 28px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink);
}
.ms-doc-modal-content h1,
.ms-doc-modal-content h2,
.ms-doc-modal-content h3,
.ms-doc-modal-content h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--ink);
    margin: 22px 0 8px;
    line-height: 1.3;
}
.ms-doc-modal-content h1 { font-size: 22px; }
.ms-doc-modal-content h2 { font-size: 19px; }
.ms-doc-modal-content h3,
.ms-doc-modal-content h4 { font-size: 17px; }
.ms-doc-modal-content p { margin: 0 0 12px; }
.ms-doc-modal-content ul,
.ms-doc-modal-content ol { margin: 0 0 14px; padding-left: 22px; }
.ms-doc-modal-content li { margin-bottom: 6px; }
.ms-doc-modal-content a { color: var(--brand); text-decoration: underline; }
.ms-doc-modal-content strong, .ms-doc-modal-content b { font-weight: 700; }
.ms-doc-modal-content hr { border: 0; border-top: 1px solid #e8e8e8; margin: 20px 0; }
.ms-doc-modal-content table { width: 100%; margin-bottom: 14px; }
.ms-doc-modal-content td, .ms-doc-modal-content th { padding: 6px 8px; border-bottom: 1px solid #e8e8e8; }
/* Postings routinely paste in inline emoji images; cap them so one stray
   full-size image cannot blow out the modal's width. */
.ms-doc-modal-content img { max-width: 100%; height: auto; vertical-align: middle; }
.ms-doc-modal-content img[width="16"],
.ms-doc-modal-content img[height="16"] { width: 16px; height: 16px; }

.ms-doc-modal-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #fafafa;
}
.ms-doc-modal-apply {
    display: inline-block;
}
@media (max-width: 600px) {
    .ms-doc-modal-dialog {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }
}
