/* ============================================================
   trabajo.info.bo — versión Tailwind v4 (CDN)
   Capa de diseño corporativo: comportamiento, tokens y
   refinamiento visual sobre los utilities de Tailwind.
   ============================================================ */

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Public Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #fff;
}
/* Nota: esta regla no vive dentro de ningun @layer de Tailwind, asi que por las
   reglas de cascade layers le gana a CUALQUIER utilidad de Tailwind (incluidas
   las dark:), sin importar especificidad. Por eso el modo oscuro del body se
   fuerza aqui explicitamente en vez de confiar en la clase dark:bg-slate-950. */
.dark body {
  background-color: #020617;
}

::selection {
  background: rgba(6, 42, 70, .85);
  color: #fff;
}

/* Scrollbar corporativo */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* Accesibilidad: foco visible profesional */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-primary, #062a46);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respetar movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Botones corporativos ---------- */
.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .875rem;
  line-height: 1;
  padding: .75rem 1.5rem;
  border-radius: .625rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease,
    transform .18s ease, box-shadow .18s ease;
}

.tf-btn:active { transform: translateY(1px); }

/* Offcanvas (menú móvil / búsqueda) ---------- */
.offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(320px, 85vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .15);
  transform: translateX(105%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
}
.offcanvas.active { transform: translateX(0); }
.dark .offcanvas { background: #0f172a; }
.offcanvas-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.offcanvas-overlay.is-visible { opacity: 1; visibility: visible; }

/* ---------- Bottom nav móvil ---------- */
.pp-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, .07);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
.dark .pp-bottom-nav {
  background: rgba(15, 23, 42, .92);
  border-top-color: #1e293b;
}
.pp-bottom-nav a,
.pp-bottom-nav button {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 2px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: .01em;
  color: #64748b;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color .15s ease;
}
.pp-bottom-nav svg {
  flex: none;
  width: 22px;
  height: 22px;
  display: block;
}
.pp-bottom-nav a > span,
.pp-bottom-nav button > span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pp-bottom-nav .is-active {
  color: var(--color-accent, #f2711c);
  position: relative;
}
.pp-bottom-nav .is-active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--color-accent, #f2711c);
}
.dark .pp-bottom-nav a,
.dark .pp-bottom-nav button {
  color: #94a3b8;
}
.has-pp-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .pp-bottom-nav { display: none; } }
@media (min-width: 768px) { .has-pp-bottom-nav { padding-bottom: 0; } }

