/* ============================================================
 * APURAÇÃO ELEIÇÕES 2026 — HOME COMPACTA V1.0.0
 * Tipografia: herdada do tema/site, no mesmo princípio dos
 * plugins Apuração Eleições 2026 e Locais de Votação.
 * Cores de ação: acompanham a paleta do site/tema/Elementor.
 * ============================================================ */
.eleicoes-home-compact {
    --ech-primary: var(--e-global-color-primary, var(--global-palette-btn-bg, var(--ast-global-color-0, var(--bunyad-main-color, var(--wp--preset--color--primary, #175ca8)))));
    --ech-primary-text: var(--e-global-color-button-text, var(--global-palette-btn, #fff));
    --ech-red: #c51622;
    --ech-text: #15171b;
    --ech-muted: #69717d;
    --ech-line: #e6e9ee;
    --ech-soft: #f8f9fa;
    width: 100%;
    max-width: 1200px;
    margin: 24px auto;
    border: 1px solid var(--ech-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(21, 23, 27, .08);
    overflow: hidden;
    color: var(--ech-text);
    font-family: inherit;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Elementor: respeita automaticamente container boxed/full. */
.e-con-boxed .eleicoes-home-compact,
.elementor-section-boxed .eleicoes-home-compact {
    max-width: 1200px;
}
.e-con-full .eleicoes-home-compact,
.elementor-section-full_width .eleicoes-home-compact,
.elementor-element.e-con-full .eleicoes-home-compact,
.eleicoes-home-compact.is-layout-full {
    max-width: none;
}
.eleicoes-home-compact.is-layout-boxed {
    max-width: 1200px;
}

.eleicoes-home-compact,
.eleicoes-home-compact *,
.eleicoes-home-compact *::before,
.eleicoes-home-compact *::after {
    box-sizing: border-box;
}

.eleicoes-home-compact button,
.eleicoes-home-compact select,
.eleicoes-home-compact a,
.eleicoes-home-compact input {
    font-family: inherit;
}

.ech-head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    padding: 8px 13px;
    border-bottom: 1px solid var(--ech-line);
    background: #fff;
}

.ech-brand {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 200px;
    line-height: 1;
}

.ech-brand-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--ech-red);
    animation: echpulse 1.4s ease-in-out infinite;
}

.ech-brand strong {
    display: inline;
    color: var(--ech-text);
    font-size: 12px;
    line-height: 1;
    font-weight: 900;
}

.ech-brand small {
    display: inline;
    color: var(--ech-muted);
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
}

.ech-wait {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid var(--ech-line);
    border-radius: 10px;
    background: var(--ech-soft);
    color: var(--ech-muted);
    font-size: 8px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.ech-wait b {
    color: var(--ech-text);
    font-size: 9px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}

.ech-wait.is-live {
    border-color: #c7dfcd;
    background: #f1f8f3;
    color: #2f6d43;
}

.ech-wait.is-live b {
    color: #2f6d43;
}

.ech-turn {
    padding: 4px 7px;
    border: 1px solid #efc9cc;
    border-radius: 999px;
    background: #fff2f2;
    color: var(--ech-red);
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .03em;
    white-space: nowrap;
}

.ech-source {
    color: var(--ech-muted);
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.ech-body {
    display: grid;
    grid-template-columns: 142px minmax(0, 1fr) minmax(0, 1fr) 136px;
    align-items: stretch;
}

.ech-state-picker {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 10px 13px;
    border-right: 1px solid var(--ech-line);
    cursor: pointer;
}

.ech-state-text {
    display: block;
    width: 100%;
    min-width: 0;
}

.ech-state-text select {
    width: 100%;
    min-width: 0;
    height: 35px;
    padding: 0 18px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ech-text);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 900;
    appearance: auto;
    cursor: pointer;
}

.ech-section {
    min-width: 0;
    padding: 9px 10px 8px;
    border-right: 1px solid var(--ech-line);
}

.ech-section-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 7px;
}

.ech-section-head strong {
    display: block;
    overflow: hidden;
    color: var(--ech-text);
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ech-candidates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    min-width: 0;
}

.ech-candidate {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
    padding: 7px 7px 6px;
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    background: #fff;
}

.ech-photo-wrap,
.ech-photo {
    width: 34px;
    height: 34px;
}

.ech-photo-wrap {
    flex: 0 0 34px;
}

.ech-photo {
    display: block;
    object-fit: cover;
    border: 2px solid #dfe5eb;
    border-radius: 50%;
    background: #eef2f6;
}

.ech-photo--fallback {
    display: grid;
    place-items: center;
    color: var(--ech-primary);
    font-size: 11px;
    font-weight: 900;
}

.ech-candidate-body {
    min-width: 0;
}

.ech-candidate-top {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
}

.ech-candidate-top strong {
    display: block;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--ech-text);
    font-size: 10px;
    line-height: 1.15;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ech-candidate-top b {
    flex: 0 0 auto;
    color: var(--ech-text);
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ech-candidate-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin-top: 2px;
    overflow: hidden;
}

.ech-candidate-meta > span:not(.ech-badge) {
    overflow: hidden;
    color: var(--ech-muted);
    font-size: 8px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ech-badge {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 4px;
    border-radius: 999px;
    background: #f0f2f4;
    color: #5e6975;
    font-size: 6px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .03em;
}

.ech-badge--second {
    background: #fff1f2;
    color: var(--ech-red);
}

.ech-badge--elected {
    background: #e8f5ec;
    color: #2f6d43;
}

.ech-progress {
    height: 3px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf1;
}

.ech-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--ech-primary);
}

.ech-candidate-body > small {
    display: block;
    margin-top: 4px;
    color: var(--ech-muted);
    font-size: 8px;
    line-height: 1;
    font-weight: 800;
}

.ech-full-link {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: center;
    width: auto;
    min-width: 122px;
    max-width: calc(100% - 18px);
    height: 34px;
    min-height: 34px;
    margin: 0 9px;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    outline: none;
    background: var(--ech-primary);
    color: var(--ech-primary-text) !important;
    text-decoration: none !important;
    font-size: 9px;
    line-height: 1.1;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    transition: filter .15s ease, transform .15s ease;
}

.ech-full-link:hover,
.ech-full-link:focus-visible {
    color: var(--ech-primary-text) !important;
    text-decoration: none !important;
    filter: brightness(.92);
    transform: translateY(-1px);
}

.ech-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 12px;
    border-top: 1px solid var(--ech-line);
    background: #fff;
    color: var(--ech-muted);
    font-size: 8px;
    line-height: 1.2;
    font-weight: 800;
}

.ech-loading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.ech-loading i {
    display: block;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(90deg, #eff2f5, #fafbfc, #eff2f5);
    animation: echpulse 1.4s ease-in-out infinite;
}

.ech-empty {
    display: flex;
    align-items: center;
    min-height: 56px;
    color: var(--ech-muted);
    font-size: 8px;
    line-height: 1.3;
    font-weight: 800;
}

.eleicoes-home-compact.is-loading .ech-body {
    cursor: progress;
}

@keyframes echpulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

@media (max-width: 1080px) {
    .ech-body {
        grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) 126px;
    }
    .ech-full-link {
        min-width: 116px;
        margin-left: 7px;
        margin-right: 7px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .ech-source {
        display: none;
    }
}

@media (max-width: 820px) {
    .ech-brand {
        min-width: 0;
        flex: 1;
    }
    .ech-wait {
        margin-left: 0;
    }
    .ech-body {
        grid-template-columns: 125px minmax(0, 1fr) minmax(0, 1fr);
    }
    .ech-full-link {
        grid-column: 1 / -1;
        width: auto;
        min-width: 130px;
        margin: 8px auto 9px;
    }
}

@media (max-width: 680px) {
    .eleicoes-home-compact {
        margin: 16px 0;
        border-radius: 14px;
    }
    .ech-head {
        flex-wrap: wrap;
        gap: 7px;
    }
    .ech-wait {
        order: 4;
        flex-basis: 100%;
        width: fit-content;
        margin: 0;
    }
    .ech-body {
        grid-template-columns: 1fr;
    }
    .ech-state-picker {
        padding: 9px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--ech-line);
    }
    .ech-section {
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--ech-line);
    }
    .ech-candidates {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ech-full-link {
        grid-column: auto;
        width: auto;
        min-width: 150px;
        max-width: calc(100% - 24px);
        margin: 9px auto;
    }
    .ech-footer {
        flex-direction: column;
        gap: 3px;
    }
}

@media (max-width: 440px) {
    .ech-candidates {
        grid-template-columns: 1fr;
    }
    .ech-candidate {
        grid-template-columns: 36px minmax(0, 1fr);
    }
    .ech-photo-wrap,
    .ech-photo {
        width: 36px;
        height: 36px;
    }
    .ech-full-link {
        min-width: 154px;
    }
}
