/* ============================================================
   Bolsa de Empleo Coopealianza — Estilos del landing público
   Todo va scopeado bajo .cbe-board para no chocar con el tema.
   ============================================================ */
.cbe-board {
    --cbe-blue: #0B4FA1;
    --cbe-blue-deep: #093E80;
    --cbe-blue-700: #0E63C4;
    --cbe-cyan: #16A0E0;
    --cbe-cyan-bar: #1CA3E6;
    --cbe-cyan-soft: #EAF5FC;
    --cbe-ink: #1F2A37;
    --cbe-muted: #67717D;
    --cbe-surface: #F2F4F6;
    --cbe-border: #E4E8EC;
    --cbe-radius: 18px;
    --cbe-radius-lg: 26px;

    /* Personalizables desde Ajustes (con valores por defecto). */
    --cbe-hero-bg-start: #0B4FA1;
    --cbe-hero-bg-end: #093E80;
    --cbe-hero-title-color: #FFFFFF;
    --cbe-title-size: clamp(28px, 4.4vw, 46px);

    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--cbe-ink);
    max-width: 1180px;
    margin: 0 auto;
    line-height: 1.55;
}
.cbe-board *, .cbe-board *::before, .cbe-board *::after { box-sizing: border-box; }

/* ===================== HERO ===================== */
.cbe-hero {
    background:
        radial-gradient(120px 120px at 88% 18%, rgba(255,255,255,.06) 0 40%, transparent 41%),
        radial-gradient(160px 160px at 12% 80%, rgba(255,255,255,.05) 0 40%, transparent 41%),
        linear-gradient(135deg, var(--cbe-hero-bg-start) 0%, var(--cbe-hero-bg-end) 100%);
    border-radius: var(--cbe-radius-lg);
    padding: 46px clamp(20px, 5vw, 56px) 40px;
    color: #fff;
    overflow: hidden;
    position: relative;
}
.cbe-board .cbe-hero-title { font-size: var(--cbe-title-size); font-weight: var(--cbe-title-weight, 700); font-family: var(--cbe-title-font, inherit); margin: 0 0 26px; letter-spacing: -.01em; color: var(--cbe-hero-title-color); overflow-wrap: break-word; position: relative; z-index: 1; }

/* Imagen de fondo (el velo va en un pseudo-elemento para cubrir siempre,
   sin importar el modo de repetición/tamaño). */
.cbe-hero.has-image {
    background-image: var(--cbe-hero-image);
    background-size: var(--cbe-hero-size, cover);
    background-repeat: var(--cbe-hero-repeat, no-repeat);
    background-position: var(--cbe-hero-pos, center);
}
.cbe-hero.has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, var(--cbe-hero-overlay, .35));
    border-radius: inherit;
    z-index: 0;
}
/* Fondo fijo (parallax). En móvil iOS lo ignora, es comportamiento normal. */
.cbe-hero.is-fixed { background-attachment: fixed; }
/* Cintillo a todo el ancho de la ventana, con contenido centrado. */
.cbe-hero.is-fullwidth {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}
.cbe-hero.is-fullwidth .cbe-hero-inner { max-width: 1180px; margin-left: auto; margin-right: auto; }
.cbe-hero-inner { position: relative; z-index: 1; }
.cbe-board .cbe-search-lead {
    color: var(--cbe-lead-color, rgba(255,255,255,.92));
    font-size: var(--cbe-lead-size, 15px);
    line-height: 1.5;
    max-width: none !important;
    margin: 0 0 16px;
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    max-height: none !important;
    white-space: normal !important;
    text-overflow: clip !important;
    position: relative;
    z-index: 1;
}
/* En escritorio el texto descriptivo va en una sola línea. */
@media (min-width: 1024px) {
    .cbe-board .cbe-search-lead { white-space: nowrap !important; }
}

