/* ABC3 Google Translate: module-scoped public UI. */
.abc3-gootrans {
    --abc3-gootrans-primary: #2196f3;
    --abc3-gootrans-primary-hover: #1976d2;
    --abc3-gootrans-icon-color: #fff;
    --abc3-gootrans-button-size: 32px;
    --abc3-gootrans-icon-size: 22px;
    --abc3-gootrans-panel-width: 360px;
    --abc3-gootrans-panel-gap: 12px;
    --abc3-gootrans-side-offset: 0px;
    --abc3-gootrans-vertical-offset: 50px;
    --abc3-gootrans-z-index: 11040;
    position: relative;
    z-index: var(--abc3-gootrans-z-index);
}

.abc3-gootrans__trigger {
    position: fixed;
    z-index: calc(var(--abc3-gootrans-z-index) + 2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--abc3-gootrans-button-size);
    height: var(--abc3-gootrans-button-size);
    padding: 0;
    color: var(--abc3-gootrans-icon-color);
    font-size: var(--abc3-gootrans-icon-size);
    line-height: 1;
    background: var(--abc3-gootrans-primary);
    border: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.26);
    cursor: pointer;
    transition: background-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.abc3-gootrans.is-side-right .abc3-gootrans__trigger {
    right: var(--abc3-gootrans-side-offset);
    left: auto;
}

.abc3-gootrans.is-side-left .abc3-gootrans__trigger {
    right: auto;
    left: var(--abc3-gootrans-side-offset);
}

.abc3-gootrans.is-anchor-top .abc3-gootrans__trigger {
    top: var(--abc3-gootrans-vertical-offset);
    bottom: auto;
}

.abc3-gootrans.is-anchor-bottom .abc3-gootrans__trigger {
    top: auto;
    bottom: var(--abc3-gootrans-vertical-offset);
}

.abc3-gootrans.is-shape-tab.is-side-right .abc3-gootrans__trigger {
    border-radius: 4px 0 0 4px;
}

.abc3-gootrans.is-shape-tab.is-side-left .abc3-gootrans__trigger {
    border-radius: 0 4px 4px 0;
}

.abc3-gootrans.is-shape-rounded .abc3-gootrans__trigger {
    border-radius: 8px;
}

.abc3-gootrans.is-shape-circle .abc3-gootrans__trigger {
    border-radius: 50%;
}

.abc3-gootrans.is-shape-square .abc3-gootrans__trigger {
    border-radius: 0;
}

.abc3-gootrans__trigger:hover,
.abc3-gootrans__trigger:focus {
    color: var(--abc3-gootrans-icon-color);
    background: var(--abc3-gootrans-primary-hover);
    outline: 0;
    transform: scale(1.06);
}

.abc3-gootrans__trigger:focus-visible,
.abc3-gootrans__close:focus-visible,
.abc3-gootrans__reset:focus-visible,
.abc3-gootrans__google-widget select:focus-visible {
    outline: 2px solid var(--abc3-gootrans-primary);
    outline-offset: 2px;
}

.abc3-gootrans__panel {
    position: fixed;
    z-index: calc(var(--abc3-gootrans-z-index) + 4);
    display: flex;
    flex-direction: column;
    width: min(var(--abc3-gootrans-panel-width), calc(100vw - 16px));
    max-height: calc(100vh - var(--abc3-gootrans-vertical-offset) - var(--abc3-gootrans-button-size) - var(--abc3-gootrans-panel-gap) - 8px);
    max-height: calc(100dvh - var(--abc3-gootrans-vertical-offset) - var(--abc3-gootrans-button-size) - var(--abc3-gootrans-panel-gap) - 8px);
    overflow: hidden;
    color: #333;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, transform 220ms ease, visibility 0s linear 220ms;
}

.abc3-gootrans.is-side-right .abc3-gootrans__panel {
    right: max(8px, var(--abc3-gootrans-side-offset));
    left: auto;
    transform-origin: right center;
}

.abc3-gootrans.is-side-left .abc3-gootrans__panel {
    right: auto;
    left: max(8px, var(--abc3-gootrans-side-offset));
    transform-origin: left center;
}

