/*
Theme Name: Meu Tema Personalizado
Description: Tema com página de votação e integração ao banco.
Version: 1.0.1
*/

/* --- Slots AdSense: altura mínima para evitar CLS ao carregar anúncios --- */
.adsense-slot {
    margin: 1rem auto;
    max-width: 970px;
    min-height: 90px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.adsense-label {
    pointer-events: none;
    user-select: none;
}

/* Quando você colar o código do AdSense, pode ocultar o rótulo: .adsense-slot:has(ins) .adsense-label { display: none; } */
.adsense-slot:has(ins) .adsense-label,
.adsense-slot:has(iframe) .adsense-label {
    display: none;
}

.adsense-meio {
    min-height: 250px;
    max-width: 300px;
}

.adsense-rodape {
    min-height: 100px;
}

/* --- Página de votação --- */
.votacao-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.votacao-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.votacao-titulo {
    font-size: clamp(1.15rem, 3.2vw, 1.85rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

.votacao-cadastro {
    max-width: 560px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.votacao-cadastro[hidden] {
    display: none !important;
}

.votacao-cadastro-titulo {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.votacao-cadastro-intro {
    margin: 0 0 1.25rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.45;
}

.votacao-cadastro-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 480px) {
    .votacao-cadastro-grid {
        grid-template-columns: 1fr 1fr;
    }

    .votacao-field-span {
        grid-column: 1 / -1;
    }
}

.votacao-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
}

.votacao-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.votacao-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
}

.votacao-input:focus {
    outline: 2px solid #1a1a2e;
    outline-offset: 1px;
}

.votacao-btn-cadastro {
    margin-top: 1.25rem;
    max-width: 100%;
}

.votacao-cadastro-msg {
    min-height: 1.25rem;
    margin: 1rem 0 0;
    font-size: 0.9rem;
    color: #2e7d32;
}

.votacao-cadastro-msg.is-error {
    color: #c62828;
}

.votacao-urna[hidden] {
    display: none !important;
}

.votacao-fim {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    text-align: center;
    padding: 2rem 1rem 2.25rem;
    margin-bottom: 1.5rem;
}

.votacao-fim[hidden] {
    display: none !important;
}

.votacao-fim-texto {
    margin: 0;
    padding: 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.45;
    color: #1b5e20;
}

.votacao-fim-voltar {
    flex-shrink: 0;
    margin: 0;
    max-width: 22rem;
    width: 100%;
    display: block;
    text-decoration: none;
    box-sizing: border-box;
    text-align: center;
}

.votacao-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
    justify-items: center;
}

@media (min-width: 900px) {
    .votacao-grid {
        grid-template-columns: 1fr auto 1fr;
        align-items: stretch;
    }

    .adsense-meio {
        align-self: center;
    }
}

.votacao-card {
    width: 100%;
    max-width: 320px;
    padding: 1.25rem;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
    border: 1px solid #e8e8e8;
}

.votacao-foto-wrap {
    width: 100%;
    aspect-ratio: 280 / 320;
    max-height: 320px;
    margin: 0 auto 1rem;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(145deg, #eee, #f8f8f8);
}

.votacao-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.votacao-nome {
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
}

.votacao-contagem {
    margin: 0 0 1rem;
    color: #555;
    font-size: 0.95rem;
}

.votacao-btn {
    appearance: none;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    background: #1a1a2e;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.votacao-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    opacity: 0.92;
}

.votacao-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.votacao-card[data-candidato="lula"] .votacao-btn {
    background: #c41e3a;
}

.votacao-card[data-candidato="bolsonaro"] .votacao-btn {
    background: #0d47a1;
}

.votacao-msg {
    text-align: center;
    min-height: 1.5rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: #2e7d32;
}

.votacao-msg.is-error {
    color: #c62828;
}

/* Mesma caixa horizontal dos .adsense-slot (max 970px + margin auto) para alinhar com o banner inferior */
.votacao-aviso-lei {
    margin: 1.5rem auto; /* Centraliza o bloco na página */
    text-align: center;  /* Centraliza as linhas de texto */
    border-left: none;   /* Remova a borda lateral para não ficar assimétrico */
    border-bottom: 2px solid #1a1a2e; /* Opcional: use borda embaixo se quiser destaque */
    background: linear-gradient(
        90deg,
        rgba(26, 26, 46, 0.1) 0%,
        rgba(26, 26, 46, 0.03) 100%
    );
    font-size: 0.8rem;
    line-height: 1.5;
    color: #1a1a2e;
    font-weight: 500;
    text-align: left;
    max-width: 970px;
    width: 100%;
    box-sizing: border-box;
}

.votacao-cadastro .votacao-aviso-lei {
    margin-top: 1.25rem;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.votacao-fim .votacao-aviso-lei {
    margin-top: 0.25rem;
    max-width: 970px;
    margin-left: auto;
    margin-right: auto;
}

.votacao-conteudo {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

body {
    margin: 0;
    background: #fafafa;
    color: #222;
}
