/* ===== Vereine Uebersicht ===== */

body.ff-page-vereine {
    background: #fff !important;
}

body.ff-page-vereine .site-content,
body.ff-page-vereine .content-area,
body.ff-page-vereine .site {
    background: #fff !important;
    padding-top: 0 !important;
}

/* Gegen Abschneiden links: .ff-content-wrap ist sonst overflow-x:hidden (ff-header.css). */
body.ff-page-vereine .ff-content-wrap {
    overflow-x: visible;
}

.ff-main.ff-vereine-page {
    background: #fff !important;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    overflow-x: visible;
}

.ff-vereine-wrap {
    max-width: min(var(--ff-layout-max), calc(100% - 2 * var(--ff-layout-gutter)));
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 8px 0 60px;
    box-sizing: border-box;
    background: #fff;
    overflow-x: visible;
}

/* --- Suchleiste: ein Feld, mittig (Ecken wie Header-Suchpanel: 10px) --- */
.ff-vereine-search {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    margin-bottom: 34px;
}

.ff-vereine-search-box {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0 12px 0 14px;
    gap: 8px;
    width: min(100%, 340px);
    min-height: 40px;
    height: 40px;
    background: #fff;
    border: 1.5px solid #c8c8c8;
    border-radius: 10px;
    box-sizing: border-box;
    box-shadow: none;
    overflow: visible;
}

.ff-vereine-search-box:focus-within {
    outline: none;
    border-color: #B43526;
    border-width: 1.5px;
}

.ff-vereine-search-icon {
    flex: none;
    width: 18px;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.ff-vereine-search-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ff-vereine-search-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-color: transparent !important;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #000;
    height: auto;
    align-self: center;
}

.ff-vereine-search-input:focus {
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.ff-vereine-search-input::-webkit-search-decoration,
.ff-vereine-search-input::-webkit-search-cancel-button,
.ff-vereine-search-input::-webkit-search-results-button,
.ff-vereine-search-input::-webkit-search-results-decoration,
.ff-vereine-search-input::-webkit-contacts-auto-fill-button {
    display: none !important;
    -webkit-appearance: none;
}

.ff-vereine-search-input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.ff-vereine-search-input::placeholder {
    color: #A2A2A2;
    font-weight: 400;
}

/* --- Grid: 3 Spalten, volle --ff-layout-max (1000px) wie Header; Spaltenabstand = (Breite − 3×200px) / 2 --- */
.ff-vereine-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: max(24px, calc((100% - 600px) / 2));
    row-gap: 50px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    align-items: start;
    justify-items: stretch;
    box-sizing: border-box;
}

/* --- Buchstaben-Gruppe --- */
.ff-vereine-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

.ff-vereine-group.is-hidden {
    display: none;
}

/* --- Buchstaben-Heading + Vereinsliste Wrapper --- */
.ff-vereine-group-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.ff-vereine-letter {
    width: 100%;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 0.005em;
    color: #000;
    margin: 0;
}

/* --- Vereinsliste: Figma Frame 1180 — gap 20px zwischen Vereinszeilen --- */
.ff-vereine-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    min-width: 0;
}

/* --- Einzelner Verein (wie Gruppenseite: Name flex, Stern rechts in der Spalte) --- */
.ff-vereine-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.ff-vereine-item:hover,
.ff-vereine-item:focus {
    background: transparent;
    box-shadow: none;
    outline: none;
}

.ff-vereine-item:hover .ff-vereine-name,
.ff-vereine-item:focus-visible .ff-vereine-name {
    color: #B43526;
}

.ff-vereine-item.is-hidden-item {
    display: none;
}

/* Logo */
.ff-vereine-logo {
    flex: none;
    width: 19px;
    height: 19px;
    margin-right: 7px;
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ff-vereine-logo img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}

.ff-vereine-logo-placeholder {
    width: 19px;
    height: 19px;
    background: #000;
    border-radius: 2px;
}

/* Name */
.ff-vereine-name {
    flex: 1;
    min-width: 0;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    transition: color .15s;
}

/* Favorit-Stern: rechts in der Zeile (gleiche Spaltenbreite wie Gruppenseite) */
.ff-vereine-fav {
    flex: none;
    position: static;
    width: 20px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: 0;
    cursor: pointer;
    color: #000;
    opacity: 0.55;
    transition: opacity .15s;
    transform: none;
}

