/* Quem são os candidatos: abas, filtros, cartões e perfil. O cabeçalho da página usa o
   visual do guia do eleitor (apuracao.css). Papel creme e serifada da marca; sem cores
   inventadas por partido (o TSE não define cor oficial). */

.ct-cand-pagina { width: 100%; max-width: none; }

/* ---------- Abas de cargo ---------- */
.ct-cand-abas { margin: 0 0 22px; border-bottom: 1px solid #e2e8f0; overflow-x: auto; overflow-y: hidden; }
.ct-cand-abas ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.ct-cand-abas a {
    display: block;
    padding: 12px 18px;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 700;
    color: #5b6472;
    text-decoration: none;
}
.ct-cand-abas a:hover { color: #17191d; }
.ct-cand-abas a.is-ativa { color: #17191d; border-bottom-color: var(--marca-acento, #c0261c); }

/* ---------- Cabeçalho da lista ---------- */
.ct-cand-titulo {
    margin: 0 0 6px;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.1;
    color: #17191d;
}
.ct-cand-escopo { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #17191d; }
.ct-cand-meta { margin: 0 0 18px; font-size: 13px; color: #5b6472; }
.ct-cand-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
}
.ct-cand-contagem { margin: 0; font-size: 14px; color: #17191d; }
.ct-cand-ordem { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #475569; }
.ct-cand-ordem select {
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

/* ---------- Corpo: filtros à esquerda, cartões à direita ---------- */
.ct-cand-corpo { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.ct-cand-filtros { position: sticky; top: 16px; }
.ct-cand-painel {
    padding: 18px;
    background: #f6f2ea;
    background-image: radial-gradient(#e7e1d4 1px, transparent 1px);
    background-size: 14px 14px;
    border-top: 3px solid #17191d;
}
.ct-cand-painel > summary {
    margin: 0 0 12px;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 19px;
    font-weight: 800;
    color: #17191d;
    list-style: none;
}
.ct-cand-painel > summary::-webkit-details-marker { display: none; }
.ct-cand-busca-rotulo { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 700; color: #17191d; }
.ct-cand-busca {
    box-sizing: border-box;
    width: 100%;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
}
.ct-cand-grupo { border-top: 1px solid #e0d9c9; }
.ct-cand-grupo > summary {
    position: relative;
    padding: 12px 22px 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #17191d;
    cursor: pointer;
    list-style: none;
}
.ct-cand-grupo > summary::-webkit-details-marker { display: none; }
.ct-cand-grupo > summary::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -6px;
    border: solid #17191d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform .15s;
}
.ct-cand-grupo[open] > summary::after { margin-top: -2px; transform: rotate(-135deg); }
.ct-cand-opcoes { max-height: 232px; overflow-y: auto; padding: 0 0 12px; }
.ct-cand-opcoes label { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13.5px; line-height: 1.35; color: #334155; cursor: pointer; }
.ct-cand-opcoes input { margin-top: 3px; }
.ct-cand-limpar {
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    border: 1px solid #17191d;
    border-radius: 6px;
    background: transparent;
    font-size: 13.5px;
    font-weight: 700;
    color: #17191d;
    cursor: pointer;
}
.ct-cand-limpar:hover { background: #17191d; color: #fff; }

/* ---------- Cartões ---------- */
.ct-cand-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ct-cand-card[hidden] { display: none; }
/* Antes de o JavaScript organizar a lista, só os primeiros aparecem (sem salto na tela). */
.ct-cand-grade:not(.is-pronta) .ct-cand-card:nth-child(n+25) { display: none; }
.ct-cand-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; }
.ct-cand-card:hover { border-color: #17191d; }
.ct-cand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 18px 12px 0;
    text-align: center;
    text-decoration: none;
    color: inherit;
}
.ct-cand-foto {
    position: relative;
    display: block;
    flex: none;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 50%;
    background: #e2e8f0;
}
.ct-cand-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ct-cand-foto b {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #64748b;
}
.ct-cand-foto.sem-foto img { display: none; }
.ct-cand-foto.sem-foto b { display: flex; }
.ct-cand-nome {
    display: block;
    margin: 12px 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #17191d;
}
.ct-cand-partido { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; }
.ct-cand-partido em {
    padding: 2px 8px;
    border: 1px solid #17191d;
    border-radius: 3px;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #17191d;
}
.ct-cand-partido strong { font-size: 17px; font-weight: 800; color: #17191d; }
.ct-cand-aviso {
    display: block;
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: #8a5a00;
}
.ct-cand-ver {
    display: block;
    width: calc(100% + 24px);
    margin: auto -12px 0;
    padding: 11px 0;
    border-top: 1px solid #e2e8f0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--marca-acento, #c0261c);
}
.ct-cand-nome + .ct-cand-partido { margin-bottom: 14px; }
.ct-cand-vazio { margin: 24px 0; padding: 22px; background: #f6f2ea; text-align: center; color: #475569; }
.ct-cand-mais-caixa { margin: 22px 0 0; text-align: center; }
.ct-cand-mais {
    padding: 11px 30px;
    border: 1px solid #17191d;
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    font-weight: 700;
    color: #17191d;
    cursor: pointer;
}
.ct-cand-mais:hover { background: #17191d; color: #fff; }

/* ---------- Perfil ---------- */
.ct-cand-voltar { margin: 0 0 18px; font-size: 14px; font-weight: 700; }
.ct-cand-voltar a { color: #17191d; text-decoration: none; }
.ct-cand-voltar a:hover { text-decoration: underline; }
.ct-cand-perfil-topo { display: flex; align-items: center; gap: 24px; margin: 0 0 26px; }
.ct-cand-perfil-topo .ct-cand-foto { width: 160px; height: 160px; }
.ct-cand-perfil-topo .ct-cand-foto b { font-size: 56px; }
.ct-cand-perfil-nome {
    margin: 4px 0 4px;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.015em;
    color: #17191d;
}
.ct-cand-perfil-completo { margin: 0 0 12px; font-size: 14.5px; color: #5b6472; }
.ct-cand-partido--grande { margin-top: 6px; }
.ct-cand-partido--grande em { font-size: 14px; padding: 3px 11px; }
.ct-cand-partido--grande strong { font-size: 26px; }
.ct-cand-dados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0 28px;
    margin: 0 0 30px;
    padding: 0;
}
.ct-cand-dados > div { padding: 12px 0; border-top: 1px solid #e2e8f0; }
.ct-cand-dados dt { margin: 0 0 3px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5b6472; }
.ct-cand-dados dd { margin: 0; font-size: 16px; line-height: 1.4; color: #17191d; }
.ct-cand-patrimonio { margin: 0 0 26px; }
.ct-cand-total { margin: 0 0 10px; font-family: var(--font-serif, Georgia, serif); font-size: 32px; font-weight: 800; color: #17191d; }
.ct-cand-total small { font-family: inherit; font-size: 13px; font-weight: 400; color: #5b6472; }
.ct-cand-bens summary { cursor: pointer; font-size: 14px; font-weight: 700; color: #17191d; }
.ct-cand-bens .ct-apuracao-rolagem { margin-top: 12px; }
.ct-cand-fonte { margin: 0; font-size: 13px; line-height: 1.55; color: #5b6472; }
.ct-cand-fonte a { color: #17191d; font-weight: 700; }

/* ---------- Celular ---------- */
@media (max-width: 800px) {
    .ct-cand-corpo { grid-template-columns: 1fr; gap: 16px; }
    .ct-cand-filtros { position: static; }
    .ct-cand-painel > summary { margin: 0; cursor: pointer; }
    .ct-cand-painel[open] > summary { margin-bottom: 12px; }
    .ct-cand-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ct-cand-titulo { font-size: 28px; }
    .ct-cand-perfil-topo { flex-direction: column; align-items: flex-start; gap: 14px; }
    .ct-cand-perfil-topo .ct-cand-foto { width: 120px; height: 120px; }
    .ct-cand-perfil-nome { font-size: 32px; }
    .ct-cand-barra { flex-direction: column; align-items: flex-start; }
}
@media (min-width: 801px) {
    .ct-cand-painel > summary { pointer-events: none; }
}
