/*
 * Coluna do Fla — Calendário de Jogos
 *
 * Tudo sob .cdfj. Os seletores têm pelo menos dois níveis de classe para
 * vencer os estilos de conteúdo do tema (no Foxiz: .rbct ul, .rbct a,
 * .medium-entry-size .rbct h2) sem !important.
 *
 * Tamanhos em px: o tema pode definir o corpo do texto bem grande (o Foxiz
 * usa 20px), e o calendário precisa de uma escala compacta e previsível.
 * Cores: usa o vermelho do tema quando existe (--g-color no Foxiz).
 */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
.cdfj {
    --cdfj-red: var(--g-color, #e60012);
    --cdfj-text: #0d1117;
    --cdfj-text-2: #344054;
    --cdfj-muted: #667085;
    --cdfj-border: #e5e7eb;
    --cdfj-surface: #fff;
    --cdfj-surface-2: #f2f4f7;
    --cdfj-win: #15803d;
    --cdfj-loss: #dc2626;
    --cdfj-live: #e11d48;
    --cdfj-radius: 12px;

    color: var(--cdfj-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
}

[data-theme="dark"] .cdfj {
    --cdfj-text: #f8f9fa;
    --cdfj-text-2: #c4cbd5;
    --cdfj-muted: #9ca3af;
    --cdfj-border: #2a3d45;
    --cdfj-surface: #1a1c20;
    --cdfj-surface-2: #121316;
    --cdfj-win: #22c55e;
    --cdfj-loss: #ef4444;
}

.cdfj *,
.cdfj *::before,
.cdfj *::after {
    box-sizing: border-box;
}

.cdfj .cdfj-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip: rect(0, 0, 0, 0);
}

/* ── Botão / link de ação ─────────────────────────────────────────────────── */
.cdfj .cdfj-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    margin: 0;
    padding: 0 16px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    background: var(--cdfj-red);
    border: 1px solid var(--cdfj-red);
    border-radius: 999px;
    box-shadow: none;
    cursor: pointer;
}

.cdfj .cdfj-button:hover,
.cdfj .cdfj-button:focus-visible {
    color: #fff;
    text-decoration: none;
    filter: brightness(0.92);
}

.cdfj .cdfj-button--ghost {
    min-height: 34px;
    padding: 0 14px;
    color: var(--cdfj-text);
    background: transparent;
    border-color: var(--cdfj-border);
    border-radius: 8px;
}

.cdfj .cdfj-button--ghost:hover,
.cdfj .cdfj-button--ghost:focus-visible {
    color: var(--cdfj-text);
    border-color: var(--cdfj-muted);
    filter: none;
}

.cdfj .cdfj-button:focus-visible,
.cdfj .cdfj-tabs__link:focus-visible,
.cdfj .cdfj-round-nav__arrow:focus-visible,
.cdfj .cdfj-select__control:focus-visible {
    outline: 2px solid var(--cdfj-red);
    outline-offset: 2px;
}

/* ── Escudo e selos ───────────────────────────────────────────────────────── */
.cdfj .cdfj-crest {
    flex-shrink: 0;
    width: 28px;
    max-width: none;
    height: 28px;
    margin: 0;
    object-fit: contain;
}

.cdfj .cdfj-crest--lg {
    width: 48px;
    height: 48px;
}

.cdfj .cdfj-crest--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cdfj-text-2);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    background: var(--cdfj-surface-2);
    border: 1px solid var(--cdfj-border);
    border-radius: 999px;
}

.cdfj .cdfj-crest--lg.cdfj-crest--fallback {
    font-size: 12px;
}

.cdfj .cdfj-result {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border-radius: 4px;
}

.cdfj .cdfj-result--win {
    background: var(--cdfj-win);
}

.cdfj .cdfj-result--draw {
    color: var(--cdfj-surface);
    background: var(--cdfj-text-2);
}

.cdfj .cdfj-result--loss {
    background: var(--cdfj-loss);
}

.cdfj .cdfj-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--cdfj-red);
    border-radius: 999px;
}

.cdfj .cdfj-badge--live {
    background: var(--cdfj-live);
}

