/* ==========================================================================
   Megarme Careers — public job openings list + job detail / apply page
   Namespaced under .mg-* classes. Palette mirrors the site theme.
   Loaded on: /careers, /careers/jobs, /careers/jobs/{id}
   ========================================================================== */

.mg-openings,
.mg-openings *,
.mg-job-hero,
.mg-job-hero *,
.mg-job-detail,
.mg-job-detail * {
    box-sizing: border-box;
    font-family: 'Montserrat', 'Montserrat Arabic', sans-serif;
}

:root {
    --mgc-navy: #002438;
    --mgc-blue: #30A9E1;
    --mgc-cyan: #00bcd4;
    --mgc-ink: #24313d;
    --mgc-muted: #6a7a89;
    --mgc-line: #e4eaef;
}

/* ---------- hero band (job list + detail) -------------------------------- */

.mg-job-hero {
    background: linear-gradient(90deg, #002438 0%, #004b8d 100%);
    color: #fff;
    padding: 150px 20px 55px;
}

.mg-job-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.mg-job-hero h1 {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-job-hero p {
    margin: 0;
    font-size: 16px;
    color: #d6e4ee;
    max-width: 640px;
}

.mg-back {
    display: inline-block;
    margin-bottom: 16px;
    color: #9fd6f0;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-back:hover {
    color: #fff;
}

/* ---------- openings list (rectangle line cards) ------------------------- */

.mg-openings {
    max-width: 1100px;
    margin: 0 auto;
    padding: 55px 20px 70px;
}

.mg-openings-head {
    margin-bottom: 30px;
}

.mg-openings-head h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: var(--mgc-navy);
    text-transform: uppercase;
}

.mg-openings-head p {
    margin: 0;
    color: var(--mgc-muted);
    font-size: 15px;
}

.mg-open-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mg-open-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--mgc-line);
    border-left: 5px solid var(--mgc-blue);
    border-radius: 10px;
    padding: 24px 26px;
    box-shadow: 0 6px 20px rgba(0, 36, 56, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-open-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 36, 56, 0.12);
}

.mg-open-main {
    min-width: 0;
}

.mg-open-card h3 {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 700;
    color: var(--mgc-navy);
}

.mg-open-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 10px;
    font-size: 12.5px;
    color: var(--mgc-muted);
    font-weight: 600;
}

.mg-open-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mg-open-meta svg {
    color: var(--mgc-blue);
    flex-shrink: 0;
}

.mg-open-meta.light {
    color: #cfe0ec;
}

.mg-open-meta.light svg {
    color: #9fd6f0;
}

/* ---------- social share (round icon buttons) ------------------------- */

.mg-open-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.mg-open-share.light {
    margin-top: 20px;
}

.mg-share-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mgc-muted);
    margin-right: 4px;
}

.mg-open-share.light .mg-share-label {
    color: #bcd3e2;
}

.mg-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f8;
    color: var(--mgc-navy);
    border: 1px solid var(--mgc-line);
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.mg-open-share.light .mg-share-btn {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.mg-share-btn:hover {
    transform: translateY(-3px);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 36, 56, 0.25);
}

.mg-share-btn.s-li:hover   { background: #0a66c2; border-color: #0a66c2; }
.mg-share-btn.s-fb:hover   { background: #1877f2; border-color: #1877f2; }
.mg-share-btn.s-x:hover    { background: #000000; border-color: #000000; }
.mg-share-btn.s-wa:hover   { background: #25d366; border-color: #25d366; }
.mg-share-btn.s-mail:hover { background: var(--mgc-blue); border-color: var(--mgc-blue); }

.mg-open-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--mgc-ink);
    max-width: 680px;
}

.mg-open-cta {
    flex-shrink: 0;
}

.mg-apply-btn {
    display: inline-block;
    padding: 13px 26px;
    background: var(--mgc-cyan);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.mg-apply-btn:hover {
    background: var(--mgc-navy);
    transform: translateY(-1px);
}

.mg-apply-btn.full {
    width: 100%;
    padding: 15px;
    font-size: 14px;
}

.mg-open-empty {
    padding: 50px 0;
    text-align: center;
    color: var(--mgc-muted);
    font-size: 15px;
}

/* ---------- job detail + apply panel ----------------------------------- */

.mg-job-detail {
    max-width: 1100px;
    margin: 0 auto;
    padding: 55px 20px 75px;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
    align-items: start;
}

.mg-job-body h2 {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    color: var(--mgc-navy);
    text-transform: uppercase;
}

.mg-job-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--mgc-ink);
}

.mg-job-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.mg-job-facts > div {
    background: #f6f9fb;
    border: 1px solid var(--mgc-line);
    border-radius: 8px;
    padding: 14px 16px;
}

.mg-job-facts span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mgc-muted);
    font-weight: 700;
    margin-bottom: 5px;
}

.mg-job-facts strong {
    font-size: 14px;
    color: var(--mgc-navy);
}

.mg-job-facts a {
    color: var(--mgc-blue);
    text-decoration: none;
}

.mg-job-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.mg-job-gallery img {
    width: 220px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--mgc-line);
}

.mg-apply-panel {
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid var(--mgc-line);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 36, 56, 0.08);
}

.mg-apply-panel h2 {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 800;
    color: var(--mgc-navy);
    text-transform: uppercase;
}

.mg-af-field {
    margin-bottom: 15px;
}

.mg-af-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--mgc-navy);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.mg-af-field input,
.mg-af-field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--mgc-line);
    border-radius: 7px;
    background: #f8fafc;
    font-size: 14px;
    color: var(--mgc-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mg-af-field input:focus,
.mg-af-field textarea:focus {
    outline: none;
    border-color: var(--mgc-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(48, 169, 225, 0.15);
}

.mg-af-field textarea {
    resize: vertical;
    min-height: 90px;
}

.mg-af-field input[type="file"] {
    padding: 9px;
    background: #fff;
}

.mg-alert-ok {
    background: #e7f7ee;
    border: 1px solid #b7e4c9;
    color: #1c7a47;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.mg-alert-err {
    background: #fdecec;
    border: 1px solid #f5c6c6;
    color: #b23b3b;
    border-radius: 8px;
    padding: 12px 16px 12px 30px;
    font-size: 13.5px;
    margin-bottom: 16px;
}

.mg-alert-err ul {
    margin: 0;
    padding-left: 4px;
}

/* ---------- responsive -------------------------------------------------- */

@media (max-width: 900px) {
    .mg-job-detail {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .mg-apply-panel {
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .mg-job-hero {
        padding-top: 120px;
    }

    .mg-job-hero h1 {
        font-size: 28px;
    }

    .mg-open-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .mg-open-cta,
    .mg-apply-btn {
        width: 100%;
        text-align: center;
    }
}
