/*
 * Alemannia Tischfußball – Mannschaften Plugin
 * Passt zum BVT-Theme (Schwarz-Gelb, Alemannia-Stil)
 * ============================================================ */

/* ---------------------------------------------------------------
 * CSS Custom Properties (erben vom Theme wenn möglich)
 * ------------------------------------------------------------- */
:root {
    --atf-yellow:  var(--bvt-yellow,  #ffd200);
    --atf-gold:    var(--bvt-gold,    #f5b700);
    --atf-black:   var(--bvt-black,   #080808);
    --atf-white:   var(--bvt-white,   #fff);
    --atf-gray:    var(--bvt-gray,    #f4f4f4);
    --atf-text:    var(--bvt-text,    #111);
    --atf-muted:   var(--bvt-muted,   #4b5563);
    --atf-focus:   var(--bvt-focus,   #005fcc);
    --atf-max:     var(--bvt-max,     1180px);
    --atf-farbe:   var(--bvt-yellow,  #ffd200); /* Mannschafts-Akzentfarbe */
    --atf-radius:  .5rem;
    --atf-shadow:  0 10px 30px rgba(0,0,0,.18);
}

/* ---------------------------------------------------------------
 * Teams Grid
 * ------------------------------------------------------------- */
.atf-teams-overview {
    padding: 0;
}

.atf-teams-grid {
    display: grid;
    gap: 1.25rem;
}

.atf-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.atf-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ---------------------------------------------------------------
 * Team Card
 * ------------------------------------------------------------- */
.atf-team-card {
    background: var(--atf-white);
    border-radius: var(--atf-radius);
    box-shadow: var(--atf-shadow);
    border-top: 7px solid var(--atf-farbe);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}

.atf-team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 45px rgba(0,0,0,.22);
}

/* Thumbnail */
.atf-team-card__img {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.atf-team-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.atf-team-card:hover .atf-team-card__img img {
    transform: scale(1.04);
}

.atf-team-card__img--placeholder {
    background: linear-gradient(135deg, var(--atf-black) 0 55%, var(--atf-farbe) 55% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.atf-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}

/* Card body */
.atf-team-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    flex: 1;
}

.atf-team-card__title {
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.atf-team-card__title a {
    color: var(--atf-text);
    text-decoration: none;
}

.atf-team-card__title a:hover {
    color: #084fa3;
}

.atf-team-card__excerpt {
    color: var(--atf-muted);
    font-size: .9rem;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.atf-team-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid #eee;
}

/* ---------------------------------------------------------------
 * Badges
 * ------------------------------------------------------------- */
.atf-liga-badge {
    display: inline-block;
    background: var(--atf-farbe);
    color: #000;
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: .2rem;
    letter-spacing: .04em;
}

.atf-liga-badge--hero {
    font-size: .9rem;
    padding: .3rem .8rem;
    margin-bottom: .5rem;
}

.atf-source-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 900;
    padding: .2rem .5rem;
    border-radius: .2rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.atf-source-dtfb {
    background: #003366;
    color: #fff;
}

.atf-source-nwtfv {
    background: #1a5c1a;
    color: #fff;
}

.atf-rang-badge {
    font-size: .85rem;
    font-weight: 700;
    color: var(--atf-muted);
    margin: 0;
}

/* ---------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------- */
.atf-btn {
    display: inline-block;
    background: var(--atf-yellow);
    color: #000;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    font-size: .82rem;
    padding: .55rem 1rem;
    border-radius: .25rem;
    box-shadow: 0 4px 0 #9a7900;
    white-space: nowrap;
    transition: transform .1s;
}

.atf-btn:hover {
    transform: translateY(1px);
    color: #000;
    text-decoration: none;
}

.atf-btn:focus-visible {
    outline: 4px solid var(--atf-focus);
    outline-offset: 3px;
}

/* ---------------------------------------------------------------
 * Single Team – Hero
 * ------------------------------------------------------------- */
.atf-team-hero {
    background-color: var(--atf-black);
    color: #fff;
    padding: clamp(3rem, 6vw, 5rem) 0;
}

.atf-team-hero__inner {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.atf-back-link {
    color: var(--atf-farbe);
    text-decoration: none;
    font-weight: 800;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.atf-back-link:hover {
    text-decoration: underline;
}

.atf-team-hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
    margin: 0;
    color: #fff;
}

.atf-team-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .9rem;
    margin: 0;
}

.atf-source-link,
.atf-sync-info {
    color: rgba(255,255,255,.75);
    font-size: .85rem;
}

.atf-source-link:hover {
    color: #fff;
}

/* ---------------------------------------------------------------
 * Single Team – Content
 * ------------------------------------------------------------- */
.atf-team-content {
    padding: 2rem 1rem 4rem;
}

.atf-section {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #eee;
}

.atf-section:last-child {
    border-bottom: 0;
}

.atf-section--alt {
    background: var(--atf-gray);
    padding: 2rem;
    border-radius: var(--atf-radius);
}

.atf-section h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 0;
}

/* ---------------------------------------------------------------
 * Ligatabelle
 * ------------------------------------------------------------- */
.atf-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--atf-radius);
    box-shadow: var(--atf-shadow);
}

.atf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    background: #fff;
}

.atf-table th {
    background: var(--atf-black);
    color: var(--atf-yellow);
    font-weight: 900;
    text-transform: uppercase;
    font-size: .8rem;
    padding: .75rem .9rem;
    text-align: left;
    white-space: nowrap;
}

.atf-table td {
    padding: .65rem .9rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.atf-table tr:nth-child(even) td {
    background: #f9f9f9;
}

.atf-table tr:hover td {
    background: #fff8e1;
}

.atf-table__pos {
    font-weight: 900;
    color: var(--atf-muted);
    text-align: center;
    width: 2.5rem;
}

/* Highlight Alemannia row */
.atf-table tr.atf-alemannia-row td {
    background: #fffde7 !important;
    font-weight: 700;
    border-left: 4px solid var(--atf-yellow);
}

/* ---------------------------------------------------------------
 * Ergebnisse
 * ------------------------------------------------------------- */
.atf-ergebnisse-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .5rem;
}

.atf-ergebnisse-list li {
    background: #fff;
    border: 1px solid #ddd;
    border-left: 6px solid var(--atf-yellow);
    padding: .75rem 1rem;
    border-radius: .3rem;
    font-size: .9rem;
}

/* ---------------------------------------------------------------
 * Bilder-Galerie
 * ------------------------------------------------------------- */
.atf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.atf-gallery__item {
    margin: 0;
    border-radius: var(--atf-radius);
    overflow: hidden;
    box-shadow: var(--atf-shadow);
}

.atf-gallery__item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.atf-gallery__item:hover img {
    transform: scale(1.05);
}

/* ---------------------------------------------------------------
 * Liga-Filter Tabs
 * ------------------------------------------------------------- */
.atf-liga-nav {
    background: var(--atf-black);
    border-bottom: 3px solid var(--atf-yellow);
    padding: .75rem 0;
}

.atf-liga-nav__inner {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.atf-liga-filter-btn {
    background: transparent;
    border: 2px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.8);
    font: inherit;
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
    padding: .45rem .9rem;
    border-radius: .25rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.atf-liga-filter-btn:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.5);
}

.atf-liga-filter-btn--active {
    background: var(--atf-yellow) !important;
    color: #000 !important;
    border-color: var(--atf-yellow) !important;
}

.atf-liga-filter-btn:focus-visible {
    outline: 3px solid var(--atf-focus);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
 * Source note / Prose
 * ------------------------------------------------------------- */
.atf-source-note {
    font-size: .82rem;
    color: var(--atf-muted);
    margin-top: .75rem;
}

.atf-source-note a {
    color: var(--atf-muted);
}

.atf-prose {
    max-width: 800px;
    line-height: 1.7;
}

.atf-prose--ext {
    background: var(--atf-gray);
    padding: 1.5rem;
    border-radius: var(--atf-radius);
    border-left: 6px solid var(--atf-yellow);
}

.atf-no-teams,
.atf-no-data {
    color: var(--atf-muted);
    font-style: italic;
}

/* ---------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------- */
@media (max-width: 900px) {
    .atf-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .atf-grid-3,
    .atf-grid-2 {
        grid-template-columns: 1fr;
    }

    .atf-team-hero__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .atf-team-content {
        padding: 1.5rem .75rem 3rem;
    }
}

/* ---------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .atf-team-card,
    .atf-team-card__img img,
    .atf-gallery__item img,
    .atf-btn {
        transition: none !important;
        transform: none !important;
    }
}

/* ---------------------------------------------------------------
 * Single Team – reines Spieler-Roster
 * ------------------------------------------------------------- */
.atf-single-roster-page {
    background: #fff;
}

.atf-roster-wrap {
    padding: clamp(2rem, 4vw, 4rem) 1rem 4rem;
}

.atf-roster-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--atf-muted);
    text-decoration: none;
    font-weight: 800;
}

.atf-roster-back:hover {
    color: var(--atf-text);
    text-decoration: underline;
}

.atf-roster-section {
    max-width: 1080px;
}

.atf-roster-title {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 0 0 2rem;
    color: var(--atf-black);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.atf-roster-title__icon {
    font-size: .85em;
    line-height: 1;
}

.atf-player-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 2.25rem 3rem;
    background: #f4f4f4;
    border-left: 7px solid var(--atf-farbe, var(--atf-yellow));
    border-radius: .45rem;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.atf-player-card {
    min-width: 0;
    text-align: center;
}

.atf-player-card__photo {
    width: 120px;
    height: 160px;
    display: block;
    margin: 0 auto 1rem;
    object-fit: cover;
    object-position: center;
    border: 1px solid #111;
    background: #fff;
}

.atf-player-card__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #777;
}

.atf-player-card__name {
    margin-bottom: .45rem;
    color: #0057b8;
    font-size: 1rem;
    line-height: 1.25;
    text-decoration: underline;
    word-break: break-word;
}

.atf-player-card__number {
    color: #222;
    font-size: .95rem;
    line-height: 1.25;
}

.atf-roster-source {
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .atf-player-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem 1rem;
        padding: 1.25rem;
    }

    .atf-player-card__photo {
        width: 96px;
        height: 128px;
    }
}


/* ---------------------------------------------------------------
 * Single Team – aktuelle Tabelle unter dem Spieler-Roster
 * ------------------------------------------------------------- */
.atf-current-table-section {
    margin-top: clamp(2rem, 4vw, 3rem);
}

.atf-current-table-title {
    margin: 0 0 1rem;
    color: var(--atf-black);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 900;
    text-transform: uppercase;
}

.atf-current-table-wrap {
    overflow-x: auto;
    background: #f4f4f4;
    border-left: 7px solid var(--atf-farbe, var(--atf-yellow));
    border-radius: .45rem;
    padding: clamp(1rem, 3vw, 1.5rem);
}

.atf-current-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.atf-current-table-wrap th,
.atf-current-table-wrap td {
    padding: .75rem .9rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: middle;
}

.atf-current-table-wrap th {
    color: #111;
    font-weight: 900;
    background: #fafafa;
}

.atf-current-table-wrap tr:nth-child(even) td {
    background: #fcfcfc;
}
