﻿/* ==================================================================== */
/*                        TOP NAVIGATION START                          */
/* ==================================================================== */

/* -------------------------------------------------------------------- */
/* 1) Mobile Navigation (≤767px)                                        */
/* -------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
    /* Menu toggle button */
    .menu-button {
        display: block;
        background: #ececec;
        text-align: center;
        margin-bottom: 10px;
    }

    /* Hide desktop menu */
    .custom_menu {
        display: none;
    }

    /* Mobile menu toggle (duplicate display:flex rule noted) */
    .header .mobile-menu-toggle {
        display: flex !important; /* duplicate: also set below */
        position: fixed;
        bottom: 10px;
        right: 10px;
        width: 60px;
        height: 60px;
        background: #000;
        border: none;
        border-radius: 50%;
        font-size: 24px;
        color: #fff;
        align-items: center;
        justify-content: center;
        z-index: 10002;
        text-indent: -9999px;
        overflow: hidden;
        transition: all 0.3s ease;
    }

        .header .mobile-menu-toggle i,
        .header .mobile-menu-toggle svg {
            pointer-events: none;
            text-indent: 0;
        }

        /* Mobile menu toggle “open” state (duplicate selector noted) */
        .header .mobile-menu-toggle.open {
            background-color: #DB4437 !important;
            text-indent: 0;
        }

            .header .mobile-menu-toggle.open i {
                transform: rotate(45deg);
                opacity: 0;
            }

            .header .mobile-menu-toggle.open::before {
                content: "X";
                position: absolute;
                font-size: 2rem;
                color: #fff;
                text-indent: 0;
            }

    /* Mobile menu header (duplicate display:block rule noted) */
    .header .mobile-menu-header {
        display: block !important;
        position: absolute;
        top: 0;
        left: 5px;
        transform: translateY(-100%);
        opacity: 0;
        color: #b4b4b4;
        font-size: 1.2em;
        font-weight: bold;
        padding: 10px;
        transition: transform 0.6s ease, opacity 0.6s ease;
        z-index: 10003;
    }

    /* Mobile branding */
    .header .mobile-brand {
        display: flex !important; /* duplicate: also set above */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: var(--mf-primary);
        padding: 10px 20px 20px;
        margin-bottom: 10px;
        border-bottom: 1px solid grey;
    }

        .header .mobile-brand img {
            height: 130px;
            margin-bottom: 8px;
        }

    .header .mobile-brand-text {
        color: var(--mf-text-light);
        font-size: 1.1rem;
        text-align: center;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Submenu toggle arrow (duplicate definitions in other sections) */
    .header .submenu-toggle.mobile-arrow {
        display: flex !important;
        flex: 0 0 32px;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border: 1px solid #6b6b6b;
        border-radius: 50%;
        color: #6b6b6b;
        opacity: 0.6;
        cursor: pointer;
    }

        .header .submenu-toggle.mobile-arrow.open {
            border-color: #555;
            background: #eaeaea;
        }

    /* Full-screen nav overlay */
    .header nav {
        opacity: 0;
        visibility: hidden;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        padding-top: 5px;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 10001;
    }

        .header nav.open {
            opacity: 1;
            visibility: visible;
            background: var(--mf-primary) !important;
        }

            .header nav.open .mobile-menu-header {
                transform: translateY(0);
                opacity: 1;
            }

        /* Mobile navigation list */
        .header nav ul#navigation {
            list-style: none;
            margin: 40px auto 0;
            padding: 0;
            width: 90%;
            max-width: 500px;
            display: flex;
            flex-direction: column;
        }

            .header nav ul#navigation li.nav-item {
                display: flex;
                justify-content: space-between;
                align-items: center;
                width: 100%;
                margin: 10px 0;
                border-bottom: 1px solid #444;
                position: relative;
                flex-wrap: wrap;
            }

                .header nav ul#navigation li.nav-item > a {
                    flex: 0 1 auto;
                    color: #b4b4b4;
                    padding: 10px 0;
                    text-align: left;
                }

                    .header nav ul#navigation li.nav-item > a:hover {
                        color: #fefefe;
                    }

            /* Mobile sub-nav groups */
            .header nav ul#navigation .sub-nav-group {
                display: none !important;
                flex-direction: column;
                width: 100%;
                background: #3a3a3a;
                margin: 0;
                padding: 0;
            }

                .header nav ul#navigation .sub-nav-group.open {
                    display: flex !important;
                }

                .header nav ul#navigation .sub-nav-group li {
                    padding-left: 20px;
                    list-style: none;
                }

                    .header nav ul#navigation .sub-nav-group li a {
                        color: #fff !important;
                        padding: 8px 0;
                        display: block;
                    }

                        .header nav ul#navigation .sub-nav-group li a:hover {
                            background: #4a4a4a;
                        }
}


