/* ==========================================================================
   JJRC Competition — schedule & standings
   Accent defaults to the site brand red; team-page renders override it with
   the team's --jjrc-accent (primary colour) inline.
   ========================================================================== */

.jjrc-schedule,
.jjrc-standings {
    --jjrc-accent: #ed1c24;
}

.jjrc-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.jjrc-empty {
    padding: 1rem 0;
    color: #fff;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Standings table — mirrors the original TablePress `.jjrc-results-table`
   structure (caption + thead, .row-N / .column-N) so the existing global
   styling applies, with a self-contained base so it also stands alone.
   -------------------------------------------------------------------------- */

.jjrc-results-table {
    --text-color: var(--e-global-color-a212a8c, #fff);
    --head-bg-color: var(--e-global-color-1c35429, #111);
    --head-text-color: var(--e-global-color-a212a8c, #fff);
    --border-color: var(--e-global-color-4e63e15, rgba(255, 255, 255, 0.12));
    --padding: 1rem;
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

.jjrc-results-table th,
.jjrc-results-table td {
    padding: var(--padding);
    border: none;
    text-align: left;
}
.jjrc-results-table thead th {
    background: var(--head-bg-color);
    color: var(--head-text-color);
    font-weight: 600;
}
.jjrc-results-table caption + thead tr:first-child th {
    border-top: none;
}
.jjrc-results-table td {
    vertical-align: middle;
}

.jjrc-results-table tbody > tr:nth-child(odd) > td {
    background-color: var(--head-bg-color);
}
.jjrc-results-table tbody > tr:nth-child(odd):hover {
    background-color: hsla(0, 0%, 50%, 0.102);
}

.jjrc-results-table td.column-2 img {
    width: 40px;
    margin-right: 10px;
    display: inline-block;
    vertical-align: bottom;
}
.jjrc-results-table td.column-2 .team-container {
    font-family: var(--e-global-typography-3042de8-font-family);
    font-size: 17px;
    display: inline-block;
    vertical-align: baseline;
    color: var(--e-global-color-7ce439d, #fff);
}
.jjrc-results-table td.column-2 .team-container .team-region {
    font-size: 0.9em;
    line-height: 0.9em;
    opacity: 0.7;
}
.jjrc-results-table td.column-2 a.jjrc-team-link {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}
.jjrc-results-table td.column-2 a.jjrc-team-link:hover .team-name {
    text-decoration: underline;
}

/* Top-two emphasis (rank 1 & 2 sit in .row-2 / .row-3) */
.jjrc-results-table .row-2 .column-1,
.jjrc-results-table .row-3 .column-1 {
    color: var(--e-global-color-844d3ce, #ed1c24);
}
.jjrc-results-table .row-2,
.jjrc-results-table .row-3 {
    background-color: #ea19210a;
}

/* On the team page (highlighted table) drop the generic top-two emphasis... */
.jjrc-results-table.has-current .row-2 .column-1,
.jjrc-results-table.has-current .row-3 .column-1 {
    color: inherit;
}
.jjrc-results-table.has-current .row-2,
.jjrc-results-table.has-current .row-3 {
    background-color: transparent;
}

/* Current-team highlight. Main page: brand accent bar + faint tint.
   Team page (.has-current): the team's own primary colour for the rank
   number and the team's transparent colour for the row background. */
.jjrc-results-table tr.is-current-team > td {
    background-color: rgba(255, 255, 255, 0.045);
}
.jjrc-results-table.has-current tr.is-current-team > td {
    background-color: var(--jjrc-team-transparent, rgba(255, 255, 255, 0.045));
}
.jjrc-results-table.has-current tr.is-current-team .column-1 {
    color: var(--jjrc-accent);
}

@media (max-width: 767px) {
    .jjrc-results-table {
        --padding: 0.4rem;
    }
    .jjrc-results-table caption + thead tr:first-child th {
        text-align: center;
    }
    .jjrc-results-table th:not(.column-1):not(.column-2),
    .jjrc-results-table td:not(.column-1):not(.column-2) {
        text-align: center;
        width: 34px;
    }
    .jjrc-results-table td.column-2 img {
        width: 34px;
    }
    .jjrc-results-table td.column-2 .team-container {
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   Schedule
   -------------------------------------------------------------------------- */

.jjrc-schedule {
    width: 100%;
}

/* Tabs (main page) */
.jjrc-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 22px;
}
.jjrc-tab {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 15px 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    margin-bottom: -1px;
}
.jjrc-tab:hover {
    background: var(--e-global-color-fc63a75);
    border-bottom-color: var(--e-global-color-024be45);
}
.jjrc-tab .jjrc-tab-label {
    font-family: "Open Sans", Sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 27px;
    text-transform: uppercase;
    text-align: center;
    color: #fff;
}
.jjrc-tab .jjrc-tab-date {
    font-family: "Open Sans", Sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
    text-align: center;
}
.jjrc-tab.is-active {
    background: var(--e-global-color-fc63a75);
    border-bottom-color: var(--jjrc-accent);
}

.jjrc-tab-panel {
    display: none;
}
.jjrc-tab-panel.is-active {
    display: block;
}

/* Day heading (the "Match 1" pill + date) */
.jjrc-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0 30px;
}
.jjrc-day-pill {
    background: var(--jjrc-accent);
    color: #fff;
    font-weight: 500;
    font-size: 16px;
    padding: 5px 20px;
    text-transform: uppercase;
    display: inline-block;
}
.jjrc-day-date {
    font-size: 13px;
    color: #aaa;
}
.jjrc-day-rule {
    display: flex;
    max-width: 100%;
    padding: 0 15px;
    height: 100%;
    flex-grow: 1;
}
.jjrc-day-rule__inner {
    border-top: 1px solid var(--e-global-color-4e63e15);
    width: 100%;
}

/* Match row */
.jjrc-match {
    display: flex;
    align-items: center;
    background: #111;
    border: 1px solid var(--e-global-color-4e63e15);
    padding: 10px 14px;
    margin-bottom: 12px;
    gap: 12px;
}
.jjrc-match .jjrc-team {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.jjrc-match .jjrc-team--a {
    justify-content: flex-start;
}
.jjrc-match .jjrc-team--b {
    justify-content: flex-end;
}

.jjrc-logo {
    width: 70px;
    height: 70px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: rgba(255, 255, 255, 0.04);
}
.jjrc-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.jjrc-team-name {
    font-family: "Open Sans", sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jjrc-match .jjrc-team--b .jjrc-team-name {
    text-align: right;
}
.jjrc-team-name a {
    color: inherit;
    text-decoration: none;
}
.jjrc-team-name a:hover {
    text-decoration: underline;
}

.jjrc-vs {
    flex: none;
    width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jjrc-vs span {
    background: var(--e-global-color-fc63a75);
    color: #ed1c24;
    font-weight: 500;
    font-size: 18px;
    font-family: "Open Sans", sans-serif;
    line-height: 23px;
    padding: 23px 23px;
}

@media (max-width: 767px) {
    .jjrc-tab {
        padding: 10px;
    }
    .jjrc-tab .jjrc-tab-label {
        font-size: 14px;
        line-height: 21px;
    }
    .jjrc-tab .jjrc-tab-date {
        font-size: 12px;
    }
    .jjrc-match {
        padding: 5px 5px;
        gap: 8px;
    }
    .jjrc-team {
        gap: 8px;
    }
    .jjrc-team-name {
        font-size: 13px;
        white-space: normal;
    }
    .jjrc-logo {
        width: 38px;
        height: 38px;
    }
    .jjrc-vs {
        width: 44px;
    }
    .jjrc-vs span {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   Sponsors — [jjrc_sponsors]
   Card look mirrors the original hardcoded main-page cards (padded logo box,
   centred initials, name below). The --team variant tints the initials box
   with the team's brand colours via the --jjrc-* vars emitted in wp_head on a
   team single; image logos always sit on a light box so any logo reads.
   -------------------------------------------------------------------------- */

.jjrc-sponsors {
    --jjrc-sponsor-box-bg: var(--e-global-color-1322fd4, #1a1a1a);
    --jjrc-sponsor-initials-color: var(--e-global-color-a212a8c, #fff);
    --jjrc-sponsor-heading-color: var(--e-global-color-3f423bc, #caa46a);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.jjrc-sponsors--team {
    --jjrc-sponsor-box-bg: var(--jjrc-team-transparent, #f8b88b1a);
    --jjrc-sponsor-initials-color: var(--jjrc-accent, var(--e-global-color-04c52d7, #fff));
    --jjrc-sponsor-heading-color: var(--e-global-color-04c52d7, #3b6cb5);
}

.jjrc-sponsor-group__title {
    margin: 0 0 18px;
    font-family: "Open Sans", sans-serif;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--jjrc-sponsor-heading-color);
}

.jjrc-sponsor-grid {
    display: grid;
    grid-template-columns: repeat(var(--jjrc-cols, 4), minmax(0, 1fr));
    gap: 24px;
}
@media (max-width: 1024px) {
    .jjrc-sponsor-grid {
        grid-template-columns: repeat(var(--jjrc-cols-tablet, 4), minmax(0, 1fr));
    }
}

.jjrc-sponsor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
/* When the sponsor has a URL the whole card is an <a>: strip link styling and
   underline only the name on hover/focus of the card. */
.jjrc-sponsor-card--link {
    color: inherit;
    text-decoration: none;
}
.jjrc-sponsor-card--link:hover .jjrc-sponsor-name,
.jjrc-sponsor-card--link:focus-visible .jjrc-sponsor-name {
    text-decoration: underline;
}

.jjrc-sponsor-logo {
    width: 100%;
    aspect-ratio: 21 / 9;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    background: var(--jjrc-sponsor-box-bg);
}
.jjrc-sponsor-logo--image {
    background: var(--e-global-color-7ce439d, #fff);
}
/* Fill the box and contain: the image scales to fit inside the fixed-ratio box
   (centred, ratio preserved) so portrait/tall logos never stretch the box. */
.jjrc-sponsor-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.jjrc-sponsor-initials {
    font-family: "Ropa Sans", sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--jjrc-sponsor-initials-color);
}

.jjrc-sponsor-name {
    margin-top: 15px;
    font-family: "Open Sans", sans-serif;
    font-size: 15px;
    line-height: 1.3;
    color: var(--e-global-color-a212a8c, #fff);
}
.jjrc-sponsor-teams {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.3;
    color: #979797;
}

@media (max-width: 767px) {
    .jjrc-sponsor-grid {
        grid-template-columns: repeat(var(--jjrc-cols-mobile, 1), minmax(0, 1fr));
        gap: 16px;
    }
    .jjrc-sponsor-initials {
        font-size: 22px;
    }
}
