/* Language picker — sits in the top-right nav cluster.
   Menu selectors are prefixed with #fh5co-header to win specificity against
   the nav-wide rule `#fh5co-header nav ul li a { color: rgba(255,255,255,.7) }`
   in style.css, which would otherwise paint dropdown text white-on-white. */

.lang-picker {
    position: relative;
    display: inline-block;
}

.lang-picker-toggle {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
}

.lang-picker-toggle:hover,
.lang-picker-toggle:focus {
    outline: none;
    text-decoration: underline;
}

.lang-picker-current {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-picker-chevron {
    width: 10px;
    height: 10px;
    filter: invert(1) brightness(1.2);
    transition: transform 0.15s ease;
}

.lang-picker.is-open .lang-picker-chevron,
.lang-picker:hover .lang-picker-chevron {
    transform: rotate(180deg);
}

.lang-picker-menu {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    border-radius: 4px;
    z-index: 1100;
    display: none;
}

.lang-picker:hover > .lang-picker-menu,
.lang-picker.is-open > .lang-picker-menu {
    display: block;
}

.lang-picker:hover > .lang-picker-menu[hidden],
.lang-picker.is-open > .lang-picker-menu[hidden] {
    display: block;
}

/* Override #fh5co-header nav ul li { display: inline-block } from style.css —
   without this the dropdown rows shrink to content width and the highlight
   doesn't span the dropdown. */
#fh5co-header .lang-picker-menu li {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Row layout — applies to both clickable <a> rows and the non-clickable
   current-language <span> row. */
#fh5co-header .lang-picker-menu a,
#fh5co-header .lang-picker-menu .lang-picker-current-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    color: #333;
}

/* Force readable color on every text descendant in the menu — beats the
   nav-wide white text rule. */
#fh5co-header .lang-picker-menu .lang-picker-name,
#fh5co-header .lang-picker-menu .lang-picker-current-suffix {
    color: #333;
}

#fh5co-header .lang-picker-menu .lang-picker-code {
    font-weight: 600;
    letter-spacing: 0.5px;
    min-width: 24px;
    color: #888;
}

/* Hover/focus only on the clickable rows. */
#fh5co-header .lang-picker-menu a:hover,
#fh5co-header .lang-picker-menu a:focus {
    background: #f5f5f5;
    color: #000;
    text-decoration: none;
    outline: none;
}

#fh5co-header .lang-picker-menu a:hover .lang-picker-code,
#fh5co-header .lang-picker-menu a:focus .lang-picker-code {
    color: #333;
}

/* Current-language row: visually distinct, non-interactive. */
#fh5co-header .lang-picker-menu .lang-picker-current-item {
    background: #f8f8f8;
    cursor: default;
    font-weight: 600;
}

#fh5co-header .lang-picker-menu .lang-picker-current-suffix {
    margin-left: auto;
    font-weight: 400;
    font-size: 12px;
    color: #888;
}

/* Mobile: anchor the dropdown to the right edge so it doesn't clip off-screen. */
@media screen and (max-width: 600px) {
    .lang-picker-menu {
        right: 0;
        left: auto;
    }
}
