/*
 * Revolgy Jobs Widget — jobs-widget.css
 *
 * All selectors are prefixed with .rjw- to avoid collisions with host-page styles.
 * Override the custom properties below to theme the widget for your context.
 */

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */

:root {
  --rjw-font:              system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Colours */
  --rjw-color-bg:          #ffffff;
  --rjw-color-border:      #e8eaed;
  --rjw-color-hover:       #f8f9fa;
  --rjw-color-text:        #1a202c;
  --rjw-color-location:    #6b7280;
  --rjw-color-state:       #718096;
  --rjw-color-error:       #c53030;

  /* Tags */
  --rjw-color-tag-bg:      #eef2ff;
  --rjw-color-tag-text:    #4338ca;

  /* CTA link */
  --rjw-color-cta:         #2d3748;
  --rjw-color-cta-hover:   #4338ca;
  --rjw-color-focus-ring:  #3182ce;
}

/* ---------------------------------------------------------------------------
   List
   --------------------------------------------------------------------------- */

.rjw-list {
  list-style: none;
  margin:  0;
  padding: 0;
}

/* ---------------------------------------------------------------------------
   Row
   --------------------------------------------------------------------------- */

.rjw-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid var(--rjw-color-border);
  border-radius: 4px;
  transition: background 0.1s ease;
}

.rjw-list li:first-child .rjw-row {
  border-top: 1px solid var(--rjw-color-border);
}

.rjw-row:hover {
  background: var(--rjw-color-hover);
}

/* ---------------------------------------------------------------------------
   Info block (left side)
   --------------------------------------------------------------------------- */

.rjw-row__info {
  flex: 1;
  min-width: 0; /* allow text to truncate inside a flex child */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Top line: title + tags */
.rjw-row__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rjw-row__title {
  margin: 0;
  font-family: var(--rjw-font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--rjw-color-text);
  line-height: 1.3;
}

/* Location */
.rjw-row__location {
  margin: 0;
  font-family: var(--rjw-font);
  font-size: 0.8125rem;
  color: var(--rjw-color-location);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Tags (department, employment type)
   --------------------------------------------------------------------------- */

.rjw-row__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.rjw-tag {
  font-family: var(--rjw-font);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 100px;
  background: var(--rjw-color-tag-bg);
  color: var(--rjw-color-tag-text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------------------
   CTA (right side)
   --------------------------------------------------------------------------- */

.rjw-row__cta {
  flex-shrink: 0;
  font-family: var(--rjw-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rjw-color-cta);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.375rem 0;
  transition: color 0.1s ease;
}

.rjw-row__cta::after {
  content: " →";
}

.rjw-row__cta:hover {
  color: var(--rjw-color-cta-hover);
}

.rjw-row__cta:focus {
  outline: none;
}

.rjw-row__cta:focus-visible {
  outline: 2px solid var(--rjw-color-focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   Mobile: stack CTA below job info
   --------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .rjw-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .rjw-row__cta {
    font-size: 0.8125rem;
  }
}

/* ---------------------------------------------------------------------------
   State containers (loading / error / empty)
   --------------------------------------------------------------------------- */

.rjw-state {
  font-family: var(--rjw-font);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--rjw-color-state);
}

.rjw-state p {
  margin: 0;
  font-size: 0.9375rem;
}

.rjw-state--error {
  color: var(--rjw-color-error);
}

/* ---------------------------------------------------------------------------
   Spinner
   --------------------------------------------------------------------------- */

.rjw-spinner {
  display: block;
  width:  2rem;
  height: 2rem;
  border: 3px solid var(--rjw-color-border);
  border-top-color: var(--rjw-color-state);
  border-radius: 50%;
  animation: rjw-spin 0.75s linear infinite;
}

@keyframes rjw-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .rjw-spinner {
    animation: none;
    border-top-color: var(--rjw-color-border);
    border-left-color: var(--rjw-color-state);
  }
}
