/* Footer Styles */
footer {
    background-color: #151516;
    color: white;
    padding: 8px;
    text-align: center;
    font-size: var(--fs-xs, 12px); /* Fallback: Footer laeuft auch auf token-losen Standalone-Seiten (login/landing/accept_invite) */
    z-index: 999;
    width: 100%;
    margin-top: auto;
    box-sizing: border-box;
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-inner {
    justify-self: center;
    white-space: nowrap;
}

.footer-right {
    justify-self: end;
}

footer a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    margin: 0 8px;
}

/* Impressum/Datenschutz sind 14px hohe Textlinks und brauchen eine echte
   Trefffläche - Optik bleibt, nur die Hitbox wächst.
   Das galt bisher nur bis 640px. Gemessen waren die beiden Links am Desktop
   deshalb 37x14 bzw. 73x14 Pixel gross; WCAG 2.2 AA (2.5.8) verlangt
   24x24. Am Handy stimmte es dank dieser Regel, am Rechner nicht - also
   ausgerechnet dort, wo mit der Maus gezielt wird. Die Trefffläche gilt
   jetzt bei jeder Breite; die Abstände bleiben mobil enger. */
footer a {
    display: inline-block;
    padding: 6px 6px;
}

@media (max-width: 640px) {
    footer a {
        padding: 10px 6px;
        margin: 0 2px;
    }
}

footer a:hover {
    color: var(--secondary-color);
}

/* Footer Responsive (mobil) – gestapelt + kleinerer Mitteltext, damit die
   lange Copyright-/Versionszeile auf dem Handy nicht zu groß wirkt/überläuft. */
@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 5px;
        text-align: center;
    }
    .footer-left, .footer-inner, .footer-right {
        justify-self: center;
    }
    .footer-left { order: 2; }
    .footer-inner {
        order: 1;
        white-space: normal;
        line-height: 1.6;
    }
    .footer-right { order: 3; }
}

@media (max-width: 600px) {
    footer { padding: 12px 15px; font-size: 11px; }
    .footer-inner {
        font-size: 10px;
        line-height: 1.8;
        max-width: 100%;
        word-break: break-word;
    }
    footer a { display: inline-block; margin: 2px 4px; font-size: 12px; }
    .footer-left { font-size: 12px; }
}

@media (max-width: 400px) {
    footer { padding: 10px 12px; font-size: 10px; }
    .footer-inner { font-size: 9px; }
    /* Impressum und Datenschutz bleiben bei 12px. Gemessen standen sie am
       Handy (390px) bei 10px - unter der Lesbarkeitsgrenze, und das
       ausgerechnet bei den beiden Links, die nach § 5 DDG "leicht
       erkennbar" sein muessen. Die lange Copyright-/Versionszeile
       (.footer-inner) darf klein bleiben; sie war der Grund fuer die
       Verkleinerung, nicht die Links. Nachgemessen: bei 360px laeuft
       dadurch nichts ueber. */
    footer a { font-size: 12px; margin: 2px 3px; }
    .footer-left { font-size: 12px; }
}