/*
 * Landing de vacantes FINSA — adaptación visual de website.css.
 * Alcance: exclusivamente .finsa-legacy-landing.
 * Se mantienen los selectores .hero*, .slide*, .locations-grid, etc.,
 * utilizados en vacancies_landing_view.php y careers-landing.js.
 * No cargar website.css ni Bootstrap en el layout de carreras.
 */

/* Las rutas son relativas a /css/V1/careers/careers-landing.css. */
@font-face {
    font-family: 'FINSA AllianceNo2';
    src: url('../../../fonts/AllianceNo2-Regular/AllianceNo2-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'FINSA AllianceNo2 Light';
    src: url('../../../fonts/AllianceNo2-Light/AllianceNo2-Light.woff2') format('woff2');
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'FINSA ARS Maquette Bold';
    src: url('../../../fonts/ARSMaquettePro-Bold/ARSMaquettePro-Bold.woff2') format('woff2');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

.finsa-legacy-landing {
    --finsa-page-gutter: 1.5rem; /* Equivalente a .row.mx-4 en el sitio original */
    --finsa-bg: #FAF7F0;/*#EFEFF0;*/
    --finsa-navy: #002855;
    --finsa-body: #475576;
    --finsa-pale: #CDDDF5;
    --finsa-muted: #F1EEE7;
    --finsa-blue: #0081C9;
    --career-hero-accent: var(--accent-cyan, #00a3e0); /* Tono original del hero */

    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
    color: var(--finsa-body);
    background: var(--finsa-bg);
    font-family: 'FINSA AllianceNo2', sans-serif;
}

.finsa-legacy-landing,
.finsa-legacy-landing * {
    box-sizing: border-box;
}

/* Un contenedor fluido con márgenes de .row.mx-4, sin depender de Bootstrap. */
.finsa-legacy-landing .row.mx-4 {
    margin-left: var(--finsa-page-gutter) !important;
    margin-right: var(--finsa-page-gutter) !important;
}

/* Equivalentes a los separadores de website.css. */
.finsa-legacy-landing .whitespace-firstslide { height: 160px; }
.finsa-legacy-landing .whitespace-110 { height: 110px; }
.finsa-legacy-landing .whitespace-90 { height: 90px; }

/* Jerarquía de website.css: h4.text-Subtitulo, h2.text-Titulo y p.text-Contenido-v1. */
.finsa-legacy-landing h4.text-Subtitulo {
    margin: 0;
    color: var(--finsa-navy);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 145%;
    letter-spacing: 0;
    text-transform: uppercase;
}

.finsa-legacy-landing h2.text-Titulo {
    margin: 0;
    color: var(--finsa-navy);
    font-family: 'FINSA ARS Maquette Bold', sans-serif;
    font-size: 3.6rem;
    font-weight: 700;
    line-height: 105%;
    letter-spacing: -1px;
}

.finsa-legacy-landing p.text-Contenido-v1 {
    margin: 0;
    color: var(--finsa-body);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 145%;
    letter-spacing: 0;
}

/* ========================================================================== */
/* CABECERA: basada en .firstslide (Properties.php), adaptada a filtros reales */
/* ========================================================================== */
.finsa-legacy-landing .hero {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 675px;
    padding: 0;
    overflow: hidden;
    color: var(--finsa-bg);
    background-color: #080705; /* Fondo oscuro original */
}

.finsa-legacy-landing .hero-slider,
.finsa-legacy-landing .slide,
.finsa-legacy-landing .slider-overlay {
    position: absolute;
    inset: 0;
}

.finsa-legacy-landing .hero-slider { z-index: 1; }

.finsa-legacy-landing .slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out, transform 6s ease;
}

.finsa-legacy-landing .slide.active {
    opacity: 1;
    transform: scale(1.015);
}

.finsa-legacy-landing .slide-1 {
    background-image: var(--career-slider-1);
    background-position: 65% center;
}
.finsa-legacy-landing .slide-2 {
    background-image: var(--career-slider-2);
    background-position: 72% center;
}
.finsa-legacy-landing .slide-3 {
    background-image: var(--career-slider-3);
    background-position: 40% center;
}

.finsa-legacy-landing .slider-overlay {
    z-index: 2;
    pointer-events: none;
    /* Gradiente original negro cálido, sin tonos azules. */
    background: linear-gradient(
        90deg,
        rgba(8, 6, 4, 0.99) 0%,
        rgba(8, 6, 4, 0.98) 32%,
        rgba(8, 6, 4, 0.94) 47%,
        rgba(8, 6, 4, 0.78) 56%,
        rgba(8, 6, 4, 0.35) 64%,
        rgba(8, 6, 4, 0.06) 74%,
        rgba(8, 6, 4, 0) 100%
    );
}

.finsa-legacy-landing .hero-content {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    width: 100%;
    margin: 0;
    padding-inline: var(--finsa-page-gutter);
}

.finsa-legacy-landing .hero-body {
    width: min(850px, 75%);
    padding: 100px 0 60px;
}

.finsa-legacy-landing .hero h1 {
    margin: 0;
    color: var(--career-hero-accent);
    font-family: 'FINSA ARS Maquette Bold', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 5.3vw, 6.25rem);
    letter-spacing: -3px;
    line-height: 100%;
}

.finsa-legacy-landing .hero p {
    margin: 24px 0 0;
    color: var(--finsa-bg);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 145%;
}
.finsa-legacy-landing .hero p strong { font-weight: 700; }

/* Filtros: colores de .bckg-gray / .dropdownbtn-Filter de website.css. */
.finsa-legacy-landing .hero-search {
    display: grid;
    grid-template-columns: minmax(190px, 1.25fr) minmax(145px, .9fr) auto;
    align-items: end;
    gap: 10px;
    width: 100%;
    max-width: 680px;
    margin-top: 40px;
}

.finsa-legacy-landing .hero-search-field { min-width: 0; }

.finsa-legacy-landing .hero-search-field label {
    display: block;
    margin: 0 0 8px;
    color: var(--finsa-bg);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: .75rem;
    font-weight: 400;
    line-height: 120%;
}


/* Contenedor transparente de inputs y select */
.finsa-legacy-landing .hero-search-control {
    height: 36px;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 0 12px;

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.12);

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease;
}