/* -------------------------------------------------------------------- */
/* 2) Desktop Top Navigation (≥768px)                                   */
/* -------------------------------------------------------------------- */
@media screen and (min-width: 768px) {
    /* Hide all mobile-only elements */
    .header .mobile-menu-toggle,
    .header .mobile-menu-header,
    .header .mobile-brand,
    .header .submenu-toggle.mobile-arrow {
        display: none !important;
    }

    .dropdown-toggle::after {
        display: none !important;
    }

    /* Header wrapper */
    .header {
        background: var(--header-bg);
        color: var(--nav-link-color);
        position: sticky;
        top: 0;
        z-index: 998;
        box-shadow: 0 2px 6px rgba(0,0,0,.1);
    }

        .header .container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.25rem;
            max-width: 1220px;
            margin: 0 auto;
        }

    /* Logo */
    .HeaderLogo img {
        max-height: 75px;
        width: auto;
    }

    /* Main nav list */
    #navigation {
        display: flex;
        gap: 1.5rem;
        margin: 0;
        padding: 0;
        list-style: none;
        align-items: center;
    }

        #navigation .nav-item {
            position: relative;
        }

            #navigation .nav-item > a,
            #navigation .nav-item > button.search-btn {
                display: flex;
                align-items: center;
                padding: 5px 10px;
                font-family: "Lato", sans-serif;
                font-weight: 500;
                color: var(--nav-link-color);
                background: none;
                border: none;
                border-radius: 4px;
                text-decoration: none;
                transition: background .2s, color .2s;
            }

                #navigation .nav-item > a:hover,
                #navigation .nav-item > button.search-btn:hover {
                    background: rgba(0,0,0,.05);
                    color: var(--primary);
                }

        /* Dropdown menus */
        #navigation .dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: var(--white);
            border-top: 3px solid var(--accent);
            box-shadow: 0 2px 4px rgba(0,0,0,.15);
            padding: .5rem 0;
            list-style: none;
            min-width: 300px;
            z-index: 1000;
        }

        #navigation .nav-item:hover > .dropdown {
            display: block;
        }

        #navigation .dropdown.two-col {
            column-count: 2;
            column-gap: 1rem;
            column-rule: 1px solid rgba(0,0,0,.1);
            min-width: 418px;
            padding: .5rem;
            left: -10px;
        }

        #navigation .nav-item:nth-last-child(3) .dropdown,
        #navigation .nav-item:nth-last-child(2) .dropdown {
            left: auto;
            right: 0;
        }

        #navigation .dropdown li {
            break-inside: avoid;
            margin: 0;
        }

            #navigation .dropdown li a {
                display: block;
                width: 100%;
                box-sizing: border-box;
                padding: .5rem 1rem;
                color: var(--primary);
                font-size: .95rem;
                line-height: 1.4;
                text-decoration: none;
                transition: background .2s;
            }

                #navigation .dropdown li a:hover {
                    background: rgba(var(--primary-rgb),.1);
                }

    /* Search button */
    .search-btn {
        font-size: 1.2rem;
        padding: 5px 8px;
        color: var(--nav-link-color);
        background: none;
        border: none;
        cursor: pointer;
        transition: color .2s;
    }

        .search-btn:hover {
            color: var(--primary);
        }

    /* Search container */
    #searchContainer {
        display: none;
        position: absolute;
        top: 100%;
        right: 1rem;
        width: 320px;
        max-width: calc(100% - 2rem);
        background: var(--white);
        border: 1px solid #ddd;
        box-shadow: 0 4px 12px rgba(0,0,0,.15);
        z-index: 1500;
    }

        #searchContainer .gcse-search {
            width: 100% !important;
        }
}
/* ==================================================================== */
/*              2) LEFT NAVIGATION / custom_menu START                  */
/* ==================================================================== */

