/* --- GLASS PANEL BASE --- */
.glass {
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 28px 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:active {
    transform: scale(0.98);
}

@media (min-width: 768px) {
    .glass-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lift);
    }
}

/* --- ICONS (CSS-Mask statt <img>) ---
   Die kopierten FontAwesome-SVGs aus home haben teils weiss, teils rot fest
   einprogrammierte Fill-Farben (gedacht fuer home's dunkles Theme). Per Mask
   wird nur die Form uebernommen, die sichtbare Farbe kommt von currentColor -
   dadurch immer lesbar, unabhaengig vom Farbschema (auch im Dark Mode). */
.icon {
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}

.icon-instagram { -webkit-mask-image: url(../assets/icons/instagram.svg); mask-image: url(../assets/icons/instagram.svg); }
.icon-whatsapp { -webkit-mask-image: url(../assets/icons/whatsapp.svg); mask-image: url(../assets/icons/whatsapp.svg); }
.icon-envelope { -webkit-mask-image: url(../assets/icons/envelope.svg); mask-image: url(../assets/icons/envelope.svg); }
.icon-phone { -webkit-mask-image: url(../assets/icons/phone.svg); mask-image: url(../assets/icons/phone.svg); }
.icon-calendar { -webkit-mask-image: url(../assets/icons/calendar.svg); mask-image: url(../assets/icons/calendar.svg); }
.icon-map-location-dot { -webkit-mask-image: url(../assets/icons/map-location-dot.svg); mask-image: url(../assets/icons/map-location-dot.svg); }
.icon-location-dot { -webkit-mask-image: url(../assets/icons/location-dot.svg); mask-image: url(../assets/icons/location-dot.svg); }
.icon-users { -webkit-mask-image: url(../assets/icons/users.svg); mask-image: url(../assets/icons/users.svg); }
.icon-handshake { -webkit-mask-image: url(../assets/icons/handshake.svg); mask-image: url(../assets/icons/handshake.svg); }
.icon-book-open { -webkit-mask-image: url(../assets/icons/book-open.svg); mask-image: url(../assets/icons/book-open.svg); }
.icon-tiktok { -webkit-mask-image: url(../assets/icons/tiktok.svg); mask-image: url(../assets/icons/tiktok.svg); }
.icon-images { -webkit-mask-image: url(../assets/icons/images-regular.svg); mask-image: url(../assets/icons/images-regular.svg); }
.icon-star { -webkit-mask-image: url(../assets/icons/star.svg); mask-image: url(../assets/icons/star.svg); }
.icon-list { -webkit-mask-image: url(../assets/icons/bars-solid-full.svg); mask-image: url(../assets/icons/bars-solid-full.svg); }
.icon-eye { -webkit-mask-image: url(../assets/icons/eye.svg); mask-image: url(../assets/icons/eye.svg); }
.icon-eye-slash { -webkit-mask-image: url(../assets/icons/eye-slash.svg); mask-image: url(../assets/icons/eye-slash.svg); }
.icon-circle-question { -webkit-mask-image: url(../assets/icons/circle-question.svg); mask-image: url(../assets/icons/circle-question.svg); }
.icon-camera { -webkit-mask-image: url(../assets/icons/camera.svg); mask-image: url(../assets/icons/camera.svg); }

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    width: 100%;
}

@media (min-width: 480px) {
    .btn { width: auto; }
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
    color: #fff;
    box-shadow: 0 10px 24px rgba(230, 57, 70, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(230, 57, 70, 0.45);
}

.btn-secondary {
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.btn.copied {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* --- TOP BAR (all breakpoints: logo; desktop also gets full nav) --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background: var(--glass-fill-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.brand img {
    height: 48px;
    width: auto;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 28px;
    }
    .desktop-nav a {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-primary);
        padding: 4px 2px;
        border-bottom: 2px solid transparent;
        transition: color 0.2s ease, border-color 0.2s ease;
    }
    .desktop-nav a.active,
    .desktop-nav a:hover {
        color: var(--aurora-red);
        border-color: var(--aurora-red);
    }
}

/* --- THEME TOGGLE --- */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .theme-icon-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .theme-icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .theme-icon-sun { display: block; }
}

/* --- PROFIL-BUTTON (Mitgliederbereich) --- Ganz rechts in der Topbar,
   gleiche Grösse/Optik wie .theme-toggle. Zeigt aktuell immer das
   Login-Symbol, da es noch keinen echten Login gibt (folgt in einem
   späteren Schritt) - öffnet direkt das Login-Modal statt eines Dropdowns,
   weil ein Dropdown ohne eingeloggten Zustand nichts zu zeigen hätte. */
.profile-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
}

