/* ========= FONT FACES (shared across all pages) ========= */
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Thin.ttf') format('truetype'); font-weight: 100; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ThinItalic.ttf') format('truetype'); font-weight: 100; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ExtraLight.ttf') format('truetype'); font-weight: 200; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ExtraLightItalic.ttf') format('truetype'); font-weight: 200; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Light.ttf') format('truetype'); font-weight: 300; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-LightItalic.ttf') format('truetype'); font-weight: 300; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-MediumItalic.ttf') format('truetype'); font-weight: 500; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-SemiBoldItalic.ttf') format('truetype'); font-weight: 600; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-BoldItalic.ttf') format('truetype'); font-weight: 700; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ExtraBoldItalic.ttf') format('truetype'); font-weight: 800; font-style: italic; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Black.ttf') format('truetype'); font-weight: 900; font-style: normal; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-BlackItalic.ttf') format('truetype'); font-weight: 900; font-style: italic; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', Arial, sans-serif;
}

.header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* sticky is a positioned context, so .subnav {position:absolute} anchors to it */
}

.header {
    background-color: #ffffff;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.3s ease;
    user-select: none;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    height: 45px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    color: #0F0F10;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #00599d;
}

.nav-link--active {
    color: #00579D;
}

.lang-flag {
    height: 20px;
    width: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.4;
    filter: grayscale(30%);
    user-select: none;
}

.lang-flag:hover {
    opacity: 0.7;
}

.lang-flag.active {
    opacity: 1;
    filter: grayscale(0%) saturate(1.3);
    transform: scale(1.15);
}

.lang-flag-single {
    height: 20px;
    width: auto;
    margin-left: 10px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    user-select: none;
}

.lang-flag-single:hover {
    opacity: 0.7;
}

.lang-selector {
    display: none;
    gap: 12px;
    align-items: center;
    margin-left: 10px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 30px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* =========================================
   SECONDARY NAVIGATION BAR
   ========================================= */

.subnav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    background: #f9f9f9;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.09);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.22s ease, box-shadow 0.22s ease;
    z-index: 99;
}

.subnav.subnav--open {
    max-height: 54px;
}

.subnav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    height: 50px;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(0, 87, 157, 0.12);
}

.subnav-panel {
    display: none;
    align-items: center;
    gap: 35px;
    height: 100%;
    width: 100%;
}

.subnav-panel.subnav-panel--active {
    display: flex;
}

.subnav-link {
    color: #555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: color 0.18s ease;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.subnav-link:hover {
    color: #00579D;
}

.subnav-link.subnav-link--active {
    color: #555;
    border-bottom-color: transparent;
    font-weight: 600;
}

/* arrow indicator */
.subnav-arrow {
    display: none; /*inline-block;*/
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-link.has-subnav:hover .subnav-arrow,
.nav-link.nav-link--subnav-open .subnav-arrow {
    transform: rotate(180deg);
    opacity: 0.85;
}

.nav-link.nav-link--subnav-open {
    color: #00579D;
}

/* mobile-children kept for legacy; slide panel used instead */
.mobile-children {
    display: none;
}

/* hide the slide-in submenu on desktop — only shown inside burger on mobile */
.mobile-submenu {
    display: none;
}

/* tablet */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 30px;
    }
    
    .nav {
        gap: 18px;
    }
    
    .nav-link {
        font-size: 16px;
    }
}

/* mobile */
@media (max-width: 768px) {
    body.mobile-nav-open {
        overflow: hidden;
    }

    .header {
        padding: 0;
    }

    .header-container {
        padding: 0 20px;
        min-height: 85px;
    }

    .header {
        position: relative;
        z-index: 1001;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 85px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ffffff;
        flex-direction: column;
        gap: 0;
        padding: 10px 20px 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 14px 0;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f0f0f0;
        font-size: 18px;
    }

    /* has-subnav: show > arrow on right using flex */
    .nav-link.has-subnav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 14px;
        cursor: pointer;
        touch-action: manipulation;
    }

    .nav-link.has-subnav::after {
        content: '›';
        font-size: 24px;
        line-height: 1;
        color: #00579D;
        font-weight: 300;
        margin-left: 8px;
    }
    
    .nav-link:last-of-type {
        border-bottom: 1px solid #f0f0f0;
    }

    /* slide-in submenu panel */
    .mobile-submenu {
        display: flex;
        position: fixed;
        top: 85px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #ffffff;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        padding: 10px 20px 20px;
        box-sizing: border-box;
        flex-direction: column;
        z-index: 1001;
    }

    .mobile-submenu.active {
        transform: translateX(0);
    }

    .mobile-submenu-back {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        font-family: inherit;
        font-weight: 500;
        color: #00579D;
        text-align: left;
        padding: 14px 0;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .mobile-submenu-title {
        font-size: 18px;
        font-weight: 700;
        color: #0F0F10;
        text-decoration: none;
        padding: 16px 0 10px;
        border-bottom: 2px solid #00579D;
        margin-bottom: 4px;
        display: block;
    }

    .mobile-submenu-title:hover {
        color: #00579D;
    }

    .mobile-child-link {
        color: #444;
        text-decoration: none;
        font-size: 17px;
        font-weight: 500;
        padding: 14px 0;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }

    .mobile-child-link:last-child {
        border-bottom: none;
    }

    .mobile-child-link.mobile-child-link--active {
        color: #00579D;
        font-weight: 600;
    }

    .lang-flag-single {
        display: none;
    }
    
    .lang-selector {
        display: flex;
        margin: 15px auto 5px;
        gap: 25px;
    }
    
    .lang-flag {
        height: 32px;
        opacity: 0.4;
        filter: grayscale(30%);
    }
    
    .lang-flag.active {
        opacity: 1;
        filter: grayscale(0%) saturate(1.3);
        transform: scale(1.2);
    }
    
    .lang-flag:active {
        transform: scale(0.95);
    }
    
    .logo {
        height: 40px;
    }

    /* mobile subnav bar: hidden (children shown via slide panel) */
    .subnav {
        display: none !important;
    }

    .subnav-arrow { display: none; }
}