/* ---------- Favoritos (corazón) ---------- */
.jmc__fav { cursor: pointer; }
.jmc__fav.is-active { color: #e11d48; }
.jmc__fav.is-active svg { fill: currentColor; }

/* ---------- Detalle SEO (details/summary) ---------- */
.tf-seo-details details { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 18px; }
.tf-seo-details summary { cursor: pointer; font-weight: 600; color: var(--color-primary, #062a46); }
.tf-seo-details summary::-webkit-details-marker { display: none; }

/* ---------- Prosa de páginas estáticas ---------- */
.prose-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.5rem 0 .5rem;
}
.prose-page p { margin: 0 0 .75rem; line-height: 1.7; }
.prose-page ul { list-style: disc; padding-left: 1.25rem; margin: 0 0 .75rem; }
.prose-page ol { list-style: decimal; padding-left: 1.25rem; margin: 0 0 .75rem; }
.prose-page li { margin-bottom: .375rem; line-height: 1.6; }
.prose-page a { color: var(--color-primary, #062a46); text-decoration: none; }
.prose-page a:hover { text-decoration: underline; }
.prose-page strong { color: #0f172a; }
.dark .prose-page { color: #cbd5e1; }
.dark .prose-page h2,
.dark .prose-page strong { color: #f1f5f9; }
.dark .prose-page a { color: var(--color-primary-soft, #7fb2e5); }

/* ============================================================
   Mobile optimization: larger touch targets and font sizes
   ============================================================ */
@media (max-width: 768px) {
  /* Minimum touch target size: 48x48px */
  .pp-bottom-nav a,
  .pp-bottom-nav button {
    min-height: 48px;
    padding: 10px 2px;
  }

  /* Ensure links are tappable */
  a {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
  }

  /* Form inputs larger on mobile */
  input, select, textarea, button[type="submit"] {
    min-height: 44px;
    font-size: 16px !important;
  }

  /* Popular search tags larger on mobile */
  .flex.flex-wrap a {
    padding: 10px 16px;
    min-height: 40px;
  }
}

/* ============================================================
   Capa corporativa: componentes de la vista front
   ============================================================ */

/* Barra superior sutil sobre el header */
.tf-topbar {
  background: var(--color-primary-darker, #021526);
  color: rgba(255, 255, 255, .75);
}
.tf-topbar a:hover { color: #fff; }

/* Header con elevación al hacer scroll */
.tf-header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .2s ease;
}
.tf-header-sticky.is-scrolled { box-shadow: 0 8px 24px rgba(2, 21, 38, .35); }

/* Logo con marca (prefijo + sufijo) */
.tf-logo-mark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
}
.tf-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-accent, #f4572e);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  box-shadow: 0 4px 12px rgba(244, 87, 46, .35);
}

/* Navegación principal con pills */
.tf-nav-pill {
  position: relative;
  border-radius: .5rem;
  transition: background-color .15s ease, color .15s ease;
}
.tf-nav-pill:hover { background: rgba(255, 255, 255, .08); }
.tf-nav-pill.is-active {
  color: #fff;
}
.tf-nav-pill.is-active::after {
  content: "";
  position: absolute;
  left: .75rem;
  right: .75rem;
  bottom: -.35rem;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent, #f4572e);
}

/* Buscador corporativo */
.tf-search-input {
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: .625rem 0 0 .625rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e2e8f0;
  transition: box-shadow .15s ease;
}
.tf-search-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-accent, #f4572e);
}
.tf-search-btn {
  height: 2.75rem;
  padding: 0 1.4rem;
  border-radius: 0 .625rem .625rem 0;
  background: var(--color-primary, #062a46);
  color: #fff;
  font-weight: 700;
  transition: background-color .15s ease;
}
.tf-search-btn:hover { background: var(--color-primary-dark, #041f35); }

/* Campos de formulario corportativos */
.tf-field,
select.tf-field,
textarea.tf-field {
  width: 100%;
  height: 2.75rem;
  padding: 0 .875rem;
  border-radius: .625rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: .875rem;
  color: #1e293b;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
textarea.tf-field { height: auto; min-height: 7rem; padding-top: .625rem; }
.tf-field::placeholder { color: #94a3b8; }
.tf-field:focus {
  outline: none;
  border-color: var(--color-primary, #062a46);
  box-shadow: 0 0 0 3px rgba(6, 42, 70, .12);
}

/* Etiqueta superior de sección (eyebrow) */
.tf-eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--color-accent, #f4572e);
}

/* Tarjeta corporativa */
.tf-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .09);
  border-color: #dbe3ee;
}

/* Chips / tags */
.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 999px;
  white-space: nowrap;
}
.tf-chip-location { background: #e3f2fd; color: var(--color-primary, #062a46); }
.tf-chip-type { background: #f1f5f9; color: #64748b; }
.tf-chip-salary { background: rgba(5, 150, 105, .12); color: var(--color-green-dark, #047857); }

/* Hero con textura corporativa */
.tf-hero {
  position: relative;
  background:
    radial-gradient(52rem 30rem at 12% -10%, rgba(244, 87, 46, .16), transparent 60%),
    radial-gradient(40rem 26rem at 88% 12%, rgba(52, 211, 153, .12), transparent 60%),
    linear-gradient(150deg, var(--color-primary-darker, #021526), var(--color-primary-dark, #041f35) 45%, var(--color-primary, #062a46));
  overflow: hidden;
}
.tf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(closest-side at 50% 20%, #000 0%, transparent 90%);
  -webkit-mask-image: radial-gradient(closest-side at 50% 20%, #000 0%, transparent 90%);
}

/* Barra posterior de favorito/boton dentro de tarjeta */
.tf-card-footer {
  border-top: 1px solid #eef2f7;
}

/* Alertas / flash */
.tf-flash {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .875rem 1.125rem;
  border-radius: .75rem;
  font-size: .875rem;
}
.tf-flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.tf-flash-error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

/* Desplegable de postulación */
.tf-postulate-panel summary::-webkit-details-marker { display: none; }
.tf-postulate-panel summary { list-style: none; }

/* ============================================================
   Validación de formularios (estilo Bootstrap 5)
   Se activa agregando `novalidate class="needs-validation"` al
   <form>; el JS (main.js) agrega `was-validated` en el primer
   intento de envío. A partir de ahí, los pseudo-selectores nativos
   :invalid/:valid (incluyendo los forzados via setCustomValidity)
   muestran el color y el mensaje de ayuda correspondiente.
   ============================================================ */
.needs-validation .invalid-feedback,
.needs-validation .valid-feedback {
  display: none;
  margin-top: .375rem;
  font-size: .78rem;
  font-weight: 500;
}
.needs-validation.was-validated :invalid ~ .invalid-feedback,
.needs-validation.was-validated select:invalid ~ .invalid-feedback {
  display: block;
}
.needs-validation.was-validated :valid ~ .valid-feedback {
  display: block;
}
.invalid-feedback { color: #be123c; }
.valid-feedback { color: #047857; }
.dark .invalid-feedback { color: #fda4af; }
.dark .valid-feedback { color: #6ee7b7; }

.needs-validation.was-validated input:invalid,
.needs-validation.was-validated select:invalid,
.needs-validation.was-validated textarea:invalid {
  border-color: #fb7185 !important;
  background-image: none;
}
.needs-validation.was-validated input:invalid:focus,
.needs-validation.was-validated select:invalid:focus,
.needs-validation.was-validated textarea:invalid:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .15) !important;
}
.needs-validation.was-validated input:valid,
.needs-validation.was-validated select:valid,
.needs-validation.was-validated textarea:valid {
  border-color: #6ee7b7 !important;
}
.needs-validation.was-validated input:valid:focus,
.needs-validation.was-validated select:valid:focus,
.needs-validation.was-validated textarea:valid:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, .15) !important;
}
/* Los checkbox/radio no llevan el mismo tratamiento de borde grueso */
.needs-validation.was-validated input[type="checkbox"]:invalid,
.needs-validation.was-validated input[type="radio"]:invalid {
  outline: 1px solid #fb7185;
  outline-offset: 2px;
}