/* V2.8.11: declare our own complete palettes, including native controls. */
html[data-wv-theme="light"] { color-scheme: only light; }
html[data-wv-theme="dark"] { color-scheme: only dark; }

@media (max-width: 760px) {
    /* Logo + language + appearance + account; the search gets its own row. */
    .wgh .wgh__primary-inner {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 8px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    .wgh .wgh__primary-inner > .wgh__brand { grid-column: 1; grid-row: 1; min-width: 0; }
    .wgh .wgh__brand img { width: 112px; max-width: 100%; }
    .wgh .wgh__primary-inner > .wgh__actions {
        grid-column: 2;
        grid-row: 1;
        position: relative;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .wgh .wgh__primary-inner > .wgh__search { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
    .wgh .wgh__actions .wahlivo-language-switcher { display: block; flex: 0 0 96px; width: 96px; }
    .wgh .wgh__actions .wahlivo-language-switcher select {
        display: block;
        width: 96px;
        min-width: 0;
        max-width: 96px;
        min-height: 44px;
        padding: 0 18px 0 6px;
        font-size: 12px;
    }
    .wgh .wgh__actions > .wgh__account {
        flex: 0 0 44px;
        min-width: 44px;
        max-width: 44px;
        min-height: 44px;
        padding: 3px;
        font-size: 11px;
        line-height: 1.15;
        white-space: normal;
        text-align: center;
    }
    .wgh .wgh__actions > .wgh__account--cta { font-size: 0; }
    /* Anchor the popup to the right edge of all actions, not to its small icon. */
    .wgh .wv-theme-menu { position: static; }
    .wgh .wv-theme-menu > summary { width: 44px; padding: 0; }
    .wgh .wv-theme-menu .wv-theme-choices { right: 0; width: 280px; max-width: calc(100vw - 22px); }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
    .wgh .wgh__carousel .wgh__carousel-track {
        animation: wgh-scroll var(--wgh-carousel-duration, 90s) linear infinite;
    }
}

/* Touch browsers can retain :hover after a tap. It must not freeze the strip. */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
    .wgh .wgh__carousel:hover .wgh__carousel-track { animation-play-state: running; }
}
.wgh .wgh__carousel[data-wv-carousel-paused] .wgh__carousel-track,
.wgh .wgh__carousel:focus-within .wgh__carousel-track { animation-play-state: paused; }

/* Motion preference always wins, even with a previous hover or touch state. */
@media (prefers-reduced-motion: reduce) {
    .wgh .wgh__carousel .wgh__carousel-track { animation: none; transform: none; }
}
