/* =========================================================
   MOH Portal - main stylesheet (cleaned & de-duplicated)
   ========================================================= */

:root {
    --moh-primary: #3d1bd4;       /* deep health green */
    --moh-primary-dark: #1a65f2;
    --moh-accent: #C8912B;        /* warm gold accent */
    --moh-secondary: rgb(49, 184, 237);
    --moh-bg: #F6F8F7;
    --moh-text: #1E2A26;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--moh-text);
    background: var(--moh-bg);
}

/* =========================================================
   HEADER (social bar + brand topbar + main nav)
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030; /* above hero/page content, below modals */
}

.topbar {
    background: var(--moh-primary-dark);
    color: #fff;
    font-size: .8rem;
    min-height: 64px;          /* was height: 90px */
    padding: .35rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.lang-link { color: rgba(255,255,255,.75); text-decoration: none; font-weight: 600; }
.lang-link.active, .lang-link:hover { color: #fff; }
.dashboard-topbar .lang-link { color: var(--moh-primary); }
.dashboard-topbar .lang-link.active { color: var(--moh-primary-dark); text-decoration: underline; }

.topbar-brand {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;              /* lets the text shrink instead of overflowing */
}
.topbar-logo {
    height: clamp(44px, 12vw, 80px);   /* was 80px */
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    background: var(--moh-primary-dark);
    border-radius: 2px;
    padding: 1px;
}
.topbar-brand-text {
    color: #fff;
    font-weight: 700;
    font-size: clamp(.9rem, 4vw, 1.55rem);  /* was 1.55rem */
    line-height: 1.15;
    letter-spacing: .01em;
}
.topbar-link {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.topbar-link:hover { color: #f9f6f6; }

.main-nav {
    padding-top: .3rem;
    padding-bottom: .3rem;
    background: var(--moh-primary-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0);
    transition: box-shadow .2s ease;
}
.main-nav.is-stuck { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.main-nav .nav-link {
    font-weight: 600;
    color: var(--moh-text);
    font-size: .80rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .5rem .85rem;
}
.main-nav .nav-link:hover, .main-nav .nav-link.active { color: var(--moh-primary); } /* =========================================================
   BUTTONS
   ========================================================= */

.btn-primary { background-color: var(--moh-primary); border-color: var(--moh-primary); }
.btn-primary:hover { background-color: var(--moh-primary-dark); border-color: var(--moh-primary-dark); }

/* Home page: header overlays the full-screen hero and slides away.
   (body.has-hero is set only by the home view.) */
body.has-hero .site-header {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 1030;
    transition: transform .35s ease;
}
body.has-hero .site-header.header-hidden {
    transform: translateY(-100%);
}

/* =========================================================
   HERO (fallback when there are no slides)
   ========================================================= */
.hero {
    
    color: #fff;
    padding: 5rem 0;
}

/* ===== HERO CAROUSEL (full screen) ===== */
section.hero-carousel { position: relative; overflow: hidden; }

section.hero-carousel,
section.hero-carousel #heroCarousel,
section.hero-carousel .carousel-inner,
section.hero-carousel .carousel-item {
    height: 100vh !important;
    height: 100svh !important;
    min-height: 480px;
    max-height: none !important;
}

.hero-slide-img {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
}

/* =========================================================
   GENERIC COMPONENTS
   ========================================================= */
.card-tile {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: transform .15s ease;
}
.card-tile:hover { transform: translateY(-3px); }

.badge-status-applied { background: #6c757d; }
.badge-status-shortlisted { background: #0d6efd; }
.badge-status-interview_scheduled { background: #C8912B; }
.badge-status-accepted { background: #198754; }
.badge-status-rejected { background: #dc3545; }

.job-deadline-badge { background: var(--moh-accent); color: #fff; }
.progress-bar { background-color: var(--moh-primary); }

.site-footer { background: var(--moh-primary-dark); color: #fff; margin-top: 4rem; }
.site-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* =========================================================
   MISSION PILLARS
   ========================================================= */
.mission-section { background: #EAEFEC; padding: 4.5rem 0; }

.mission-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 767px) {
    .mission-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

.mission-item {
    background: linear-gradient(160deg, rgb(52, 52, 236) 0%, var(--moh-primary-dark) 50%);
    border-radius: 16px;
    padding: 2.25rem 1.5rem 2rem;
    box-shadow: 0 10px 24px rgba(206, 221, 216, .18);
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease;
}
.mission-item:hover {
    background: linear-gradient(160deg, rgb(87, 12, 161) 0%, var(--moh-secondary) 50%);
    box-shadow: 0 16px 34px rgba(7,63,50,.26);
}

.mission-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--moh-primary-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    transition: transform .25s ease, background-color .25s ease;
}
.mission-icon svg { width: 52px; height: 52px; }
.mission-item:hover .mission-icon { transform: translateY(-4px); }

.mission-item p {
    font-weight: 500;
    line-height: 1.55;
    margin: 0;
    color: rgba(255,255,255,.92);
}

/* =========================================================
   LEADERSHIP
   ========================================================= */
.leadership-section { padding: 4.5rem 0 5rem; }
.leadership-heading { color: rgb(52, 52, 236); font-weight: 700; margin-bottom: 2rem; }

.leader-track-wrap { position: relative; }

.leader-track {
    display: flex;
    align-items: flex-end;
    gap: 1.75rem;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    padding: 2.5rem 1rem;
    margin: -1.5rem -1rem 0;
    scrollbar-width: none;
}
.leader-track::-webkit-scrollbar { display: none; }

.leader-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--moh-primary);
    box-shadow: 0 4px 14px rgba(7,63,50,.22);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    transition: background-color .2s ease, transform .2s ease;
}
.leader-nav:hover { background: var(--moh-primary); color: #fff; }
.leader-nav svg { width: 20px; height: 20px; }
.leader-nav-prev { left: -6px; }
.leader-nav-next { right: -6px; }

.leader-card {
    position: relative;
    flex: 0 0 250px;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(7,63,50,.12);
    transition: box-shadow .3s ease, transform .3s ease;
}
.leader-card:hover,
.leader-card:focus-within { transform: translateY(-6px); }

.leader-card.is-near,
.leader-card:focus-within {
    box-shadow: 0 30px 55px rgba(7,63,50,.35), 0 0 0 3px rgba(200,145,43,.6);
    z-index: 3;
}

.leader-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
    transition: transform .6s cubic-bezier(.34,1.56,.64,1);
}

.leader-card .leader-accent {
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--moh-accent), #f0c766);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s ease;
}
.leader-card:hover .leader-accent,
.leader-card:focus-within .leader-accent { transform: scaleX(1); }

.leader-card .leader-caption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.75rem 1.1rem 1rem;
    background: linear-gradient(to top, rgba(7,63,50,.96) 25%, rgba(7,63,50,0) 100%);
    color: #fff;
}
.leader-caption .leader-name {
    font-weight: 560;
    font-size: .80rem;
    margin: 0 0 .2rem;
    letter-spacing: .01em;
    line-height: 1;
    color: #fff;
}
.leader-caption .leader-title {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(212, 234, 85, .88);
    margin: 0;
}

.leader-dots { display: flex; gap: .45rem; justify-content: center; margin-top: 1.25rem; }
.leader-dots button {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #D8DFDC;
    cursor: pointer;
    transition: background-color .25s ease, width .25s ease;
}
.leader-dots button.active { background: var(--moh-primary); width: 24px; border-radius: 5px; }

/* =========================================================
   DEPARTMENT DETAIL PAGE
   ========================================================= */
.dept-detail { padding: 3.5rem 0 4.5rem; }

.dept-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--moh-text);
    font-size: 2.25rem;
    line-height: 1.2;
    margin-bottom: 1.75rem;
}
@media (max-width: 767px) { .dept-title { font-size: 1.6rem; } }

.dept-lead {
    color: #6b7570;
    font-size: 1.05rem;
    line-height: 1.85;
    max-width: 900px;
    margin-bottom: 2.75rem;
}
.dept-units-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 1rem;
    color: var(--moh-primary);
    margin-bottom: 1.25rem;
}
.dept-units-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.dept-unit { display: flex; align-items: center; gap: .9rem; }
.dept-unit-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--moh-primary);
    transition: transform .15s ease, background-color .15s ease;
}
.dept-unit-label { font-size: 1.05rem; font-weight: 500; color: var(--moh-primary-dark); }
.dept-unit:hover .dept-unit-icon { background: var(--moh-accent); transform: scale(1.1); }

/* =========================================================
   NESTED DROPDOWN ("Systems" menu)
   ========================================================= */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
}
.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu.show > .dropdown-menu { display: block; }
.dropdown-submenu > a.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.dropdown-submenu > a.dropdown-toggle::after { transform: rotate(-90deg); }

@media (max-width: 991.98px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        margin-left: 1rem;
        border: none;
        box-shadow: none;
        display: none;
    }
    .dropdown-submenu.show > .dropdown-menu { display: block; }
}

/* =========================================================
   ORGANISATION STRUCTURE PAGE
   ========================================================= */
.org-structure-page { background: var(--moh-bg); padding: 1rem 0 2rem; }
.org-structure-title {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--moh-primary);
    font-size: 2rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 767px) { .org-structure-title { font-size: 1.5rem; } }