.cdfj .cdfj-badge--live::before {
    width: 6px;
    height: 6px;
    background: currentcolor;
    border-radius: 50%;
    content: "";
    animation: cdfj-pulse 1.5s ease-in-out infinite;
}

@keyframes cdfj-pulse {
    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cdfj .cdfj-badge--live::before {
        animation: none;
    }
}

/* ── Campanha (calendário) ────────────────────────────────────────────────── */
.cdfj .cdfj-record {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
}

.cdfj .cdfj-record__item {
    display: flex;
    flex-direction: column-reverse;
    min-width: 72px;
    margin: 0;
    padding: 8px 12px;
    background: var(--cdfj-surface);
    border: 1px solid var(--cdfj-border);
    border-radius: 8px;
}

.cdfj .cdfj-record__item dt {
    margin: 0;
    color: var(--cdfj-muted);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cdfj .cdfj-record__item dd {
    margin: 0;
    color: var(--cdfj-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.cdfj .cdfj-record__item--win dd {
    color: var(--cdfj-win);
}

.cdfj .cdfj-record__item--loss dd {
    color: var(--cdfj-loss);
}

/* ── Seletor Todos / Próximos / Resultados ─────────────────────────────────── */
.cdfj .cdfj-views {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
    padding: 4px;
    background: var(--cdfj-surface-2);
    border: 1px solid var(--cdfj-border);
    border-radius: 999px;
}

.cdfj .cdfj-views .cdfj-views__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    color: var(--cdfj-text-2);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 999px;
}

.cdfj .cdfj-views .cdfj-views__link:hover {
    color: var(--cdfj-text);
    text-decoration: none;
}

.cdfj .cdfj-views .cdfj-views__link[aria-current="page"] {
    color: #fff;
    background: var(--cdfj-red);
}

.cdfj .cdfj-views .cdfj-views__link:focus-visible {
    outline: 2px solid var(--cdfj-red);
    outline-offset: 2px;
}

.cdfj .cdfj-views__count {
    min-width: 20px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    background: color-mix(in srgb, currentcolor 14%, transparent);
    border-radius: 999px;
}

@media (max-width: 479px) {
    .cdfj .cdfj-views {
        display: flex;
    }

    .cdfj .cdfj-views .cdfj-views__link {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 8px;
    }
}

/* ── Seções: Próximos jogos / Resultados ──────────────────────────────────── */
.cdfj .cdfj-section {
    margin: 0;
}

.cdfj .cdfj-section + .cdfj-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--cdfj-border);
}

.cdfj .cdfj-section .cdfj-section__title {
    margin: 0 0 16px;
    padding: 0;
    color: var(--cdfj-text);
    font-family: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

/* ── Filtros: abas de competição e temporada ──────────────────────────────── */
.cdfj .cdfj-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0 0 24px;
    border-bottom: 2px solid var(--cdfj-border);
}

.cdfj .cdfj-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: -2px;
}

.cdfj .cdfj-tabs__list {
    display: flex;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}

.cdfj .cdfj-tabs__list::-webkit-scrollbar {
    display: none;
}

.cdfj .cdfj-tabs__item {
    position: static;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.cdfj .cdfj-tabs__item::before,
.cdfj .cdfj-tabs__item::marker {
    content: none;
}

.cdfj .cdfj-tabs__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 16px;
    color: var(--cdfj-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.cdfj .cdfj-tabs__link:hover {
    color: var(--cdfj-text);
    text-decoration: none;
}

.cdfj .cdfj-tabs__link[aria-current="page"] {
    color: var(--cdfj-red);
    border-bottom-color: var(--cdfj-red);
}

.cdfj .cdfj-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-bottom: 8px;
}

.cdfj .cdfj-select__label {
    margin: 0;
    color: var(--cdfj-text-2);
    font-size: 12px;
    font-weight: 600;
}

.cdfj .cdfj-select__control {
    width: auto;
    max-width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 4px 32px 4px 12px;
    color: var(--cdfj-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--cdfj-surface);
    border: 1px solid var(--cdfj-border);
    border-radius: 8px;
}

/* ── Grupos (mês / dia) ───────────────────────────────────────────────────── */
.cdfj .cdfj-group {
    margin: 0;
}

.cdfj .cdfj-group + .cdfj-group {
    margin-top: 28px;
}

.cdfj .cdfj-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}