/* Eingeloggt: statt eines runden Icon-Buttons ein breiteres Pill (Avatar +
   Chevron nebeneinander) - ein einzelner Buchstabe wirkte mittig in einem
   40px-Kreis gequetscht/unfertig, siehe Punkt 30. */
.profile-toggle.is-logged-in {
    width: auto;
    height: 40px;
    padding: 0 12px 0 4px;
    border-radius: var(--radius-pill);
}

.profile-toggle svg {
    width: 18px;
    height: 18px;
}

.profile-toggle-initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.profile-toggle-chevron.profile-toggle-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Defensiv: [hidden] verliert gegen jede Autor-Regel, die auf demselben
   Element auch "display" setzt (gleiches Muster wie bei .self-profile-link,
   siehe Punkt 20) - hier zwar keine der Regeln oben direkt verantwortlich,
   aber SVGs behandeln [hidden] browserabhängig unzuverlässig genug, dass es
   sich lohnt, das explizit zu erzwingen statt sich auf das UA-Stylesheet
   zu verlassen. */
#profileToggleIcon[hidden],
#profileToggleInitial[hidden],
#profileToggleChevron[hidden] {
    display: none;
}

.profile-menu-wrapper {
    position: relative;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 50;
    min-width: 160px;
    background: var(--modal-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--shadow-lift);
    padding: 6px;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown a,
.profile-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
}

.profile-dropdown a:hover,
.profile-dropdown button:hover {
    background: var(--glass-fill);
}

/* --- BOTTOM TAB BAR (mobile only) --- */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--tabbar-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--tabbar-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -8px 30px rgba(27, 27, 35, 0.08);
}

@media (min-width: 768px) {
    .tabbar { display: none; }
}

.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    padding: 8px 0;
}

.tabbar-item.active {
    color: var(--accent-text);
    background: rgba(230, 57, 70, 0.12);
    border-radius: 16px;
}

/* Icons als CSS-Mask (statt <img>): so kann .active die Icon-Farbe per
   currentColor mitändern, unabhängig von der internen SVG-Fill-Farbe. */
.tabbar-icon {
    width: 22px;
    height: 22px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.tabbar-item[data-page="home"] .tabbar-icon { -webkit-mask-image: url(../assets/icons/tab-home.svg); mask-image: url(../assets/icons/tab-home.svg); }
.tabbar-item[data-page="blog"] .tabbar-icon { -webkit-mask-image: url(../assets/icons/tab-blog.svg); mask-image: url(../assets/icons/tab-blog.svg); }
.tabbar-item[data-page="team"] .tabbar-icon { -webkit-mask-image: url(../assets/icons/tab-team.svg); mask-image: url(../assets/icons/tab-team.svg); }
.tabbar-item[data-page="verein"] .tabbar-icon { -webkit-mask-image: url(../assets/icons/tab-document.svg); mask-image: url(../assets/icons/tab-document.svg); }
.tabbar-item[data-page="kontakt"] .tabbar-icon { -webkit-mask-image: url(../assets/icons/tab-kontakt.svg); mask-image: url(../assets/icons/tab-kontakt.svg); }

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-pending {
    background: var(--badge-pending-bg);
    color: var(--badge-pending-text);
}

.badge-category {
    background: var(--badge-category-bg);
    color: var(--badge-category-text);
}

/* --- PERSON CARDS (Team + Kontakt-Ansprechperson) --- */
.person-card {
    text-align: center;
}

.person-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 18px;
    border: 3px solid var(--glass-border);
}

.person-card h3 {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--aurora-red);
    margin-bottom: 10px;
}

.person-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.person-role {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
}

.person-links {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.person-links a {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s ease, background 0.2s ease;
}

.person-links a:hover {
    transform: translateY(-2px);
    background: rgba(230, 57, 70, 0.18);
}

.search-field {
    max-width: 360px;
    margin: 0 auto 20px;
}

/* --- FILTER-LEISTE (Blog-Kategorien, Mitglieder-Rollen) --- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.2s ease;
}

.filter-btn:active {
    transform: scale(0.96);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
    color: #fff;
    border-color: transparent;
}

/* --- TOGGLE-SWITCH (z.B. "E-Mail mit anderen teilen" im Profil) --- */
.toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 20px;
    text-align: left;
}

.toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: relative;
    width: 44px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--glass-border);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-track {
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
}

.toggle input:checked + .toggle-track .toggle-thumb {
    transform: translateX(18px);
}

.toggle input:focus-visible + .toggle-track {
    outline: 2px solid var(--aurora-red);
    outline-offset: 2px;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* --- BACK-LINK --- Genutzt auf Seiten ohne eigenen Nav-Punkt (Mitglieder,
   Mein Profil, Blog-Post). margin-bottom sorgt fuer Abstand zum
   Section-Title darunter; innerhalb von .post-section-top (das schon
   selbst per `gap` fuer Abstand sorgt) wieder auf 0 zurueckgesetzt, sonst
   addiert sich beides. */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--accent-text);
}

.post-section-top .back-link {
    margin-bottom: 0;
}

.self-profile-link {
    display: inline-block;
    margin-top: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent-text);
}

/* Ohne das gewinnt obiges `display: inline-block` gegen die native
   `[hidden] { display: none }`-Regel des Browsers, das Element bliebe also
   trotz `element.hidden = true` sichtbar. */
.self-profile-link[hidden] {
    display: none;
}

/* --- BREADCRUMB --- Dezente Alternative zu zwei nebeneinander konkurrierenden
   .back-link/.self-profile-link-Elementen (siehe pages/mein-profil.html) -
   nur da im Einsatz, wo mehr als ein Navigations-Link oben auf der Seite
   nötig ist. */
