////
/// Input elements.
///
/// @group  Elements
/// @author Sky Shabatura <theme@sky.camp>
/// @link   https://taproot-theme.com
////

// reset


button,
input,
optgroup,
select,
textarea {
    font-family: inherit; /* 1 */
    font-size: 100%; /* 1 */
    line-height: 1.15; /* 1 */
    margin: 0; /* 2 */
}

/**
 * Remove the inheritance of text transform in Edge and Firefox.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
    text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */

button,
[type='button'],
[type='reset'],
[type='submit'] {
    -webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type='button']::-moz-focus-inner,
[type='reset']::-moz-focus-inner,
[type='submit']::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type='button']:-moz-focusring,
[type='reset']:-moz-focusring,
[type='submit']:-moz-focusring {
    outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */

fieldset {
    padding: 0.35em 0.75em 0.625em;
}

/**
 * Remove the padding so developers are not caught out when they zero out `fieldset` elements in all browsers.
 */

legend {
    padding: 0;
}

/**
 * Add the correct vertical alignment in Chrome and Firefox.
 */

progress {
    vertical-align: baseline;
}

/**
 * Correct the cursor style of increment and decrement buttons in Safari.
 */

[type='number']::-webkit-inner-spin-button,
[type='number']::-webkit-outer-spin-button {
    height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type='search'] {
    -webkit-appearance: textfield; /* 1 */
    outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */

[type='search']::-webkit-search-decoration {
    -webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
    -webkit-appearance: button; /* 1 */
    font: inherit; /* 2 */
}

// end reset

// Fieldsets.
fieldset {
    margin:  0 0 1.5rem;
    padding: 1.5rem 1.5rem 0;
    border:  1px solid;
    border-color: var( --colors--meta-medium );
}

// Legends.
legend {
    padding: 0.375rem 1.5rem;
    background-color:   var( --colors--meta-light );
    border-color:       var( --colors--meta-medium );

    font: {
        size: 0.8em;
        weight: 700;
    }

    border: 1px solid;
}

// Labels.
label {
    font: {
        weight: 400;
    }
    cursor: pointer;
}

// Inputs
input {
    display: block;

    &[type="checkbox"],
    &[type="radio"] { display: inline-block; }
}

input, textarea, select {
    color: var( --colors--meta-dark );
}

input,
textarea,
button,
select {
    font-family: inherit;
}

label,
button,
input[type="submit"],
input[type="reset"],
input[type="button"] {
    cursor: pointer;
}

input[type="submit"],
input[type="reset"],
input[type="button"],
button {
    display: inline-block;
    text-shadow: none;
}

input[type="number"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"],
textarea,
select,
option {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625em 1em;
    background: rgba( 255, 255, 255, 0.6 );
    border: 1px solid;
    border-color: var( --colors--meta-medium );

    &:focus {
        background: #ffffff;
    }
}

input[type="number"] { width: auto; }

input[name="post_password"] {
    margin-bottom: 1.5rem;
}

select[disabled], input[disabled] {
    background: transparent;
}

textarea {
    min-height:  200px;
}

input:focus, textarea:focus {
    outline: 2px solid var(--colors--accent);
}
