/**
 * SIDARCO — Styling Halaman Publik Calon Kepala Desa (Foto Posisi di Atas)
 * File: /public_html/assets/css/publik-calon.css
 */

:root {
    --primary-color: #0284c7;
    --primary-dark: #0369a1;
    --secondary-blue: #1e3a8a;
    --bg-light: #f8fafc;
    --border-color: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

.calon-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* Heading Halaman */
.calon-page-heading {
    margin-bottom: 25px;
    text-align: center;
}
.calon-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #0284c7;
    background: #e0f2fe;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.calon-page-heading h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 900;
    color: var(--text-main);
    margin: 0 0 6px 0;
}
.calon-page-heading p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Panel Filter Desa */
.calon-filter-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.04);
}
.calon-filter-form {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}
.calon-filter-group {
    flex: 1;
    min-width: 250px;
}
.calon-filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.calon-form-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.88rem;
    font-weight: 700;
    background: #fff;
    color: var(--text-main);
    cursor: pointer;
}
.calon-btn-reset {
    background: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.calon-btn-reset:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

/* Group per Desa */
.village-section {
    margin-bottom: 40px;
}
.village-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.village-header h2 {
    font-size: 1.2rem;
    font-weight: 850;
    color: var(--secondary-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.village-badge {
    background: #e0f2fe;
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
}

/* Grid Kartu Kandidat (2 Kolom) */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
    gap: 20px;
}

/* Kartu Kandidat Horizontal */
.candidate-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.04);
    display: flex;
    flex-direction: row;
    align-items: stretch; /* Memastikan card membentang seimbang */
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.candidate-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.08);
}

/* Nomor Urut Badge */
.candidate-number-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 900;
    z-index: 2;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Foto Kandidat di Sebelah Kiri (Diposisikan Pasti di Atas) */
.candidate-photo-wrapper {
    width: 180px;
    min-width: 180px;
    background: #ffffff;
    position: relative;
    display: flex;
    align-self: flex-start; /* KUNCI UTAMA: Memaksa wrapper menempel di atas */
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
}
.candidate-photo {
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    padding: 8px;
    display: block;
}
.candidate-photo-placeholder {
    font-size: 3rem;
    color: #cbd5e1;
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Informasi Kandidat di Sebelah Kanan */
.candidate-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start;
    gap: 10px;
}
.candidate-name {
    font-size: 1.05rem;
    font-weight: 850;
    color: var(--text-main);
    margin: 2px 0 4px 0;
    line-height: 1.3;
}
.candidate-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Status Badge untuk 3 Kategori */
.candidate-status-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
}
.status-bakal {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.status-resmi {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.status-gugur {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecdd3;
}

/* Visi Misi Bagian */
.candidate-vision-mission {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.76rem;
    color: #334155;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vm-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.vm-title {
    font-weight: 800;
    color: var(--secondary-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}
.vm-text {
    margin: 0;
    line-height: 1.4; /* Sedikit dirapatkan dari 1.5 */
    white-space: pre-line;
}

/* Tambahkan ini untuk merapatkan jarak antar paragraf/baris enter */
.vm-text p, .vm-text br + br {
    display: none; /* Mencegah baris kosong berlebih jika ada double enter */
}

/* Responsif untuk HP / Layar Kecil */
@media (max-width: 768px) {
    .candidates-grid {
        grid-template-columns: 1fr;
    }
    .candidate-card {
        flex-direction: column;
    }
    .candidate-photo-wrapper {
        width: 100%;
        align-self: stretch;
        height: 260px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* Status Kosong */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 12px;
}
.empty-state p {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}