/* Tarjeta pública de vacante (public_render_job_card en includes/functions.php).
   Se carga después de frontend-premium.css y usa clases propias ta-jcard-*
   para no depender de las capas antiguas de .ta-job-card. */

body.ta-public-shell .ta-jcard {
  --jc-surface: #ffffff;
  --jc-line: rgba(23, 32, 51, .10);
  --jc-line-hover: rgba(254, 80, 0, .45);
  --jc-text: #121826;
  --jc-muted: #5b6474;
  --jc-soft: #8a93a3;
  --jc-accent: #e04800;
  --jc-accent-strong: #fe5000;
  --jc-accent-soft: rgba(254, 80, 0, .09);
  --jc-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --jc-shadow-hover: 0 18px 42px rgba(15, 23, 42, .12);
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 22px 22px 18px;
  border: 1px solid var(--jc-line);
  border-radius: 18px;
  background: var(--jc-surface);
  color: var(--jc-text);
  box-shadow: var(--jc-shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

html[data-theme="dark"] body.ta-public-shell .ta-jcard {
  --jc-surface: #121722;
  --jc-line: rgba(255, 255, 255, .09);
  --jc-line-hover: rgba(255, 122, 26, .55);
  --jc-text: #f3f4f6;
  --jc-muted: #aab1be;
  --jc-soft: #7f8796;
  --jc-accent: #ff8a3d;
  --jc-accent-strong: #ff6a00;
  --jc-accent-soft: rgba(255, 106, 0, .14);
  --jc-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
  --jc-shadow-hover: 0 22px 50px rgba(0, 0, 0, .45);
}

body.ta-public-shell.ta-brand-ni .ta-jcard {
  --jc-line-hover: rgba(217, 15, 29, .45);
  --jc-accent: #243f86;
  --jc-accent-strong: #d90f1d;
  --jc-accent-soft: rgba(36, 63, 134, .08);
}

html[data-theme="dark"] body.ta-public-shell.ta-brand-ni .ta-jcard {
  --jc-accent: #9fb4ff;
  --jc-accent-strong: #ef2335;
  --jc-accent-soft: rgba(159, 180, 255, .12);
}

body.ta-public-shell .ta-jcard:hover,
body.ta-public-shell .ta-jcard:focus-within {
  transform: translateY(-3px);
  border-color: var(--jc-line-hover);
  box-shadow: var(--jc-shadow-hover);
}

/* Enlace que cubre toda la tarjeta. */
body.ta-public-shell .ta-jcard-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

body.ta-public-shell .ta-jcard-link:focus-visible {
  outline: 3px solid var(--jc-line-hover);
  outline-offset: 2px;
}

body.ta-public-shell .ta-jcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-bottom: 14px;
}

body.ta-public-shell .ta-jcard-area {
  overflow: hidden;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--jc-accent-soft);
  color: var(--jc-accent);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.ta-public-shell .ta-jcard .ta-card-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  margin-right: -6px;
}

body.ta-public-shell .ta-jcard .ta-card-actions button {
  display: inline-grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  flex: 0 0 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: var(--jc-soft) !important;
  box-shadow: none !important;
  transform: none !important;
  transition: background-color .18s ease, color .18s ease !important;
}

body.ta-public-shell .ta-jcard .ta-card-actions button:hover,
body.ta-public-shell .ta-jcard .ta-card-actions button:focus-visible {
  background: var(--jc-accent-soft) !important;
  color: var(--jc-accent) !important;
  outline: none !important;
}

body.ta-public-shell .ta-jcard .ta-card-actions button:focus-visible {
  box-shadow: 0 0 0 2px var(--jc-line-hover) !important;
}

body.ta-public-shell .ta-jcard .ta-card-actions button.is-saved {
  color: var(--jc-accent-strong) !important;
}

body.ta-public-shell .ta-jcard .ta-action-icon {
  display: block;
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ta-public-shell .ta-jcard .ta-card-actions button.is-saved .ta-action-icon {
  fill: currentColor !important;
}

body.ta-public-shell .ta-jcard-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.5em;
  margin: 0 0 14px;
  color: var(--jc-text);
  font-size: clamp(19px, 1.6vw, 21px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.015em;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color .2s ease;
}

body.ta-public-shell .ta-jcard:hover .ta-jcard-title,
body.ta-public-shell .ta-jcard:focus-within .ta-jcard-title {
  color: var(--jc-accent);
}

body.ta-public-shell .ta-jcard-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

body.ta-public-shell .ta-jcard-meta li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--jc-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

body.ta-public-shell .ta-jcard-meta li {
  min-width: 0;
}

body.ta-public-shell .ta-jcard-meta li > span {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

body.ta-public-shell .ta-jcard-meta svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--jc-accent-strong);
}