.cdfj .cdfj-group .cdfj-group__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    color: var(--cdfj-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
}

.cdfj .cdfj-group .cdfj-group__title::before {
    display: block;
    flex-shrink: 0;
    width: 3px;
    height: 1.2em;
    background: var(--cdfj-red);
    border-radius: 999px;
    content: "";
}

.cdfj .cdfj-group__count {
    color: var(--cdfj-muted);
    font-size: 12px;
    white-space: nowrap;
}

.cdfj .cdfj-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Linha de jogo ────────────────────────────────────────────────────────── */
/* Mobile: [data/hora ··· resultado] em cima, confronto embaixo. */
.cdfj .cdfj-row {
    display: grid;
    grid-template-areas:
        "when status"
        "main main";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    margin: 0;
    padding: 12px 16px;
    background: var(--cdfj-surface);
    border: 1px solid var(--cdfj-border);
    border-radius: var(--cdfj-radius);
    scroll-margin-top: 120px;
}

/* Desktop: tudo numa linha. */
@media (min-width: 640px) {
    .cdfj .cdfj-row {
        grid-template-areas: "when main status";
        grid-template-columns: 96px minmax(0, 1fr) 40px;
        align-items: center;
        padding: 14px 18px;
    }
}

.cdfj .cdfj-row--next,
.cdfj .cdfj-row--club {
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--cdfj-red) 7%, transparent), transparent 55%),
        var(--cdfj-surface);
    border-color: color-mix(in srgb, var(--cdfj-red) 35%, var(--cdfj-border));
    box-shadow: inset 3px 0 0 var(--cdfj-red);
}

.cdfj .cdfj-row--live {
    border-color: color-mix(in srgb, var(--cdfj-live) 45%, var(--cdfj-border));
    box-shadow: inset 3px 0 0 var(--cdfj-live);
}

.cdfj .cdfj-row__when {
    display: flex;
    grid-area: when;
    align-items: center;
    min-width: 0;
}

