/**
 * Thẻ tuyển dụng (widget Danh sách tuyển dụng).
 * Grid card: .tgwv-recruitment-card
 * List card (horizontal): .tgwv-recruitment-card--horizontal
 */
.tgwv-recruitment-card {
  --tgwv-recruitment-card-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --tgwv-recruitment-card-duration: 0.3s;
  --tgwv-recruitment-card-tag-bg: var(--tgwv-color-dark, #000000);
  --tgwv-recruitment-card-tag-color: var(--tgwv-color-light, #ffffff);
  --tgwv-recruitment-card-badge-bg: var(--tgwv-color-dark, #000000);
  --tgwv-recruitment-card-accent: var(--tgwv-brand, #003466);

  background-color: var(--tgwv-color-light, #ffffff);
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 4px 20px rgba(20, 16, 15, 0.06);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.tgwv-recruitment-card__media {
  overflow: hidden;
  border-radius: 15px 15px 0 0;
  position: relative;
}

.tgwv-recruitment-card__media-link {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  text-decoration: none;
  line-height: 0;
  color: inherit;
}

.tgwv-recruitment-card__media-link:focus-visible {
  outline: 2px solid #374586;
  outline-offset: -2px;
}

.tgwv-recruitment-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 16, 15, 0.4) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.tgwv-recruitment-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.tgwv-recruitment-card__badge {
  color: var(--tgwv-color-light, #ffffff);
  font-size: 10px;
  font-weight: 500;
  background-color: var(--tgwv-recruitment-card-badge-bg);
  padding: 5px 10px;
  border-radius: 999px;
  position: absolute;
  left: 15px;
  top: 20px;
  z-index: 2;
  transition: transform 0.35s ease;
}

.tgwv-recruitment-card__body {
  padding: 20px 15px;
}

.tgwv-recruitment-card__title {
  font-size: 18px;
  color: var(--tgwv-color-dark, #000000);
  margin: 0 0 8px;
  transition: color var(--tgwv-recruitment-card-duration) var(--tgwv-recruitment-card-ease);
}

.tgwv-recruitment-card__link {
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.tgwv-recruitment-card__link:focus-visible {
  outline: 2px solid #374586;
  outline-offset: 2px;
  border-radius: 2px;
}

.tgwv-recruitment-card__excerpt {
  font-size: 14px;
  margin: 0;
  color: var(--tgwv-color-dark, #000000);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tgwv-recruitment-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tgwv-recruitment-card__tag {
  color: var(--tgwv-recruitment-card-tag-color);
  background-color: var(--tgwv-recruitment-card-tag-bg);
  font-size: 13px;
  padding: 5px 15px;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  line-height: 1.3;
  cursor: pointer;
  transition:
    background-color var(--tgwv-recruitment-card-duration) var(--tgwv-recruitment-card-ease),
    color var(--tgwv-recruitment-card-duration) var(--tgwv-recruitment-card-ease),
    transform var(--tgwv-recruitment-card-duration) var(--tgwv-recruitment-card-ease);
}

.tgwv-recruitment-card__tag:focus-visible {
  outline: 2px solid #374586;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(20, 16, 15, 0.12);
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__img {
    transform: scale(1.06);
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__media::after {
    opacity: 1;
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__badge {
    transform: translateY(-2px);
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__title,
  .tgwv-recruitment-card__link:hover {
    color: var(--tgwv-brand);
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__link,
  .tgwv-recruitment-card__link:hover {
    text-decoration: none;
  }

  .tgwv-recruitment-card:not(.tgwv-recruitment-card--horizontal):hover .tgwv-recruitment-card__tag,
  .tgwv-recruitment-card__tag:hover {
    background-color: var(--tgwv-brand, #000000);
    color: var(--tgwv-color-light, #ffffff);
    transform: scale(1.02);
    text-decoration: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Horizontal list card (layout=list)                                         */
/* -------------------------------------------------------------------------- */

.tgwv-recruitment-card--horizontal {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.tgwv-recruitment-card--horizontal:focus-visible {
  outline: 2px solid var(--tgwv-recruitment-card-accent);
  outline-offset: 2px;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__media {
  position: relative;
  width: 280px;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  border-radius: 0;
  overflow: hidden;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__media::after {
  display: none;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__meta-item--salary {
  color: #198754;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tgwv-recruitment-card-accent);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__excerpt {
  font-size: 0.9rem;
  color: #666666;
  line-height: 1.5;
  margin: 0 0 20px;
  flex-grow: 1;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__cta {
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--tgwv-recruitment-card-accent);
  background: transparent;
  color: var(--tgwv-recruitment-card-accent);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.tgwv-recruitment-card--horizontal .tgwv-recruitment-card__cta i {
  margin-left: 0.25rem;
}

@media (hover: hover) and (pointer: fine) {
  .tgwv-recruitment-card--horizontal:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 52, 102, 0.1);
    border-color: var(--tgwv-recruitment-card-accent);
    text-decoration: none;
    color: inherit;
  }

  .tgwv-recruitment-card--horizontal:hover .tgwv-recruitment-card__img {
    transform: scale(1.06);
  }

  .tgwv-recruitment-card--horizontal:hover .tgwv-recruitment-card__cta {
    background-color: var(--tgwv-recruitment-card-accent);
    color: #ffffff;
  }
}

.tgwv-recruitment-card--horizontal.tgwv-recruitment-card--active {
  border: 2px solid var(--tgwv-recruitment-card-accent);
  box-shadow: 0 10px 25px rgba(0, 52, 102, 0.15);
  background-color: rgba(0, 52, 102, 0.01);
}

.tgwv-recruitment-card--horizontal.tgwv-recruitment-card--active .tgwv-recruitment-card__cta {
  background-color: var(--tgwv-recruitment-card-accent);
  color: #ffffff;
}

@media (max-width: 767.98px) {
  .tgwv-recruitment-card--horizontal {
    flex-direction: column;
  }

  .tgwv-recruitment-card--horizontal .tgwv-recruitment-card__media {
    width: 100%;
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tgwv-recruitment-card,
  .tgwv-recruitment-card__img,
  .tgwv-recruitment-card__badge,
  .tgwv-recruitment-card--horizontal,
  .tgwv-recruitment-card--horizontal .tgwv-recruitment-card__cta {
    transition: none;
  }

  @media (hover: hover) and (pointer: fine) {
    .tgwv-recruitment-card:hover,
    .tgwv-recruitment-card--horizontal:hover {
      transform: none;
    }

    .tgwv-recruitment-card:hover .tgwv-recruitment-card__img,
    .tgwv-recruitment-card--horizontal:hover .tgwv-recruitment-card__img {
      transform: none;
    }

    .tgwv-recruitment-card:hover .tgwv-recruitment-card__badge,
    .tgwv-recruitment-card:hover .tgwv-recruitment-card__tag {
      transform: none;
    }
  }
}
