/*
 * „Sportarten" in der Sprache der Spieldetailseite und von „Alle Spiele":
 * dieselben Farben, dieselbe Schrift für Zahlen und Namen. Das Eigene der Seite
 * ist die Tafel oben — die Piktogramme aller besuchten Sportarten auf einen
 * Blick, Fußball zuletzt und für sich. Die Versprechen stehen in specs/sports.md.
 */

/* Vorspann: der Kasten aus intro-text.md, in der ruhigen Form von „Alle Spiele". */

.sports-page .collection-intro {
    margin: 4px 0 22px;
    background: transparent;
    border: 0;
}

.sports-page .collection-intro .card-header {
    padding: 0;
    background: transparent;
    border: 0;
    font-family: var(--gh-numeral);
    font-weight: 700;
    font-size: 22px;
    color: var(--gh-night);
}

.sports-page .collection-intro .card-body {
    padding: 4px 0 0;
    font-style: normal;
    font-size: 16px;
    line-height: 1.55;
    color: var(--gh-ink);
}

.sports-page .collection-numbers {
    display: block;
    margin-top: 6px;
    font-family: var(--gh-numeral);
    font-weight: 600;
    font-size: 17px;
    color: var(--gh-muted);
    font-variant-numeric: tabular-nums;
}

/* Das Schild: ein weißes Feld, auf dem das schwarze Piktogramm steht. */
.sport-plate {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 6px;
}

.sport-plate img {
    width: 30px;
    height: 30px;
}

.sport-plate--large {
    width: 52px;
    height: 52px;
}

.sport-plate--large img {
    width: 40px;
    height: 40px;
}

/* Die Tafel */

.sport-board {
    margin: 0 0 34px;
    padding: 14px;
    background: var(--gh-paper);
    border-radius: 8px;
}

.sport-board__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sport-board__link {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 5px 8px 5px 5px;
    border-radius: 6px;
    color: var(--gh-ink);
    text-decoration: none;
}

.sport-board__link:hover {
    background: var(--gh-paper-hover);
    color: var(--gh-ink);
}

.sport-board__link:focus-visible,
.sport-row:focus-visible {
    outline: 2px solid var(--gh-night);
    outline-offset: 1px;
}

.sport-board__name {
    min-width: 0;
    font-family: var(--gh-numeral);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.15;
    color: var(--gh-night);
    hyphens: auto;
}

.sport-board__count {
    font-family: var(--gh-numeral);
    font-weight: 700;
    font-size: 20px;
    color: var(--gh-grass);
    font-variant-numeric: tabular-nums;
}

/* Eine Gruppe der Tafel: ihr Name als Sprung zur Gruppe, darunter ihre
   Sportarten. */
.sport-board__group + .sport-board__group {
    margin-top: 12px;
}

.sport-board__group-name {
    display: inline-block;
    margin: 0 0 4px 5px;
    font-family: var(--gh-numeral);
    font-weight: 600;
    font-size: 15px;
    color: var(--gh-muted);
    text-decoration: none;
}

.sport-board__group-name:hover {
    color: var(--gh-grass);
    text-decoration: underline;
}

.sport-board__group-name:focus-visible {
    outline: 2px solid var(--gh-night);
    outline-offset: 2px;
}

/* Fußball: die eine Gruppe, die anders ist — ohne Namen hinter dem Abriss, das
   Schild in Nachtfarbe. Seine Zahl steht für sich und muss nicht lauter sein
   als die anderen. */
.sport-board__group--football {
    padding-top: 12px;
    border-top: 2px dashed var(--gh-perforation);
}

.sport-board__group--football .sport-board__list {
    grid-template-columns: 1fr;
}

.sport-board__group--football .sport-board__link {
    grid-template-columns: auto auto 1fr;
}

.sport-board__group--football .sport-plate {
    background: var(--gh-night);
}

.sport-board__group--football .sport-plate img {
    filter: invert(1);
}

