/* styles/vacancies.css */

/* ============================================================
   Hero Section Architecture
   ============================================================ */
.vacancies-hero {
    position: relative;
    width: 100%;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden; /* Ensures the physical image doesn't break out */
}

/* New class to handle the physical SEO image */
.vacancies-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.vacancies-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1; /* Sits directly above the image */
}

.vacancies-hero-content {
    position: relative;
    z-index: 2; /* Sits above the overlay */
    color: #ffffff;
    padding: 0 5%;
}

.vacancies-hero-content h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.text-deep-red {
    color: #8B0000;
}

.vacancies-hero-content p {
    font-size: 1.1rem;
    color: #e0e0e0;
    letter-spacing: 0.05em;
}

/* ============================================================
   Main Content Layout
   ============================================================ */
.careers-wrapper {
    padding: 4rem 0 8rem 0;
    background-color: #F2F0E6;
}

.jobs-list {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================================
   Dynamic Job Cards & Hover Animation
   ============================================================ */
.job-card {
    background-color: #ffffff;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* The animated Deep Red line on hover */
.job-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #8B0000;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

.job-card:hover::after,
.job-card.active::after {
    transform: scaleX(1);
}

/* ============================================================
   Job Header Architecture
   ============================================================ */
.job-header {
    padding: 2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.job-header:hover {
    background-color: #fafafa;
}

.job-title-group h2 {
    margin: 0 0 0.5rem 0;
    color: #050505;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

/* Deep Red Heading when open */
.job-card.active .job-title-group h2 {
    color: #8B0000;
}

.job-meta span {
    font-size: 0.85rem;
    color: #777777;
    margin-right: 1.5rem;
}

.job-meta strong {
    color: #333333;
}

/* ============================================================
   Action Toggle (More Information)
   ============================================================ */
.job-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #8B0000;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.job-action svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.job-card.active .job-action svg {
    transform: rotate(180deg);
}

/* ============================================================
   Expanded Details (Smooth Slide)
   ============================================================ */
.job-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #ffffff;
}

.details-inner {
    padding: 0 2.5rem 2.5rem 2.5rem;
    border-top: 1px solid #f0f0f0;
}

.details-inner p,
.details-inner ul {
    color: #444444;
    line-height: 1.6;
}

.details-inner h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem 0;
    color: #050505;
}

.details-inner ul {
    padding-left: 1.5rem;
}

.details-inner ul li::marker {
    color: #8B0000;
}

.details-inner ul li {
    margin-bottom: 0.75rem;
}

.apply-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.closing-date {
    font-size: 0.85rem;
    color: #8B0000;
    font-weight: 600;
}

/* ============================================================
   Job Card 'Apply Now' Button
   ============================================================ */
.apply-btn {
    background-color: #8B0000;
    color: #ffffff;
    padding: 0.8rem 2.5rem;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.apply-btn:hover {
    background-color: #050505;
    transform: translateY(-2px);
}

/* ============================================================
   Modal System (Pop-up)
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75); /* Slightly darker background */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    padding: 3.5rem 3rem; /* Adjusted padding for a more spacious feel */
    border-radius: 4px;
    max-width: 550px; /* Made slightly wider to fit the text beautifully */
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative; /* Crucial for the absolute positioning of the X */
}

/* Left aligned styling to match screenshot */
.modal-left-align {
    text-align: left;
}

/* The Close 'X' Button */
.close-modal-x {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: #050505;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal-x:hover {
    color: #8B0000;
}

/* The Kicker Text */
.modal-kicker {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B0000; /* Replaced Gold with Deep Red */
    margin-bottom: 1rem;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #050505;
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.modal-content p {
    color: #555555;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-size: 1.05rem;
}

.modal-actions-left {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Ensures buttons stack on very small mobile screens */
}

/* Solid Black Pill Button */
.btn-black-pill {
    background-color: #050505;
    color: #ffffff;
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
    text-align: center;
}

.btn-black-pill:hover {
    background-color: #333333;
}

/* White Outline Pill Button */
.btn-outline-pill {
    background-color: transparent;
    color: #050505;
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    border: 1px solid #cccccc;
    font-weight: 500;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    text-align: center;
}

.btn-outline-pill:hover {
    border-color: #050505;
}

/* ============================================================
   Empty State Fallback Logic
   ============================================================ */
.empty-jobs-msg:not(:only-child) {
    display: none;
}

/* Change only the top-level main nav links to white ON DESKTOP ONLY */
@media (min-width: 901px) {
    .main-nav .nav-links > li > a {
        color: #ffffff !important;
    }
}

/* ============================================================
   Mobile Navigation & Job Cards Optimization
   ============================================================ */
@media (max-width: 900px) {
    /* EXACT MIRROR OF OUR-COMPANY.CSS NAV LAYOUT */
    .main-nav .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        padding: 1rem 1.5rem !important;
        box-sizing: border-box; 
    }

    /* Hide the Logo (Mirroring our-company.css behavior) */
    .main-nav .nav-brand {
        display: none !important;
    }

    /* Burger Menu Left */
    .main-nav .mobile-toggle {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        order: 1;
        display: flex !important;
    }

    /* FORCED WHITE HAMBURGER: Ensures visibility against the dark Vacancies hero */
    .main-nav .mobile-toggle span {
        background-color: #ffffff !important;
    }

    /* Force Quote Button to Show on Right */
    .main-nav .nav-actions {
        position: relative !important;
        display: block !important;
        order: 2;
    }

    /* Scale the button slightly for small screens */
    .main-nav .nav-quote-pill {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.85rem !important;
    }

    /* MOBILE NAV TEXT COLOR: Updated to match the Ren-Flex Deep Red */
    .main-nav .nav-links > li > a {
        color: #8B0000 !important; 
    }

    /* VACANCIES SPECIFIC: Mobile Job Cards Layout */
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 1.5rem;
    }

    .job-title-group h2 {
        font-size: 1.25rem;
    }

    .job-meta {
        flex-direction: column;
        gap: 0.4rem;
    }

    .job-action {
        align-self: flex-start;
    }

    .details-inner {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    .apply-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .apply-btn {
        width: 100%;
        text-align: center;
    }
}