/*
 * WM FairVote – public styles.
 * Intentionally restrained: inherits the theme's typography and colors,
 * only provides layout plus a small accent token that themes can override.
 */

.wmfv-overview {
    /* Room for fixed theme headers when jumping to the overview anchor. */
    scroll-margin-top: 110px;
}

.wmfv-overview,
.wmfv-detail {
    --wmfv-accent: #3152ff;
    --wmfv-accent-dark: #243fd7;
    --wmfv-border: rgba(0, 0, 0, 0.12);
    --wmfv-muted: rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.wmfv-overview *,
.wmfv-detail * {
    box-sizing: inherit;
}

/* Filter bar */
.wmfv-filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px;
}

.wmfv-search-wrap {
    position: relative;
    display: flex;
    flex: 1 1 220px;
    min-width: 0;
}

.wmfv-filterbar input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 8px 34px 8px 12px;
    border: 1px solid var(--wmfv-border);
    border-radius: 4px;
}

/* Hide the inconsistent native clear control; we bring our own. */
.wmfv-filterbar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Deliberately heavy-handed: themes style bare <button> elements with
   their own padding/min-height, which turned the circle into an oval. */
button.wmfv-search-clear {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px;
    max-height: 26px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.08) !important;
    box-shadow: none !important;
    color: inherit !important;
    font-size: 15px;
    line-height: 1 !important;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

button.wmfv-search-clear:hover,
button.wmfv-search-clear:focus {
    background: rgba(0, 0, 0, 0.16) !important;
}

.wmfv-filterbar select {
    padding: 8px 12px;
    border: 1px solid var(--wmfv-border);
    border-radius: 4px;
}

/* Buttons */
.wmfv-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: 0;
    border-radius: 4px;
    background: var(--wmfv-accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wmfv-button:hover,
.wmfv-button:focus {
    background: var(--wmfv-accent-dark);
    color: #fff;
}

.wmfv-button-secondary {
    background: transparent;
    border: 1px solid var(--wmfv-border);
    color: inherit;
}

.wmfv-button-secondary:hover,
.wmfv-button-secondary:focus {
    background: rgba(0, 0, 0, 0.04);
    color: inherit;
}

/* Card grid */
.wmfv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 0 0 24px;
}

.wmfv-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--wmfv-border);
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.wmfv-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.wmfv-card-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.wmfv-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
}

.wmfv-card-media-fallback {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(49, 82, 255, 0.12), rgba(49, 82, 255, 0.03));
}

.wmfv-card-body {
    flex: 1 1 auto;
    padding: 16px 18px 0;
}

.wmfv-card-category {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--wmfv-accent);
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wmfv-card-title {
    margin: 0 0 6px;
    font-size: 1.1em;
    line-height: 1.35;
}

.wmfv-card-title a {
    color: inherit;
    text-decoration: none;
}

.wmfv-card-title a:hover {
    color: var(--wmfv-accent);
}

.wmfv-card-meta {
    margin: 0 0 8px;
    color: var(--wmfv-muted);
    font-size: 0.88em;
}

.wmfv-card-summary {
    margin: 0;
    font-size: 0.94em;
    line-height: 1.5;
}

.wmfv-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
}

/* Chip and button share one height so the row reads as a unit. */
.wmfv-card-foot .wmfv-stat--sm,
.wmfv-card-cta {
    min-height: 42px;
    box-sizing: border-box;
}

/* The grid button stays compact: short label on phones, full wording above. */
.wmfv-card-cta {
    flex: 0 0 auto;
    padding: 9px 18px;
    white-space: nowrap;
}

.wmfv-cta-short {
    display: none;
}

@media (max-width: 480px) {
    .wmfv-cta-long {
        display: none;
    }

    .wmfv-cta-short {
        display: inline;
    }

    .wmfv-card-foot {
        padding: 14px 16px;
    }
}

/* Pagination */
.wmfv-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.wmfv-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 7px 10px;
    border: 1px solid var(--wmfv-border);
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
}

.wmfv-page:hover {
    border-color: var(--wmfv-accent);
    color: var(--wmfv-accent);
}

.wmfv-page.current {
    border-color: var(--wmfv-accent);
    background: var(--wmfv-accent);
    color: #fff;
}

.wmfv-note {
    padding: 12px 16px;
    border: 1px solid var(--wmfv-border);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.03);
}

/* Detail layout.
   The aside stretches to full row height so the sticky column can travel
   alongside the content on desktop. */
.wmfv-detail {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 32px;
}

.wmfv-detail-sticky {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 781px) {
    .wmfv-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .wmfv-detail-sticky {
        position: static;
    }
}

/* Back to overview */
.wmfv-back-wrap {
    margin: 0 0 18px;
}

.wmfv-back-wrap--bottom {
    margin: 28px 0 0;
}

.wmfv-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.wmfv-back:hover {
    color: var(--wmfv-accent);
}

/* Media: video and gallery */
.wmfv-media {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 28px;
}

.wmfv-video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.85);
}

.wmfv-video video,
.wmfv-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.wmfv-video-consent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    color: #fff;
    text-align: center;
}

.wmfv-video-consent p {
    max-width: 420px;
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
}

