/* Form */
/* button - not needed to style as actions are not button and it effects toolbar #12 */
/* Need to target off canvas for Layout builder */
form {
  display: flex;
  flex-direction: column;
}

.contact-form.block.block-contact-block {
  max-width: 100%;
  margin: 0;
}

input,
optgroup,
select,
textarea {
  box-sizing: border-box;
  /*height: 33px;*/
  height: auto;
  border: 1px solid #979797;
  border-radius: 3px;
  background-color: rgba(255, 255, 255, 0.3);
  font-family: 'Open Sans', sans-serif;
  padding: 0.8em 1em;
  /* Need for width for custom select icon*/
  width: 100%;
  max-width: 100%;
  appearance: none;
  line-height: 1.5; /* override normalize */
}

/* todo: check @slate theme for widths mobile and desktop
 *
 * because forms are mainly use in block the max-width should be set in container query
 * max-width: 350px;
 */

textarea {
  height: revert;
}

/* Include Layout Builder
   #edit-discard-changes
   #edit-revert
 */

/* input[id^="edit-"], // this target all inputs. I.e. edit-nae, edit-pass, edit-FIELD-NAME */
input[id^="edit-submit-"],
#edit-submit,
#edit-preview {
  background-color: #242e2f !important;
  border-color: #242e2f;
  border-style: solid;
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
  color: #c6e9b9 !important;
  cursor: pointer;
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  /*font-size: 14px !important;*/
  font-weight: 700;
  line-height: 20px;
  margin: 0 !important;
  /*padding: 10px !important;*/
  /*height: auto;*/
}

.layout.layout--twocol-section.layout--twocol-section--50-50 input#edit-submit,
.layout.layout--twocol-section.layout--twocol-section--50-50 input[id^="edit-submit-"]{
  text-transform: uppercase;
  text-align: right;
}

/* label.js-form-required.form-required */
.form-item label {
  width: 12em;
  display: inline-block;
}
.field--type-datetime .label {
  font-weight: normal;
}

/* Contact Form */
/* input need to make all input consistent todo: test with date .form-date as width doesn't apply from global rule */
.contact-form input,
.contact-form select {
  width: 20em
}

.contact-form .form-textarea-wrapper textarea {
  max-width: 40em;
}

/* Layout Builder */
#node-spa-layout-builder-layout-builder-form {
  margin-right: 24px;
  margin-left: 24px;
}
/* Layout Builder makes buttons height too large*/
#edit-actions {
  display: flex;
  height: 55px;
  gap: 1rem;
}

/* Layout Builder Modal todo: @LBM work out way to better implement Layout Builder Modal */
#edit-actions {
  flex-wrap: unset;
}

#edit-actions .button {
  cursor: pointer;
  margin: 0;
}

/* select */
.form-type-select select {
  /*
  display: flex;
  justify-content: space-between;
  */
  display: inline;

  /* If you don't use ;utf8 then you need to encode the opening and closing tags , use %23 for #*/
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 16 16'> <path fill='%23424B5A' stroke='%23424B5A' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6 z' /></svg>");
  /*background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'> <path d = 'M3 3 L3 25 L23 14 z' stroke = 'black' stroke-width = '3' fill = 'black'/> </svg>");*/

  background-repeat: no-repeat;
  background-position: right 1.35rem center;
  background-size: 1.1rem 1.1rem;

}

.form-type-select select:focus {
  outline: auto 2px Highlight;
  outline: auto 5px -webkit-focus-ring-color;
}

.form-type-select select:hover {
  cursor: pointer;
}
/*
.form-type-select::after {
  content: "";
  width: 0.8em;
  height: 0.5em;
  background-color: #131415;
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  position: relative;
  top: 0;
  right: 2.5em;
  z-index: 20;
  border: 1px solid #ffffff;
  cursor: pointer;
  pointer-events: none; /* this makes it transparent to pointer /
  display: inline-block;
}
*/

/* Chrome + Safari + Opera + Firefox todo: remove the supports rule */
/* Also check /claro/css/components/form--checkbox-radio.css*/
/*@supports (-webkit-appearance:none) { Supports no longer needed */

/* todo: remove  The drupal-off-canvas selector is deprecated in drupal:9.5.0 and is removed from drupal:10.0.0. See https://www.drupal.org/node/3305664.
           drupal-off-canvas input[type="checkbox"], */
#drupal-off-canvas-wrapper input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none; /* Safari and Chrome */
  -moz-appearance: none !important;
  -o-appearance: none !important;
  appearance: none !important;
  display: inline-block;
  position: relative;
  top: 5px;
  margin-right: 0.75em;
  padding: 0;
  background: #fff;
  border: 1px solid #757575;
  border-radius: 2px;
  width: 1.125rem;
  height: 1.125rem;
  -webkit-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  transition: background 0.5s ease;
  outline: none;
}

/* Override for webform
.node-type-webform input[type=checkbox], */
input[type="radio"] {
  top: 0;
}

input[type="radio"] {
  border-radius: 50%;
  box-shadow: inset 0 0 0 0 #fff;
  transition: box-shadow .1s cubic-bezier(0.28, 0.63, 0.77, 0.17);
}

