/*
 * Zero1_Poll storefront styles. Self-contained so the poll looks the same on Luma and Hyva
 * (Hyva does not style Luma's .action.primary / .actions-toolbar). Theme it by overriding the
 * custom properties below, e.g. .zero1-poll { --zero1-poll-accent: #c00; }
 */
.zero1-poll {
    --zero1-poll-accent: #111;
    --zero1-poll-accent-contrast: #fff;
    --zero1-poll-bg: #f5f5f6;
    --zero1-poll-surface: #fff;
    --zero1-poll-border: #e2e2e6;
    --zero1-poll-border-hover: #b8b8c0;
    --zero1-poll-muted: #6b6b75;
    --zero1-poll-radius: .5rem;
    --zero1-poll-control-radius: .25rem;
    box-sizing: border-box;
    max-width: 44rem;
    margin: 2.5rem 0;
    padding: 1.75rem;
    background: var(--zero1-poll-bg);
    border: 1px solid var(--zero1-poll-border);
    border-radius: var(--zero1-poll-radius);
}
.zero1-poll *, .zero1-poll *::before, .zero1-poll *::after { box-sizing: border-box; }

/* Heading */
.zero1-poll.block .block-title { margin: 0 0 1.25rem; padding: 0; border: 0; }
.zero1-poll.block .block-title strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}
.zero1-poll .zero1-poll__question { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 0 0 1rem; }
.zero1-poll .zero1-poll__loading { margin: 0; color: var(--zero1-poll-muted); }

/* Answer tiles */
.zero1-poll .zero1-poll__answers {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: .625rem;
}
.zero1-poll .zero1-poll__answer { margin: 0; padding: 0; }
.zero1-poll .zero1-poll__option {
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 100%;
    margin: 0;
    padding: .875rem 1rem;
    background: var(--zero1-poll-surface);
    border: 1px solid var(--zero1-poll-border);
    border-radius: var(--zero1-poll-control-radius);
    line-height: 1.35;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.zero1-poll .zero1-poll__option:hover { border-color: var(--zero1-poll-border-hover); }
.zero1-poll .zero1-poll__option:has(input:checked) {
    border-color: var(--zero1-poll-accent);
    box-shadow: inset 0 0 0 1px var(--zero1-poll-accent);
}
.zero1-poll .zero1-poll__option:has(input:focus-visible) {
    outline: 2px solid var(--zero1-poll-accent);
    outline-offset: 2px;
}
.zero1-poll .zero1-poll__option input[type="radio"] {
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    --form-active-color: var(--zero1-poll-accent); /* Hyva 1.4 forms checked colour */
    color: var(--zero1-poll-accent); /* @tailwindcss/forms checked colour */
    accent-color: var(--zero1-poll-accent); /* native radios */
    cursor: pointer;
}
.zero1-poll .zero1-poll__option input[type="radio"]:focus { box-shadow: none; outline: none; }

/* Buttons */
.zero1-poll .zero1-poll__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin: 0;
    padding: 0;
    border: 0;
}
.zero1-poll button.zero1-poll__button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.875rem;
    margin: 0;
    padding: .625rem 2rem;
    background: var(--zero1-poll-accent);
    border: 1px solid var(--zero1-poll-accent);
    border-radius: var(--zero1-poll-control-radius);
    box-shadow: none;
    color: var(--zero1-poll-accent-contrast);
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.zero1-poll button.zero1-poll__button:hover { opacity: .85; }
.zero1-poll button.zero1-poll__button:focus-visible { outline: 2px solid var(--zero1-poll-accent); outline-offset: 2px; }
.zero1-poll button.zero1-poll__button:disabled { opacity: .5; cursor: progress; }
.zero1-poll button.zero1-poll__button--secondary {
    background: transparent;
    color: var(--zero1-poll-accent);
}
.zero1-poll button.zero1-poll__button--secondary:hover {
    opacity: 1;
    background: var(--zero1-poll-accent);
    color: var(--zero1-poll-accent-contrast);
}

/* Results */
.zero1-poll .zero1-poll__results {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    gap: 1rem;
}
.zero1-poll .zero1-poll__result { margin: 0; }
.zero1-poll .zero1-poll__result-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: .375rem;
    font-size: .95em;
}
.zero1-poll .zero1-poll__result-votes {
    white-space: nowrap;
    color: var(--zero1-poll-muted);
    font-variant-numeric: tabular-nums;
}
.zero1-poll .zero1-poll__bar {
    height: .5rem;
    background: rgba(0, 0, 0, .08);
    border-radius: 999px;
    overflow: hidden;
}
.zero1-poll .zero1-poll__bar-fill {
    display: block;
    height: 100%;
    background: var(--zero1-poll-accent);
    border-radius: 999px;
    transition: width .5s ease;
}
.zero1-poll .zero1-poll__total,
.zero1-poll .zero1-poll__closed { margin: 0 0 1rem; font-size: .875em; color: var(--zero1-poll-muted); }

/* Feedback */
.zero1-poll .zero1-poll__message.message {
    margin: 1.25rem 0 0;
    padding: .75rem 1rem;
    border: 0;
    border-left: 3px solid #1f7a45;
    border-radius: var(--zero1-poll-control-radius);
    background: #e9f6ee;
    color: #155a33;
    font-size: .925rem;
    box-shadow: none;
}
.zero1-poll .zero1-poll__message.message::before,
.zero1-poll .zero1-poll__message.message::after { content: none; }
.zero1-poll .zero1-poll__message.message.error {
    border-left-color: #b42318;
    background: #fdeceb;
    color: #8f1c13;
}

/* Small screens */
@media (max-width: 640px) {
    .zero1-poll { padding: 1.25rem; margin: 2rem 0; }
    .zero1-poll .zero1-poll__answers { grid-template-columns: 1fr; }
    .zero1-poll .zero1-poll__actions button.zero1-poll__button { width: 100%; }
}

/* Compact sidebar template */
.zero1-poll--sidebar { padding: 1.25rem; margin: 0 0 2rem; }
.zero1-poll--sidebar.block .block-title strong { font-size: 1.05rem; }
.zero1-poll--sidebar .zero1-poll__answers { grid-template-columns: 1fr; gap: .5rem; }
.zero1-poll--sidebar .zero1-poll__option { padding: .625rem .75rem; }
.zero1-poll--sidebar .zero1-poll__result-head { flex-direction: column; gap: 0; }
.zero1-poll--sidebar button.zero1-poll__button { width: 100%; padding-inline: 1rem; }