/* Al seleccionar un campo */
.finsa-legacy-landing .hero-search-control:focus-within {
    border-color: var(--accent-cyan, #00a3e0);
    background: rgba(0, 0, 0, 0.25);
}

/* Iconos */
.finsa-legacy-landing .hero-search-control i {
    flex-shrink: 0;
    color: #ffffff;
    font-size: 0.72rem;
}

/* Input y select */
.finsa-legacy-landing .hero-search-control input,
.finsa-legacy-landing .hero-search-control select {
    width: 100%;
    min-width: 0;
    height: 100%;

    padding: 0;
    border: 0;
    outline: 0;

    background: transparent;
    color: #ffffff;

    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
}

/* Placeholder */
.finsa-legacy-landing .hero-search-control input::placeholder {
    color: rgba(255, 255, 255, 0.72);
    opacity: 1;
}

/* Select */
.finsa-legacy-landing .hero-search-control select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Opciones desplegables */
.finsa-legacy-landing .hero-search-control select option {
    color: #111827;
    background: #ffffff;
}


.finsa-legacy-landing .hero-search-button {
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 30px;
    color: #fff;
    background-color: var(--career-hero-accent);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .05rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .2s ease;
}
.finsa-legacy-landing .hero-search-button:hover,
.finsa-legacy-landing .hero-search-button:focus-visible {
    background-color: #008bc2;
}
.finsa-legacy-landing .hero-search-button:focus-visible,
.finsa-legacy-landing .hero-slider-button:focus-visible,
.finsa-legacy-landing .equipo-link:focus-visible,
.finsa-legacy-landing .hero-all-jobs:focus-visible {
    outline: 2px solid var(--career-hero-accent);
    outline-offset: 3px;
}

.finsa-legacy-landing .hero-all-jobs {
    display: inline-block;
    margin-top: 22px;
    color: var(--career-hero-accent);
    font-family: 'FINSA AllianceNo2', sans-serif;
    font-size: .85rem;
    line-height: 145%;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}
.finsa-legacy-landing .hero-all-jobs:hover { color: #ffffff; }

.finsa-legacy-landing .hero-slider-controls {
    position: absolute;
    right: var(--finsa-page-gutter);
    bottom: 60px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.finsa-legacy-landing .hero-slider-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: var(--career-hero-accent);
    color: #fff;
    font-size: .75rem;
    cursor: pointer;
    transition: background-color .2s ease;
}
.finsa-legacy-landing .hero-slider-button:hover { background-color: #008bc2; }

/* ========================================================================== */
/* SECCIONES: análogo de container-fluid > .row.mx-4 con columnas 4 / 8     */
/* ========================================================================== */
.finsa-legacy-landing .somos-finsa-section,
.finsa-legacy-landing .vacantes-section {
    background-color: var(--finsa-bg);
}
.finsa-legacy-landing .equipos-section {
    background-color: var(--finsa-navy);
    color: var(--finsa-bg);
}

.finsa-legacy-landing .somos-finsa-container,
.finsa-legacy-landing .equipos-container,
.finsa-legacy-landing .vacantes-container {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: 24px;
    width: auto; /* Sin 100%: el margen mx-4 se respeta dentro del viewport. */
}

.finsa-legacy-landing .somos-finsa-tag,
.finsa-legacy-landing .equipos-tag,
.finsa-legacy-landing .vacantes-tag {
    padding: 0;
}
.finsa-legacy-landing .somos-finsa-content,
.finsa-legacy-landing .equipos-content,
.finsa-legacy-landing .vacantes-content {
    min-width: 0;
}

.finsa-legacy-landing .somos-finsa-title { margin-bottom: 32px !important; }
.finsa-legacy-landing .somos-finsa-text { margin-bottom: 20px !important; }
.finsa-legacy-landing .somos-finsa-image-wrapper { margin-top: 40px; }
.finsa-legacy-landing .somos-finsa-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

/* Imágenes de Somos FINSA y Equipos */
.finsa-legacy-landing .somos-finsa-image-wrapper,
.finsa-legacy-landing .equipo-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

/* Imágenes interiores */
.finsa-legacy-landing .somos-finsa-img,
.finsa-legacy-landing .equipo-img {
    display: block;
    width: 100%;
}

/* La zona azul reutiliza la jerarquía tipográfica, pero invierte el contraste. */
.finsa-legacy-landing .equipos-section h4.text-Subtitulo,
.finsa-legacy-landing .equipos-section h2.text-Titulo { color: var(--finsa-bg); }
.finsa-legacy-landing .equipos-section p.text-Contenido-v1 { color: var(--finsa-pale); }
.finsa-legacy-landing .equipos-title { margin-bottom: 50px !important; }

/* Las dos tarjetas comparten sus 5 filas (cabecera, título, descripción,
   enlace e imagen), para alinear elementos aunque los textos varíen. */
.finsa-legacy-landing .equipos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 36px;
    row-gap: 36px;
    align-items: stretch;
}
.finsa-legacy-landing .equipo-card {
    min-width: 0;
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 0;
}
.finsa-legacy-landing .equipo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.finsa-legacy-landing .equipo-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--finsa-pale);
}
.finsa-legacy-landing .equipo-badge {
    color: var(--career-hero-accent);
    font-family: 'FINSA ARS Maquette Bold', sans-serif;
    font-size: .75rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.finsa-legacy-landing .equipo-subtitle {
    margin: 0 0 16px;
    color: var(--finsa-bg);
    font-family: 'FINSA ARS Maquette Bold', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 145%;
}
.finsa-legacy-landing .equipo-text { margin-bottom: 22px !important; }
.finsa-legacy-landing .equipo-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 26px;
    padding-bottom: 4px;
    color: var(--career-hero-accent);
    font-family: 'FINSA ARS Maquette Bold', sans-serif;
    font-size: .85rem;
    font-weight: 400;
    line-height: 145%;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}
