/* =========================================================
   C-Sky Photonic
   ========================================================= */

:root {
    --dimension-size: 20vh;

    --theme-teal: #008080;
    --theme-teal-hover: #006666;

    --bg-page: #ffffff;
    --text-white: #ffffff;
    --text-dark: #1e293b;
    --border-light: #e2e8f0;

    --font-family: system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, sans-serif;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-dark);
}

a {
    color: inherit;
    text-decoration: none;
}

.career-heading {
    text-align: center;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    width: 100%;
    height: 20vh;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 2rem;
    gap: 1.5rem;

    background: var(--theme-teal);
    color: var(--text-white);

    flex-shrink: 0;
    z-index: 10;
}


/* Logo */

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;

    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.1em;

    color: var(--text-white);
    white-space: nowrap;
}

.companyname {
    font-size: 1.4rem;
    font-weight: 700;
}


/* Navigation */

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    position: relative;

    padding: 0.25rem 0;

    font-size: 1.3rem;
    font-weight: 600;

    color: var(--text-white);
}


/* Navigation underline */

.nav-links a::after {
    content: "";

    position: absolute;
    left: 0;
    bottom: 0;

    width: 0;
    height: 2px;

    background: var(--text-white);

    transition: width 0.2s ease;
}

.nav-links a:hover::after {
    width: 100%;
}


/* Search styling is centralized in search.css. */

/* Mobile menu button */

.mobile-toggle-btn {
    display: none;

    padding: 0.3rem 0.6rem;

    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;

    background: none;
    color: var(--text-white);

    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}


/* =========================================================
   HERO SECTION
   ========================================================= */

.herosection {
    display: grid;

    grid-template-columns: 20vh 1fr;
    grid-template-areas: "sidebar content";

    background: var(--bg-page);
}


/* Sidebar */

.sidebar {
    grid-area: sidebar;

    width: 20vh;
    min-width: 20vh;
    max-width: var(--dimension-size);

    height: 100%;

    display: flex;
    flex-direction: column;

    padding: 1.5rem 0.75rem;
    gap: 0.75rem;

    background: var(--theme-teal);
    color: var(--text-white);

    overflow-y: auto;

    position: sticky;
    top: 0;

    z-index: 10;
}


/* Main content */

.content {
    grid-area: content;
    min-height: 0;
}


/* =========================================================
   HERO IMAGE
   ========================================================= */

.heroimage {
    position: relative;
    overflow: hidden;

    min-height: 50vh;
    margin: 5vh;

    background: #f1f5f9;
}

.heroimage img {
    display: block;

    width: 100%;
    height: 50vh;

    object-fit: cover;
    object-position: center;
}

.career-p {
    text-align: justify;
    font-size: 16px;
}

/* =========================================================
   CATEGORY
   ========================================================= */

.category {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 5vh;

    margin: 0 5vh 5vh;

    justify-items: center;
    align-items: start;

    background: var(--bg-page);

    border-top: 1px solid var(--border-light);
}


/* Category boxes */

.category {
    align-items: center;
    display: flex;
    flex-direction: column;

}


.jobopening {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 1rem 2rem;
    row-gap: 1rem;
    width: 100%;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.formbutton button {

    padding: 0.8rem 0.8rem;
    background-color: #008080;
    border: none;
    color: #ffffff;
}

.jobbottomtext {

    display: grid;
    grid-template-columns: 1fr 1fr;

}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    width: 100%;
    min-height: var(--dimension-size);

    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 1.75rem;

    padding: 1.5rem 2.5rem;

    background: var(--theme-teal);
    color: var(--text-white);

    align-items: start;
    align-content: center;

    overflow: hidden;

    flex-shrink: 0;

    z-index: 20;
}


/* Footer columns */

.footer div {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 0.25rem;
}


/* Footer headings */

.footer h4 {
    width: 100%;

    margin-bottom: 0.35rem;
    padding-bottom: 0.2rem;

    color: var(--text-white);

    font-size: 0.85rem;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.06em;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Footer links */

.footer a {
    display: inline-block;

    color: rgba(255, 255, 255, 0.85);

    font-size: 0.8rem;
    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: 0.15s ease;
}

.footer a:hover {
    color: var(--text-white);

    text-decoration: none;

    transform: translateX(3px);
}


/* Footer contact text */

.footer p {
    color: rgba(255, 255, 255, 0.85);

    font-size: 0.76rem;
    line-height: 1.3;

    word-break: break-word;
}

.career-t,
.two,
.three {
    color: #64748b !important;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .footer {
        grid-template-columns: repeat(3, 1fr);
        min-height: var(--dimension-size);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    :root {
        --dimension-size: clamp(65px, 12vh, 85px);
    }

    body {
        height: auto;
        overflow-y: auto;
    }


    /* Navbar */

    .navbar {
        height: auto;
        min-height: var(--dimension-size);

        padding: 0.8rem 1rem;

        flex-wrap: wrap;
        gap: 0.5rem;
    }


    /* Mobile button */

    .mobile-toggle-btn {
        display: block;

        order: 2;
        margin-left: auto;
    }


    /* Logo */

    .logo {
        order: 1;
    }


    /* Search */

    .search-box {
        order: 4;

        width: 100%;
        max-width: none;
    }


    /* Navigation */

    .nav-links {
        order: 3;

        width: 100%;

        display: none;
        flex-direction: column;

        gap: 0;

        background: var(--theme-teal-hover);

        border-radius: 8px;
        overflow: hidden;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;

        padding: 0.7rem 1rem;

        font-size: 0.95rem;

        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
    }


    /* Hero section */

    .herosection {
        display: flex;
        flex-direction: column;

        overflow: visible;
    }


    /* Sidebar */

    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;

        flex-direction: row;

        padding: 0.6rem 0.8rem;
        gap: 0.5rem;

        overflow-x: auto;

        white-space: nowrap;
    }

    .sidebar a {
        flex: 1 0 auto;

        padding: 0.5rem 0.85rem;

        font-size: 0.8rem;
    }


    /* Content */

    .content {
        overflow-y: visible;
    }


    /* Hero image */

    .heroimage {
        min-height: 200px;
        max-height: 280px;

        margin: 1rem;
    }


    /* Categories */

    .category {
        grid-template-columns: repeat(2, 1fr);

        gap: 0.75rem;

        padding: 1rem;

        margin: 0;
    }


    /* Footer */

    .footer {
        grid-template-columns: 1fr;

        min-height: var(--dimension-size);

        padding: 2rem 1.5rem;

        gap: 1.5rem;

        text-align: center;
    }

    .footer div {
        align-items: center;
    }
}

