/* ==========================================================================
   GTX compact language menu (7 Oct 2026) - markup from gtx-lang-menu.php
   Desktop: the WPML header dropdown becomes a compact panel:
     "ENGLISH" + UK / US / CA / AU flag chips, then a 2-column grid of
     flag + native name. About half the old height; new languages slot in.
   Mobile takeover: one row "[globe][flag] ENGLISH (UK) v" (<details>) that
     opens the same panel in place.
   Page-scoped "hide the switcher" CSS (li.wpml-ls-item, .wpml-ls) still wins.
   ========================================================================== */

.gtx-lang-panel {
    --gtx-lang-line: rgba(255, 255, 255, 0.10);
    list-style: none;
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
}

.gtx-lang-panel .gtx-lang-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

/* ---------- Desktop dropdown ---------- */
@media (min-width: 1151px) {
    .gtx-primary-menu > li.wpml-ls-item > .gtx-lang-panel {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        width: 300px;
        min-width: 0;
        padding: 12px;
        left: auto;
        right: 0;
        box-sizing: border-box;
    }
    /* keyboard: Tab into the language item opens the panel too */
    .gtx-primary-menu > li.wpml-ls-item:focus-within > .gtx-lang-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.gtx-lang-panel > li {
    margin: 0;
    padding: 0;
    min-width: 0;
}

.gtx-lang-panel > li.gtx-lang-head {
    grid-column: 1 / -1;
    padding: 0 2px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--gtx-text-gray, #9aa0b4);
    line-height: 1.2;
}

.gtx-lang-panel > li.gtx-lang-sep {
    grid-column: 1 / -1;
    height: 1px;
    margin: 4px 0;
    background: var(--gtx-lang-line);
}

.gtx-lang-panel > li.gtx-lang-item {
    grid-column: span 2;
}

/* links: one rule for desktop and mobile (beats the generic .sub-menu li a and the old foot chips) */
.gtx-primary-menu .gtx-lang-panel > li > a,
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li > a {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    padding: 6px 10px !important;
    box-sizing: border-box;
    border: 1px solid transparent !important;
    border-left-width: 1px;
    border-radius: 6px !important;
    background: transparent;
    color: var(--gtx-text-light, #d7dbe7) !important;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px !important;
    font-weight: 600;
    letter-spacing: 0.6px;
    line-height: 1.1;
    text-transform: uppercase;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* English region chips: flag over a short code, centred */
.gtx-primary-menu .gtx-lang-panel > li.gtx-lang-en > a,
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li.gtx-lang-en > a {
    justify-content: center;
    gap: 6px;
    padding: 6px 4px !important;
    border-color: var(--gtx-lang-line) !important;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    letter-spacing: 1px;
}

.gtx-primary-menu .gtx-lang-panel > li > a:hover,
.gtx-primary-menu .gtx-lang-panel > li > a:focus-visible,
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li > a:hover,
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li > a:focus-visible {
    color: var(--gtx-text-white, #fff) !important;
    background: rgba(255, 107, 0, 0.10);
    border-color: rgba(255, 107, 0, 0.55) !important;
    padding-left: 10px;
    outline: none;
}
.gtx-primary-menu .gtx-lang-panel > li.gtx-lang-en > a:hover {
    padding-left: 4px;
}

/* current language */
.gtx-primary-menu .gtx-lang-panel > li.is-current > a,
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li.is-current > a {
    color: var(--gtx-neon-orange, #ff6b00) !important;
    background: rgba(255, 107, 0, 0.12);
    border-color: var(--gtx-neon-orange, #ff6b00) !important;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.25);
}

/* ---------- Mobile takeover row ---------- */
.gtx-mobile-menu-foot .gtx-lang-m {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    flex: 0 1 auto;
    min-width: 0;
}
.gtx-mobile-menu-foot .gtx-lang-m[open] {
    flex-basis: 100%;
}

.gtx-lang-m > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px 0 14px;
    box-sizing: border-box;
    border: 1px solid var(--gtx-border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--gtx-text-light, #d7dbe7);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.gtx-lang-m > summary::-webkit-details-marker { display: none; }
.gtx-lang-m > summary::marker { content: ''; }
.gtx-lang-m > summary:focus-visible,
.gtx-lang-m[open] > summary {
    border-color: var(--gtx-neon-orange, #ff6b00);
    color: var(--gtx-text-white, #fff);
    outline: none;
}
.gtx-lang-m .gtx-lang-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}
.gtx-lang-m svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}
.gtx-lang-m .gtx-lang-globe { color: var(--gtx-neon-orange, #ff6b00); }
.gtx-lang-m .gtx-lang-chev { width: 14px; height: 14px; opacity: 0.8; transition: transform 0.25s ease; }
.gtx-lang-m[open] .gtx-lang-chev { transform: rotate(180deg); }

.gtx-lang-m .gtx-lang-panel--m {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 10px 0 0;
    padding: 12px;
    border: 1px solid var(--gtx-border-subtle, rgba(255, 255, 255, 0.1));
    border-top: 2px solid var(--gtx-neon-orange, #ff6b00);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}
/* bigger tap targets on phones */
.gtx-mobile-menu-foot .gtx-lang-m .gtx-lang-panel > li > a { min-height: 40px; }

/* The numbered mobile list also carried WPML's current-language item ("08 DEUTSCH", a link to the
   same page). The language row above replaces it: hidden on screen only, the link stays in the HTML
   (Matthew, 7 Oct 2026). Loaded only while the compact menu is on, so the off switch brings it back. */
.gtx-mobile-menu-list > li.wpml-ls-item {
    display: none;
}