/* -------------------------------------------------------------------- */
/* 2.1) Left column stretch & scroll container                          */
/* -------------------------------------------------------------------- */
#ucLeftNav_pnlLeftSide {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
    padding: 5px 20px 10px 20px; /* consistent padding on all sides */
    overflow-x: hidden; /* prevent sideways expansion */
}

    #ucLeftNav_pnlLeftSide #dynamic_nav {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
        /* ── prevent hamburger/button from stretching ── */
        #ucLeftNav_pnlLeftSide #dynamic_nav .menu-button {
            flex: 0 0 auto;
        }
        /* ── let the menu list fill remaining height and scroll ── */
        #ucLeftNav_pnlLeftSide #dynamic_nav .custom_menu {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden; /* lock width */
        }

/* -------------------------------------------------------------------- */
/* 2.2) Reset & base list styles                                        */
/* -------------------------------------------------------------------- */
#dynamic_nav .custom_menu,
#dynamic_nav .custom_menu ul,
#dynamic_nav .custom_menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Ensure submenus don’t push width */
#dynamic_nav .custom_menu ul {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* -------------------------------------------------------------------- */
/* 2.3) Top project title                                               */
/* -------------------------------------------------------------------- */
#dynamic_nav #ul_dynamic_nav > li:first-child > a {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 1rem 0 0.75rem;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;
}

/* -------------------------------------------------------------------- */
/* 2.4) Shared item styles                                              */
/* -------------------------------------------------------------------- */
#dynamic_nav .custom_menu li {
    position: relative;
    border-bottom: 1px solid #e5e5e5;
}

/* ✅ remove the extra/double line at the end of each list */
#dynamic_nav .custom_menu li:last-child {
    border-bottom: none;
}

    #dynamic_nav .custom_menu li > a {
        display: block;
        padding: 0.85rem 0;
        line-height: 1.4;
        font-size: .95rem;
        color: #4a4a4a;
        text-decoration: none;
        transition: color 0.15s;
    }

        #dynamic_nav .custom_menu li > a:hover {
            color: #000;
        }

#dynamic_nav .custom_menu a.current_page {
    font-weight: 700;
}

/* -------------------------------------------------------------------- */
/* 2.5) Indentation levels                                              */
/* -------------------------------------------------------------------- */
#dynamic_nav .custom_menu ul ul li > a {
    padding-left: 1.25rem;
}

#dynamic_nav .custom_menu ul ul ul li > a {
    padding-left: 2.25rem;
}

/* -------------------------------------------------------------------- */
/* 2.6) Submenu toggles & chevron                                       */
/* -------------------------------------------------------------------- */
/* room for chevron & anchor */
#dynamic_nav .custom_menu .has-submenu > a {
    position: relative;
    padding-right: 2rem; /* consistent space for toggle */
}

#dynamic_nav .custom_menu .has-submenu.open > a {
    color: #005978;
    font-weight: 600;
}

/* chevron positioning */
#dynamic_nav .custom_menu .submenu-toggle {
    position: absolute;
    top: 50%;
    right: 0; /* keep inside container */
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    #dynamic_nav .custom_menu .submenu-toggle i {
        font-size: 0.7rem;
        color: #7a7a7a;
        transition: transform 0.25s ease;
    }

#dynamic_nav .custom_menu .has-submenu.open > a .submenu-toggle i {
    transform: rotate(90deg);
}

#dynamic_nav .custom_menu .submenu-toggle:hover i {
    color: #000;
}


/* -------------------------------------------------------------------- */
/* 3) Tablet Overrides (≤992px)                                         */
/* -------------------------------------------------------------------- */
@media (max-width: 992px) {
    .header .container {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .HeaderLogo,
    .HeaderRight nav {
        width: 100%;
    }

    #navigation {
        justify-content: center;
        flex-wrap: wrap;
    }

    #searchContainer {
        right: auto;
        left: 1rem;
    }
}


/* -------------------------------------------------------------------- */
/* 2.7) Child lists (hidden by default)                                 */
/* -------------------------------------------------------------------- */
#dynamic_nav .custom_menu ul ul {
    /* hidden by default */
}


/* -------------------------------------------------------------------- */
/* 2.8) Menu button                                                     */
/* -------------------------------------------------------------------- */
/* Note: duplicate selector—padding differs */
#dynamic_nav .menu-button {
    display: none;
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 0; /* original */
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
}