.sport-board__group--football .sport-board__count {
    color: var(--gh-muted);
}

/* Eine Gruppe in der Liste: ihr Name steht nur auf der Tafel. Hier ist sie
   Sprungziel und Überschrift für Screenreader, sichtbar nur als etwas mehr Luft
   vor ihrer ersten Sportart. */

.sport-group {
    scroll-margin-top: 16px;
}

.sport-group + .sport-group {
    margin-top: 56px;
}

/* Ein Abschnitt je Sportart */

.sport-section {
    margin-bottom: 34px;
    scroll-margin-top: 16px;
}

.sport-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 8px;
}

.sport-heading .sport-plate {
    background: var(--gh-paper);
}

.sport-heading__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sport-heading__name {
    font-family: var(--gh-numeral);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.1;
    color: var(--gh-night);
}

.sport-heading__facts {
    font-family: var(--gh-numeral);
    font-weight: 600;
    font-size: 16px;
    color: var(--gh-muted);
    font-variant-numeric: tabular-nums;
}

/* Die Zeilen. Auf dem Telefon: Ziffer links, rechts Ground, Begegnung und
   darunter Datum und Liga. Ab Tablet bekommen Datum und Liga eigene Spalten. */

.sport-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sport-rows__item + .sport-rows__item {
    border-top: 1px solid var(--gh-rule);
}

.sport-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas:
        "count place place"
        "count fixture fixture"
        "count date league";
    column-gap: 10px;
    row-gap: 1px;
    padding: 8px 8px 8px 0;
    color: var(--gh-ink);
    text-decoration: none;
}

a.sport-row:hover {
    background: var(--gh-paper);
    color: var(--gh-ink);
}

.sport-row__counter {
    grid-area: count;
    align-self: start;
    text-align: right;
    font-family: var(--gh-numeral);
    font-weight: 700;
    font-size: 19px;
    line-height: 1.2;
    color: var(--gh-muted);
    font-variant-numeric: tabular-nums;
}

.sport-row__place {
    grid-area: place;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.sport-row__place img {
    flex: none;
}

.sport-row__flag {
    max-height: 14px;
    max-width: 22px;
}

.sport-row__ground {
    font-family: var(--gh-numeral);
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
    color: var(--gh-night);
}

.sport-row__fixture {
    grid-area: fixture;
    font-size: 14px;
    line-height: 1.35;
}

.sport-row__date {
    grid-area: date;
    font-size: 13px;
    color: var(--gh-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sport-row__league {
    grid-area: league;
    font-size: 13px;
    color: var(--gh-muted);
    text-align: right;
}

.sport-rows__item--coming-soon .sport-row__ground,
.sport-rows__item--coming-soon .sport-row__fixture {
    color: var(--gh-muted);
}

@media (max-width: 575.98px) {
    .sport-board {
        padding: 10px 8px;
    }

    .sport-board__link {
        gap: 7px;
        padding: 4px;
    }

    .sport-board .sport-plate {
        width: 34px;
        height: 34px;
    }

    .sport-board .sport-plate img {
        width: 26px;
        height: 26px;
    }

    .sport-board__name {
        font-size: 14px;
    }

    .sport-board__count {
        font-size: 17px;
    }
}

@media (min-width: 576px) {
    .sport-board__list {
        grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    }
}

@media (min-width: 768px) {
    .sport-board {
        padding: 16px;
    }

    .sport-row {
        grid-template-columns: 48px 104px 1fr 170px;
        grid-template-areas:
            "count date place league"
            "count date fixture league";
        column-gap: 14px;
        padding: 7px 10px 7px 0;
    }

    .sport-row__date {
        padding-top: 3px;
        font-size: 14px;
        color: var(--gh-ink);
    }

    .sport-row__league {
        padding-top: 3px;
        font-size: 14px;
    }

    .sport-row__team {
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .sport-board__link,
    a.sport-row {
        transition: background-color .15s ease;
    }
}
