/* =========================================
   SECRETARIAT ADMINISTRATION DEPARTMENT
   HEADER DESIGN
========================================= */

:root {
    --header-blue: #162f6a;
    --header-text: #170d0d;
    --header-border: #e5e5e5;
    --header-background: #ffffff;

    /* CHANGE SEARCH BOX WIDTH HERE */
    --search-width: 300px;
}


/* =========================================
   MAIN HEADER
========================================= */

.department-header {
    width: 100%;
    min-height: 188px;

    background: var(--header-background);

    border-top: 2px solid var(--header-border);
    border-bottom: 1px solid var(--header-border);

    display: flex;
    align-items: center;

    padding: 0;
    margin: 0;

    box-sizing: border-box;
}

.header-main {
    width: 100%;
    max-width: 1800px;
    min-height: 186px;

    margin: 0 auto;
    padding: 20px 6.2%;

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

    gap: 30px;

    box-sizing: border-box;
}


/* =========================================
   GOVERNMENT BRANDING
========================================= */

.brand-section {
    display: flex;
    align-items: center;

    gap: 24px;

    /*
       Keep branding independent of search box width.
    */
    flex: 0 0 auto;

    min-width: 0;
}

.emblem-logo {
    width: 66px;
    height: 106px;

    object-fit: contain;

    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
}

.government-name {
    color: var(--header-text);

    font-size: 20px;
    font-weight: 400;
    line-height: 1.25;

    margin: 0 0 5px;

    white-space: nowrap;
}

.department-name {
    color: var(--header-text);

    font-size: 27px;
    font-weight: 700;
    line-height: 1.2;

    margin: 0;

    white-space: nowrap;
}


/* =========================================
   SEARCH, STATE LOGO AND HEADER TOOLS
========================================= */

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    /*
       Use remaining space without forcing
       the branding text to resize.
    */
    flex: 1 1 auto;

    min-width: 0;

    gap: 30px;
}


/* =========================================
   SEARCH BOX
========================================= */

.search-box {
    width: var(--search-width);
    height: 50px;

    /*
       Prevent automatic growing or shrinking.
    */
    flex: 0 0 var(--search-width);

    min-width: 0;

    display: flex;
    align-items: center;

    border: 1px solid #e8e8e8;
    border-bottom: 3px solid var(--header-blue);

    border-radius: 4px 4px 0 0;

    background: #ffffff;

    box-sizing: border-box;

    margin: 0;
    padding: 0;
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 100%;

    flex: 1 1 auto;

    padding: 0 12px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--header-text);

    font-size: 16px;
    font-family: inherit;

    box-sizing: border-box;
}

.search-box input::placeholder {
    color: #343434;
    opacity: 1;
}

.search-box input:focus-visible {
    outline: 2px solid var(--header-blue);
    outline-offset: -3px;
}

.search-box button {
    width: 40px;
    height: 100%;

    flex: 0 0 40px;

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

    padding: 0;

    border: none;
    background: transparent;

    color: var(--header-blue);

    font-size: 26px;

    cursor: pointer;
}

.search-box button:hover {
    color: #0b204d;
}

.search-box button:focus-visible {
    outline: 2px solid var(--header-blue);
    outline-offset: -3px;
}


/* =========================================
   MEGHALAYA GOVERNMENT LOGO
========================================= */

.department-logo {
    width: auto;
    max-width: 200px;
    height: 106px;

    object-fit: contain;

    flex: 0 0 auto;
}


/* =========================================
   HEADER TOOLS
========================================= */

/* HEADER TOOLS */
.header-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 0 0 auto;
}

