@import url('../wp-content/uploads/fonts/fonts/css/all.min.css');
@import url('../wp-content/uploads/fonts/font-awesome/css/all.min.css');


:root {
    --lightpurple: #dac7ea;
    --darkpurple: #441d66;

    --scrollbar-track: white;
    --scrollbar-handle: var(--lightpurple);
    --scrollbar-hover: var(--lightpurple);

    --border-radius: 0.3rem;
}


html, body {
    margin: 0;
    padding: 0;

    font-family: 'Lato', sans-serif;
}

body {
    width: 100%;
    height: 100%;

    overflow-y: scroll;
}


header {
    margin: 3rem auto;
    padding-inline: 1ch;

    max-width: 50ch;

    text-align: left;
}


main {
    margin: 0 auto;
    padding-inline: 1ch;

    max-width: 50ch;
}


footer {
    margin: 6rem auto 2rem auto;

    max-width: 50ch;
    
    color: #565657;
    text-align: center;
    font-size: 0.8rem;
}

footer a[href] {
    color: #565657;
}


h1 {
    color: var(--darkpurple);
    text-align: center;
    font-size: 2.3rem;
    font-family: 'Roboto Slab', serif;
}


.bordered {
    margin-block: 1rem;
    padding: 1rem;

    display: block;

    border: 1px solid var(--lightpurple);
    border-radius: var(--border-radius);
}

section > h3:first-of-type {
    margin-bottom: 1rem;

    display: block;
    
    font-size: 0.8rem;
    text-align: center;
    text-transform: uppercase;
}


/* SCROLLBAR */

/* Overall */
::-webkit-scrollbar {
    width: calc(var(--border-radius) * 2);
}
/* Track */
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-handle);
    border-radius: var(--border-radius);
}
/* On hover */
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-hover);
}

/*************/


/* SELECT RECIPIENT */

#select-recipient {
    border-bottom: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: 0;
}

.select-party {
    border: 1px solid var(--lightpurple);
    border-top: none;
    border-bottom: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
    align-content: stretch;
    justify-content: center;
    gap: 0.5ch;
    overflow-y: scroll;
}

.select-party:invalid ~ section {
  display: none;
}

.select-party input {
    clip: rect(0,0,0,0) !important;
    position: absolute;
}

.select-party label {
    padding: 0.2rem 1ch;

    flex-grow: 1;
    flex-basis: 0.5;

    font-size: 0.8rem;
    max-width: max-content;

    color: var(--darkpurple);
    
    border: 1px solid var(--lightpurple);
    border-radius: 10rem;

    user-select: none;
}

.select-party input:checked + label {
    color: white;
    background-color: var(--darkpurple) !important;
    border-color: var(--darkpurple) !important;
}

.select-party label::before,
.select-member label::before {
    display: none;
}

.select-party label:hover {
    cursor: pointer;
}

.select-member {
    border: 1px solid var(--lightpurple);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 1rem;
    

    display: grid;
    /* grid-template-columns: 1fr 1fr 1fr; */
    grid-template-columns: 1fr;

    overflow-y: auto;
}

.select-member input {
    clip: rect(0,0,0,0) !important;
    position: absolute;
}

.member {
    margin: 0.2em;
    padding: 0.1em 1ch;

    display: block;

    font-size: 0.8em;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;

    height: 1.5em;

    border: 1px solid transparent;
    border-radius: 1.5em;

    break-inside: avoid-column;

    user-select: none;
}

input[type=radio]:checked + label,
input[type=checkbox]:checked + label {
    background-color: var(--lightpurple);
    border-color: var(--lightpurple);
}

input[type=radio] + label::before,
input[type=checkbox] + label::before {
    float: left;
    color: var(--darkpurple);

}

input[type=checkbox] + label::before {
    content: '\f0c8';
}

input[type=checkbox]:checked + label::before {
    font-weight: bold;
    content: '\f14a';
}

input[type=radio] + label::before {
    content: '\f111';
}

input[type=radio]:checked + label::before {
    font-weight: bold;
    content: '\f058';
}

input[type=radio],
input[type=checkbox] {
    clip: rect(0,0,0,0) !important;
    position: absolute;
}



label:hover {
    cursor: pointer;
}

/********************/


/* OPTIONS */

.options > label {
    margin-block: 0.5rem;
    padding: 1rem;
    
    display: block;

    border-radius: calc(var(--border-radius) / 2);
}
.options > label:has(+ label) {
    margin-bottom: 0.5rem;
}
.options > label input {
    display: none;
}
.options > label:hover {
    cursor: pointer;
}
.options > label label {
    width: 100%;

    background-color: transparent;
    border-radius: 5px;
}
.options > input:checked {
    background-color: var(--lightpurple);
}
.options > input:checked::before {
    content: '\f058';
    font-weight: bold;
}

.options > label::before {
    margin-right: 1ch;

    font-family: 'Font Awesome 5 Free';
    font-weight: normal;
    font-style: normal;
}

.options > label:has(> input[type="radio"])::before {
    content: '\f111';
    color: var(--darkpurple);
}

.options > label:has(> input[type="radio"]:checked)::before {
    content: '\f058';
    font-weight: bold;
}

.options > label:has(> input[type="checkbox"])::before {
    content: '\f0c8';
    color: var(--darkpurple);
}

.options > label:has(> input[type="checkbox"]:checked)::before {
    content: '\f14a';
    font-weight: bold;
}


.options:has(:first-child > input:required:invalid) > label {
    display: none;
}

/***********/


/* OUTPUT */

#output {
    background-color: var(--lightpurple);
}

#output__email,
#output__subject,
#output__body {
    display: block;

    background-color: white;
    border: 1px solid var(--lightpurple);
    border-radius: var(--border-radius);
}

#enter-name label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
    display: block;
    text-align: center;
}

#enter-name input {
    margin: 0.25rem 0;
    padding: 0.5rem;
    font-size: 0.8rem;
    border-color: var(--lightpurple);
    border-radius: var(--border-radius);
    width: calc(100% - 2rem);
}
#enter-name input:focus-visible {
    outline-color: var(--darkpurple);
}

#output__email {
    margin-bottom: 0.25rem;
    padding: 0.5rem;

    font-size: 0.8rem;
}

#output__email::before {
    margin-right: 0.5ch;

    content: 'Till:';

    color: var(--darkpurple);

    user-select: none;
}

#output__subject {
    margin-bottom: 1rem;
    padding: 0.5rem;

    font-size: 0.8rem;
}

#output__subject::before {
    margin-right: 0.5ch;

    content: 'Ämne:';

    color: var(--darkpurple);

    user-select: none;
}

#output__body {
    padding: 1rem;

    font-size: 0.9rem;
}

#output__mailto {
    margin-bottom: 1rem;
    padding: 0.5em;

    display: block;

    color: white;
    background-color: var(--darkpurple);

    font-size: 1em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;

    border-radius: var(--border-radius);
}

#output:has(#output__mailto[href=""]) {
    display: none;
}

/**********/