.finsa-legacy-landing .equipo-link:hover { color: var(--finsa-pale); }
.finsa-legacy-landing .equipo-link-icon { transition: transform .2s ease; }
.finsa-legacy-landing .equipo-link:hover .equipo-link-icon {
    transform: translateX(4px);
}
.finsa-legacy-landing .equipo-image-wrapper {
    width: 100%;
    align-self: start;
}
/* Evita que el enlace se extienda a todo el ancho de su fila. */
.finsa-legacy-landing .equipo-link {
    justify-self: start;
    align-self: start;
}

/* Compatibilidad con navegadores anteriores a CSS subgrid: mantiene
   enlace e imágenes al pie de las tarjetas, aunque no todas las filas. */
@supports not (grid-template-rows: subgrid) {
    .finsa-legacy-landing .equipo-card {
        display: flex;
        flex-direction: column;
    }
    .finsa-legacy-landing .equipo-text { flex-grow: 1; }
    .finsa-legacy-landing .equipo-image-wrapper { margin-top: auto; }
}
.finsa-legacy-landing .equipo-img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

/* UBICACIONES: misma composición a todo el ancho que el bloque final de Services.php.
   .p-0.col se reproduce aquí porque esta landing NO importa Bootstrap.
   Las secciones Somos FINSA y Equipos mantienen su cuadrícula 4/8. */