.org-structure-frame {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(7,63,50,.08);
    max-width: 1000px;
    margin: 0 auto;
    border-top: 4px solid var(--moh-accent);
}
.org-structure-frame img { display: block; margin: 0 auto; border-radius: 8px; width: 100%; }

/* =========================================================
   ABOUT US PAGE
   ========================================================= */
.about-hero {
    background: linear-gradient(135deg, var(--moh-primary) 0%, var(--moh-primary-dark) 100%);
    color: #fff;
    padding: 4rem 0 7rem;
}
.about-hero h1 { font-weight: 800; text-transform: uppercase; }
.about-hero .subtitle { color: rgba(255,255,255,.8); }

.about-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(7,63,50,.15);
    margin-top: -5rem;
    position: relative;
    overflow: hidden;
}
.about-img-wrap { height: 100%; min-height: 340px; }
.about-img-wrap img {
    width: 100%;
    height: 20%;
    min-height: 250px;
    display: block;
}
.about-caption {
    padding: .85rem 1.25rem;
    font-weight: 700;
    color: var(--moh-primary-dark);
    background: #F6F8F7;
}
.about-content { padding: 3rem 2.5rem; }
.about-quote-icon { font-size: 3rem; color: var(--moh-accent); line-height: 1; font-family: Georgia, serif; }
.about-eyebrow {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: var(--moh-primary);
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: .75rem 0 .5rem;
}
.about-content h2 { font-weight: 800; margin-bottom: 1rem; }
.about-content p { color: #5a6660; line-height: 1.8; white-space: pre-line; }

@media (max-width: 991px) {
    .about-card { margin-top: -2rem; }
    .about-img-wrap { min-height: 260px; }
}

/* =========================================================
   SOCIAL FEEDS
   ========================================================= */
.social-feeds-section { background: #2d4373; color: #fff; }
.social-feeds-heading {
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.35);
}

/* =========================================================
   LOCATION / FIND US MAP
   ========================================================= */
.location-map-section .heading-divider {
    width: 60px;
    height: 3px;
    background: var(--moh-green, #0f7a3d);
    margin-top: 2px;
    margin-bottom: 4px;
}
.map-embed-wrapper {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}
.location-address-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.location-address-card i { font-size: 2rem; color: var(--moh-green, #0f7a3d); margin-bottom: 12px; }
.location-address-card p { margin: 0; color: #333; line-height: 1.6; }

.footer-map-wrapper { border-radius: 8px; overflow: hidden; width: 280px; max-width: 100%; }
.footer-map-wrapper iframe { display: block; width: 100%; height: 180px; }

/* =========================================================
   BACK TO TOP BUTTON
   ========================================================= */
#backToTopBtn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: var(--moh-green, #0f7a3d);
    color: #fff;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background .2s ease;
    z-index: 1050;
    cursor: pointer;
}
#backToTopBtn.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTopBtn:hover { background: var(--moh-green-dark, #0b5c2e); }
@media (max-width: 576px) {
    #backToTopBtn { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    .hero-slide-img { animation: none !important; }
    body.has-hero .site-header { transition: none; }
    .leader-card,
    .leader-card img,
    .leader-card .leader-accent,
    .mission-icon { transition: none !important; }
    .leader-card { transform: none !important; }
}

html, body { overflow-x: hidden; }
section.hero-carousel { width: 100%; max-width: 100vw; }

@media (max-width: 767.98px) {
    .mission-grid,
    #leaderTrack.mission-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        overflow: visible;
        padding: 0;
    }

    .mission-item,
    #leaderTrack .leader-card {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }

    #leaderTrack .leader-card { flex: none; aspect-ratio: 3 / 4; }
    #leaderTrack .leader-caption .leader-name { font-size: .95rem; }
    #leaderTrack .leader-caption .leader-title { font-size: 1.1rem; }

    .leader-dots,
    .leader-nav { display: none !important; }
}
/* keep the header in place and above the backdrop while the menu is open */
.site-header:has(.offcanvas.show) {
    transform: none !important;
    z-index: 1060;
}

@media (max-width: 991.98px) {
    #mainMenu { width: 280px; max-width: 85vw; }
    #mainMenu .nav-link { padding: .75rem .5rem; color: var(--moh-text); }
}
@media (max-width: 991.98px) {
    .main-nav .container,
    .main-nav .container-fluid {
        justify-content: flex-start;
    }
    .main-nav .navbar-toggler {
        margin-right: auto;   /* pushes it to the left edge */
        margin-left: 0;
    }
}
@media (min-width: 992px) {
    .navbar .nav-item.dropdown:hover > .dropdown-menu { display: block; margin-top: 0; }
}
.navbar .dropdown-menu { min-width: 220px; }

/* only the departments list can be long, so only it scrolls */
#departmentsDropdown + .dropdown-menu {
    max-height: 70vh;
    overflow-y: auto;
    min-width: 260px;
}
.navbar .dropdown-item { white-space: normal; }
.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    background-color: #311afe;
    color: #fff;
}
.navbar .dropdown-menu .dropdown-item:active,
.navbar .dropdown-menu .dropdown-item.active {
    background-color: #2d30e6;
    color: #fff;
}
.dropdown-submenu > .dropdown-menu,
#systemsDropdown + .dropdown-menu {
    overflow: visible;
    max-height: none;
}
.news-card .card-img-top,
.news-card img {
    width: 100%;
    height: 280px;       /* was probably ~180px */
    object-fit: cover;
    object-position: center 20%;
}
.news-card {
    border-radius: 20px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,.15);
}
.news-card-img {
    display: block;
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center;
}
.news-card-body { padding: 1.75rem 2rem; }
.news-card-title { font-size: 1.5rem; line-height: 1.3; margin-bottom: 1rem; }
.news-card-link { font-size: 1.1rem; font-weight: 600; }

@media (max-width: 575.98px) {
    .news-card-img { height: 240px; }
    .news-card-title { font-size: 1.25rem; }
}