/* The month calendar of games (FEAT-110): public Schedule and the portal's Leagues > Schedule. Built by
   Assets/js/game-calendar.js. Colours come from Bootstrap's variables (and the tenant's --lm-accent where the page has
   one), so it follows each site's look. */

/* List | Calendar switch */
.gc-switch {
    display: inline-flex;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 30px;
    overflow: hidden;
    font-size: 0.875rem;
}

.gc-switch a,
.gc-switch button {
    display: inline-block;
    padding: 0.35rem 1.1rem;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color, #555);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.gc-switch a:hover,
.gc-switch button:hover {
    background: var(--bs-tertiary-bg, #EFEFEF);
}

.gc-switch .gc-on,
.gc-switch .gc-on:hover {
    background: #000;
    color: #FFF;
    cursor: default;
}

/* The calendar's own month bar (the portal; the public page uses its month bar) */
.game-calendar .gc-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.game-calendar .gc-title {
    margin: 0;
    text-align: center;
    font-size: 1.25rem;
}

.game-calendar .gc-btn {
    justify-self: start;
    border: 0;
    border-radius: 30px;
    padding: 0.4rem 0.9rem;
    background: var(--bs-tertiary-bg, #EFEFEF);
    color: var(--bs-secondary-color, #555);
    font-size: 0.875rem;
    white-space: nowrap;
}

.game-calendar .gc-bar .gc-btn:last-child {
    justify-self: end;
}

.game-calendar .gc-btn:hover:not(:disabled) {
    background: var(--bs-secondary-bg, #CCC);
    color: var(--bs-body-color, #222);
}

.game-calendar .gc-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* The grid: seven equal columns */
.game-calendar .gc-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.game-calendar .gc-table th {
    padding: 0.4rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-tertiary-bg, #F5F7FA);
    color: var(--bs-secondary-color, #555);
    font-weight: 400;
    text-align: center;
}

.game-calendar .gc-day {
    height: 6.5rem;
    padding: 0.25rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #FFF);
    vertical-align: top;
    overflow: hidden;
}

.game-calendar .gc-out {
    background: var(--bs-tertiary-bg, #F5F7FA);
}

.game-calendar .gc-date {
    margin-bottom: 0.2rem;
    color: var(--bs-secondary-color, #555);
    font-size: 0.75rem;
}

.game-calendar .gc-dow {
    display: none;
}

.game-calendar .gc-today {
    outline: 2px solid var(--lm-accent, var(--bs-primary, #0d6efd));
    outline-offset: -2px;
}

.game-calendar .gc-today .gc-num {
    display: inline-block;
    min-width: 1.5em;
    padding: 0.05em 0.35em;
    border-radius: 30px;
    background: var(--lm-accent, var(--bs-primary, #0d6efd));
    color: var(--lm-accent-fg, #FFF);
    text-align: center;
}

.game-calendar .gc-games {
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-calendar .gc-games li + li {
    margin-top: 0.2rem;
}

/* A game: its time, the teams (visitors at home) and, when there is one, its score or status */
.game-calendar .gc-game {
    display: block;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    background: var(--bs-tertiary-bg, #EFEFEF);
    color: var(--bs-body-color, #000);
    line-height: 1.25;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.game-calendar a.gc-game:hover,
.game-calendar a.gc-game:focus-visible {
    background: var(--bs-secondary-bg, #CCC);
    color: var(--bs-body-color, #000);
}

.game-calendar .gc-time {
    display: block;
    font-weight: 600;
    white-space: nowrap;
}

.game-calendar .gc-result {
    display: block;
    font-weight: 600;
}

.game-calendar .gc-alert {
    display: inline-block;
    margin-top: 0.1rem;
    padding: 0 0.4em;
    border-radius: 30px;
    background: var(--bs-warning, #FFC107);
    color: #000;
    font-size: 0.6875rem;
}

/* A league event beside the games (the member area's Family Calendar): a bar on the left sets it apart */
.game-calendar .gc-event {
    border-left: 3px solid var(--lm-accent, var(--bs-primary, #0d6efd));
}

.game-calendar .gc-empty {
    margin: 0.75rem 0 0;
    color: var(--bs-secondary-color, #555);
}

@media (min-width: 576px) {
    /* A month with no games shows its empty grid; the words are for the phone's list */
    .game-calendar .gc-empty {
        display: none;
    }
}

/* A phone has no room for seven columns: the month becomes a list of the days that have games, each day's date
   (with its weekday) over its games */
@media (max-width: 575.98px) {
    .game-calendar .gc-table,
    .game-calendar .gc-table tbody,
    .game-calendar .gc-table tr,
    .game-calendar .gc-table td {
        display: block;
    }

    .game-calendar .gc-table thead,
    .game-calendar .gc-table td:not(.gc-has) {
        display: none;
    }

    .game-calendar .gc-table td.gc-has {
        height: auto;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        border-radius: 6px;
    }

    .game-calendar .gc-dow {
        display: inline;
    }

    .game-calendar .gc-date {
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--bs-body-color, #000);
    }

    .game-calendar .gc-game {
        padding: 0.4rem 0.5rem;
        font-size: 0.875rem;
    }

    .game-calendar .gc-time,
    .game-calendar .gc-result {
        display: inline;
    }

    .game-calendar .gc-time::after {
        content: " ";
    }

    .game-calendar .gc-result {
        margin-left: 0.5rem;
    }

    .game-calendar .gc-title {
        font-size: 1.0625rem;
    }

    .game-calendar .gc-btn {
        padding: 0.35rem 0.6rem;
    }
}
