/* ===============================
   GLOBAL
================================ */

body{
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background: linear-gradient(
        rgba(255,255,255,0.3),
        rgba(255,255,255,0.3)
    );
    overflow-x: hidden;
}

.nlhdr-main{
    background: #ffffff;
    border-bottom: 1px solid #e7e7e7;
    top: 0;
    overflow: visible;
    position: relative;
    z-index: 1000;
    padding-bottom: 6px; 
    padding-top: 6px; 
}

.nlhdr-wrapper{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 6000;
}

/* ===============================
   NAV CONTAINER
================================ */
/* ==========================================
   TWO-ROW HEADER LAYOUT
   ========================================== */

.nlhdr-nav-container{
    position: relative;
    z-index: 50;

    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;

    max-width: 1850px;
    margin: 0 auto;

    /* top right bottom left */
    padding: 10px clamp(12px, 2vw, 20px)
             4px clamp(12px, 5vw, 90px);

    /* minimal space between row 1 and row 2 */
    row-gap: 0;
}

/* ------------------------------------------
   LEFT SECTION
------------------------------------------ */
.nlhdr-brand-left{
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    
}

/* ------------------------------------------
   CENTER TITLE - ABSOLUTELY CENTERED
------------------------------------------ */
.nlhdr-brand-center{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1.1;
    z-index: 10;
    pointer-events: none;
    margin-left: 0;
}

/* ------------------------------------------
   FIRST ROW NAVIGATION
------------------------------------------ */
.nlhdr-main nav{
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: auto;
    align-self: end;
    padding-top: 0;
    padding-bottom: 0;

}

/* Move second row upward, but less */
.nlhdr-header-row-2{
    transform: translateY(-2px);
}
/* ------------------------------------------
   SECOND ROW NAVIGATION
------------------------------------------ */
.nlhdr-header-row-2{
    grid-column: 3 / 4;
    grid-row: 2;

    display: flex;
    align-items: center;

    width: fit-content;
    margin-left: auto;

    min-height: 18px;

    /* Push the second row slightly downward */
    margin-top: 8px;

    /* Ensure no previous transform affects it */
    transform: none;
}

.nlhdr-nav-menu-secondary{
    margin: 0;
    padding: 0;
    gap: clamp(8px, 1.2vw, 22px); /* same as first row */
}

.nlhdr-nav-menu-secondary a{
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
}

/* ------------------------------------------
   SEARCH ICON - CENTERED ACROSS BOTH ROWS
------------------------------------------ */
.nlhdr-search{
    grid-column: 4;
    grid-row: 1 / 3;      /* span both rows */

    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;

    border-left: 1px solid rgba(0,0,0,0.15);
    padding-left: 8px;
    margin-left: 8px;
    margin-right: -8px;
}

/* ------------------------------------------
   KEEP TEXT ON ONE LINE
------------------------------------------ */
.nlhdr-iit-text,
.nlhdr-brand-center,
.nlhdr-nav-menu a{
    white-space: nowrap;
}

/* ===============================
   LEFT SIDE (LOGOS + IIT TEXT)
================================ */

.nlhdr-brand-left{
    grid-column: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}



.nlhdr-logo-iit{
    height: clamp(42px, 4vw, 60px);
}

.nlhdr-iit-text{
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.nlhdr-iit-en{
    font-size: clamp(0.9rem, 1.2vw, 1.25rem);
    font-weight: 600;
}

.nlhdr-iit-hi{
    font-size: clamp(0.9rem, 1.2vw, 1.25rem);
    color: #6b7280;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

/* ===============================
   CENTER TITLE
================================ */

.nlhdr-brand-center{
    position: absolute;
    left: 50%;
    top: 50%;                 /* move upward */
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1.1;
    z-index: 10;
    pointer-events: none;
    margin-left: 0;
}

.nlhdr-library-en{
    font-size: clamp(0.55rem, 1.2vw, 1.35rem);
    font-weight: 600;
}

.nlhdr-library-hi{
    font-size: clamp(0.45rem, 1.2vw, 1.25rem);
    color: #6b7280;
    font-family: 'Noto Sans Devanagari', sans-serif;
}

/* ===============================
   RIGHT SIDE NAVIGATION
================================ */

.nlhdr-main nav{
    grid-column: 3;
    justify-self: end;
    margin-left: auto;
    align-self: center;
}

/* NAV MENU */

.nlhdr-nav-menu{
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 22px);
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.nlhdr-search{
    border-left: 1px solid rgba(0,0,0,0.15);
    padding-left: 0px;
    margin-right: -8px;
    margin-left: 8px;
}

.nlhdr-nav-menu a{
    text-decoration: none;
    color: #1a1a1a;
    font-size: clamp(0.65rem, 1vw, 1.05rem);
    font-weight: 500;
    white-space: nowrap;
}

/* ===============================
   MEGA MENU
================================ */

.nlhdr-mega-parent{
    position: relative;
}

.nlhdr-search-overlay.active .nlhdr-nalanda-search{
    top: auto;
    left: auto;
    transform: translate(-50%, -160%);
    margin-top: 30px;
    width: 100%;
    max-width: 900px;
}

.nlhdr-mega-menu{
    position: absolute;
    top: 100%;
    z-index: 9999;
    
    transform: translateX(-78%) scale(1);
    padding: 25px;
    width: auto;
    max-width: 90vw;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transition: .20s;
}

.nlhdr-mega-parent:hover .nlhdr-mega-menu{
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-78%)scale(1);
}
.nlhdr-mega-parent::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 8px;
}
.nlhdr-mega-parent:hover .nlhdr-mega-menu,
.nlhdr-mega-menu:hover{
    opacity: 1;
    pointer-events: auto;
}

/* ===============================
   MEGA MENU GRID
================================ */

.nlhdr-mega-grid{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 280px;
    gap: 20px;
    justify-content: start;
}

/* ===============================
   MEGA MENU COLUMN
================================ */

.nlhdr-menu-col h4{
    font-size: 1.10rem;
    color: #6b7280;
    margin-bottom: 15px;
}

/* ===============================
   MENU ITEM
================================ */

.nlhdr-menu-item{
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    transition: .2s;
    cursor: pointer;
}

.nlhdr-menu-item:hover{
    background: #f3f4f6;
}

.nlhdr-menu-item strong{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: clamp(0.85rem, 0.95vw, 1rem);
    line-height: 1.25;
}

.nlhdr-menu-item p{
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ===============================
   ICON
================================ */

.nlhdr-icon{
    width: 34px;
    height: 34px;
    background: #eef0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.10rem;
    color: #333;
    flex-shrink: 0;
}