.breadcrumb {
    display: block;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.breadcrumb a {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb a:hover {
    color: var(--accent-text);
}

.breadcrumb span {
    margin: 0 6px;
    color: var(--text-muted);
}

/* Kein "margin: auto" hier: .profile-layout ist ein Flex-Container, und
   ein Flex-Item mit auto-Querachsen-Margin schaltet "align-items: stretch"
   ab und faellt stattdessen auf Shrink-to-fit zurueck - die Karte waere
   dadurch unterhalb 768px unabhaengig vom verfuegbaren Platz immer nur so
   breit wie ihr breitester Inhalt (~305px), umgeben von ungewolltem
   auto-Rand. Ohne auto-Margin greift stretch normal und die Karte fuellt
   die volle Breite von .profile-layout. Ab 768px (Media Query unten) wird
   margin ohnehin explizit auf 0 gesetzt, aendert sich also nicht. */
.profile-form-card {
    padding: 32px 28px;
    text-align: center;
}

/* Auf dem Handy nimmt die Karte sonst nur einen schmalen Streifen ein, weil
   .section (base.css) 20px Seiten-Abstand zum Bildschirmrand reserviert -
   hier gezielt auf mein-profil.html verringert, statt .section selbst
   siteweit zu aendern und damit ungefragt jede andere Seite zu beeinflussen. */
@media (max-width: 767px) {
    body[data-page="mein-profil"] .section {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Mobil gestapelt, ab 768px nebeneinander - `gap` übernimmt den Abstand in
   beiden Fällen einheitlich (vorher übereinander praktisch ohne Abstand,
   da .profile-form-card kein eigenes vertikales margin hat). */
.profile-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Gleicher Fallstrick wie bei .self-profile-link (Punkt 20): [hidden]
   verliert gegen die eigene "display: flex"-Regel oben, weil eine
   Autor-Regel mit display immer gegen die Attribut-Regel des
   User-Agent-Stylesheets gewinnt - die Klasse setzt "hidden" also nie
   tatsaechlich um, ohne diese explizite Override-Regel. */
.profile-layout[hidden] {
    display: none;
}

@media (min-width: 768px) {
    .profile-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
    }

    /* max-width lebt bewusst nur hier (ab 768px), nicht in der Basisregel
       oben: unterhalb 768px soll die Karte immer die volle verfuegbare
       Breite von .profile-layout ausfuellen, auch bei Viewport-Breiten
       zwischen 480px und 767px (z.B. Tablet-Hochformat, breiteres Handy
       im Querformat) - mit einem unbedingten max-width waere sie dort per
       auto-Margin eingerueckt gewesen, obwohl .section kaum noch eigenen
       Seiten-Abstand hat. */
    .profile-layout .profile-form-card {
        margin: 0;
        max-width: 480px;
    }

    /* Ohne festes "width" bestimmt allein der Inhalt die Breite (max-width
       ist nur eine Obergrenze, kein Zwang) - seit der Hinweistext und die
       Labels bei Instagram/TikTok durch das kompaktere Info-Icon-System
       ersetzt wurden (Punkt 40), hatte diese Karte spürbar weniger langen
       Fliesstext und schrumpfte dadurch sichtbar schmaler. Nur die
       Profil-Karte selbst (nicht die "Passwort ändern"-Karte daneben, die
       dieselbe .profile-form-card-Klasse teilt, aber inhaltlich unverändert
       blieb und weiterhin ihre eigene Inhaltsbreite behalten soll). */
    .profile-layout .profile-form-card:not(.password-details) {
        width: 480px;
    }
}

/* Standardmässig eingeklappt (natives <details>, kein JS nötig) - Passwort
   ändern ist eine seltene Aktion, muss nicht immer offen auf der Seite
   stehen. */
.password-details summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    list-style: none;
}

.password-details summary::-webkit-details-marker {
    display: none;
}

.password-details .details-chevron svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.password-details[open] .details-chevron svg {
    transform: rotate(180deg);
}

/* Eigentlich regelt der Browser das Ein-/Ausblenden bei <details> selbst -
   explizit ergänzt, weil sich das in Tests nicht auf jeder Engine verlässlich
   genug verhielt. Schadet in Browsern, die es schon von sich aus richtig
   machen, nicht. */
.password-details:not([open]) form {
    display: none;
}

.password-details form {
    margin-top: 24px;
}

.person-img-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 18px;
    border: 3px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
    color: #fff;
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 2.2rem;
}

.profile-avatar-wrap {
    position: relative;
    width: fit-content;
    margin: 0 auto 18px;
}

/* role="button" sitzt auf .profile-avatar-wrap, nicht auf dem inneren
   .person-img-placeholder-Kreis: border-radius:50% nimmt die Ecken der
   quadratischen Box vom Hit-Testing aus, und genau dort (unten rechts)
   sitzt das Kamera-Badge - ein Klick darauf landete dadurch nie beim
   Kreis selbst, sondern lief ins Leere (der Wrap hatte keinen Handler).
   Der Wrap ist ein normales Rechteck ohne eigene Rundung, deckt die
   Badge-Position also immer zuverlaessig ab. */
.profile-avatar-wrap[role="button"] {
    cursor: pointer;
}

.profile-avatar-wrap .person-img-placeholder {
    margin: 0;
}

.avatar-camera-badge {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--aurora-red);
    border: 2px solid var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.avatar-camera-badge .icon {
    width: 16px;
    height: 16px;
    background-color: #fff;
}

.profile-avatar-remove {
    display: block;
    margin: 0 auto 18px;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-text);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
}

/* --- PERSON-GRID (Team + Mitglieder) --- Karten-Raster mit schmalem
   Icon-Panel neben jeder Person; genutzt von team.html und mitglieder.html. */
.people-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
}

