/* =========================================================
   14. GOOGLE TRANSLATE CLEANUP
   Hides Google branding and the top banner ribbon, and
   styles the native language selector.
   ========================================================= */

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
.VIpgJd-Z43Wfe-a223ad-wT322c,
.VIpgJd-Z43Wfe-a223ad,
.goog-te-balloon-frame,
#goog-gt-tt {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    pointer-events: none !important;
}

.goog-logo-link,
.goog-te-gadget span {
    display: none !important;
}

.goog-te-gadget {
    font-size: 0 !important;
    color: transparent !important;
}

/* Keep page pinned to the very top (Google injects an offset) */
html {
    top: 0 !important;
    margin-top: 0 !important;
}

body {
    top: 0 !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Native language dropdown */
.goog-te-combo {
    width: 100% !important;
    max-width: 320px !important;
    padding: 10px 14px !important;
    font-family: var(--font-body) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--forest) !important;
    background-color: #ffffff !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm) !important;
    outline: none !important;
    cursor: pointer !important;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease) !important;
}

.goog-te-combo:hover,
.goog-te-combo:focus {
    border-color: var(--champagne-deep) !important;
    box-shadow: 0 0 0 3px rgba(198, 169, 107, 0.35) !important;
}


/* =========================================================
   15. RESPONSIVE: TABLET & MOBILE NAVIGATION
   ========================================================= */

/* --- Tablet & below: collapsible navigation --- */
@media (max-width: 900px) {
    :root {
        --header-height: 68px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        margin-top: 12px;
        padding: 8px 0;
        background: var(--forest-light) !important;
        border-top: 1px solid var(--champagne);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

    .nav-link {
        padding: 13px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(250, 245, 233, 0.1);
    }

    /* Underline effect is desktop-only; rows already have dividers here */
    .nav-link::after {
        display: none;
    }

    /* Arrow sits at the right edge of each row that has a submenu */
    .nav-link:not(:only-child) {
        justify-content: space-between;
    }

    .nav-link:not(:only-child)::before {
        margin-left: 0;
    }

    /* Touch screens keep :hover "stuck" after a tap, so on mobile the
       chevron and submenu follow only the .dropdown-open class. */
    .nav-item:hover > .nav-link:not(:only-child)::before,
    .nav-item:focus-within > .nav-link:not(:only-child)::before {
        transform: translateY(-2px) rotate(45deg);
    }

    .nav-item.dropdown-open > .nav-link:not(:only-child)::before {
        transform: translateY(2px) rotate(225deg);
    }

    /* Submenu: sits in the flow and expands / collapses with a
       height + fade transition instead of the desktop curtain. */
    .dropdown,
    .nav-item:hover .dropdown,
    .nav-item:focus-within .dropdown {
        position: static;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        padding-left: 16px;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.18) !important;
        border: none !important;
        border-radius: 0;
        box-shadow: none;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        clip-path: none;
        transition: max-height 0.4s var(--ease),
                    padding 0.4s var(--ease),
                    opacity 0.3s var(--ease),
                    visibility 0s linear 0.4s;
    }

    .nav-item.dropdown-open .dropdown {
        max-height: 360px;
        padding-top: 6px;
        padding-bottom: 6px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .hero {
        padding: 64px 18px;
    }

    .hero p {
        font-size: 1rem;
    }

    .container {
        padding: 44px 18px;
    }

    .section-title {
        margin-bottom: 32px;
    }

    .card {
        padding: 22px;
    }

    .account-box {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    form {
        max-width: 100%;
    }

    form .btn {
        width: 100%;
    }

    #ngo-chatbot-container {
        right: 14px;
        bottom: 14px;
    }

    #chatbot-window {
        width: calc(100vw - 28px);
        max-width: 340px;
        height: 70vh;
        max-height: 460px;
    }

    /* 16px stops iOS Safari from zooming the page when the field is focused */
    .chatbot-input-area input {
        font-size: 16px;
    }
}


/* =========================================================
   16. ACCESSIBILITY & REDUCED MOTION
   ========================================================= */

:focus-visible {
    outline: 3px solid var(--forest);
    outline-offset: 2px;
}

header :focus-visible,
footer :focus-visible,
.chatbot-header :focus-visible {
    outline-color: var(--cream);
}

/* Chips and page buttons sit on light backgrounds, so keep the forest ring there */
.chatbot-chip:focus-visible,
.chatbot-action:focus-visible {
    outline-color: var(--forest);
}

.goog-te-combo:focus-visible {
    outline: 3px solid var(--forest) !important;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .chatbot-messages {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Dropdowns open and close instantly, with no delayed hide */
    .dropdown {
        transition-delay: 0s !important;
    }
}

