.header-row {
    background: white;
    box-shadow: 0 6px 16px rgba(20, 45, 70, 0.06);
    border-bottom: 1px solid #d9e6f5;
    padding: 0.4rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;      /* allows wrapping on small screens, still row */
    gap: 1.5rem 1rem;
}

/* left side: logo + full name (inline) */
.logo-block {
    padding: 0 0 10px 35px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.tagline {
    font-size: 1rem;
    font-weight: 500;
    color: #2c6e9e;
    background: #eef2ff;
    display: inline-block;
    padding: 6px 12px;
    border-radius: 40px;
    margin-top: 8px;
    letter-spacing: 0.2px;
    border-left: 3px solid #1e88e5;
}
.tagline i {
    font-size: 0.85rem;
    margin-right: 6px;
    color: #0f6b9c;
}

/* ── Centre: skip + partner logos ── */
.header-centre {
    /*display: flex;*/
    align-items: center;
    flex: 1;
    justify-content: center;
}

.skip-link {
    color: var(--accent-color);
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
}
.skip-link:hover { text-decoration: underline; }

.header-partner-logos {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Department of Health Research emblem */
.dhr-block {
    display: flex;
    align-items: center;
}

.dhr-emblem {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.42rem; color: #555; text-align: center; padding: 4px;
    overflow: hidden; gap: 8px;
}

.dhr-text {
    display: flex; flex-direction: column;
    font-size: 0.6rem; color: #222;
    line-height: 1.3;
    text-transform: uppercase; letter-spacing: 0.03em;
}

.dhr-text strong { font-size: 0.62rem; color: var(--icmr-navy); }

/* Circular badges (rashtriya, etc.) */
.badge-rashtriya {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

/* Glasses/vision icon badge */
.badge-vision {
    width: 90px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
/* ----- navigation bar (main menu) ----- */
.navbar {
    background: #ffffff;
    border-top: 1px solid #dde7f0;
    border-bottom: 1px solid #dde7f0;
    box-shadow: 0 2px 4px rgba(0,20,40,0.02);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.main-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    align-items: center;
    margin: 0 0.5rem 0 0;   /* push menu to the right within flex row */
}

.main-menu > li {
    position: relative;
}

.main-menu > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 1rem 1.9rem;
    font-weight: 800;
    font-size: 20px;
    color: #1a405e;
    border-radius: 30px;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.main-menu > li > a i {
    font-size: 0.8rem;
    color: #738ea8;
    transition: transform 0.2s;
}

.main-menu > li > i {
    font-size: 10px;
}

.main-menu > li:hover > a {
    background: #e5f0fe;
    color: #0a314b;
}

.main-menu > li:hover > a i {
    /* transform: rotate(180deg); */
    color: #0a314b;
}

/* dropdown submenu — sleek & accessible */
.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    box-shadow: 0 18px 30px -8px rgba(17, 55, 80, 0.2), 0 6px 12px rgba(0,20,30,0.1);
    border: 1px solid #e5eef9;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.3s, visibility 0.25s;
    backdrop-filter: blur(2px);
    z-index: 100;
}

.main-menu > li:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(4px);
}

/* submenu links (two columns for long lists) */
.dropdown-content .sub-grid {
    display: flex;
    gap: 1rem;
}

.sub-column {
    display: flex;
    flex-direction: column;
    min-width: 130px;
}

.dropdown-content a {
    padding: 0.55rem 1.2rem;
    font-size: 0.98rem;
    color: #1e3a5f;
    text-decoration: none;
    display: block;
    border-radius: 40px;
    transition: 0.15s;
    font-weight: 450;
    white-space: nowrap;
}

.dropdown-content a:hover {
    background: #eef4fc;
    color: #0a2c44;
    font-weight: 500;
    padding-left: 1.7rem;
}

/* small heading inside dropdown (like "About Us" section) */
.dropdown-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #607e9e;
    padding: 0.3rem 1.2rem 0.1rem 1.2rem;
    font-weight: 600;
    border-bottom: 1px dashed #c7d9ec;
    margin-bottom: 5px;
}

/* Nested Dropdown Fix - Centers submenu only shows on Centers hover */

/* The wrapper that contains Centers and its submenu */
.nested-dropdown-wrapper {
    position: relative;
}

/* The Centers link with right arrow */
.nested-dropdown-trigger {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.nested-dropdown-trigger i {
    transition: transform 0.2s ease;
}

.nested-dropdown-wrapper:hover .nested-dropdown-trigger i {
    transform: rotate(-90deg);
}

/* The hidden submenu (Centers dropdown) */
.nested-dropdown-content {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: white;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 18px 30px -8px rgba(17, 55, 80, 0.2), 0 6px 12px rgba(0,20,30,0.1);
    border: 1px solid #e5eef9;
    visibility: hidden;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.25s ease;
    z-index: 100;
    margin-left: 4px;
}

/* Show the submenu ONLY when hovering over the wrapper */
.nested-dropdown-wrapper:hover .nested-dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(4px);
}

/* Style the submenu links */
.nested-dropdown-content a {
    padding: 0.55rem 1.2rem;
    font-size: 0.98rem;
    color: #1e3a5f;
    text-decoration: none;
    display: block;
    border-radius: 40px;
    transition: 0.15s;
    font-weight: 450;
    white-space: nowrap;
}

.nested-dropdown-content a:hover {
    background: #eef4fc;
    color: #0a2c44;
    font-weight: 500;
    padding-left: 1.7rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nested-dropdown-content {
        position: static;
        display: none;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f0f5fb;
        width: 100%;
        padding-left: 1.5rem;
        margin-left: 0;
        border-radius: 8px;
    }
    
    .nested-dropdown-wrapper:hover .nested-dropdown-content {
        display: block;
        transform: none;
    }
    
    .nested-dropdown-trigger i {
        transform: rotate(0deg);
    }
    
    .nested-dropdown-wrapper:hover .nested-dropdown-trigger i {
        transform: rotate(90deg);
    }
}

/* divider line */
.divider-light {
    height: 1px;
    background: linear-gradient(to right, #c7d9ec, transparent);
    margin: 8px 16px;
}

/* right corner – mini cta / contact */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fas.fa-chevron-down {
    font-size: 10px;
}

/* ----- Header & Navigation Responsive ----- */

/* Tablets and Desktop (Under 1200px) */
@media (max-width: 1200px) {
    .header-row {
        padding: 0.5rem 1.5rem;
        justify-content: center; /* Center everything if it wraps */
    }

    .header-partner-logos {
        gap: 30px; /* Tighten logo spacing */
    }

    .main-menu > li > a {
        padding: 0.8rem 1rem;
        font-size: 16px; /* Slightly smaller font */
    }
}

/* Tablets (Under 992px) */
@media (max-width: 992px) {
    .header-centre {
        order: 3; /* Move partner logos below logo-block and nav-right */
        width: 100%;
        margin-top: 1rem;
    }

    .logo-block {
        padding-left: 0;
        justify-content: center;
    }

    .navbar {
        overflow-x: auto; /* Allow menu to scroll horizontally if it overflows */
        -webkit-overflow-scrolling: touch;
    }

    .nav-container {
        justify-content: center;
    }

    .main-menu {
        flex-wrap: nowrap; /* Prevent menu from breaking into 2 rows */
        padding: 0 1rem;
    }
}

/* Mobile Devices (Under 768px) */
@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-partner-logos {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tagline {
        font-size: 0.9rem;
        padding: 4px 10px;
    }

    /* Dropdown adjustment for touch */
    .dropdown-content {
        position: static; /* Let dropdowns push content down instead of floating */
        display: none; 
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        border: none;
        background: #f8fbff;
        width: 100%;
    }

    /* Show dropdown on click/hover for mobile */
    .main-menu > li:hover .dropdown-content {
        display: block;
        transform: none;
    }

    .dropdown-content .sub-grid {
        flex-direction: column;
        gap: 0;
    }
}

/* Small Mobile (Under 480px) */
@media (max-width: 480px) {
    .dhr-text {
        display: none; /* Hide text, keep emblem to save space */
    }

    .badge-vision {
        width: 70px;
    }

    .main-menu > li > a {
        padding: 0.8rem 0.6rem;
        font-size: 14px;
    }
    
    .logo-block {
        gap: 10px;
    }
}