.ff-vereine-fav:hover {
    opacity: 1;
}

.ff-vereine-fav svg {
    width: 20px;
    height: 19px;
    display: block;
    flex-shrink: 0;
}

/* --- "mehr" (Link zur Buchstaben-Seite): kein grauer Flächen-Hover, nur roter Text --- */
body.ff-page-vereine a.ff-vereine-more,
body.ff-page-vereine button.ff-vereine-more,
.ff-vereine-more {
    width: 100%;
    max-width: 100%;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    color: #646464;
    cursor: pointer;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0;
    margin: 0;
    text-align: left;
    box-shadow: none !important;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    display: inline-block;
}

body.ff-page-vereine a.ff-vereine-more:hover,
body.ff-page-vereine a.ff-vereine-more:focus,
body.ff-page-vereine button.ff-vereine-more:hover,
body.ff-page-vereine button.ff-vereine-more:focus,
.ff-vereine-more:hover,
.ff-vereine-more:focus {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: #B43526;
    outline: none;
}

.ff-vereine-more:focus-visible {
    outline: 2px solid #B43526;
    outline-offset: 2px;
}

.ff-vereine-more.is-hidden {
    display: none;
}

/* --- Keine Ergebnisse --- */
.ff-vereine-no-results {
    display: none;
    width: 100%;
    text-align: center;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 16px;
    color: #646464;
    padding: 40px 0;
}

.ff-vereine-no-results.is-visible {
    display: block;
}

/* --- Buchstaben-Unterseite (?vereine_gruppe=): Überschrift + 3-Spalten-Grid --- */
.ff-vereine-gruppe-page .ff-vereine-search {
    margin-top: 0;
}

.ff-vereine-gruppe-title {
    margin: 0 0 10px;
    width: 100%;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 25px;
    line-height: 30px;
    letter-spacing: 0.005em;
    color: #000;
    text-align: left;
}

/*
 * Buchstaben-Unterseite (?vereine_gruppe=): gleiche Raster-Logik wie .ff-vereine-grid,
 * Zeilenabstand wie .ff-vereine-list (20px); volle Content-Breite (--ff-layout-max im .ff-vereine-wrap).
 */
.ff-vereine-all-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: max(24px, calc((100% - 600px) / 2));
    row-gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    align-items: start;
    justify-items: stretch;
    overflow-x: visible;
}

.ff-vereine-all-grid .ff-vereine-item--grid {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    height: auto;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    position: static;
    overflow-x: visible;
    -webkit-tap-highlight-color: transparent;
}

.ff-vereine-all-grid .ff-vereine-item--grid .ff-vereine-logo {
    overflow: visible;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .ff-vereine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(28px, 8vw, 116px);
        row-gap: 50px;
    }

    .ff-vereine-all-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(28px, 8vw, 116px);
        row-gap: 20px;
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    .ff-vereine-all-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 20px;
        max-width: 100%;
    }

    .ff-vereine-all-grid .ff-vereine-item--grid {
        max-width: 100%;
    }

    .ff-vereine-grid {
        grid-template-columns: 1fr;
        row-gap: 50px;
        column-gap: 0;
    }
    .ff-vereine-search {
        justify-content: center;
    }
}

@media (max-width: 450px) {
    .ff-vereine-grid {
        row-gap: 50px;
    }
    .ff-vereine-search {
        justify-content: stretch;
    }
    .ff-vereine-search-box {
        width: 100%;
        max-width: none;
    }
}

/* ===== Verein-Detail (?verein=…&verein_tab=…) ===== */
/* Hero-Bottom (Kommentar + Pin/Lesezeichen) und Karten-Meta wie auf der Startseite sichtbar */

/*
 * Feed-Kacheln: Titel/Teaser volle Kartenbreite (kein JS-Balancing wie auf der Startseite).
 * Ohne diese Regeln bleiben ggf. max-width / Balance-Klassen von früheren Skriptläufen sichtbar.
 */
.ff-verein-detail .ff-home-card-title {
    max-width: 100% !important;
}
.ff-verein-detail .ff-home-card-title-inner,
.ff-verein-detail .ff-home-card-title-inner--balance,
.ff-verein-detail .ff-home-card-title-inner--balance-strong,
.ff-verein-detail .ff-home-card-title-inner--balance-max {
    max-width: 100% !important;
}

