
/* ==========================================
   THE ENGINEERS GROUP - HEADER
   Premium Navy Blue + Gold
   ========================================== */

.teg-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5eaf1;
    box-shadow: 0 3px 16px rgba(11, 31, 58, 0.045);
}

.teg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 94px;
}

/* Brand and logo */
.teg-brand {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

.teg-brand a {
    text-decoration: none;
}

.teg-logo {
    display: flex;
    align-items: center;
    min-width: 0;
}

.teg-logo .custom-logo-link {
    display: inline-flex;
    align-items: center;
    max-width: 300px;
}

.teg-logo .custom-logo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
}

.teg-brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #0b1f3a;
    line-height: 1.25;
}

.teg-brand-name {
    color: #0b1f3a;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.teg-brand-tagline {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Main navigation */
.teg-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    min-width: 0;
}

.teg-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.teg-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.teg-menu > li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #24364d;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.teg-menu > li > a:hover,
.teg-menu > li.current-menu-item > a,
.teg-menu > li.current_page_item > a,
.teg-menu > li.current-menu-ancestor > a {
    background: #f5f8fc;
    color: #a77900;
}

/* Submenus */
.teg-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1001;
    display: none;
    min-width: 220px;
    margin: 0;
    padding: 8px;
    border: 1px solid #e0e7f0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(11, 31, 58, 0.12);
    list-style: none;
}

.teg-menu li:hover > .sub-menu,
.teg-menu li:focus-within > .sub-menu {
    display: block;
}

.teg-menu .sub-menu li {
    margin: 0;
    padding: 0;
}

.teg-menu .sub-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #24364d;
    font-size: 13px;
    text-decoration: none;
}

.teg-menu .sub-menu a:hover {
    background: #f5f8fc;
    color: #a77900;
}

/* Header CTA */
.teg-header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 11px 17px;
    border: 1px solid #e3ad13;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffd34f, #e8a900);
    color: #0b1f3a;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teg-header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(213, 157, 0, 0.2);
    color: #06172f;
}

/* Mobile menu toggle */
.teg-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #0b1f3a;
}

.teg-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: #0b1f3a;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.teg-menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.teg-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.teg-menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

/* Tablet and compact desktop */
@media (max-width: 1050px) {
    .teg-header-inner {
        gap: 16px;
        min-height: 82px;
    }

    .teg-logo .custom-logo-link {
        max-width: 240px;
    }

    .teg-logo .custom-logo {
        max-height: 62px;
    }

    .teg-navigation {
        gap: 10px;
    }

    .teg-menu > li > a {
        padding: 8px;
        font-size: 12px;
    }

    .teg-header-cta {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Mobile navigation */
@media (max-width: 800px) {
    .teg-header {
        z-index: 1000;
    }

    .teg-header-inner {
        position: relative;
        min-height: 76px;
        gap: 12px;
    }

    .teg-logo .custom-logo-link {
        max-width: 230px;
    }

    .teg-logo .custom-logo {
        max-height: 54px;
    }

    .teg-brand-name {
        font-size: 17px;
    }

    .teg-brand-tagline {
        font-size: 10px;
    }

    .teg-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .teg-navigation {
        position: absolute;
        top: calc(100% + 1px);
        right: -14px;
        left: -14px;
        display: none;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        max-height: calc(100vh - 85px);
        padding: 18px 20px 22px;
        overflow-y: auto;
        border-bottom: 1px solid #e0e7f0;
        background: #ffffff;
        box-shadow: 0 15px 25px rgba(11, 31, 58, 0.1);
    }

    .teg-navigation.is-open {
        display: flex;
    }

    .teg-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 3px;
    }

    .teg-menu > li {
        width: 100%;
    }

    .teg-menu > li > a {
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        padding: 11px 12px;
        font-size: 14px;
    }

    .teg-menu .sub-menu {
        position: static;
        display: block;
        min-width: 0;
        margin: 0 0 8px 12px;
        padding: 4px;
        border: 0;
        border-left: 2px solid #f2b51e;
        border-radius: 0;
        background: #f8fafc;
        box-shadow: none;
    }

    .teg-menu .sub-menu a {
        padding: 9px 12px;
    }

    .teg-header-cta {
        width: 100%;
        min-height: 46px;
        font-size: 14px;
    }
}

/* Small mobile devices */
@media (max-width: 420px) {
    .teg-header-inner {
        min-height: 70px;
    }

    .teg-logo .custom-logo-link {
        max-width: 195px;
    }

    .teg-logo .custom-logo {
        max-height: 48px;
    }

    .teg-brand-name {
        font-size: 15px;
    }

    .teg-brand-tagline {
        font-size: 9px;
    }

    .teg-menu-toggle {
        width: 40px;
        height: 40px;
    }
}
