/* ============================================
   BIOCRACY v2 - SHARED COMPONENTS
   (candidates, blogs, videos, reports, comments)
   ============================================ */

.page-header {
    padding: 118px 0 24px;
    text-align: center;
}

.page-header h1 {
    font-size: var(--font-size-4xl);
    color: var(--gray-900);
    margin-bottom: 8px;
}

.page-header p {
    color: var(--gray-600);
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Grid layouts ===== */
.grid {
    display: grid;
    gap: 24px;
}

.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* ===== Generic content card ===== */
.content-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.content-card img.card-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--gray-100);
}

.content-card .card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-card .card-category {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
    width: fit-content;
}

.content-card h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.35;
}

.content-card p.card-summary {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    flex: 1;
    margin-bottom: 12px;
}

.content-card .card-meta {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    display: flex;
    justify-content: space-between;
    margin-top: auto;
}

/* ===== Candidate card ===== */
.candidate-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.candidate-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.candidate-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    margin: 0 auto 14px;
    background: var(--gray-100);
    border: 3px solid var(--gray-100);
    flex-shrink: 0;
    display: block;
}

.local-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    border: none;
    flex-shrink: 0;
}

.candidate-card h3 {
    font-size: var(--font-size-lg);
    color: var(--gray-900);
}

.candidate-card .candidate-meta {
    color: var(--gray-500);
    font-size: var(--font-size-sm);
    margin: 4px 0 12px;
}

.party-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

/* ===== Verdict / recommend meter ===== */
.verdict-meter {
    margin-top: 10px;
}

.verdict-bar {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    overflow: hidden;
}

.verdict-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: var(--radius-full);
}

.verdict-label {
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    margin-top: 6px;
}

.verdict-label strong {
    color: var(--gray-900);
}

/* ===== Promise / track-record badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.badge-fulfilled { background: #d1fae5; color: #065f46; }
.badge-broken { background: #fee2e2; color: #991b1b; }
.badge-in_progress { background: #fef3c7; color: #92400e; }

.badge-achievement { background: #d1fae5; color: #065f46; }
.badge-controversy { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }

.promise-item, .record-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.promise-item h4, .record-item h4 {
    font-size: var(--font-size-base);
    color: var(--gray-900);
    margin: 6px 0 4px;
}

.promise-item p, .record-item p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.record-item .record-date {
    color: var(--gray-400);
    font-size: var(--font-size-xs);
    margin-top: 4px;
    display: block;
}

/* ===== Vote widget (recommend / not recommend) ===== */
.vote-widget {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: var(--gray-50);
}

.vote-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 14px;
}

.vote-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px;
    border-radius: var(--radius);
    border: 2px solid var(--gray-200);
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.vote-btn.recommend:hover, .vote-btn.recommend.active {
    border-color: var(--success);
    background: #ecfdf5;
    color: #065f46;
}

.vote-btn.not_recommend:hover, .vote-btn.not_recommend.active {
    border-color: var(--error);
    background: #fef2f2;
    color: #991b1b;
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Comments ===== */
.comments-section {
    margin-top: 32px;
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.comment-form input, .comment-form textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: var(--font-size-sm);
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body .comment-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: var(--font-size-sm);
}

.comment-body .comment-time {
    color: var(--gray-400);
    font-size: var(--font-size-xs);
    margin-left: 8px;
}

.comment-body p {
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 40px 20px;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* ===== Detail page layout ===== */
.detail-hero {
    background: linear-gradient(135deg, var(--gray-900) 0%, #1e293b 100%);
    color: white;
    padding: 110px 0 40px;
}

.detail-hero .container {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.detail-hero .candidate-photo {
    width: 120px;
    height: 120px;
    border: 4px solid rgba(255,255,255,0.15);
}

.detail-hero h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: 6px;
}

.detail-hero .detail-meta {
    color: rgba(255,255,255,0.7);
}

.detail-body {
    padding: 32px 0 64px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section h2 {
    font-size: var(--font-size-xl);
    color: var(--gray-900);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}

.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .two-col { grid-template-columns: 1fr; }

    .detail-hero .container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .detail-hero h1 {
        font-size: var(--font-size-2xl);
    }
}

.video-embed-wrap {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-embed-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== Loading / toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}