.person-unit {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.person-unit .person-card {
    flex: 1;
    min-width: 0;
}

.person-links-panel {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 74px;
    flex-shrink: 0;
    padding: 20px 8px;
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

@media (min-width: 640px) {
    .people-grid { grid-template-columns: repeat(2, 1fr); }
    .people-grid .person-img { width: 110px; height: 110px; }
    .people-grid .person-img-placeholder { width: 110px; height: 110px; font-size: 1.7rem; }
}

.person-links .icon {
    width: 22px;
    height: 22px;
}

/* --- FAQ ACCORDION --- */
.faq-item {
    border-bottom: 1px solid var(--glass-border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: none;
    border: none;
    text-align: left;
    padding: 18px 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
}

.faq-trigger .chev {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.faq-item.active .faq-trigger .chev {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-content p {
    padding: 0 4px 18px;
    color: var(--text-muted);
}

/* --- MODALS --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(27, 27, 35, 0.35);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--modal-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lift);
    padding: 32px 24px 24px;
    text-align: center;
}

.modal-content h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
    word-break: break-word;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

/* --- FORMS --- */
.field {
    margin-bottom: 20px;
    text-align: left;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9rem;
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: 2px solid var(--aurora-red);
    outline-offset: 1px;
}

.field input:read-only {
    opacity: 0.6;
    cursor: default;
}

/* ::placeholder hat browserseitig eine fixe Grau-Standardfarbe, die nie auf
   --text-muted/--text-primary reagiert - im Dark Mode dadurch kaum lesbar
   (z. B. Instagram/TikTok-Felder auf "Mein Profil"). Nur dort auf
   --text-primary (praktisch Weiss) angehoben, Light Mode bewusst
   unveraendert (Browser-Grau dort ausreichend lesbar), gleiches
   Dark-Mode-Override-Muster wie beim Theme-Toggle-Icon oben. */
:root[data-theme="dark"] .field input::placeholder,
:root[data-theme="dark"] .field textarea::placeholder {
    color: var(--text-primary);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .field input::placeholder,
    :root:not([data-theme="light"]) .field textarea::placeholder {
        color: var(--text-primary);
    }
}

/* Auge-Button zum Anzeigen/Verstecken bei Passwort-Feldern - der Wrapper
   braucht position:relative, das Input zusaetzlich rechts Platz fuer den
   Button (sonst ueberlappt getippter Text das Icon). */
.password-input-wrap {
    position: relative;
}

.password-input-wrap input {
    padding-right: 44px;
}

.password-toggle-visibility {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
}

.password-toggle-visibility .icon {
    width: 18px;
    height: 18px;
}

.form-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: left;
}

/* "a { color: inherit }" (base.css) laesst einen Link in .form-hint sonst
   optisch mit dem umgebenden Fliesstext verschmelzen, nicht als klickbar
   erkennbar - Akzentfarbe + Unterstreichung nach demselben Rot-Muster wie
   alle anderen Links im Projekt (siehe Design-System in CLAUDE.md). */
.form-hint a {
    color: var(--accent-text);
    text-decoration: underline;
}

/* Abstand zum Anmelden-Button davor - nur fuer einen .form-hint, der direkt
   auf ein ganzes Formular folgt (wie "Zugang anfragen" im Login-Modal),
   nicht fuer die vielen anderen .form-hint-Vorkommen INNERHALB eines
   Formulars (z. B. unter einzelnen Feldern), die keinen Extra-Abstand
   brauchen. */
.modal-content > form + .form-hint {
    margin-top: 16px;
}

.not-logged-in {
    max-width: 420px;
    margin: 32px auto;
    text-align: center;
}

.not-logged-in .form-hint {
    text-align: center;
}

.not-logged-in .btn {
    margin-top: 12px;
}

.form-error {
    font-size: 0.85rem;
    color: var(--accent-text);
    margin-bottom: 10px;
    text-align: left;
}

/* Info-Icon oben rechts über einem Feld (z. B. Instagram/TikTok auf
   "Mein Profil") - ersetzt dort das Label, das stattdessen als Platzhalter
   im Input steht. Eigene Zeile über dem Input statt innerhalb (wie beim
   Passwort-Auge), damit ein langer eingetippter Link nicht unter das Icon
   laeuft. .field-info-text ist eine schwebende Sprechblase unter dem Icon
   (position:absolute, "im Vordergrund"), nicht mehr ein fest im Textfluss
   stehender Absatz unter dem Feld - dafür muss .field-info-row selbst der
   position:relative-Anker sein. Am PC (echte Maus, siehe @media unten)
   reicht Hover; auf Touch-Geräten (kein Hover) übernimmt weiterhin
   toggleFieldInfo() per Klasse .is-visible statt des hidden-Attributs -
   Grund: eine reine Attribut-Steuerung hätte sich mit der CSS-Hover-Regel
   in die Quere kommen können (siehe main.js). */
.field-info-row {
    position: relative;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.field-info-toggle {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
}

.field-info-toggle .icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
}

.field-info-text {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 5;
    width: max-content;
    max-width: 220px;
    margin: 0;
    padding: 8px 12px;
    background: var(--modal-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.field-info-text.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Nur auf Geräten mit echter Maus (nicht bei Touch, wo "hover" entweder
   gar nicht oder nur unzuverlässig nach einem Tap feuert) reicht reines
   Überfahren - kein Klick nötig. */
@media (hover: hover) and (pointer: fine) {
    .field-info-row:hover .field-info-text {
        opacity: 1;
    }
}

.field-info-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* --- CUSTOM SELECT (ersetzt natives <select>: dessen geöffnete
   Options-Liste wird vom Betriebssystem gerendert und lässt sich nicht
   gestalten oder auf die Feldbreite begrenzen) --- */
.custom-select {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}

.custom-select-trigger:focus-visible {
    outline: 2px solid var(--aurora-red);
    outline-offset: 1px;
}

.select-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.custom-select.open .select-chevron {
    transform: rotate(180deg);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    background: var(--glass-fill-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--shadow-lift);
    padding: 6px;
    list-style: none;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-options li {
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.custom-select-options li:hover,
.custom-select-options li.selected {
    background: rgba(230, 57, 70, 0.14);
}

/* --- LIGHTBOX (grosse Bildansicht, z.B. Community-Slider) --- */
.lightbox-overlay {
    background: rgba(10, 9, 15, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lightbox-content {
    position: relative;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: 92vw;
    width: auto;
}

.lightbox-img-wrap {
    overflow: hidden;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
    /* Verhindert, dass der Browser Pinch/Wisch auf dem Bild selbst als
       eigene Seiten-Zoom-/Scroll-Geste interpretiert - das eigene JS
       (Pinch-Zoom, Wisch-Navigation) soll die Geste exklusiv bekommen. */
    touch-action: none;
}

.lightbox-caption {
    margin-top: 16px;
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.lightbox-content .modal-close {
    position: absolute;
    top: -42px;
    right: 0;
    color: #fff;
    font-size: 2rem;
}

/* Zoom/Pan/Vor-Zurueck sind bewusst nur am PC (siehe js/main.js,
   isDesktopViewport()) - mobil gibt es dafuer schon native Pinch-Zoom- und
   Wisch-Gesten. Die Nav-Buttons bleiben deshalb unter 768px auch visuell
   versteckt, nicht nur funktionslos. */
.lightbox-nav {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--glass-fill-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: #fff;
    cursor: pointer;
    z-index: 10;
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

@media (min-width: 768px) {
    .lightbox-nav {
        display: flex;
    }
}

.slide-img {
    cursor: pointer;
}

.slide-img:focus-visible {
    outline: 2px solid var(--aurora-red);
    outline-offset: -2px;
}

/* --- BACK TO TOP --- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: calc(var(--tabbar-height) + 16px);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--aurora-coral), var(--aurora-red));
    color: #fff;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 900;
}

@media (min-width: 768px) {
    .back-to-top { bottom: 24px; }
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 48px 20px 32px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
}

.footer-links a {
    text-decoration: underline;
}

.footer-links a:hover {
    color: var(--accent-text);
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.footer-social-link:hover {
    color: var(--aurora-red);
}

.footer-social-link .icon {
    width: 18px;
    height: 18px;
}

/* --- TOAST (kurze Bestaetigung, z. B. Profilbild gespeichert/entfernt) ---
   Kein [hidden]/display:none, weil das nicht animierbar ist - Ein-/
   Ausblenden laeuft ueber .is-visible (opacity/visibility + Slide), gleiches
   Prinzip wie beim Instagram/TikTok-Info-Tooltip (siehe .field-info-text).
   Mobil: schwebt von oben unterhalb der Topbar rein/raus. Ab 768px: dezenter
   Toast unten rechts, passt zum ueblichen Desktop-Muster fuer solche
   Meldungen. */
.toast {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 16px;
    right: 16px;
    z-index: 1500;
    padding: 14px 18px;
    border-radius: var(--radius-card);
    background: var(--modal-fill);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-left: 4px solid #16a34a;
    box-shadow: var(--shadow-lift);
    color: var(--text-primary);
    font-size: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-130%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .toast {
        top: auto;
        left: auto;
        right: 24px;
        /* .back-to-top sitzt hier ebenfalls (right 20px, bottom 24px,
           46px hoch) - 12px oberhalb seiner Oberkante, damit sich beide
           nicht ueberlappen, wenn Toast und Button gleichzeitig sichtbar
           sind. */
        bottom: 82px;
        max-width: 320px;
        transform: translateY(12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.3s ease, visibility 0.3s ease;
        transform: none;
    }

    .toast.is-visible {
        transform: none;
    }
}
