/**
 * Views and Vacancy card styles.
 *
 * Styles for the vacancy listing page: exposed filters,
 * vacancy cards, and pager.
 */

/* =========================================================
   0. Vacancy listing section spacing
   ========================================================= */
.vacancy-listing-section {
  padding-top: 60px;
  padding-bottom: 60px;
}

@media (min-width: 768px) {
  .vacancy-listing-section {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

/* =========================================================
   1. Views Exposed Form — horizontal filter layout
   ========================================================= */
.views-exposed-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #CDD6D6;
}

.views-exposed-form .form-item {
  flex: 1 1 160px;
  min-width: 0;
  margin: 0;
}

.views-exposed-form .form-item label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.views-exposed-form select {
  display: block;
  width: 100%;
  height: 44px;
  padding: 8px 36px 8px 12px;
  border: 2px solid var(--color-border-secondary);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--color-secondary);
  background-color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease-in-out;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.views-exposed-form select:focus {
  outline: none;
  border-color: var(--color-brand);
}

.views-exposed-form select:hover {
  border-color: var(--color-brand);
}

/* Form actions (Filter + Reset buttons) */
.views-exposed-form .form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.views-exposed-form .form-actions .form-submit,
.views-exposed-form .form-actions input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 8px 24px;
  border: none;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease-in-out;
}

/* Filter button — primary */
.views-exposed-form .form-actions .form-submit:first-child,
.views-exposed-form .form-actions input[type="submit"]:first-child {
  background-color: var(--color-brand);
  color: #fff;
}

.views-exposed-form .form-actions .form-submit:first-child:hover,
.views-exposed-form .form-actions input[type="submit"]:first-child:hover {
  background-color: var(--color-brand-dark);
}

/* Reset button — secondary */
.views-exposed-form .form-actions .form-submit:last-child,
.views-exposed-form .form-actions input[type="submit"]:last-child {
  background-color: #F5F7FA;
  color: var(--color-secondary);
  border: 2px solid var(--color-border-secondary);
}

.views-exposed-form .form-actions .form-submit:last-child:hover,
.views-exposed-form .form-actions input[type="submit"]:last-child:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* One-button case: when no reset, don't apply last-child secondary style */
.views-exposed-form .form-actions .form-submit:first-child:last-child,
.views-exposed-form .form-actions input[type="submit"]:first-child:last-child {
  background-color: var(--color-brand);
  color: #fff;
  border: none;
}

/* =========================================================
   2. Salary badge (--color-accent not compiled in Tailwind)
   ========================================================= */
.vacancy-salary-badge {
  background-color: var(--color-accent);
  color: #fff;
}

/* =========================================================
   3. Vacancy card styles
   ========================================================= */
.vacancy-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.vacancy-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.vacancy-card__link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.vacancy-card__link:hover {
  color: var(--color-brand);
}

.vacancy-card__footer {
  margin-top: auto;
  border-top: 1px solid #EDF0F5;
}

/* =========================================================
   3. Pager styles
   ========================================================= */
.pager {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pager__items {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pager__item a,
.pager__item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-secondary);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pager__item a:hover {
  background-color: var(--color-background-secondary);
}

.pager__item--active a,
.pager__item.is-active a,
.pager__item--active span {
  background-color: var(--color-brand);
  color: #fff;
}

.pager__item--previous a,
.pager__item--next a {
  font-weight: 600;
}

.pager__item--ellipsis {
  color: var(--color-tertiary);
}

/* =========================================================
   4. Empty state (no results)
   ========================================================= */
.view-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-tertiary);
  font-size: 1.125rem;
}

/* =========================================================
   5. Vacancy body — prose-like typography
   ========================================================= */
.vacancy-body h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.3;
}

.vacancy-body h2:first-child {
  margin-top: 0;
}

.vacancy-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.vacancy-body p {
  margin-bottom: 1em;
  line-height: 1.75;
  color: var(--color-secondary);
}

.vacancy-body ul {
  list-style: disc;
  padding-left: 1.75rem;
  margin-bottom: 1.25em;
}

.vacancy-body ol {
  list-style: decimal;
  padding-left: 1.75rem;
  margin-bottom: 1.25em;
}

.vacancy-body li {
  margin-bottom: 0.5em;
  line-height: 1.75;
  color: var(--color-secondary);
}

.vacancy-body li::marker {
  color: var(--color-brand);
}

.vacancy-body a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vacancy-body a:hover {
  color: var(--color-brand-dark);
}

.vacancy-body strong,
.vacancy-body b {
  font-weight: 600;
  color: var(--color-primary);
}

/* =========================================================
   6. Responsive: stack filters on mobile
   ========================================================= */
@media (max-width: 640px) {
  .views-exposed-form {
    flex-direction: column;
    gap: 16px;
  }

  .views-exposed-form .form-item {
    flex: 1 1 100%;
  }

  .views-exposed-form .form-actions {
    width: 100%;
  }

  .views-exposed-form .form-actions .form-submit,
  .views-exposed-form .form-actions input[type="submit"] {
    flex: 1;
  }
}
