/* =========================================================
   Voting Campaigns — Frontend Styles
   Accent: rose #c8263a  |  Base: white / near-black
   ========================================================= */

/* Reset scope — prevent theme overrides on layout-critical rules */
.vc-campaign,
.vc-campaign * {
    box-sizing: border-box;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.vc-campaign {
    max-width: 780px;
    margin: 0 auto;
    font-family: inherit;
    color: #111827;
}

.vc-campaign-header {
    margin-bottom: 32px;
}

.vc-campaign-title {
    font-size: 1.75em;
    font-weight: 700;
    margin: 0 0 10px;
    color: #111827;
}

.vc-campaign-description {
    color: #4b5563;
    line-height: 1.65;
    margin: 0;
}

/* ── Sections ────────────────────────────────────────────── */
.vc-campaign .vc-sections {
    display: block;
}

.vc-campaign .vc-section {
    margin-bottom: 36px;
}

.vc-campaign .vc-section-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 10px;
    margin: 0 0 16px;
    border-bottom: 2px solid #f3f4f6;
    border-left: 4px solid #c8263a;
    padding-left: 10px;
}

/* ── Article list — vertical stack ──────────────────────── */
.vc-campaign .vc-articles {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Single article option ───────────────────────────────── */
.vc-campaign .vc-article-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin: 0;
    width: 100%;
}

.vc-campaign .vc-article-option:hover {
    border-color: #f9a8b4;
    background: #fffbfb;
}

/* Selected state — :has() with JS class fallback */
.vc-campaign .vc-article-option:has(input[type="radio"]:checked),
.vc-campaign .vc-article-option.vc-selected {
    border-color: #c8263a;
    background: #fff8f8;
    box-shadow: 0 0 0 1px #c8263a;
}

/* ── Custom radio button ─────────────────────────────────── */
.vc-campaign .vc-article-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin: 2px 0 0;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease;
    position: relative;
}

.vc-campaign .vc-article-option input[type="radio"]::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background: #c8263a;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

.vc-campaign .vc-article-option input[type="radio"]:checked {
    border-color: #c8263a;
}

.vc-campaign .vc-article-option input[type="radio"]:checked::after {
    transform: translate(-50%, -50%) scale(1);
}

/* ── Article content — span (valid phrasing content inside label) ── */
.vc-campaign .vc-article-info {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    vertical-align: top;
}

/* All children of vc-article-info are spans — force block display */
.vc-campaign .vc-article-info > span,
.vc-campaign .vc-article-info > a {
    display: block;
}

.vc-campaign .vc-article-title {
    font-weight: 700;
    font-size: 0.975em;
    color: #111827;
    line-height: 1.4;
}

.vc-campaign .vc-article-meta {
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.4;
}

.vc-campaign .vc-article-meta em {
    font-style: italic;
    color: #6b7280;
}

.vc-campaign .vc-article-extra {
    font-size: 0.8em;
    color: #9ca3af;
    font-style: italic;
    line-height: 1.4;
}

.vc-campaign .vc-read-link {
    display: inline-block;
    font-size: 0.82em;
    color: #c8263a;
    text-decoration: none;
    margin-top: 4px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.vc-campaign .vc-read-link:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ── Selection preview ───────────────────────────────────── */
.vc-campaign .vc-selection-preview {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: #f7f7f8;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #9ca3af;
    border-radius: 4px;
    padding: 12px 16px;
    margin: 28px 0 24px;
    font-size: 0.9em;
    color: #374151;
}

.vc-campaign .vc-selection-preview strong {
    color: #374151;
    font-weight: 600;
    white-space: nowrap;
}

.vc-campaign .vc-selected-title {
    color: #c8263a;
    font-style: italic;
    font-weight: 500;
}

/* ── Voter fields ────────────────────────────────────────── */
.vc-campaign .vc-voter-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
}

.vc-campaign .vc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vc-campaign .vc-field label {
    font-weight: 600;
    font-size: 0.875em;
    color: #374151;
    letter-spacing: 0.01em;
}

.vc-campaign .vc-input {
    padding: 11px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 5px;
    font-size: 0.975em;
    max-width: 420px;
    width: 100%;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.vc-campaign .vc-input:focus {
    border-color: #c8263a;
    box-shadow: 0 0 0 3px rgba(200, 38, 58, 0.1);
}

.vc-campaign .vc-input::placeholder {
    color: #9ca3af;
}

/* ── Error message ───────────────────────────────────────── */
.vc-campaign .vc-error-message {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-left: 4px solid #c8263a;
    color: #9f1239;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ── Submit button ───────────────────────────────────────── */
.vc-campaign .vc-submit-wrap {
    margin-top: 6px;
}

.vc-campaign .vc-submit-btn {
    background: #c8263a;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 13px 40px;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: inline-block;
}

.vc-campaign .vc-submit-btn:hover {
    background: #a81e2f;
}

.vc-campaign .vc-submit-btn:active {
    transform: translateY(1px);
}

.vc-campaign .vc-submit-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

/* ── Thank you ───────────────────────────────────────────── */
.vc-campaign .vc-thank-you {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    color: #14532d;
    border-radius: 5px;
    padding: 20px 24px;
    font-size: 0.975em;
    line-height: 1.65;
    margin-top: 20px;
}

/* ── Notices (scheduled / deadline) ─────────────────────── */
.vc-campaign .vc-notice {
    background: #f9fafb;
    border-left: 4px solid #d1d5db;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.9em;
    color: #374151;
    border-radius: 0 4px 4px 0;
}

.vc-campaign .vc-notice-scheduled {
    background: #fff8f8;
    border-left-color: #c8263a;
    color: #374151;
}

.vc-campaign .vc-notice-deadline {
    background: #fffbeb;
    border-left-color: #d97706;
    color: #374151;
}

/* ── Pre/post content ────────────────────────────────────── */
.vc-campaign .vc-pre-campaign-content,
.vc-campaign .vc-post-campaign-content {
    margin: 16px 0;
    line-height: 1.7;
    color: #374151;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .vc-campaign .vc-article-option {
        padding: 12px 14px;
        gap: 12px;
    }

    .vc-campaign .vc-input {
        max-width: 100%;
    }

    .vc-campaign .vc-selection-preview {
        flex-direction: column;
        gap: 4px;
    }
}
