@tailwind base;
@tailwind components;
@tailwind utilities;

/*
 * We need to override trix.css's image gallery styles to accommodate the
 * <action-text-attachment> element we wrap around attachments. Otherwise,
 * images in galleries will be squished by the max-width: 33%; rule.
*/
@layer components {
  /* Trix editor base styles */
  .trix-content {
    @apply prose max-w-none;
    @apply text-primary-black;
  }

  .get-involved .trix-content {
    @apply text-primary-white;
  }

  /* Trix attachment styles */
  .trix-content .attachment-gallery>action-text-attachment,
  .trix-content .attachment-gallery>.attachment {
    flex: 1 0 33%;
    padding: 0 0.5em;
    max-width: 33%;
  }

  /* Your existing Trix editor styles */
  form .rich-text h1 {
    @apply font-bold text-2xl;
  }

  form .rich-text strong {
    @apply font-semibold;
  }

  form .rich-text em {
    @apply italic;
  }

  form .rich-text del {
    @apply line-through;
  }

  form .rich-text blockquote {
    @apply font-semibold italic border-l-2 border-gray-500 pl-4;
  }

  form .rich-text ul {
    @apply list-inside list-disc;
  }

  form .rich-text ol {
    @apply list-inside list-decimal;
  }

  form .rich-text a {
    @apply text-blue-600 underline;
  }
}

/* Trix display */
.trix-content a {
  @apply underline;
}

/* Fix bug where safari doesn't display the correct font on select options */
select {
  font-family: sans-serif, system-ui !important;
}

/* button enable/disable -> https://gorails.com/episodes/turbo-data-confirm-method-and-disable */
button .show-when-enabled {
  display: initial;
}

button .show-when-disabled {
  display: none;
}

button[disabled] .show-when-enabled {
  display: none;
}

button[disabled] .show-when-disabled {
  display: initial;
}

/* shared styles */
.wrapper {
  @apply mx-auto;
  @apply max-w-6xl;
  @apply px-6;
  center: true;
}

body {
  @apply bg-primary-black;
  @apply font-workSans;
  @apply text-primary-black;
  @apply antialiased;
  @apply leading-normal;
}

::selection {
  @apply text-primary-white;
  @apply bg-primary-blue;
}

strong {
  @apply font-workSansBold font-bold;
}

/* NGP form */
header.at-title,
header.at-markup,
legend.at-legend {
  display: none !important;
}

.ngp-form,
.at form {
  text-align: left !important;
}

.ngp-form,
.ngp-form .at,
.at,
.at form,
.clearfix,
.at-inner,
.at-form,
.at *,
.at *:before,
.at *:after,
.at-mode-person,
#NVVolunteerForm1003940 {
  z-index: 10 !important;
}

.at-inner {
  background-color: #000000 !important;
  color: #ffffff !important;
  z-index: 10 !important;
}

.at label {
  color: #ffffff !important;
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif !important;
}

.at .btn-at,
.at input[type="text"],
.at input[type="password"],
.at input[type="date"],
.at input[type="datetime"],
.at input[type="datetime-local"],
.at input[type="month"],
.at input[type="week"],
.at input[type="email"],
.at input[type="number"],
.at input[type="search"],
.at input[type="tel"],
.at input[type="time"],
.at input[type="url"],
.at input[type="color"],
.at textarea {
  border-radius: 0px !important;
  border-color: #000000 !important;
  width: 100% !important;
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif !important;
  color: #000000 !important;
}

.at input[type="submit"] {
  color: #ffffff !important;
}

.at ::placeholder {
  /* Chrome, Firefox, Opera, Safari 10.1+ */
  color: #b8bbaf !important;
  opacity: 1 !important;
  /* Firefox */
}

.at :-ms-input-placeholder {
  /* Internet Explorer 10-11 */
  color: #b8bbaf !important;
}

.at ::-ms-input-placeholder {
  /* Microsoft Edge */
  color: #b8bbaf !important;
}

.at label small {
  color: #b8bbaf !important;
}

.at .btn-at-primary {
  color: #ffffff !important;
  background-color: #008bfd !important;
  float: left !important;
  font-family: 'Work Sans', system-ui, -apple-system, sans-serif !important;
  font-weight: bold !important;
  font-size: 1.5rem !important;
}

.at .btn-at-primary:hover {
  color: #f1f1f2 !important;
}

.form-unit-radio label {
  padding: 0.5rem 0 0.5rem 0 !important;
}

.AdditionalInformation .radios>label:last-child input[type='radio'] {
  margin: 4px 8px 0 0 !important;
}

.at input[type="radio"] {
  margin: 0 0 0 0 !important;
}

/* Direct Upload Progress Bars */
.direct-upload {
  display: inline-block;
  position: relative;
  padding: 2px 4px;
  margin: 0 3px 3px 0;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  font-size: 11px;
  line-height: 13px;
}

.direct-upload--pending {
  opacity: 0.6;
}

.direct-upload__progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  opacity: 0.2;
  background: #0076ff;
  transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
  transform: translate3d(0, 0, 0);
}

.direct-upload--complete .direct-upload__progress {
  opacity: 0.4;
}

.direct-upload--error {
  border-color: red;
}

input[type=file][data-direct-upload-url][disabled] {
  display: none;
}

@import 'actiontext.css';