/* SKIP AND ACCESSIBILITY ICONS */
.header-tool {
    width: 40px;
    height: 45px;

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

    padding: 0;
    background: transparent;
    border: none;

    color: var(--header-blue);
    font-size: 30px; /* ICON SIZE */

    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

/* HOVER EFFECT */
.header-tool:hover {
    color: #0b204d;
}

/* KEYBOARD FOCUS */
.header-tool:focus-visible {
    outline: 2px solid var(--header-blue);
    outline-offset: 4px;
}

/* VERTICAL DIVIDER */
.header-tool-divider {
    width: 2px;
    height: 40px; /* DIVIDER HEIGHT */

    background: var(--header-blue);
    display: block;
    flex-shrink: 0;
}


/* =========================================
   MAIN NAVIGATION
========================================= */

.main-navigation {
    width: 100%;
    min-height: 52px;

    padding: 0;
    margin: 0;

    background: #ffffff;

    border-bottom: 1px solid var(--header-border);

    position: relative;
    z-index: 1000;
}

.nav-container {
    width: 100%;
    max-width: 1800px;

    min-height: 52px;

    margin: 0 auto;
    padding: 0 6.2%;

    box-sizing: border-box;
}


/* =========================================
   NAVIGATION MENU
========================================= */

.main-menu {
    display: flex;
    align-items: stretch;
    justify-content: space-between;

    width: 100%;
    min-height: 51px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.main-menu > .nav-item {
    display: flex;
    align-items: stretch;
    justify-content: center;

    position: relative;
}

.main-menu > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 51px;

    padding: 10px 12px;

    color: var(--header-text);

    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;

    text-decoration: none;
    white-space: nowrap;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}


/* HOME LINK */

.main-menu > .nav-item:first-child > .nav-link {
    color: var(--header-blue);
}


/* NAVIGATION HOVER */

.main-menu > .nav-item > .nav-link:hover,
.main-menu > .nav-item > .nav-link:focus-visible,
.main-menu > .nav-item > .nav-link.show {
    color: var(--header-blue);

    background: #f0f3fa;
}

.main-menu > .nav-item > .nav-link:focus-visible {
    outline: 2px solid var(--header-blue);
    outline-offset: -3px;
}


/* =========================================
   DROPDOWN ARROWS
========================================= */

.main-menu .dropdown-toggle::after {
    display: inline-block;

    margin-left: 7px;
    vertical-align: middle;

    border-top: 5px solid currentColor;
    border-right: 4px solid transparent;
    border-bottom: 0;
    border-left: 4px solid transparent;
}


/* =========================================
   DROPDOWN MENUS
========================================= */

.main-menu .dropdown-menu {
    min-width: 230px;

    padding: 8px 0;
    margin: 0;

    border: 1px solid #e3e8e8;
    border-top: 3px solid var(--header-blue);

    border-radius: 0 0 5px 5px;

    background: #ffffff;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

.main-menu .dropdown-item {
    padding: 11px 18px;

    color: var(--header-text);
    background: #ffffff;

    font-size: 16px;
    font-weight: 500;

    white-space: normal;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.main-menu .dropdown-item:hover,
.main-menu .dropdown-item:focus {
    color: var(--header-blue);
    background: #eef2fc;
}
/* Custom dropdown arrow */
.main-navigation .dropdown-arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.25s ease;
}

/* Rotate arrow when any dropdown opens */
.main-navigation .nav-item.dropdown.show > .dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}


/* =========================================
   MOBILE MENU BUTTON
========================================= */

.main-navigation .navbar-toggler {
    padding: 7px 10px;

    border: 1px solid var(--header-blue);
    border-radius: 4px;

    box-shadow: none;
}

.main-navigation .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(22, 47, 106, 0.15);
}

.main-navigation .navbar-toggler-icon {
    background-image: url(
        "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23162f6a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"
    );
}


/* =========================================
   SMALL LAPTOPS
========================================= */

@media (max-width: 1400px) {

    .header-main {
        padding-left: 3%;
        padding-right: 3%;

        gap: 24px;
    }

    .brand-section {
        gap: 16px;
    }

    .government-name {
        font-size: 20px;
    }

    .department-name {
        font-size: 25px;
    }

    .header-actions {
        gap: 18px;
    }

    /*
       Search width remains independent.
       Change --search-width to resize it.
    */

.department-logo {
        width: auto;
        max-width: 200px;
        height: 106px;

        object-fit: contain;

        flex: 0 0 auto;
    }

    .header-tools {
        gap: 17px;
    }

    .nav-container {
        padding-left: 3%;
        padding-right: 3%;
    }

    .main-menu > .nav-item > .nav-link {
        font-size: 20px;

        padding-left: 9px;
        padding-right: 9px;
    }
}


/* =========================================
   TABLETS AND SMALLER LAPTOPS
========================================= */

