/* =========================================================
   CONTENEDOR / LAYOUT GENERAL
========================================================= */
.v5-empleo {
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px;
  border-radius: 12px;
  background-color: #ffffff;
  font-family: "Segoe UI", sans-serif;
}

.v5-contenedor-busqueda {
  display: flex;
  gap: 30px;
}

/* =========================================================
   COLUMNA DE FILTROS
========================================================= */
.v5-columna-filtros {
  flex: 0 0 300px;
  padding: 20px;
  border-radius: 12px;
  background-color: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.v5-filtro { margin-bottom: 20px; }
.v5-filtro label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}
.v5-filtro input[type="text"],
.v5-filtro select {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
  appearance: none;
}
.v5-filtro select {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 35px;
}
.v5-filtro input[type="checkbox"] { margin-right: 8px; }

/* Botón de búsqueda */
#v5-form-filtros button {
  width: 100%;
  padding: 12px;
  background-color: #2196F3;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .3s;
  outline: none;               /* sin borde punteado */
}
#v5-form-filtros button:hover { background-color: #1976d2; }

/* =========================================================
   RESULTADOS
========================================================= */
.v5-columna-resultados { flex: 1; }
.v5-resultados-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}
.v5-resultados-header h3 {
  margin: 0;
  font-size: 20px;
  color: #333;
}
.v5-orden { display: flex; align-items: center; gap: 10px; }
.v5-orden select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #fff;
}
.v5-listado-avisos {
  display: flex;
  flex-direction: column;
  gap: 20px;
}



/* =========================================================
   TARJETA DE AVISO (LISTA)
========================================================= */
.v5-aviso{
  display:grid;
  grid-template-columns: 92px 1fr auto;     /* logo | header/desc | acciones */
  grid-template-areas:
    "logo header  share"
    "desc desc    desc"
    "vermas .     apply";
  gap:20px;
  align-items:start;

  background:#fff;
  border:1px solid #e0e0e0;
  border-radius:12px;
  padding:22px;
  box-shadow:0 1px 2px rgba(0,0,0,0.05);
  transition:box-shadow .2s ease;
}
.v5-aviso:hover{ box-shadow:0 4px 12px rgba(0,0,0,0.08); }


/* ===== TIER VISUALS (coinciden con el PHP) ===== */
.v5-badge-tier{
  display:inline-block;
  margin-top:6px;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  font-weight:600;
}

/* Premium: dorado suave */
.v5-aviso--premium{
  background:#FFF8E1;             /* dorado suave */
  border:1px solid #F6D777;
}
.v5-aviso--premium .v5-badge-tier{
  background:#FFE08A;
  color:#8A6D3B;
}

/* Estándar: fucsia suave */
.v5-aviso--estandar{
  background:#FFE6F1;             /* fucsia muy suave */
  border:1px solid #F8A5C2;
}
.v5-aviso--estandar .v5-badge-tier{
  background:#FFB3D1;
  color:#8A1F55;
}



