/* Old import */
.block-external_api_call {
    .external_api_results {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;

        table {
            display: block;
            margin: 0;
        }
        tbody {
            display: flex;
            gap: 1rem;
        }
        tr {
            flex-shrink: 0;
            flex-grow: 0;
            display: grid;
            grid-template-columns: 1fr 0.3fr;
            grid-template-rows: 1fr 1fr;
            column-gap: 0.5rem;
            grid-auto-flow: column;
            width: 13rem;
            height: 7rem;
            padding: 0.5rem;
            border-left: 2px solid #e60031;
            background: #d4d4d8;
        }
        tr:nth-child(even) {
            background: #efeff0;
        }
        td {
            display: block;
            padding: 0;
            background: none;
        }
        td:nth-child(1) {
            display: none;
        }
        td:nth-child(2) {
            display: none;
        }
        td:nth-child(3) {
            grid-area: 1/1/2/2;
            align-self: center;
        }
        td:nth-child(4) {
            grid-area: 1/2/1/2;
            align-self: center;
            justify-self: center;
            font-size: 1.3rem;
            font-weight: bold;
            background: #ffffff;
            padding: 0.25rem 0.5rem;
            min-width: 2rem;
            text-align: center;
        }
        td:nth-child(5) {
            grid-area: 2/1/3/2;
            align-self: center;
        }
        td:nth-child(6) {
            grid-area: 2/2/3/3;
            align-self: center;
            justify-self: center;
            font-size: 1.3rem;
            font-weight: bold;
            background: #ffffff;
            padding: 0.25rem 0.5rem;
            min-width: 2rem;
            text-align: center;
        }
        td:nth-child(7) {
            display: none;
        }
        .team_of_interest {
            font-weight: bold;
        }
        .score_won {
            background-color: #ff1a4b !important;
            color: #ffffff;
        }
        .score_lost {
            background-color: #808088 !important;
            color: #ffffff;
        }
    }
    .external_api_fixtures {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;

        table {
            display: block;
            margin: 0;
        }
        tbody {
            display: flex;
            gap: 1rem;
        }
        tr {
            flex-shrink: 0;
            flex-grow: 0;
            display: grid;
            grid-template-columns: 1fr 0.4fr;
            grid-template-rows: 1fr 0.3fr 0.3fr 1fr;
            column-gap: 0.5rem;
            grid-auto-flow: column;
            width: 13rem;
            height: 7rem;
            padding: 0.5rem;
            border-left: 2px solid #e60031;
            background: #d4d4d8;
        }
        tr:nth-child(even) {
            background: #efeff0;
        }
        td {
            display: block;
            padding: 0;
            background: none !important;
        }
        td:nth-child(1) {
            grid-area: 1 / 2 / 2 / 3;
            align-self: end;
            text-align: center;
            font-size: 0.9rem;
        }
        tr.no-time td:nth-child(1) {
            grid-area: 1 / 2 / 3 / 3;
        }
        tr.is-central-venue td:nth-child(1) {
            grid-area: 1 / 2 / 3 / 3;
        }
        tr.is-central-venue.no-time td:nth-child(1) {
            grid-area: 1 / 2 / 5 / 3;
            align-self: center;
        }
        td:nth-child(2) {
            grid-area: 2 / 2 / 4 / 3;
            align-self: center;
            text-align: center;
            font-size: 1.1rem;
        }
        tr.no-time td:nth-child(2) {
            display: none;
        }
        tr.is-central-venue td:nth-child(2) {
            grid-area: 3 / 2 / 5 / 3;
            align-self: start;
        }
        td:nth-child(3) {
            grid-area: 4 / 2 / 5 / 3;
            text-align: center;
            font-size: 0.9rem;
        }
        tr.no-time td:nth-child(3) {
            grid-area: 3 / 2 / 5 / 3;
            align-self: start;
        }
        tr.is-central-venue td:nth-child(3) {
            display: none;
        }
        td:nth-child(4) {
            grid-area: 1 / 1 / 3 / 2;
            align-self: center;
        }
        td:nth-child(5) {
            grid-area: 3 / 1 / 5 / 2;
            align-self: center;
        }
        .team_of_interest {
            font-weight: bold;
        }
    }
    .external_api_league_tables {
        font-size: 0.9em;
        overflow-x: auto;

        th,
        td {
            width: 8%;
        }
        th:nth-child(2),
        td:nth-child(2) {
            width: 44%;
        }
        th:nth-child(n+3),
        td:nth-child(n+3) {
            text-align: right;
        }
        .team-highlight th,
        .team-highlight td {
            background: #ff1a4b;
            color: #ffffff;
        }
        caption {
            caption-side: bottom;
            text-align: center;
            font-weight: normal;
            font-size: 0.8rem;
            margin-top: 1rem;
            color: #808088;
        }
        @media (max-width: 600px) {
            th:nth-child(1),
                td:nth-child(1) {
                display: none;
            }
        }
    }
    .external_attribution {
        text-align: center;
        font-weight: normal;
        font-size: 0.8rem;
        color: #808088;
    }
    .external_links {
        text-align: center;
    }
    .fixture_container {
        position: relative;

        .scroll-button-container {
            position: absolute;
            right: 0;
            top: 0;

            button {
                padding: 0.1rem 0.3rem;
                margin-left: 0.25rem;
            
                &[disabled] {
                    pointer-events: none;
                    background: #ccc !important;
                    border-color: #ccc !important;
                }
            }
        }
        .disable-scrollbars {
            position: relative;
            scrollbar-width: none;

            &::-webkit-scrollbar {
                display: none;
            }
        }
    }
}

