/* ================================================================
   JOB SEARCH CARD  (.jsc)
   Compact horizontal card for job search results.
   Primary color: #00659b | Dark: #013e5e | Light: #e3f2fd
   ================================================================ */

/* ── Grid wrapper ── */
.job-search-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}


/* ── Grid wrapper (generic) ── */
.job-search-grid .jsc {
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .job-search-grid,
  .job-search-grid--4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 575px) {
  .job-search-grid,
  .job-search-grid--4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ── Card container ── */
.jsc {
  position: relative;
  background: #fff;
  border: 1px solid #e6eef8;
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  overflow: visible;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.jsc:hover {
  border-color: rgba(0, 101, 155, 0.3);
  box-shadow: 0 4px 16px rgba(0, 101, 155, 0.07);
  transform: translateY(-2px);
}

/* ── Featured variant ── */
.jsc--featured {
  /* Differentiated by "EMPLEO DESTACADO" label only */
}

/* ── Link layer ── */
.jsc__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px;
  text-decoration: none !important;
  color: inherit;
}

.jsc__link:hover,
.jsc__link:focus {
  color: inherit;
  text-decoration: none !important;
}

/* ── Horizontal row: logo + body ── */
.jsc__row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* ── Logo ── */
.jsc__logo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #f0f6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #e6eef8;
}

.jsc__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jsc__initial {
  font-weight: 700;
  font-size: 14px;
  color: #00659b;
  text-transform: uppercase;
  line-height: 1;
}

/* ── Body (title + company + meta) ── */
.jsc__body {
  flex: 1;
  min-width: 0;
  padding-right: 28px; /* room for fav button */
}

/* ── Title (semantic h2, styled as compact card heading) ── */
h2.jsc__title,
.jsc__title {
  font-size: 15px;
  font-weight: 600;
  color: #00659b;
  margin: 0 0 2px;
  padding: 0;
  line-height: 1.3;
  border: none;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jsc:hover .jsc__title {
  color: #013e5e;
}

/* ── Company ── */
.jsc__company {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Meta row ── */
.jsc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.jsc__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.jsc__meta-item svg {
  flex-shrink: 0;
  stroke: #94a3b8;
}

/* ── Footer ── */
.jsc__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  margin-top: 10px;
  margin-left: 48px; /* align with body (logo 36 + gap 12) */
  border-top: 1px solid #f1f5f9;
}

.jsc__date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94a3b8;
}

.jsc__date svg {
  stroke: #94a3b8;
}

.jsc__promoted {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.jsc__cta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #00659b;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.jsc:hover .jsc__cta {
  opacity: 1;
  transform: translateX(0);
}

.jsc__cta svg {
  stroke: #00659b;
  transition: transform 0.15s ease;
}

.jsc:hover .jsc__cta svg {
  transform: translateX(2px);
}

/* ── Favorite button ── */
.jsc__fav {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.jsc__fav:hover {
  background: #e3f2fd;
  transform: scale(1.12);
}

.jsc__fav:active {
  transform: scale(0.92);
}

.jsc__fav-icon {
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
  fill: none;
  stroke-width: 2;
  transition: stroke 0.18s ease, fill 0.22s ease;
}

.jsc__fav:hover .jsc__fav-icon {
  stroke: #00659b;
}

/* Active / favorited */
.jsc__fav.is-active .jsc__fav-icon {
  fill: #00659b;
  stroke: #00659b;
}

.jsc__fav.is-active {
  background: #e3f2fd;
}

/* Info state (non-postulante users) — clickable with toast */
.jsc__fav--info .jsc__fav-icon {
  stroke: #cbd5e1;
}

/* ── Toast message ── */
.jsc-toast {
  position: absolute;
  z-index: 10;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: jsc-toast-in 0.2s ease;
}

.jsc-toast.is-hiding {
  opacity: 0;
  transition: opacity 0.2s ease;
}

@keyframes jsc-toast-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.jsc__fav.is-active:hover {
  background: #bbdefb;
}

/* Pulse animation on toggle */
@keyframes jsc-bookmark-pulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.jsc__fav.is-animating .jsc__fav-icon {
  animation: jsc-bookmark-pulse 0.4s ease;
}

/* ── Full page variant ── */
.jsc__fav--full {
  position: relative;
  top: auto;
  right: auto;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #f8fafc;
  flex-shrink: 0;
}

.jsc__fav--full .jsc__fav-icon {
  width: 22px;
  height: 22px;
}

.jsc__fav--full:hover {
  border-color: #00659b;
  background: #e3f2fd;
}

.jsc__fav--full.is-active {
  border-color: #00659b;
  background: #e3f2fd;
}

@media (max-width: 767px) {
  .jsc__fav--full {
    width: 40px;
    height: 40px;
  }
}

/* ── Mobile refinements ── */
@media (max-width: 575px) {
  .jsc__link {
    padding: 12px 14px;
  }

  .jsc__logo {
    width: 32px;
    height: 32px;
  }

  .jsc__body {
    padding-right: 24px;
  }

  .jsc__title {
    font-size: 14px;
  }

  .jsc__fav {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .jsc__fav-icon {
    width: 16px;
    height: 16px;
  }

  .jsc__foot {
    margin-left: 44px; /* 32 + 12 */
  }

  /* Always show CTA on mobile (no hover) */
  .jsc__cta {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Empty state (favorites page) ── */
.jsc-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.jsc-empty svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.jsc-empty h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.jsc-empty p {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.jsc-empty .btn-primary {
  background: #00659b;
  border-color: #00659b;
  border-radius: 8px;
  padding: 10px 24px;
  font-weight: 600;
}