@media (max-width: 1100px) {

    .department-header {
        min-height: auto;
    }

    .header-main {
        min-height: 150px;

        padding: 18px 25px;

        gap: 20px;
    }

    .brand-section {
        gap: 13px;
    }

    .emblem-logo {
        width: 55px;
        height: 85px;
    }

    .government-name {
        font-size: 18px;
        white-space: normal;
    }

    .department-name {
        font-size: 22px;
        white-space: normal;
    }

    .header-actions {
        gap: 12px;
    }

.department-logo {
        width: auto;
        max-width: 200px;
        height: 85px;

        object-fit: contain;

        flex: 0 0 auto;
    }

    .header-tools {
        gap: 10px;
    }

    .header-tool {
        width: 35px;
        height: 42px;

        font-size: 30px;
    }

    .header-tool-divider {
        height: 38px;
    }

    .nav-container {
        padding: 0 25px;
    }

    .main-menu > .nav-item > .nav-link {
        font-size: 17px;

        padding: 10px 7px;
    }
}


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

@media (max-width: 767px) {

    .department-header {
        min-height: auto;
    }

    .header-main {
        min-height: auto;

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

        gap: 16px;

        padding: 16px;
    }

    .brand-section {
        width: 100%;

        flex: 0 0 auto;

        gap: 13px;
    }

    .emblem-logo {
        width: 45px;
        height: 70px;
    }

    .government-name {
        font-size: 18px;
        line-height: 1.25;

        margin-bottom: 4px;
    }

    .department-name {
        font-size: 21px;
        line-height: 1.25;
    }

    .header-actions {
        width: 100%;

        flex: 0 0 auto;

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

        gap: 12px;
    }

    /*
       Mobile search box has its own width.
       It does not resize the branding text.
    */

    .search-box {
        width: 180px;
        height: 45px;

        flex: 0 1 180px;

        min-width: 120px;
    }

    .search-box input {
        font-size: 15px;

        padding: 0 10px;
    }

    .search-box button {
        width: 38px;

        flex: 0 0 38px;

        font-size: 24px;
    }

.department-logo {
        width: auto;
        max-width: 200px;
        height: 70px;

        object-fit: contain;

        flex: 0 0 auto;
    }

    .header-tools {
        gap: 10px;
    }

    .header-tool {
        width: 32px;
        height: 38px;

        font-size: 27px;
    }

    .header-tool-divider {
        height: 32px;
    }


    /* MOBILE NAVIGATION */

    .main-navigation {
        min-height: 48px;
    }

    .nav-container {
        padding: 7px 16px;
    }

    .main-navigation .navbar-toggler {
        margin-left: auto;
    }

    .main-navigation .navbar-collapse {
        width: 100%;
        flex-basis: 100%;
    }

    .main-menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        padding: 8px 0;
    }

    .main-menu > .nav-item {
        display: block;

        width: 100%;
    }

    .main-menu > .nav-item > .nav-link {
        width: 100%;
        min-height: 44px;

        display: flex;
        justify-content: space-between;

        padding: 10px 12px;

        font-size: 17px;

        white-space: normal;
    }

    .main-menu .dropdown-menu {
        position: static !important;

        transform: none !important;

        width: 100%;
        min-width: 0;

        margin: 0;
        padding: 4px 0;

        border: none;
        border-left: 3px solid var(--header-blue);

        border-radius: 0;

        box-shadow: none;
    }

    .main-menu .dropdown-item {
        padding: 10px 22px;

        font-size: 15px;
    }
}


/* =========================================
   VERY SMALL MOBILE DEVICES
========================================= */

@media (max-width: 380px) {

    .header-main {
        padding: 12px;
    }

    .emblem-logo {
        width: 38px;
        height: 60px;
    }

    .brand-section {
        gap: 10px;
    }

    .government-name {
        font-size: 16px;
    }

    .department-name {
        font-size: 18px;
    }

.department-logo {
        width: auto;
        max-width: 200px;
        height: 60px;

        object-fit: contain;

        flex: 0 0 auto;
    }

    .header-tools {
        gap: 5px;
    }

    .header-tool {
        width: 28px;

        font-size: 24px;
    }

    .search-box {
        width: 150px;

        flex: 0 1 150px;

        min-width: 120px;
    }
}


/* =========================================
   GAP BETWEEN EMBLEM AND STATE LOGO
   (the gap between the logo and the text is unchanged)
========================================= */

.emblem-logo {
    margin-right: -46px;
}

@media (max-width: 1400px) {
    .emblem-logo {
        margin-right: -8px;
    }
}

@media (max-width: 1100px) {
    .emblem-logo {
        margin-right: -5px;
    }
}

@media (max-width: 380px) {
    .emblem-logo {
        margin-right: -4px;
    }
}