/* New import */
.nbr-embed-team-switcher {
    position: relative;
    min-height: 10rem;

    button {
        border-color: #7e001b;
        background: #e60031;

        &:hover {
            background: #ff1a4b;
        }

        &:focus {
            background: white;
            color: #e60031 !important;
            box-shadow: none;
        }

        .icon {
            margin: -7px 0 0 0.2em;
        }
    }

    .switcher ul {
        display: none;
        position: absolute;
        padding: 0;
        box-shadow: 0 0 10px -3px #808088;
        z-index: 1000;

        li {
            list-style: none;
            margin: 0;
            background: #e60031;
            color: white;

            a {
                display: block;
                color: white;
                text-decoration: none;
                padding: 0.5rem 0.75rem;

                span {
                    font-weight: normal;
                }

                &.selected {
                    pointer-events: none;
                }
            }

            &:hover {
                background: #7e001b;
            }

            &:has(a.selected) {
                background: white;
                color: #e60031;

                a {
                    color: #e60031 !important;
                }
            }
        }
    }

    .switcher:focus-within ul {
        display: block;
    }
}

.nbr-embed-results {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    margin-bottom: 1rem;

    table {
        display: block;
        margin: 0 0 1rem;

        tbody {
            display: flex;
            gap: 1rem;

            tr {
                scroll-snap-align: start;
                flex-shrink: 0;
                flex-grow: 0;
                display: grid;
                grid-template-columns: 1fr 0.3fr;
                grid-template-rows: 1fr 1fr;
                gap: 0.25rem 0.5rem;
                grid-auto-flow: column;
                width: 13rem;
                height: 7rem;
                padding: 0.5rem;
                border-left: 2px solid #e60031;
                background: #d4d4d8;

                &:nth-child(even) {
                    background: #efeff0;
                }

                td {
                    display: block;
                    padding: 0;
                    background: none;

                    &:nth-child(1) {
                        display: none;
                    }

                    &:nth-child(2) {
                        grid-area: 1/1/2/2;
                        align-self: center;
                    }

                    &:nth-child(3) {
                        grid-area: 1/2/1/2;
                        align-self: center;
                        justify-self: center;
                        font-size: 1.3rem;
                        font-weight: bold;
                        background: #ffffff;
                        padding: 0.25rem 0.5rem;
                        min-width: 2rem;
                        text-align: center;
                    }

                    &:nth-child(4) {
                        grid-area: 2/1/3/2;
                        align-self: center;
                    }

                    &:nth-child(5) {
                        grid-area: 2/2/3/3;
                        align-self: center;
                        justify-self: center;
                        font-size: 1.3rem;
                        font-weight: bold;
                        background: #ffffff;
                        padding: 0.25rem 0.5rem;
                        min-width: 2rem;
                        text-align: center;
                    }
                }
            }
        }
    }

    .highlight-team {
        font-weight: bold;
    }

    tr:has(> .team1name.highlight-team)>.team1score.score_won,
    tr:has(> .team2name.highlight-team)>.team2score.score_won {
        background-color: #ff1a4b !important;
        color: #ffffff;
    }

    tr:has(> .team1name.highlight-team)>.team1score.score_lost,
    tr:has(> .team2name.highlight-team)>.team2score.score_lost {
        background-color: #808088 !important;
        color: #ffffff;
    }
}

.nbr-embed-fixtures {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-bottom: 1rem;

    table {
        display: block;
        margin: 0 0 1rem;

        tbody {
            display: flex;
            gap: 1rem;

            tr {
                scroll-snap-align: start;
                flex-shrink: 0;
                flex-grow: 0;
                display: grid;
                grid-template-columns: 1fr 0.4fr;
                grid-template-rows: 1fr 1fr;
                gap: 0.25rem 0.5rem;
                grid-auto-flow: column;
                width: 13rem;
                height: 7rem;
                padding: 0.5rem;
                border-left: 2px solid #e60031;
                background: #d4d4d8;

                &:nth-child(even) {
                    background: #efeff0;
                }

                td {
                    display: block;
                    padding: 0;
                    background: none !important;

                    &:nth-child(1) {
                        grid-area: 1 / 2 / 3 / 3;
                        align-self: center;
                        text-align: center;
                        font-size: 0.9rem;
                    }

                    &:nth-child(2) {
                        grid-area: 1 / 1 / 2 / 2;
                        align-self: center;
                    }

                    &:nth-child(3) {
                        grid-area: 2 / 1 / 3 / 2;
                        align-self: center;
                    }
                }
            }
        }
    }

    .highlight-team {
        font-weight: bold;
    }
}

.nbr-embed-table {
    font-size: 0.9em;
    overflow-x: auto;

    table.league-table {

        th,
        td {
            width: 8%;

            &:nth-child(1) {
                width: 44%;
            }

            &:nth-child(n+2) {
                text-align: center;
            }

            .highlight-team & {
                background: #ff1a4b;
                color: #ffffff;
            }
        }
    }
}

.scrollable {
    position: relative;

    .scroll-button-container {
        position: absolute;
        top: -2.5em;
        right: 0;

        button {
            padding: 0.1rem 0.3rem;
            margin-left: 0.25rem;

            &[disabled] {
                pointer-events: none;
                background: #ccc !important;
                border-color: #ccc !important;
            }
        }
    }
}
