/* ==========================================================================
   i18n.css -- Sprachumschalter und Übersetzungshinweis
   Baut auf den Tokens aus report-responsive.css auf. Fällt diese Datei weg,
   bleibt der Report unverändert nutzbar.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Sprachumschalter
   -------------------------------------------------------------------------- */

.lang-switch {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 12px;
}

/* Die Kopfzeile schiebt .brand-txt per margin-left:auto nach rechts. Ohne
   eigenen Abstand klebt der Umschalter direkt daran. */
.h-fix .brand-txt + .lang-switch {
    margin-left: 14px;
}

.lang-switch-inline {
    gap: 2px;
    padding: 2px;
    background: var(--surface-panel, #f1f4f8);
    border: 1px solid var(--line, #d4dae2);
    border-radius: 999px;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 3px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-muted, #5a6270);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background var(--dur, 200ms) var(--ease, ease),
        color var(--dur, 200ms) var(--ease, ease);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink, #191c21);
}

.lang-btn.is-active {
    background: var(--surface, #fff);
    color: var(--brand-ink, #1f5c99);
    box-shadow: 0 1px 2px rgba(25, 28, 33, 0.12);
    cursor: default;
}

.lang-btn:focus-visible {
    outline: 2px solid var(--brand, #2f6fb5);
    outline-offset: 2px;
}

.lang-flag {
    display: block;
    width: 20px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 2px;
    overflow: hidden;
    /* Gelb auf Weiß ist sonst kaum abgegrenzt. */
    box-shadow: inset 0 0 0 1px rgba(25, 28, 33, 0.22);
}

.lang-flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-code {
    letter-spacing: 0.02em;
}

/* Der ausgeschriebene Name erscheint nur im Klappmenü (ab vier Sprachen). */
.lang-switch-inline .lang-name {
    display: none;
}

@media (max-width: 400px) {
    .lang-btn {
        padding: 3px 7px;
    }

    .lang-switch-inline .lang-code {
        display: none;
    }
}

/* ---------------------------------------------- Klappmenü ab vier Sprachen */

.lang-menu {
    position: relative;
}

.lang-menu > summary {
    list-style: none;
    border: 1px solid var(--line, #d4dae2);
    background: var(--surface, #fff);
    cursor: pointer;
}

.lang-menu > summary::-webkit-details-marker {
    display: none;
}

.lang-caret {
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.lang-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: var(--z-header, 300);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 170px;
    padding: 6px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #d4dae2);
    border-radius: var(--radius, 8px);
    box-shadow: 0 10px 28px rgba(25, 28, 33, 0.16);
}

.lang-menu-list .lang-btn {
    justify-content: flex-start;
    width: 100%;
    border-radius: var(--radius, 8px);
}

.lang-menu-list .lang-code {
    display: none;
}

/* ------------------------------------- Umschalter auf den Anhangseiten */

/* Dort ist die Kopfzeile ein schmaler float-Kasten (report_final.css setzt
   .container > header auf float:left, index.css ab 1200px auf width:25%).
   Sie schrumpft auf die Breite ihres Inhalts — der Umschalter würde das Logo
   aus dem Kasten drängen, der per overflow:hidden abschneidet. Auf diesen
   Seiten bekommt sie deshalb die volle Breite und ordnet per Flexbox:
   Umschalter links, Logo rechts. Das entspricht der ursprünglichen Wirkung
   des gefloateten Logos. */
body.other-page .container > header {
    float: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.other-page .container > header .lang-switch {
    order: -1;
    margin-left: 0;
}

@media (max-width: 519px) {
    body.other-page .container > header {
        gap: 8px;
    }
}

/* --------------------------------------------------------------------------
   2. Hinweis auf die maschinelle Übersetzung
   -------------------------------------------------------------------------- */

.mt-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 24px;
    padding: 14px 16px;
    background: #fffaef;
    border: 1px solid #eccf87;
    border-left: 4px solid #d9a441;
    border-radius: var(--radius, 8px);
    color: #4a3a17;
}

.mt-notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin-top: 1px;
    border-radius: 50%;
    background: #d9a441;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
}

.mt-notice-body {
    min-width: 0;
}

.mt-notice-title {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.mt-notice-text {
    margin: 0;
    max-width: var(--measure, 76ch);
    font-size: 13.5px;
    line-height: 1.55;
}

.mt-notice-action {
    display: inline-block;
    margin-top: 8px;
    color: #8a5e12;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mt-notice-action:hover,
.mt-notice-action:focus {
    color: #5d3f0b;
}

.mt-notice-footer {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.85;
}

@media (max-width: 519px) {
    .mt-notice {
        padding: 12px 13px;
        gap: 10px;
    }

    .mt-notice-text {
        font-size: 13px;
    }
}

/* --------------------------------------------------------------------------
   3. Druck
   -------------------------------------------------------------------------- */

@media print {
    /* Der Umschalter ist auf Papier funktionslos, der Hinweis dagegen
       gerade dort wichtig -- ein Ausdruck verliert sonst den Kontext,
       dass der Text maschinell übersetzt ist. */
    .lang-switch {
        display: none !important;
    }

    .mt-notice {
        background: transparent;
        border: 1px solid #999;
        border-left: 4px solid #999;
        color: #000;
    }

    .mt-notice-icon {
        background: #999;
    }

    .mt-notice-action {
        display: none;
    }
}