/* =========================================================
   CAREER TABLE
   ========================================================= */

.career-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.career-table {
    width: 600px;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}

.career-table th,
.career-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.career-table th {
    background: var(--theme-teal);
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.career-table th:first-child,
.career-table td:first-child {
    width: 38%;
}

.career-table tbody tr:last-child td {
    border-bottom: none;
}

.career-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.career-table tbody tr:hover {
    background: #f8fafc;
}

.career-role {
    font-weight: 700;
    color: var(--text-dark);
}

.career-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--theme-teal);
    border-radius: 7px;
    background: var(--theme-teal);
    color: var(--text-white);
    font-size: 0.85rem;
    font-weight: 700;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.career-pdf-link:hover,
.career-pdf-link:focus-visible {
    background: var(--theme-teal-hover);
    border-color: var(--theme-teal-hover);
    transform: translateY(-1px);
}

.career-pdf-link:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.25);
    outline-offset: 2px;
}

.career-no-pdf,
.career-table-status {
    color: #64748b;
    font-size: 0.9rem;
}

.career-table-status {
    text-align: center;
    padding: 1.5rem;
}

.career-table-error {
    color: #b91c1c;
}

@media (max-width: 768px) {
    .career-table {
        min-width: 620px;
    }

    .career-table th,
    .career-table td {
        padding: 0.8rem 0.9rem;
    }
}

/* =========================================================
   CAREER TABLES - TWO COLUMNS ON LARGE SCREENS
   ========================================================= */

.career-tables-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    justify-content: stretch;
    gap: 24px;
    width: 100%;
    max-width: 100%;
}

.career-tables-row .career-table-wrap {
    display: block;
    flex: 1 1 0;
    width: calc(50% - 12px);
    min-width: 0;
    max-width: none;
    margin: 0;
    overflow-x: auto;
}

.career-tables-row .career-table {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    table-layout: fixed;
}

.career-tables-row .career-table th:first-child,
.career-tables-row .career-table td:first-child {
    width: 40%;
}

.career-tables-row .career-table th:nth-child(2),
.career-tables-row .career-table td:nth-child(2) {
    width: 60%;
}

@media (max-width: 768px) {
    .career-tables-row {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 20px;
    }

    .career-tables-row .career-table-wrap {
        width: 100%;
        flex: none;
        max-width: 100%;
    }

    .career-tables-row .career-table {
        min-width: 620px;
    }
}

/* Career table: role, JD preview and application action. */
.career-table {
    width: 100%;
    table-layout: fixed;
}

.career-table th:nth-child(1),
.career-table td:nth-child(1) {
    width: 38%;
}

.career-table th:nth-child(2),
.career-table td:nth-child(2) {
    width: 37%;
}

.career-table th:nth-child(3),
.career-table td:nth-child(3) {
    width: 25%;
}

.career-preview-btn,
.career-apply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem .85rem;
    border-radius: 7px;
    border: 1px solid #008080;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.career-preview-btn {
    background: #fff;
    color: #008080;
}

.career-apply-btn {
    background: #008080;
    color: #fff !important;
}

.career-preview-btn:hover,
.career-apply-btn:hover {
    background: #006666;
    color: #fff !important;
}

.career-jd-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(15, 23, 42, .7);
}

.career-jd-modal.open {
    display: flex;
}

.career-jd-dialog {
    width: min(950px, 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    z-index: 2000;
    margin-top: 4rem;
}

.career-jd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    background: #008080;
    color: #ffffff;
}

.career-jd-header h2 {
    margin: 0;
    color: #ffffff !important;
    font-size: 1.2rem;
}

.career-jd-header button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.career-jd-dialog iframe {
    width: 100%;
    height: 65vh;
    border: 0;
    background: #f8fafc;
}

.career-jd-actions {
    padding: .85rem 1rem;
    display: flex;
    justify-content: flex-end;
}

body.career-modal-open {
    overflow: hidden;
}

@media (max-width:700px) {
    .career-jd-modal {
        padding: .75rem;
    }

    .career-jd-dialog iframe {
        height: 68vh;
    }

    .career-table {
        font-size: .9rem;
    }

    .career-preview-btn,
    .career-apply-btn {
        padding: .45rem .6rem;
    }
}