/* todo:
     remove see note above
     drupal-off-canvas input[type="checkbox"]:hover,
     drupal-off-canvas input[type="checkbox"]:focus, */
#drupal-off-canvas-wrapper input[type="checkbox"]:hover,
#drupal-off-canvas-wrapper input[type="checkbox"]:focus,
input[type="checkbox"]:hover,
input[type="checkbox"]:focus,
input[type="radio"]:hover,
input[type="radio"]:focus {
  border-color: #757575;
  cursor: pointer;
}

/* todo:
     remove see note above drupal-off-canvas input[type="checkbox"]:checked, */
#drupal-off-canvas-wrapper input[type="checkbox"]:checked,
input[type=checkbox]:checked,
input[type=checkbox]:disabled:checked,
input[type=radio]:checked,
input[type=radio]:disabled:checked {
  border: 1px solid #0E9C57;
}

/* todo:
     remove see note above drupal-off-canvas input[type="checkbox"]:checked, */
#drupal-off-canvas-wrapper input[type="checkbox"]:checked,
input[type=checkbox]:checked,
input[type=checkbox]:disabled:checked {
  /* background: url('../img/check.svg') scroll no-repeat 0 0 #0E9C57; */
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.795 7.096l2.387 2.506 6.023-6.327 1.484 1.56-7.507 7.89L2.31 8.656z' fill='%23fff'/%3e%3c/svg%3e");
  background-color: #0E9C57;
}

input[type=radio]:checked,
input[type=radio]:disabled:checked {
  background: #0E9C57;
  box-shadow: inset 0 0 0 3 #fff;
}

input[type=checkbox]:disabled,
input[type=radio]:disabled {
  opacity: .5;
  background: #E2E2E2;
}

input[type=checkbox]:disabled:hover,
input[type=radio]:disabled:hover {
  border-color: #0E9C57;
  cursor: default;
  /*cursor: not-allowed;*/
}

input[type="checkbox"]:focus {
  outline: auto 2px Highlight;
  outline: auto 5px -webkit-focus-ring-color;
}

/* Doesn't get read by browser
.contact-form input[type="number"]::-moz-number-spin-down {
  display:none;
}

input[type="number"] [aria-hidden="true"]
input[type="number"] div:nth-child(3) div {
  display: none;
  appearance: none;
}
 */

/* Only works on webkit (including Safari)*/
input[type="number"]::-webkit-inner-spin-button {
  /*cursor: crosshair;
  *display: none;
  appearance: none;*/
}

/* Blink Webkit */

/* input date
 * Makes Calender background yellow
 * All so see https://stackoverflow.com/questions/15530850/method-to-show-native-datepicker-in-chrome/45461709#45461709
 */
input[type="date"]::-webkit-calendar-picker-indicator {
  /*background-color: yellow;*/
  filter: invert(100%);
  /* -webkit-min-logical-width: 100%;  This pushes the calender icon to the left and therefore input background 100%  */

  width: 80%;
  background-position: right;
}

/* Safari Fixes */

/* Not relevant 2023 possibly https://stackoverflow.com/questions/18381594/input-type-date-appearance-in-safari-on-ios
input[type="date"] {
  -webkit-min-logical-width: 100%;
}
 *
 * No effect
input::-webkit-datetime-edit-fields-wrapper {
  text-align: center;
}*/
/* Safari iOS Centres Date in input */
input::-webkit-date-and-time-value {
  text-align: left;
}

/* Shadow dom element
input::-webkit-contacts-auto-fill-button {
  color: whitesmoke;
}
*/
input:not(input:-webkit-autofill)::-webkit-contacts-auto-fill-button {
  background-color: #c2d1d9; /*whitesmoke;*/
}


/* todo: remove once production works #wrapper.layout */

/* SPA Block only /
/* Remove margin for alignment to top to match info section /
form .form-item:first-child {
  margin-top: 0;
}
/* Need to allow from input to expand 100% /
form .form-item:first-child {
  width: 100%;
}

.contact-form input, .contact-form select {
  width: 100%;
}

 */

/*** Dark

.dark.layout.layout--twocol-section.layout--twocol-section--50-50 label,
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 .label,
.dark label,
.dark .label {
  color: #c2d1d9;
}
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 input,
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 optgroup,
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 select,
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 textarea,
.dark input,
.dark optgroup,
.dark select,
.dark textarea {
  background-color: transparent;
  border-color: #c2d1d9;
  color: #c2d1d9;
  /*width: 100%; This make checkboxes too wide and therefore many tick icons show /
  max-width: 100%;
}
.dark input[type="date"] {
  color: #c2d1d9;
}
.dark.layout.layout--twocol-section.layout--twocol-section--50-50 input#edit-submit,
.dark input#edit-submit,
.dark input[id^="edit-submit-"] {
  border-width: 0;
  background-color: #c2d1d9!important;
  color: #363636!important;
  text-transform: uppercase;
  text-align: right;
  border-radius: 1px;
}
   */