.wmfv-gallery-stage img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
}

.wmfv-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.wmfv-gallery-thumb {
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    background: none;
    line-height: 0;
    cursor: pointer;
    overflow: hidden;
}

.wmfv-gallery-thumb img {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: cover;
}

.wmfv-gallery-thumb.is-active,
.wmfv-gallery-thumb:hover {
    border-color: var(--wmfv-accent);
}

/* Framed stat chips: score and rank, in the card and in the grid */
.wmfv-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.wmfv-stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid var(--wmfv-border);
    border-radius: 10px;
    background: #fff;
    font-size: 0.86em;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.wmfv-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(49, 82, 255, 0.1);
    color: var(--wmfv-accent);
}

.wmfv-stat.is-leading .wmfv-stat-icon {
    background: rgba(219, 166, 23, 0.18);
    color: #8a6100;
}

.wmfv-stat--sm {
    gap: 7px;
    padding: 5px 14px;
    font-size: 0.82em;
}

.wmfv-stat--sm .wmfv-stat-icon {
    width: 20px;
    height: 20px;
}

/* Conditions of participation */
.wmfv-vote-terms {
    margin: 0 0 12px;
    font-size: 0.86em;
    line-height: 1.5;
}

.wmfv-vote-terms label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.wmfv-vote-terms input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.wmfv-required {
    color: #d63638;
}

/* Share block */
.wmfv-share {
    padding: 20px 24px;
    border: 1px solid var(--wmfv-border);
    border-radius: 8px;
    background: #fff;
}

.wmfv-share-title {
    margin: 0 0 12px;
    font-size: 1em;
}

.wmfv-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wmfv-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--wmfv-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.12s ease;
}

.wmfv-share-button:hover,
.wmfv-share-button:focus {
    border-color: var(--wmfv-accent);
    background: var(--wmfv-accent);
    color: #fff;
}

.wmfv-share-button--native {
    width: auto;
    padding: 0 14px;
    font-size: 0.85em;
    font-weight: 600;
}

.wmfv-share-feedback {
    min-height: 1.2em;
    margin: 10px 0 0;
    color: #006b19;
    font-size: 0.82em;
    font-weight: 600;
}

.wmfv-share-hint {
    margin: 6px 0 0;
    color: var(--wmfv-muted);
    font-size: 0.78em;
    line-height: 1.5;
}

/* Social channels card */
.wmfv-social-card {
    padding: 20px 24px;
    border: 1px solid var(--wmfv-border);
    border-radius: 8px;
    background: #fff;
}

.wmfv-social-card-title {
    margin: 0 0 12px;
    font-size: 1em;
}

.wmfv-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wmfv-social-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 6px 12px;
    border: 1px solid var(--wmfv-border);
    border-radius: 16px;
    color: inherit;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.12s ease;
}

.wmfv-social-link:hover {
    border-color: var(--wmfv-accent);
    color: var(--wmfv-accent);
}

/* Facts */
.wmfv-facts {
    margin-top: 28px;
}

.wmfv-facts-title {
    margin: 0 0 12px;
    font-size: 1.2em;
}

.wmfv-facts-list {
    margin: 0;
    border-top: 1px solid var(--wmfv-border);
}

.wmfv-fact {
    display: grid;
    grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--wmfv-border);
}

.wmfv-fact dt {
    margin: 0;
    color: var(--wmfv-muted);
    font-weight: 600;
}

.wmfv-fact dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Voting card */
.wmfv-vote-card {
    padding: 22px 24px;
    border: 1px solid var(--wmfv-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}


.wmfv-vote-campaign {
    margin: 0 0 12px;
    color: var(--wmfv-muted);
    font-size: 0.9em;
}


.wmfv-vote-button {
    width: 100%;
    padding: 12px 18px;
    font-size: 1.02em;
}

.wmfv-vote-button[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.wmfv-vote-status {
    margin: 0 0 8px;
    color: var(--wmfv-muted);
}

.wmfv-vote-field {
    margin: 0 0 12px;
}

.wmfv-vote-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.88em;
    font-weight: 600;
}

.wmfv-vote-field input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--wmfv-border);
    border-radius: 4px;
}

.wmfv-confirm-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 600;
}

.wmfv-confirm-notice--success {
    background: rgba(0, 138, 32, 0.1);
    color: #006b19;
}

.wmfv-confirm-notice--info {
    background: rgba(49, 82, 255, 0.1);
}

.wmfv-confirm-notice--error {
    background: rgba(214, 54, 56, 0.1);
    color: #a32224;
}


.wmfv-vote-status-done {
    color: #008a20;
    font-weight: 600;
}

.wmfv-vote-feedback {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-weight: 600;
}

.wmfv-vote-feedback.wmfv-success {
    color: #008a20;
}

.wmfv-vote-feedback.wmfv-error {
    color: #d63638;
}

.wmfv-vote-privacy {
    margin: 12px 0 0;
    color: var(--wmfv-muted);
    font-size: 0.8em;
    line-height: 1.5;
}

.wmfv-vote-deadline {
    margin: 12px 0 0;
    color: var(--wmfv-muted);
    font-size: 0.85em;
}
