/* A few repeated utility compositions. Tailwind CDN cannot use @apply, so
   these are written out longhand and referenced by class name. */

.focus-ring:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.nav-link {
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
}
.nav-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.nav-link-mobile {
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
}
.nav-link-mobile:hover {
  background-color: #f1f5f9;
}

/* Hide the number input spinners: budget is typed, not nudged. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Respect a user's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Carousel: the track is `slides.length * 100%` wide (set inline in the
   template) and each slide is `100 / slides.length` percent of the track.
   The track is translated by one slide width per step. */
[data-carousel-track] {
  will-change: transform;
}
[data-carousel-slide] {
  flex: 0 0 auto;
  box-sizing: border-box;
}

.skeleton {
  background-image: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
}
@keyframes skeleton-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