.abc3-gootrans.is-anchor-top .abc3-gootrans__panel {
    top: calc(var(--abc3-gootrans-vertical-offset) + var(--abc3-gootrans-button-size) + var(--abc3-gootrans-panel-gap));
    bottom: auto;
    transform: translate3d(0, -18px, 0) scale(0.985);
}

.abc3-gootrans.is-anchor-bottom .abc3-gootrans__panel {
    top: auto;
    bottom: calc(var(--abc3-gootrans-vertical-offset) + var(--abc3-gootrans-button-size) + var(--abc3-gootrans-panel-gap));
    transform: translate3d(0, 18px, 0) scale(0.985);
}

.abc3-gootrans.is-open .abc3-gootrans__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    transition-delay: 0s;
}

.abc3-gootrans.is-open .abc3-gootrans__trigger {
    opacity: 0;
    pointer-events: none;
}

.abc3-gootrans__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 14px;
    border-bottom: 1px solid #e8e8e8;
}

.abc3-gootrans__header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.abc3-gootrans__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #777;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.abc3-gootrans__close:hover,
.abc3-gootrans__close:focus {
    color: #222;
    background: #f2f2f2;
}

.abc3-gootrans__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px;
}

.abc3-gootrans__reset {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    margin-top: 14px;
    padding: 9px 12px;
    color: #b42318;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    background: #fff5f4;
    border: 1px solid #ffd6d2;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.abc3-gootrans__reset > .fa {
    width: 28px;
    margin-right: 8px;
    text-align: center;
}

.abc3-gootrans__reset:hover,
.abc3-gootrans__reset:focus {
    color: #8f1910;
    background: #ffe9e6;
    border-color: #ffb4ad;
    outline: 0;
}

.abc3-gootrans__status {
    padding: 10px 8px;
    color: #777;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.abc3-gootrans__status.is-error {
    color: #b42318;
    background: #fff5f4;
    border: 1px solid #ffd6d2;
    border-radius: 4px;
}

.abc3-gootrans__google-widget {
    width: 100%;
    min-height: 42px;
}

.abc3-gootrans__google-widget .goog-te-gadget {
    width: 100%;
    color: #666 !important;
    font-family: inherit !important;
    /* Google sometimes emits "Powered by" as a bare text node. Keeping the
     * gadget at zero font size removes it while the select restores 14px. */
    font-size: 0 !important;
}

.abc3-gootrans__google-widget select {
    display: block !important;
    width: 100% !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 8px 34px 8px 12px !important;
    color: #333 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    background-color: #fff !important;
    border: 1px solid #d8d8d8 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    cursor: pointer;
}

.abc3-gootrans__google-widget select:focus {
    border-color: var(--abc3-gootrans-primary) !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.12) !important;
    outline: 0 !important;
}

.abc3-gootrans__google-widget .goog-logo-link,
.abc3-gootrans__google-widget .goog-te-gadget span,
.abc3-gootrans__google-widget .VIpgJd-ZVi9od-l4eHX-hSRGPd,
.abc3-gootrans__google-widget [class*="VIpgJd-ZVi9od-l4eHX"] {
    display: none !important;
}

.abc3-gootrans__overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--abc3-gootrans-z-index) + 3);
    padding: 0;
    background: rgba(0, 0, 0, 0.34);
    border: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    cursor: default;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.abc3-gootrans.is-open .abc3-gootrans__overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

/* Google may inject a native toolbar after translation. The ABC3 selector is
 * nested inside #abc3-gootrans, so hiding direct body children is safe. */
body > .skiptranslate,
.goog-te-banner-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-ORHb,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
}

html,
body {
    top: 0 !important;
}

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