.cbe-search-bar { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.cbe-search-input {
    flex: 1 1 320px; display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: 999px; padding: 0 18px; min-height: 54px;
}
.cbe-search-input svg { width: 20px; height: 20px; fill: var(--cbe-cyan); flex: none; }
.cbe-search-input input { flex: 1; border: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important; font-size: 16px; color: var(--cbe-ink); }
.cbe-search-input input::placeholder { color: #9AA3AD; }

.cbe-search-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.cbe-select-wrap { position: relative; flex: 1 1 200px; }
.cbe-select-wrap::after {
    content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px;
    border-right: 2px solid var(--cbe-blue); border-bottom: 2px solid var(--cbe-blue);
    transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.cbe-board .cbe-select-wrap select {
    width: 100%; appearance: none; -webkit-appearance: none;
    background: #fff; border: 0; border-radius: 999px; min-height: 52px;
    padding: 0 40px 0 20px; font-size: 15px; color: var(--cbe-ink); cursor: pointer;
}

/* Botones */
.cbe-board .cbe-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer; text-decoration: none; font-family: inherit;
    border-radius: 999px; font-weight: 600; transition: filter .15s ease, transform .05s ease;
}
.cbe-board .cbe-btn:active { transform: translateY(1px); }
.cbe-board .cbe-btn-primary { background: var(--cbe-blue); color: #fff; padding: 0 34px; min-height: 54px; font-size: 16px; }
.cbe-board .cbe-btn-primary:hover { filter: brightness(1.1); color: #fff; }
.cbe-board .cbe-btn-ghost { background: #fff; color: var(--cbe-blue); border: 1.5px solid var(--cbe-border); padding: 10px 20px; }

/* ===================== RESULTADOS (master-detail) ===================== */
.cbe-results { display: grid; grid-template-columns: 340px 1fr; gap: 24px; margin-top: 30px; align-items: start; }

/* Lista de tarjetas */
.cbe-list { display: flex; flex-direction: column; gap: 14px; max-height: 1100px; overflow-y: auto; padding-right: 4px; }
.cbe-card {
    text-align: left; width: 100%; cursor: pointer; font-family: inherit;
    background: var(--cbe-surface); border: 2px solid transparent; border-radius: var(--cbe-radius);
    padding: 18px 20px; position: relative; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.cbe-card:hover { background: #fff; box-shadow: 0 6px 20px rgba(11,79,161,.08); }
.cbe-card.is-active { background: #fff; border-color: var(--cbe-cyan); box-shadow: 0 8px 26px rgba(22,160,224,.16); }
.cbe-card-title { display: block; font-size: 18px; font-weight: 700; color: var(--cbe-cyan); margin-bottom: 12px; padding-right: 28px; }
.cbe-card.is-active .cbe-card-title { color: var(--cbe-blue); }
.cbe-card-meta { display: flex; flex-direction: column; gap: 7px; }
.cbe-card-row { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--cbe-muted); }
.cbe-card-label { font-weight: 600; color: var(--cbe-ink); }
.cbe-ic { width: var(--cbe-ic-size, 16px); height: var(--cbe-ic-size, 16px); fill: var(--cbe-cyan); flex: none; }
.cbe-ic-img { object-fit: contain; }

/* LinkedIn */
.cbe-linkedin { position: absolute; top: 16px; right: 16px; display: inline-flex; }
.cbe-linkedin svg { width: 22px; height: 22px; fill: #0A66C2; }
.cbe-linkedin-lg { position: static; }
.cbe-linkedin-lg svg { width: 28px; height: 28px; }

/* Fila de compartir (detalle) */
.cbe-share-row { display: flex; align-items: center; gap: 10px; flex: none; }
.cbe-share { display: inline-flex; }
.cbe-share svg { width: 28px; height: 28px; }
.cbe-share-fb svg { fill: #1877F2; }
.cbe-share-wa svg { fill: #25D366; }
.cbe-share-x svg { fill: #14171A; }

.cbe-empty-list { background: var(--cbe-surface); border-radius: var(--cbe-radius); padding: 40px 24px; text-align: center; color: var(--cbe-muted); }

/* Panel de detalle */
.cbe-detail {
    background: #fff; border: 1px solid var(--cbe-border); border-radius: var(--cbe-radius-lg);
    padding: clamp(22px, 3vw, 40px); min-height: 320px;
}
.cbe-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cbe-detail-title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; color: var(--cbe-cyan); margin: 0; line-height: 1.15; }
.cbe-detail-location { display: flex; align-items: center; gap: 7px; color: var(--cbe-muted); font-size: 15px; margin: 12px 0 24px; }
.cbe-detail-location .cbe-ic { width: calc(var(--cbe-ic-size, 16px) + 2px); height: calc(var(--cbe-ic-size, 16px) + 2px); }

.cbe-detail-block { margin-bottom: 22px; }
.cbe-detail-h { color: var(--cbe-cyan); font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.cbe-detail-block p { margin: 0 0 8px; color: #2B3540; }
.cbe-bullets { margin: 0; padding-left: 22px; }
.cbe-bullets li { margin-bottom: 5px; color: #2B3540; }

.cbe-apply { margin: 26px 0 22px; padding: 20px 22px; background: var(--cbe-cyan-soft); border-radius: var(--cbe-radius); }
.cbe-apply p { margin: 0 0 14px; color: #2B3540; }
.cbe-apply a[href^="mailto:"] { color: var(--cbe-blue); font-weight: 600; }
.cbe-apply .cbe-btn-primary { min-height: 48px; padding: 0 28px; font-size: 15px; }

.cbe-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cbe-chip { background: var(--cbe-surface); color: var(--cbe-blue); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }

.cbe-empty-detail { color: var(--cbe-muted); text-align: center; padding: 60px 20px; }

.cbe-board .cbe-back-mobile { display: none !important; }

/* ===================== BOTÓN "AQUÍ SÍ" ===================== */
.cbe-board .cbe-aqui-btn {
    flex: 1 1 200px;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: var(--cbe-aqui-size, 16px);
    color: var(--cbe-aqui-color, #fff) !important;
    background-color: var(--cbe-aqui-bg, #16A0E0) !important;
    background-image: var(--cbe-aqui-image, none);
    background-size: cover;
    background-position: center;
    padding: 0 22px;
    text-shadow: none;
    transition: filter .15s ease, transform .05s ease;
}
.cbe-board .cbe-aqui-btn:hover { filter: brightness(1.08); color: var(--cbe-aqui-color, #fff) !important; }
.cbe-board .cbe-aqui-btn:active { transform: translateY(1px); }

/* ===================== EVENTOS "AQUÍ SÍ" ===================== */
.cbe-events { display: none; margin-top: 30px; }
.cbe-board.show-aquisi .cbe-results { display: none; }
.cbe-board.show-aquisi .cbe-events { display: block; }
.cbe-events-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cbe-events-title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--cbe-blue); margin: 0; }
.cbe-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.cbe-event-card { background: #fff; border: 1px solid var(--cbe-border); border-radius: var(--cbe-radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.cbe-event-img img { width: 100%; height: 200px; object-fit: cover; display: block; }
.cbe-event-info { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.cbe-event-title { font-size: 20px; font-weight: 700; color: var(--cbe-cyan); margin: 0; }
.cbe-event-place { display: flex; align-items: center; gap: 7px; color: var(--cbe-muted); margin: 0; font-size: 14.5px; }
.cbe-event-text { color: #2B3540; margin: 0; }
.cbe-event-btn { align-self: flex-start; min-height: 46px; padding: 0 26px; margin-top: 6px; }

/* Single page */
.cbe-single { padding: 30px 16px; }
.cbe-single-wrap { max-width: 820px; margin: 0 auto; }
.cbe-single-back { margin-bottom: 18px; }

/* Carga */
.cbe-loading { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.cbe-loading[hidden] { display: none; }
.cbe-spinner { width: 40px; height: 40px; border: 4px solid #D7E1EC; border-top-color: var(--cbe-blue); border-radius: 50%; animation: cbe-spin .8s linear infinite; }
@keyframes cbe-spin { to { transform: rotate(360deg); } }

/* Foco accesible */
.cbe-board a:focus-visible, .cbe-board button:focus-visible, .cbe-board select:focus-visible, .cbe-board input:focus-visible {
    outline: 3px solid rgba(22,160,224,.55); outline-offset: 2px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    .cbe-results { grid-template-columns: 1fr; }
    .cbe-list { max-height: none; }

    /* En móvil: el detalle se oculta hasta tocar una tarjeta. */
    .cbe-detail { display: none; }
    .cbe-board.show-detail .cbe-list { display: none; }
    .cbe-board.show-detail .cbe-detail { display: block; }
    .cbe-board .cbe-back-mobile {
        display: inline-flex !important; align-items: center; background: transparent; border: 0;
        color: var(--cbe-blue); font-weight: 600; font-size: 15px; cursor: pointer;
        padding: 0; margin-bottom: 18px; font-family: inherit;
    }
}

@media (max-width: 560px) {
    .cbe-search-bar { flex-direction: column; }
    .cbe-search-input { flex: 0 0 auto; width: 100%; }
    .cbe-board .cbe-btn-primary { width: 100%; }
    .cbe-select-wrap { flex: 1 1 100%; }
    .cbe-hero { padding: 32px 20px 28px; }
    .cbe-board .cbe-hero-title { font-size: min(var(--cbe-title-size), 34px); }
}

@media (prefers-reduced-motion: reduce) {
    .cbe-spinner { animation: none; }
    .cbe-card, .cbe-board .cbe-btn { transition: none; }
}