.cdfj .cdfj-row__time {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

@media (min-width: 640px) {
    .cdfj .cdfj-row__time {
        flex-direction: column;
        align-items: flex-start;
    }
}

.cdfj .cdfj-row__date {
    color: var(--cdfj-text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cdfj .cdfj-row__hour {
    color: var(--cdfj-text);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cdfj .cdfj-row--finished .cdfj-row__hour {
    color: var(--cdfj-muted);
    font-weight: 600;
}

.cdfj .cdfj-row__main {
    display: flex;
    grid-area: main;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cdfj .cdfj-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    color: var(--cdfj-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cdfj .cdfj-row__competition {
    color: var(--cdfj-red);
}

.cdfj .cdfj-row__competition + .cdfj-row__round::before {
    margin-right: 8px;
    content: "·";
}

.cdfj .cdfj-row__match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.cdfj .cdfj-row__team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cdfj .cdfj-row__team--home {
    flex-direction: row-reverse;
    text-align: right;
}

.cdfj .cdfj-row__team-name {
    min-width: 0;
    overflow: hidden;
    color: var(--cdfj-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cdfj .cdfj-row__team.is-club .cdfj-row__team-name {
    font-weight: 700;
}

.cdfj .cdfj-row__team-short {
    display: none;
}

/* Abaixo de 480px: sigla na tela, nome completo para leitores de tela. */
@media (max-width: 479px) {
    .cdfj .cdfj-row__team-full {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        white-space: nowrap;
        border: 0;
        clip: rect(0, 0, 0, 0);
    }

    .cdfj .cdfj-row__team-short {
        display: inline;
    }
}

.cdfj .cdfj-row__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 64px;
    min-height: 32px;
    padding: 4px 8px;
    color: var(--cdfj-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    background: var(--cdfj-surface-2);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.cdfj .cdfj-row__score-sep,
.cdfj .cdfj-row__score--empty {
    color: var(--cdfj-muted);
    font-size: 14px;
    font-weight: 400;
}

.cdfj .cdfj-row__venue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    color: var(--cdfj-muted);
    font-size: 12px;
    line-height: 1.4;
}

.cdfj .cdfj-row__venue svg {
    flex-shrink: 0;
}

.cdfj .cdfj-row__status {
    display: flex;
    grid-area: status;
    align-items: center;
    justify-content: flex-end;
}

.cdfj .cdfj-row__pending {
    color: var(--cdfj-muted);
    font-size: 11px;
    line-height: 1.3;
    text-align: right;
}

/* ── Navegação entre rodadas ──────────────────────────────────────────────── */
.cdfj .cdfj-round-nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    padding: 12px;
    background: var(--cdfj-surface);
    border: 1px solid var(--cdfj-border);
    border-radius: 16px;
}

.cdfj .cdfj-round-nav__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--cdfj-text);
    text-decoration: none;
    border: 1px solid var(--cdfj-border);
    border-radius: 999px;
}

.cdfj .cdfj-round-nav__arrow:hover {
    color: var(--cdfj-red);
    border-color: var(--cdfj-red);
}

.cdfj .cdfj-round-nav__arrow.is-disabled {
    opacity: 0.35;
}

.cdfj .cdfj-round-nav__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    min-width: 0;
    margin: 0;
    text-align: center;
}

.cdfj .cdfj-round-nav__select {
    min-height: 40px;
    font-size: 16px;
    font-weight: 700;
}

.cdfj .cdfj-round-nav__dates {
    flex-basis: 100%;
    color: var(--cdfj-muted);
    font-size: 12px;
}

/* ── Card: próximo jogo / último resultado ────────────────────────────────── */
.cdfj.cdfj-card {
    overflow: hidden;
    background: var(--cdfj-surface);
    border: 1px solid var(--cdfj-border);
    border-radius: var(--cdfj-radius);
}

/* No widget, a caixa é da sidebar do tema: o card só cuida do conteúdo. */
.cdfj.cdfj-card--widget {
    background: transparent;
    border: 0;
    border-radius: 0;
}

/* Dentro do texto do post (shortcode). */
.cdfj.cdfj-card--embed {
    max-width: 420px;
    margin: 24px auto;
}

.cdfj .cdfj-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cdfj-border);
}

.cdfj .cdfj-card__title {
    color: var(--cdfj-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cdfj .cdfj-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    text-align: center;
}

.cdfj.cdfj-card--widget .cdfj-card__body {
    padding: 4px 0 0;
}

.cdfj .cdfj-card__competition {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 6px;
    margin: 0;
    color: var(--cdfj-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.cdfj .cdfj-card__teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
}

.cdfj .cdfj-card__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cdfj .cdfj-card__team-name {
    color: var(--cdfj-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cdfj .cdfj-card__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 48px;
}

.cdfj .cdfj-card__hour {
    color: var(--cdfj-text);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cdfj .cdfj-card__score {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cdfj-text);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.cdfj .cdfj-card__score-sep {
    color: var(--cdfj-muted);
    font-size: 18px;
    font-weight: 400;
}

.cdfj .cdfj-card__date {
    color: var(--cdfj-text-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.cdfj .cdfj-card__venue,
.cdfj .cdfj-card__result {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--cdfj-muted);
    font-size: 12px;
    line-height: 1.4;
}

.cdfj .cdfj-card__result {
    color: var(--cdfj-text-2);
    font-weight: 600;
}

.cdfj-card--live {
    border-color: color-mix(in srgb, var(--cdfj-live) 40%, transparent);
}

/* ── Estado vazio ─────────────────────────────────────────────────────────── */
.cdfj .cdfj-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 16px;
    color: var(--cdfj-muted);
    text-align: center;
    background: var(--cdfj-surface);
    border: 1px dashed var(--cdfj-border);
    border-radius: 16px;
}

.cdfj .cdfj-empty__title {
    margin: 0;
    color: var(--cdfj-text);
    font-size: 17px;
    font-weight: 600;
}

.cdfj .cdfj-empty__text {
    margin: 0;
    font-size: 14px;
}
