/* Poll - Webbfråga */

.sv-poll-portlet > table {
    width: 100%;
    border-spacing: 0 10px;
}

.sv-poll-portlet > table caption {
    text-align: center !important; 
}

.sv-poll-portlet > table tbody tr {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.sv-poll-portlet > table > tbody > tr:before {
    content: "";
    height: 40px;
    width: 100%;
    border-radius: 8px;
    display: block;
}

.sv-poll-portlet > table > tbody > tr > th,
.sv-poll-portlet > table > tbody > tr > td:last-child {
    position: absolute;
    top: calc(50% + 2px);
    transform: translateY(-50%);
    z-index: 2;
}
.sv-poll-portlet > table > tbody > tr > th {
    left: 12px;
}
.sv-poll-portlet > table > tbody > tr > td:last-child {
    right: 12px;
}

.sv-poll-portlet td:has(table) {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

.sv-poll-portlet td > table {
    width: 100%;
    border-spacing: 0;
}

.sv-poll-portlet td > table tr {
    display: flex;
}

.sv-poll-portlet td > table th {
    height: 40px;
}

.sv-poll-portlet > table tbody tr:has(td a) {
    display: none !important; 
}

/* Beige bakgrund */
.sv-poll-portlet > table tbody tr:before,
.sv-poll-portlet td > table tr {
    background-color: #DDCABE;
}

.sv-poll-portlet td > table th:first-of-type {
    background-color: #AD143D;
    border-radius: 8px;
}

.sv-poll-portlet td > table th:last-of-type {
    background-color: transparent;
}

/* Mörkröd bakgrund */
.env-block-primary .sv-poll-portlet > table tbody tr:before,
.env-block-primary .sv-poll-portlet td > table tr {
    background-color: #8E082B;
}

.env-block-primary .sv-poll-portlet td > table th:first-of-type {
    background-color: #ED1B34;
    border-radius: 8px;
}

.env-block-primary .sv-poll-portlet td > table th:last-of-type {
    background-color: transparent;
}

/* Vit bakgrund */
.env-block .sv-poll-portlet > table tbody tr:before,
.env-block .sv-poll-portlet td > table tr {
    background-color: #FBF6F3;
}

.env-block .sv-poll-portlet td > table th:first-of-type {
    background-color: #ED1B34;
    border-radius: 8px;
}

.env-block .sv-poll-portlet td > table th:last-of-type {
    background-color: transparent;
}

.env-block .sv-poll-portlet td > table th:only-of-type {
    background-color: #ED1B34;
} 

/* Poll - Egen mall */

.soc-poll {
    --poll-option-color: rgb(221,202,190);
    --poll-filled-bar-text-color: #fff;
    --poll-bar-color: #AD143D;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    margin-bottom: 1.5em;
}

.soc-poll__question {
    text-align: center;
}

.soc-poll__options {
    display: flex;
    flex-direction: column;
    gap: 10px;

}

.soc-poll__option {
    position: relative;
    background-color: var(--poll-option-color);
    border-radius: 8px;
    display: flex;
    width: 100%;
    height: 40px;
    overflow: hidden;
}

a.soc-poll__option:hover {
    background-color: var(--env-color-brand);
    color: #fff;
}

.soc-poll__option span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--env-font-color);
}
span.soc-poll__option-title {
    left: 1em;

}

.soc-poll__option-votes {
    right: 1em;
}

.soc-poll__bar {
    background-color: var(--poll-bar-color);
}

.soc-poll__option span.soc-poll__filled {
    color: var(--poll-filled-bar-text-color);
}

.soc-poll__bar.soc-poll__bar-empty {
    background-color: transparent;
}

/* Vit bakgrund */
.env-block .soc-poll {
    --poll-option-color: rgba(245,233,225, 0.4);
    --poll-filled-bar-text-color: #fff;
    --poll-bar-color: #ED1B34;
}

/* Mörkröd bakgrund */
.env-block-secondary .soc-poll {
    --poll-option-color: rgba(237,27,52, 0.3);
    --poll-filled-bar-text-color: #fff;
    --poll-bar-color: rgba(237,27,52, 1);;
}
.soc-poll:has(.soc-poll__filled) 
span.soc-poll__option-title {
    color: var(--poll-filled-bar-text-color);
}