/* scrollbar improvements (taken from tlon; https://github.com/tloncorp/tlon-apps) */
* {
  /* Scrollbar resizing for Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--colors-gray-200)) transparent;
  /* Hide gray box when tapping a link on iOS */
  -webkit-tap-highlight-color: transparent;
  /* Disable double-tap to zoom, removes click delay */
  touch-action: manipulation;
  /* Better font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: subpixel-antialiased;
}

/* Scrollbar resizing for Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border: solid 2px transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgb(var(--colors-gray-200));
  border: solid 2px transparent;
  border-radius: 20px;
  background-clip: content-box;
}


/* Auto-grow Text Areas (css-tricks.com/the-cleanest-trick-for-autogrowing-textareas) */
.grow-wrap {
  /* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */
  display: grid;
}
.grow-wrap::after {
  /* Note the weird space! Needed to preventy jumpy behavior */
  content: attr(data-replicated-value) " ";

  /* This is how textarea text behaves */
  white-space: pre-wrap;

  /* Hidden from view, clicks, and screen readers */
  visibility: hidden;
}
.grow-wrap > textarea {
  /* You could leave this, but after a user resizes, then it ruins the auto sizing */
  resize: none;

  /* Firefox shows scrollbar on growth, you can hide like this. */
  overflow: hidden;
}
.grow-wrap > textarea,
.grow-wrap::after {
  /* NOTE: Identical styling required!! */
  padding: 0.25rem;
  font: inherit;

  /* Place on top of each other */
  grid-area: 1 / 1 / 2 / 2;
}


/* Inverted Tailwindcss "drop-shadow" classes (https://tailwindcss.com/docs/drop-shadow) */
.drip-shadow-sm {
  filter: drop-shadow(0 -1px 1px rgb(0 0 0 / 0.05));
}
.drip-shadow {
  filter: drop-shadow(0 -1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 -1px 1px rgb(0 0 0 / 0.06));
}
.drip-shadow-md {
  filter: drop-shadow(0 -4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 -2px 2px rgb(0 0 0 / 0.06));
}
.drip-shadow-lg {
  filter: drop-shadow(0 -10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 -4px 3px rgb(0 0 0 / 0.1));
}
.drip-shadow-xl {
  filter: drop-shadow(0 -20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 -8px 5px rgb(0 0 0 / 0.08));
}
.drip-shadow-2xl {
  filter: drop-shadow(0 -25px 25px rgb(0 0 0 / 0.15));
}


/* Auto-add indicators for required fields (https://stackoverflow.com/q/49685336) */
input[required] + label:after,
select[required] + label:after,
div.ts-wrapper + label:after {
  content: '*';
  color: #EF4444; /* text-red-500 */
}


/* Allow for pseudo-'disabled' on <a> elements (https://stackoverflow.com/a/43492810) */
a[disabled] {
  pointer-events: none;
}