.finsa-legacy-landing .vacantes-section .vacantes-container {
    display: block;
}

.finsa-legacy-landing .vacantes-section .p-0.col {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
}

.finsa-legacy-landing .vacantes-section .vacantes-tag {
    margin-bottom: 24px;
}

.finsa-legacy-landing .vacantes-title {
    margin-bottom: 0 !important;
}

.finsa-legacy-landing .locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 20px;
}

/* La API genera inline styles desde careers-landing.js: aquí se neutralizan
 * SOLAMENTE los acabados visuales de las tarjetas, sin tocar su lógica. */
.finsa-legacy-landing .vacancy-card {
    padding: 20px 0 !important;
    background: transparent !important;
    border-top: 1px solid #CFD1D4;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* El JS también agrega colores inline a los metadatos de cada ubicación. */
.finsa-legacy-landing .vacancy-card > div:first-child {
    color: var(--finsa-navy) !important;
    font-family: 'FINSA AllianceNo2', sans-serif;
}
.finsa-legacy-landing .vacancy-card > div:nth-child(2) {
    color: var(--finsa-body) !important;
    font-family: 'FINSA AllianceNo2', sans-serif;
}

/* ========================================================================== */
/* RESPONSIVE: los mismos tramos de anchura usados en website.css            */
/* ========================================================================== */
@media (min-width: 1922px) {
    .finsa-legacy-landing { --finsa-page-gutter: 12rem; }
}

@media (min-width: 1600px) and (max-width: 1921px) {
    .finsa-legacy-landing { --finsa-page-gutter: 6rem; }
    .finsa-legacy-landing .hero { min-height: 850px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .finsa-legacy-landing { --finsa-page-gutter: 2rem; }
    .finsa-legacy-landing .whitespace-firstslide { height: 120px; }
    .finsa-legacy-landing .whitespace-110 { height: 70px; }
    .finsa-legacy-landing .hero { min-height: 630px; }
    .finsa-legacy-landing .hero h1 { font-size: 3.5rem; }
    .finsa-legacy-landing h2.text-Titulo { font-size: 2.25rem; }
    .finsa-legacy-landing h4.text-Subtitulo { font-size: 1rem; }
}

@media (max-width: 1023px) {
    .finsa-legacy-landing .somos-finsa-container,
    .finsa-legacy-landing .equipos-container,
    .finsa-legacy-landing .vacantes-container {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 24px;
    }
    .finsa-legacy-landing .hero-body { width: min(680px, 85%); }
}


/* El hero de tabletas conserva un gradiente oscuro como la versión original. */
@media (min-width: 768px) and (max-width: 900px) {
    .finsa-legacy-landing .slider-overlay {
        background: linear-gradient(
            90deg,
            rgba(8, 6, 4, 0.98) 0%,
            rgba(8, 6, 4, 0.93) 45%,
            rgba(8, 6, 4, 0.55) 72%,
            rgba(8, 6, 4, 0.20) 100%
        );
    }
}

@media (max-width: 767px) {
    .finsa-legacy-landing .whitespace-firstslide { height: 99px; }
    .finsa-legacy-landing .whitespace-110 { height: 70px; }
    .finsa-legacy-landing .hero {
        /* El .firstslide original usa 450px; esta landing necesita más
           alto para el buscador de tres controles sin superposiciones. */
        min-height: 660px;
    }
    .finsa-legacy-landing .hero-content { align-items: flex-start; }
    .finsa-legacy-landing .hero-body {
        width: 100%;
        padding: 92px 0 100px;
    }
    .finsa-legacy-landing .hero h1 {
        font-size: 2.25rem;
        line-height: 100%;
        letter-spacing: -1px;
    }
    .finsa-legacy-landing .hero p { font-size: .9rem; }
    .finsa-legacy-landing h2.text-Titulo { font-size: 1.6rem; }
    .finsa-legacy-landing h4.text-Subtitulo {
        margin-bottom: 1rem;
        font-size: .9rem;
        letter-spacing: 0;
    }
    .finsa-legacy-landing p.text-Contenido-v1 { font-size: .9rem; }
    .finsa-legacy-landing .hero-search {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
        max-width: 100%;
        margin-top: 34px;
    }
    .finsa-legacy-landing .hero-search-button { width: 100%; }
    .finsa-legacy-landing .hero-slider-controls {
        left: var(--finsa-page-gutter);
        right: auto;
        bottom: 20px;
    }
    .finsa-legacy-landing .slider-overlay {
        background: rgba(8, 6, 4, .76);
    }
    .finsa-legacy-landing .equipos-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 42px;
    }
    .finsa-legacy-landing .somos-finsa-img,
    .finsa-legacy-landing .equipo-img { max-height: 320px; }
}

@media (max-width: 480px) {
    .finsa-legacy-landing .whitespace-90 { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    .finsa-legacy-landing .slide,
    .finsa-legacy-landing .hero-slider-button,
    .finsa-legacy-landing .equipo-link-icon {
        transition: none;
        transform: none;
    }
}


/* =========================================
   FINSA - CONTROL DE ESPACIOS DEL HERO
   ========================================= */

.finsa-legacy-landing {
    --hero-espacio-inferior: 80px;

    --hero-titulo-subtitulo: 24px;

    --hero-subtitulo-buscador: 40px;

    --hero-buscador-enlace: 22px;

    --hero-espacio-superior-mobile: 92px;
}

/* Posición vertical de todo el contenido */
@media (min-width: 768px) {
    .finsa-legacy-landing .hero-body {
        padding-bottom: var(--hero-espacio-inferior);
    }
}

/* Distancia entre título y subtítulo */
.finsa-legacy-landing .hero p {
    margin-top: var(--hero-titulo-subtitulo);
}

/* Distancia entre subtítulo y buscador */
.finsa-legacy-landing .hero-search {
    margin-top: var(--hero-subtitulo-buscador);
}

/* Distancia entre buscador y enlace */
.finsa-legacy-landing .hero-all-jobs {
    margin-top: var(--hero-buscador-enlace);
}

/* Ajuste de posición en móviles */
@media (max-width: 767px) {
    .finsa-legacy-landing .hero-body {
        padding-top: var(--hero-espacio-superior-mobile);
    }
}


