/* Language switcher (PT | EN) and first-visit notice. Focus ring comes from base.css. */

.lang-switcher__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
}

.lang-switcher__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-target-min);
    min-height: var(--tap-target-min);
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.lang-switcher__link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

/* Current language: not only a colour change (underline + bold). */
.lang-switcher__link.is-current {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 0.35em;
    text-decoration-thickness: 2px;
}

/* The header copy is for desktop; phones get the one inside the mobile menu. */
.lang-switcher--mobile {
    margin-top: var(--space-3);
}

@media (max-width: 1199px) {
    .lang-switcher--header {
        display: none;
    }
}

@media (min-width: 1200px) {
    .lang-switcher--mobile {
        display: none;
    }
}

/* Fixed at the bottom of the window: it is added by script after the page loads, so in the normal flow it would push
   the whole page down (layout shift). Scrolling keeps clear of it so a focused element is never hidden behind it. */
html:has(.lang-notice) {
    scroll-padding-bottom: calc(var(--lang-notice-height, 6rem) + var(--space-4));
}

/* The end of the page (footer) and the scroll-to-top button stay clear of the notice. */
body:has(.lang-notice) {
    padding-bottom: var(--lang-notice-height, 6rem);
}

body:has(.lang-notice) .scroll-to-top {
    bottom: calc(var(--lang-notice-height, 6rem) + var(--space-4));
}

.lang-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-default);
    color: var(--text-primary);
}

.lang-notice__text {
    font-size: var(--text-sm);
}

.lang-notice__link {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.lang-notice__dismiss {
    min-width: var(--tap-target-min);
    min-height: var(--tap-target-min);
    font-size: var(--text-xl);
    line-height: 1;
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.lang-notice__dismiss:hover {
    background-color: var(--bg-tertiary);
}

/* Notice at the top of an English page that has been machine-translated and not yet reviewed. */
.translation-notice {
    margin-bottom: var(--space-6);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: var(--border-width-2) dashed var(--text-secondary);
    border-radius: var(--radius-md);
}

.translation-notice a {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
