/*
 * Application-wide styles. Component classes live in app/assets/tailwind/application.css.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Source Sans 3', ui-sans-serif, system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*:focus-visible {
  outline: 2px solid rgb(13 148 136);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

*:focus:not(:focus-visible) {
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgb(204 251 241 / 0.8);
}

input:user-invalid,
textarea:user-invalid,
select:user-invalid {
  border-color: rgb(239 68 68);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.transition-smooth {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgb(245 245 244);
}

::-webkit-scrollbar-thumb {
  background: rgb(214 211 209);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(168 162 158);
}

@media (max-width: 640px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  button,
  [role="button"],
  a {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (prefers-contrast: high) {
  input,
  textarea,
  select {
    border-width: 2px;
  }

  button,
  [role="button"] {
    border: 2px solid currentColor;
  }
}

@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;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: white;
  color: black;
  padding: 8px;
  text-decoration: none;
  z-index: 1000;
  border: 2px solid black;
}

.skip-link:focus {
  top: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  .no-print {
    display: none !important;
  }
}

.loading {
  pointer-events: none;
  opacity: 0.6;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.form-field-error {
  color: rgb(239 68 68);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-field-help {
  color: rgb(120 113 108);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Tom Select — language multi-select chips */
.ts-hidden-accessible {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
}

.ts-wrapper {
  position: relative;
  margin-top: 0.375rem;
  width: 100%;
}

.ts-wrapper.multi .ts-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  width: 100%;
  border: 1px solid rgb(231 229 228);
  border-radius: 0.75rem;
  background: white;
  padding: 0.375rem 0.625rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  font-size: 0.875rem;
}

.ts-wrapper.multi .ts-control > input {
  min-width: 10rem;
  flex: 1 1 10rem;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0.25rem 0;
}

.ts-wrapper.multi .ts-control > input:focus {
  box-shadow: none;
}

.ts-wrapper.focus .ts-control {
  border-color: rgb(13 148 136);
  box-shadow: 0 0 0 3px rgb(204 251 241);
}

.ts-wrapper.multi .ts-control .item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  background: rgb(240 253 250);
  color: rgb(15 118 110);
  padding: 0.25rem 0.625rem;
  font-weight: 600;
}

.ts-wrapper.multi .ts-control .item .remove {
  color: rgb(15 118 110);
  opacity: 0.75;
}

.ts-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 60;
  width: 100%;
  margin-top: 0.25rem;
  overflow: hidden;
  border: 1px solid rgb(231 229 228);
  border-radius: 0.75rem;
  background: white;
  box-shadow: 0 16px 40px -12px rgb(28 25 23 / 0.18);
  font-size: 0.875rem;
}

.ts-dropdown.active {
  display: block;
}

.ts-dropdown .ts-dropdown-content {
  max-height: 12rem;
  overflow-y: auto;
}

.ts-dropdown .option {
  padding: 0.5rem 0.75rem;
}

.ts-dropdown .active {
  background: rgb(240 253 250);
  color: rgb(28 25 23);
}

/* Subtle road-line pattern for hero backgrounds */
.road-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230d9488' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