#dynamic_nav .menu-button {
    padding: 0.75rem 1rem; /* duplicate with different padding */
}


/* ==================================================================== */
/*           2.9) Mobile Overrides for LEFT NAVIGATION (≤767px)         */
/* ==================================================================== */
@media screen and (max-width: 767px) {
    /* Show & style the toggle button */
    #ucLeftNav_pnlLeftSide #dynamic_nav .menu-button {
        display: block;
        width: 100%; /* full-width */
        background: #ececec; /* light grey bg */
        color: #000; /* black text */
        text-align: center; /* centered label */
        border: none;
        padding: 0.75rem 1rem; /* vertical/horizontal padding */
        font-size: 1rem;
        font-weight: 600;
        margin-bottom: 1rem; /* spacing below button */
    }

    /* Hide the menu list until “open” */
    #ucLeftNav_pnlLeftSide #dynamic_nav .custom_menu {
        display: none;
    }

    /* When #dynamic_nav gets .open, show the list */
    #ucLeftNav_pnlLeftSide .custom_menu {
        display: flex;
        flex-direction: column;
        padding: 0 2rem .5rem 2rem !important;
        background: #ececec; /* light grey bg */
    }
}


/* ==================================================================== */
/*            2.10) Desktop Overrides for LEFT NAVIGATION               */
/*              (optional if you need to force hide on ≥768px)         */
/* ==================================================================== */
@media screen and (min-width: 768px) {
    /* Ensure button is hidden on desktop */
    #ucLeftNav_pnlLeftSide #dynamic_nav .menu-button {
        display: none;
    }
    /* Menu always visible on desktop */
    #ucLeftNav_pnlLeftSide #dynamic_nav .custom_menu {
        display: flex;
        justify-content: center;
    }
}

/* ============================================================================
     2) Footer base styles
     ============================================================================ */
:root {
    --accent: #d6ba5a;
}

.footer {
    background: #2c2c2c;
    color: #ccc;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem 1rem;
    float: left;
    width: 100%;
}

/* ----------------------------------------------------------------------------
     2a) Logo & social
     ---------------------------------------------------------------------------- */
.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .footer-logo img {
        width: 100%;
        max-width: 200px;
        filter: contrast(0) grayscale(100) brightness(200) !important;
    }

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

    .footer-social a {
        font-size: 1.25rem;
        color: #fff;
        transition: .2s;
    }

        .footer-social a:hover {
            color: var(--accent);
        }

/* ----------------------------------------------------------------------------
     2b) Quick links & contact
     ---------------------------------------------------------------------------- */
.footer-nav,
.footer-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

    .footer-nav a,
    .footer-contact a,
    .footer-contact span {
        display: flex;
        align-items: center;
        gap: .3rem;
        font-size: .875rem;
        color: #ccc;
        text-decoration: none;
        transition: .2s;
    }

        .footer-nav a:hover,
        .footer-contact a:hover {
            color: var(--accent);
        }



/* ============================================================================
     Footer bottom (“Ownership + CMS Credit”)
     ============================================================================ */
.footer-bottom {
    width: 100%;
    margin-top: 2rem;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
    font-size: .75rem;
    color: #777;
    border-top: 1px solid #80808030;
}

    .footer-bottom a {
        color: #777;
        transition: .2s;
    }

        .footer-bottom a:hover {
            color: var(--accent);
        }

/* ----------------------------------------------------------------------------
     Responsive tweaks
     ---------------------------------------------------------------------------- */
@media (max-width: 576px) {
    .footer {
        padding: 2rem .5rem;
        gap: 1rem;
    }

    .footer-nav,
    .footer-contact {
        gap: 1rem;
    }
}




/* ============================================================================
    Translate dropdown (upward-opening)
     ============================================================================ */
.custom-translate-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: .9rem;
    color: #ccc;
    gap: .25rem;
    padding: .25rem .5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
}

    .custom-translate-dropdown:hover {
        color: var(--accent);
    }

.custom-translate-list {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    color: #333;
    list-style: none;
    margin: 0;
    padding: .25rem 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    min-width: 120px;
}

    .custom-translate-list li {
        display: flex;
        align-items: center;
        padding: .4rem .75rem;
        cursor: pointer;
        white-space: nowrap;
    }

        .custom-translate-list li:hover {
            background: rgba(0,0,0,0.05);
        }

.custom-translate-label {
    color: #ccc;
}