.ff-verein-detail-head {
    margin-bottom: clamp(24px, 4vw, 40px);
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    box-sizing: border-box;
}

.ff-verein-detail-title-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px 20px;
    margin-bottom: 20px;
    width: 100%;
}

.ff-verein-detail-logo-wrap {
    flex: none;
    width: 54px;
    height: 51px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ff-verein-detail-logo {
    width: 54px;
    height: 51px;
    object-fit: contain;
    display: block;
}

.ff-verein-detail-title {
    margin: 0;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(28px, 5vw, 40px);
    line-height: 1;
    letter-spacing: 0;
    color: #000;
}

.ff-verein-detail-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-height: 23px;
}

.ff-verein-detail-nav-link {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ff-verein-detail-nav-link:hover {
    color: #B43526;
}

.ff-verein-detail-nav-link.is-active {
    font-weight: 600;
    color: #000;
    border-bottom-color: #B43526;
}

@media (max-width: 500px) {
    .ff-verein-detail-nav {
        max-width: 100%;
    }

    .ff-verein-detail-nav-link {
        white-space: normal;
    }
}

/* Fixierte Vereins-Leiste unter dem Header (Desktop), wenn Seiten-Tabs nach oben wegscrollen */
.ff-verein-sticky-nav {
    display: none;
}

@media (min-width: 1025px) {
    .ff-verein-sticky-nav {
        --ff-verein-sticky-ease: cubic-bezier(0.45, 0, 0.55, 1);
        --ff-verein-sticky-dur: 0.36s;
        /* Minimal anders als Header (#fff), gleiche horizontale Einrückung wie .ff-header (Desktop) */
        /* Fast wie Header (#fff), nur minimal abgesetzt */
        --ff-verein-sticky-bg: #fefefe;
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        z-index: 90;
        box-sizing: border-box;
        margin: 0;
        padding: 0 clamp(16px, 3vw, 40px);
        background: var(--ff-verein-sticky-bg);
        border: 0;
        box-shadow: none;
        transform: translateY(-100%);
        visibility: hidden;
        pointer-events: none;
        transition:
            transform var(--ff-verein-sticky-dur) var(--ff-verein-sticky-ease),
            visibility 0s linear var(--ff-verein-sticky-dur);
    }

    .ff-verein-sticky-nav.is-visible {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition:
            transform var(--ff-verein-sticky-dur) var(--ff-verein-sticky-ease),
            visibility 0s linear 0s;
    }

    /* Wie .ff-header-stack.ff-header--compact .ff-header-inner: padding10px / 14px, Zeilenhöhe wie Icon-Zeile (40px) */
    .ff-verein-sticky-nav-inner {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 12px 18px;
        max-width: min(var(--ff-layout-max), calc(100% - 2 * var(--ff-layout-gutter)));
        width: 100%;
        margin: 0 auto;
        padding-top: 10px;
        padding-bottom: 14px;
        min-height: 64px;
        box-sizing: border-box;
    }

    .ff-verein-sticky-nav-logo-wrap {
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 30px;
    }

    .ff-verein-sticky-nav-logo {
        width: 32px;
        height: 30px;
        max-width: 32px;
        max-height: 30px;
        object-fit: contain;
        display: block;
    }

    .ff-verein-sticky-nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 18px;
        min-width: 0;
        flex: 1;
    }

    .ff-verein-sticky-nav-link {
        font-family: 'Barlow Semi Condensed', sans-serif;
        font-weight: 400;
        font-size: 15px;
        line-height: 1;
        letter-spacing: 0;
        color: #000;
        text-decoration: none;
        white-space: nowrap;
        padding-bottom: 4px;
        border-bottom: 2px solid transparent;
        transition: color 0.18s var(--ff-verein-sticky-ease), border-color 0.18s var(--ff-verein-sticky-ease);
    }

    .ff-verein-sticky-nav-link:hover {
        color: #b43526;
    }

    .ff-verein-sticky-nav-link.is-active {
        font-weight: 600;
        color: #000;
        border-bottom-color: #b43526;
    }
}

@media (prefers-reduced-motion: reduce) {
    @media (min-width: 1025px) {
        .ff-verein-sticky-nav {
            --ff-verein-sticky-dur: 0.01s;
            transform: none;
        }

        .ff-verein-sticky-nav.is-visible {
            transform: none;
        }
    }
}