@media (max-width: 767px) {
    .abc3-gootrans__panel {
        width: calc(100vw - 16px);
    }

    .abc3-gootrans.is-side-right .abc3-gootrans__panel {
        right: 8px;
    }

    .abc3-gootrans.is-side-left .abc3-gootrans__panel {
        left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .abc3-gootrans__trigger,
    .abc3-gootrans__panel,
    .abc3-gootrans__overlay {
        transition: none;
    }
}

/* Keep the independent selector visible even when Google's remote widget fails. */
.abc3-gootrans__language { display:block; width:100%; height:42px; padding:8px 12px; color:#333; background:#fff; border:1px solid #d8d8dd; border-radius:4px; }
.abc3-gootrans__google-widget { position:absolute; width:1px; height:1px; min-height:0; overflow:hidden; clip-path:inset(50%); pointer-events:none; }


/* HumHub 1.19+ account menu integration; keep the original floating rules as
 * fallback on themes that do not expose a recognizable profile menu item. */
.abc3-gootrans-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    list-style: none;
    padding: 0;
    margin: 0;
}
.abc3-gootrans.is-in-topmenu {
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    z-index: auto;
}
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger {
    position: static;
    top: auto;
    bottom: auto;
    right: auto;
    left: auto;
    box-shadow: none;
    flex: 0 0 auto;
}
/* Match the adjacent HumHub nav link: icon only, with the same computed
 * link colors, vertical rhythm and padding (set by placeInAccountMenu()).
 * Important: override even the selected square/tab shape and hover styles. */
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger,
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger:hover,
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger:focus {
    width: auto;
    height: auto;
    min-height: var(--abc3-gootrans-nav-height, 50px);
    margin: 0;
    padding: var(--abc3-gootrans-nav-padding, 15px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: var(--abc3-gootrans-nav-color, inherit);
    font-size: var(--abc3-gootrans-nav-font-size, 16px);
    font-weight: normal;
    line-height: var(--abc3-gootrans-nav-line-height, 20px);
    transform: none;
    opacity: 1;
    transition: color 150ms ease, background-color 150ms ease;
}
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger:hover,
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger:focus-visible {
    background: var(--abc3-gootrans-nav-hover-background, rgba(0, 0, 0, 0.04));
    color: var(--abc3-gootrans-nav-hover-color, var(--abc3-gootrans-nav-color, inherit));
}
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}
/* Icon must inherit the nav text color, not the configurable blue-flyout theme. */
.abc3-gootrans.is-in-topmenu .abc3-gootrans__trigger .fa {
    color: currentColor;
    font-size: inherit;
}
.abc3-gootrans.is-in-topmenu .abc3-gootrans__panel {
    position: fixed;
    top: var(--abc3-gootrans-menu-panel-top) !important;
    bottom: auto !important;
    left: var(--abc3-gootrans-menu-panel-left) !important;
    right: auto !important;
    max-height: calc(100dvh - var(--abc3-gootrans-menu-panel-top) - 8px);
    transform-origin: top right;
    transform: translate3d(0, -12px, 0) scale(0.985);
}
.abc3-gootrans.is-in-topmenu.is-open .abc3-gootrans__panel {
    transform: translate3d(0, 0, 0) scale(1);
}

/* Guest icon overlays the header without consuming navigation width. This
 * prevents HumHub's desktop main menu from collapsing into its hamburger. */
.abc3-gootrans.is-guest-overlay {
    position: static;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}
.abc3-gootrans.is-in-topmenu.is-guest-overlay .abc3-gootrans__trigger,
.abc3-gootrans.is-in-topmenu.is-guest-overlay .abc3-gootrans__trigger:hover,
.abc3-gootrans.is-in-topmenu.is-guest-overlay .abc3-gootrans__trigger:focus {
    position: fixed;
    left: var(--abc3-gootrans-guest-left);
    top: var(--abc3-gootrans-guest-top);
    right: auto;
    bottom: auto;
    width: var(--abc3-gootrans-guest-size);
    height: var(--abc3-gootrans-guest-size);
    min-height: 0;
    padding: 0;
    z-index: calc(var(--abc3-gootrans-z-index) + 2);
}

/* Guest-only mobile space for the translation globe. `translate` does not
 * change the available width of HumHub's responsive navigation. */
@media (max-width: 767px) {
    #topbar-first .abc3-gootrans-guest-login-shift,
    #topbar .abc3-gootrans-guest-login-shift,
    header .abc3-gootrans-guest-login-shift {
        translate: -38px 0;
    }
}
/* Unlike the login button's text, the globe contrasts with the header. */
.abc3-gootrans.is-guest-overlay .abc3-gootrans__trigger,
.abc3-gootrans.is-guest-overlay .abc3-gootrans__trigger .fa {
    color: var(--abc3-gootrans-nav-color, #171717) !important;
}