/* Áreas */
.v5-logo{ grid-area:logo; width:72px; height:72px;
  background:#2196F3; color:#fff; font-weight:700; font-size:22px;
  display:flex; align-items:center; justify-content:center;
  border-radius:6px; overflow:hidden;
}
.v5-logo img{ width:100%; height:100%; object-fit:cover; display:block; border-radius:inherit; background:#fff; }

.v5-header{ grid-area:header; min-width:0; }
.v5-header h4{ font-size:20px; font-weight:800; margin:0 0 4px; color:#1a1a1a; }
.v5-subtitulo{ font-size:15px; color:#555; }
.v5-fecha-icono{ display:flex; align-items:center; font-size:14px; color:#777; margin-top:8px; }
.v5-fecha-icono i{ margin-right:6px; color:#999; }

/* =========================================================
   BOTONES (base + colores + hover simple)
========================================================= */
.v5-share{ grid-area:share; justify-self:end; align-self:start; }
.v5-apply{ grid-area:apply; justify-self:end; }

/* Base común */
.v5-btn-compartir,
.v5-btn-vermas,
.v5-btn-postular{
  display:inline-flex; align-items:center; justify-content:center;
  height:38px; padding:0 14px;
  border:none; border-radius:10px;
  font-size:14px; font-weight:700;
  text-decoration:none !important; cursor:pointer;
  transition:background-color .2s ease;
  outline: none;                 /* sin borde punteado en focus */
}

/* Colores */
.v5-btn-compartir{ background:#FA1188; color:#fff; position:relative; }
.v5-btn-vermas{ background:#f2f4f7; color:#344054; }
.v5-btn-postular{ background:#2196F3; color:#fff; }

/* Hover simple: solo cambia fondo */
.v5-btn-compartir:hover,
.v5-btn-compartir:focus{ background:#d20c70; color:inherit; }
.v5-btn-vermas:hover,
.v5-btn-vermas:focus{ background:#e4e7ec; color:inherit; }
.v5-btn-postular:hover,
.v5-btn-postular:focus{ background:#1976d2; color:inherit; }

/* Burbuja de "enlace copiado" (anclada al botón) */
.v5-btn-compartir .copiado{
  position:absolute; left:50%; bottom:calc(100% + 8px);
  transform:translateX(-50%) translateY(6px);
  background:#2196F3; color:#fff; padding:6px 10px; border-radius:8px;
  font-size:12px; line-height:1; white-space:nowrap;
  box-shadow:0 4px 10px rgba(0,0,0,.12);
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
  z-index: 10;
}
.v5-btn-compartir .copiado::after{
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:6px solid transparent; border-top-color:#2196F3;
}
.v5-btn-compartir.exito .copiado{ opacity:1; transform:translateX(-50%) translateY(0); }

/* =========================================================
   DESCRIPCIÓN
========================================================= */
.v5-descripcion{ grid-area:desc; }
.v5-resumen{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; line-height:1.55;
  font-size:16px;   /* reducido (antes 20px) */
  color:#222;
  transition:all .25s ease;
}
/* ===== Resumen: 2 líneas por defecto, 10 al expandir ===== */
.v5-resumen{
  /* clamping base */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;

  /* controla el nº de líneas con una variable */
  --v5-lines: 2;
  -webkit-line-clamp: var(--v5-lines);
  line-clamp: var(--v5-lines);
}

/* al pulsar "Ver más" (clase .expandido), muestra 15 líneas */
.v5-resumen.expandido{
  --v5-lines: 10;
  /* aseguramos que no lo desactive ningún override previo */
  white-space: normal;
  overflow: hidden;
}

/* márgenes suaves si hay <p> por wpautop() */
.v5-resumen p{ margin: 0 0 .6em; }
.v5-resumen p:last-child{ margin-bottom: 0; }


/* =========================================================
   RESPONSIVE — TABLET / MÓVIL (≤ 768px)
   - 3 columnas: logo | header | share en la misma fila
   - Botones compactos e iguales
   - Compartir: solo ícono (texto oculto, burbuja activa)
========================================================= */
@media (max-width: 768px){
  /* Layout */
  .v5-contenedor-busqueda{ flex-direction: column; }
  .v5-columna-filtros, .v5-columna-resultados{ width: 100%; }

  .v5-aviso{
    grid-template-columns: 72px minmax(0,1fr) auto;   /* logo | header | share */
    grid-template-areas:
      "logo  header  share"
      "desc  desc    desc"
      "vermas .      apply";
    gap: 12px;
    padding: 16px;
    overflow: visible;   /* no recortar burbuja */
  }

  /* Visuales */
  .v5-logo{ width: 64px; height: 64px; border-radius: 6px; }
  .v5-header h4{ margin:0 0 4px; font-size: clamp(16px, 4.8vw, 18px); line-height: 1.25; }
  .v5-subtitulo{ font-size: clamp(13px, 3.8vw, 15px); }
  .v5-fecha-icono{ margin-top: 6px; font-size: clamp(12px, 3.5vw, 14px); }

  .v5-resumen{
    font-size: clamp(14px, 4.2vw, 15px);
    line-height: 1.5;
    word-break: break-word;
  }

  /* Botones uniformes y compactos */
  .v5-btn-postular,
  .v5-btn-compartir,
  .v5-btn-vermas{
    height:34px; padding:0 10px; font-size:13px; border-radius:10px;
  }
  .v5-share{ justify-self:end; align-self:start; }
  .v5-apply{ justify-self:end; }
  .v5-btn-vermas{ justify-self:start; }

  /* Compartir solo ícono en móvil (NO ocultar burbuja) */
  .v5-btn-compartir{
    width: 38px; height: 34px; padding: 0; justify-content: center; overflow: visible;
  }
  .v5-btn-compartir > span:not(.copiado){ display: none; }   /* oculta texto "Compartir" */

  /* Burbuja algo más pequeña */
  .v5-btn-compartir .copiado{
    font-size: 11px; padding: 5px 8px;
    bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(6px);
  }
}

/* =========================================================
   RESPONSIVE — MÓVIL PEQUEÑO (≤ 420px)
========================================================= */
@media (max-width: 420px){
  .v5-aviso{
    grid-template-columns: 64px minmax(0,1fr) auto;
    gap: 10px; padding: 14px;
  }
  .v5-logo{ width: 56px; height: 56px; }
  .v5-btn-postular,
  .v5-btn-compartir,
  .v5-btn-vermas{
    height:32px; padding:0 8px; font-size:12px;
  }
  .v5-btn-compartir{ width: 34px; height: 32px; }
  .v5-resumen{ font-size: clamp(13px, 4.4vw, 14px); }
}

/* =========================================================
   DESKTOP — MOSTRAR SOLO TEXTO EN COMPARTIR (OCULTAR ICONO)
========================================================= */
@media (min-width: 769px){
  .v5-btn-compartir i { display: none; }                 /* sin icono en escritorio */
  .v5-btn-compartir > span:not(.copiado){ display:inline; } /* asegura que el texto esté visible */
}

/* =========================================================
   OVERRIDES FINALES PARA BOTONES
   - Hover: solo oscurece background
   - No cambia color de texto jamás
   - Sin bordes/outline punteados ni subrayados
========================================================= */

/* Estados común a TODOS los botones (y visitado) */
.v5-btn-compartir,
.v5-btn-postular,
.v5-btn-vermas,
.v5-btn-compartir:visited,
.v5-btn-postular:visited,
.v5-btn-vermas:visited{
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* Colores de texto FIJOS por botón (incluye todos los estados) */
.v5-btn-postular,
.v5-btn-postular:hover,
.v5-btn-postular:focus,
.v5-btn-postular:active,
.v5-btn-postular:visited{
  color: #fff !important;
}
.v5-btn-compartir,
.v5-btn-compartir:hover,
.v5-btn-compartir:focus,
.v5-btn-compartir:active,
.v5-btn-compartir:visited{
  color: #fff !important;      /* en escritorio el texto “Compartir” se mantiene blanco */
}
.v5-btn-vermas,
.v5-btn-vermas:hover,
.v5-btn-vermas:focus,
.v5-btn-vermas:active,
.v5-btn-vermas:visited{
  color: #344054 !important;   /* “Ver más / Ver menos” siempre del mismo color */
}

/* Hover simples: solo cambia el fondo, nada más */
.v5-btn-postular:hover,
.v5-btn-postular:focus{ background:#1976d2 !important; }
.v5-btn-compartir:hover,
.v5-btn-compartir:focus{ background:#d20c70 !important; }
.v5-btn-vermas:hover,
.v5-btn-vermas:focus{ background:#e4e7ec !important; }

/* Quitar outline punteado en todos los navegadores */
.v5-btn-compartir:focus,
.v5-btn-postular:focus,
.v5-btn-vermas:focus,
.v5-btn-compartir:focus-visible,
.v5-btn-postular:focus-visible,
.v5-btn-vermas:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

/* Firefox legacy (por si acaso) */
.v5-btn-compartir::-moz-focus-inner,
.v5-btn-postular::-moz-focus-inner,
.v5-btn-vermas::-moz-focus-inner{
  border: 0 !important;
}


/* =========================================================
   VER MÁS / VER MENOS: hover simple y consistente
========================================================= */
.v5-btn-vermas{ transition: background-color .18s ease !important; }
.v5-btn-vermas:hover,
.v5-btn-vermas:focus,
.v5-btn-vermas:active,
.v5-btn-vermas.is-hover{
  background-color:#e0e3e8 !important;
  color:#344054 !important;
  text-decoration:none !important;
  outline:none !important;
  box-shadow:none !important;
}
/* Estado táctil simulado */
.v5-btn-vermas.pressed{
  background-color:#e0e3e8 !important;
  color:#344054 !important;
}
@media (hover:none), (pointer:coarse){
  .v5-btn-vermas:active{
    background-color:#e0e3e8 !important;
    color:#344054 !important;
  }
}

/* =========================================================
   MÓVIL: tarjetas más anchas (casi a los bordes)
========================================================= */
@media (max-width: 768px){
  .v5-empleo{ padding:12px 12px 20px; }
  .v5-listado-avisos{ margin-inline:-8px; }  /* ensancha las cards */
  .v5-aviso{ border-radius:12px; }
}
@media (max-width: 420px){
  .v5-empleo{ padding:8px 8px 16px; }
  .v5-listado-avisos{ margin-inline:-10px; }
}

/* =========================================================
   MÓVIL: encabezado apilado
   Línea 1: título (puede ocupar 2 líneas)
   Línea 2: “Ordenar por:” + select EN LA MISMA LÍNEA
========================================================= */
@media (max-width: 768px){
  .v5-resultados-header{
    display:block;
    padding-bottom:12px;
  }
  .v5-resultados-header h3{
    margin:0 0 6px;
    font-size:clamp(18px, 5.2vw, 20px);
    line-height:1.2;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .v5-orden{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap;
    white-space:nowrap;     /* evita que “Ordenar por” se parta */
  }
  .v5-orden br{ display:none; }                 /* por si el HTML trae <br> */
  .v5-orden span, .v5-orden label{ flex:0 0 auto; }
  .v5-orden select{
    flex:1 1 auto;         /* el select ocupa el resto de la línea */
    min-width:0;
    width:auto;
    max-width:100%;
  }
}
@media (max-width: 420px){
  .v5-resultados-header h3{
    font-size:clamp(17px, 5vw, 19px);
  }
}