body.ta-public-shell .ta-jcard-meta-location > span {
  color: var(--jc-text);
  font-weight: 650;
}

body.ta-public-shell .ta-jcard-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--jc-line);
  color: var(--jc-muted);
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.ta-public-shell .ta-jcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--jc-line);
  color: var(--jc-accent);
  font-size: 14.5px;
  font-weight: 750;
}

body.ta-public-shell .ta-jcard-excerpt + .ta-jcard-foot {
  border-top: 0;
  padding-top: 0;
}

body.ta-public-shell .ta-jcard-go {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--jc-accent-soft);
  color: var(--jc-accent);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

body.ta-public-shell .ta-jcard:hover .ta-jcard-go,
body.ta-public-shell .ta-jcard:focus-within .ta-jcard-go {
  background: var(--jc-accent-strong);
  color: #ffffff;
  transform: translateX(2px);
}

@media (max-width: 575.98px) {
  body.ta-public-shell .ta-jcard {
    padding: 18px 18px 16px;
    border-radius: 16px;
  }

  body.ta-public-shell .ta-jcard-title {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ta-public-shell .ta-jcard,
  body.ta-public-shell .ta-jcard-go {
    transition: none;
  }

  body.ta-public-shell .ta-jcard:hover,
  body.ta-public-shell .ta-jcard:focus-within,
  body.ta-public-shell .ta-jcard:hover .ta-jcard-go {
    transform: none;
  }
}

/* =====================================================================
   Animaciones del rediseño público.
   Las tarjetas nuevas definen su propia transición (hover), lo que anulaba
   la entrada .ta-reveal; aquí se combinan ambas con mayor especificidad.
   El retraso escalonado solo afecta a opacidad y desplazamiento y public.js
   lo pone en 0 al terminar, para que el hover responda al instante.
   ===================================================================== */
html body.ta-public-shell .ta-reveal {
  transition:
    opacity 640ms cubic-bezier(.2, .8, .2, 1) var(--ta-reveal-delay, 0ms),
    transform 640ms cubic-bezier(.2, .8, .2, 1) var(--ta-reveal-delay, 0ms),
    border-color 200ms ease,
    box-shadow 200ms ease,
    background-color 200ms ease,
    color 200ms ease;
}

html body.ta-public-shell .ta-reveal:not(.ta-reveal-visible) {
  opacity: 0;
  transform: translateY(22px);
}

/* Entrada del texto de los banners y del encabezado del detalle. */
@keyframes taHeroRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

body.ta-public-shell .ta-hm-hero-copy > * {
  animation: taHeroRise 720ms cubic-bezier(.2, .8, .2, 1) backwards;
}

body.ta-public-shell .ta-hm-hero-copy > :nth-child(1) { animation-delay: 60ms; }
body.ta-public-shell .ta-hm-hero-copy > :nth-child(2) { animation-delay: 140ms; }
body.ta-public-shell .ta-hm-hero-copy > :nth-child(3) { animation-delay: 220ms; }
body.ta-public-shell .ta-hm-hero-copy > :nth-child(4) { animation-delay: 300ms; }
body.ta-public-shell .ta-hm-hero-copy > :nth-child(5) { animation-delay: 380ms; }

@media (prefers-reduced-motion: reduce) {
  body.ta-public-shell .ta-hm-hero-copy > * {
    animation: none;
  }

  html body.ta-public-shell .ta-reveal,
  html body.ta-public-shell .ta-reveal:not(.ta-reveal-visible) {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Sin palabras forzadas a MAYÚSCULAS en el sitio público (títulos pequeños,
   etiquetas y pie). Las siglas escritas así en el texto (ACOSA, RH) no cambian. */
html body,
html body *,
html body *::before,
html body *::after {
  text-transform: none !important;
}

.ta-hm-kicker,
.ta-hm-eyebrow,
.ta-hm-card-kicker,
.ta-footer-kicker,
.ta-public-eyebrow,
.ta-public-card-kicker,
.apply-gate-kicker,
.ta-jd-kicker,
.ta-jcard-area {
  letter-spacing: .01em !important;
}

/* frontend-premium.css fuerza mayúsculas con !important en estas etiquetas. */
.ta-public-shell .ta-public-eyebrow,
.ta-public-shell .section-label,
.ta-public-shell .country-kicker,
.ta-public-shell .ta-public-card-kicker {
  text-transform: none !important;
  letter-spacing: .01em !important;
}
