/*
Theme Name: ListingHive Child - Conecta Talento
Template: listinghive
Version: 1.4.0
Description: Header centrado tipo pill para Conecta Talento, compatible con ListingHive 1.2.12.
*/

/* =========================================================
   CONECTA TALENTO — HEADER DESKTOP
   No cambia la paleta del sitio. Solo estructura, tamaños y espaciado.
   ========================================================= */
@media only screen and (min-width: 75em) {
    .site-header .header-navbar {
        position: relative;
        display: grid !important;
        grid-template-columns: minmax(220px, 1fr) auto minmax(320px, 1fr);
        align-items: center;
        column-gap: 24px;
        min-height: 76px;
        padding: 0 2rem;
        box-sizing: border-box;
        z-index: 50;
    }

    /* El header original mete menú + acciones dentro de __end.
       display:contents permite colocarlos como columnas independientes. */
    .site-header .header-navbar__start {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        z-index: 3;
    }

    .site-header .header-navbar__end {
        display: contents !important;
    }

    /* -------- Menú principal centrado -------- */
    .site-header .header-navbar__menu {
        grid-column: 2;
        grid-row: 1;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        width: max-content !important;
        max-width: min(52vw, 700px);
        margin: 0 !important;
        align-self: center;
        justify-self: center;
        display: flex !important;
        align-items: center;
        height: auto;
        z-index: 5;
    }

    .site-header .header-navbar__menu > ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: center !important;
        width: max-content !important;
        max-width: 100%;
        margin: 0 !important;
        padding: 5px !important;
        gap: 2px;
        list-style: none;
        background: #fff;
        border: 1px solid rgba(7, 36, 86, 0.08);
        border-radius: 9999px;
        box-shadow: 0 4px 18px rgba(7, 36, 86, 0.08);
        box-sizing: border-box;
    }

    .site-header .header-navbar__menu > ul > li {
        display: flex !important;
        flex: 0 0 auto;
        align-items: center;
        margin: 0 !important;
        padding: 0 !important;
        position: relative;
    }

    /* La cuenta duplicada se elimina desde wp_nav_menu_objects en functions.php. */

    .site-header .header-navbar__menu > ul > li > a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 0 16px !important;
        border-radius: 9999px;
        color: rgba(15, 23, 39, 0.72);
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
        box-sizing: border-box;
        transition: background-color .2s ease, color .2s ease;
    }

    .site-header .header-navbar__menu > ul > li > a:hover,
    .site-header .header-navbar__menu > ul > li.current-menu-item > a,
    .site-header .header-navbar__menu > ul > li.active > a {
        background: rgba(79, 70, 229, 0.08);
        color: #4F46E5;
    }

    .site-header .header-navbar__menu > ul > li.current-menu-item::before,
    .site-header .header-navbar__menu > ul > li.active::before {
        display: none !important;
    }

    /* Oculta las flechas de submenú solo si no son necesarias en el menú principal. */
    .site-header .header-navbar__menu > ul > li.menu-item-has-children::after {
        color: rgba(7, 36, 86, 0.35);
        margin-right: 10px;
    }

    /* -------- Acciones derechas -------- */
    .site-header .header-navbar__actions {
        grid-column: 3;
        grid-row: 1;
        min-width: 0;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        z-index: 6;
        white-space: nowrap;
    }

    /* Usuario: cápsula independiente, compacta y sin invadir el menú. */
    .site-header .header-navbar__actions .hp-menu__item--user,
    .site-header .header-navbar__actions .hp-menu__item--user > a,
    .site-header .header-navbar__actions .hp-menu__item--user > button {
        box-sizing: border-box;
    }

    .site-header .header-navbar__actions .hp-menu__item--user > a,
    .site-header .header-navbar__actions .hp-menu__item--user > button,
    .site-header .header-navbar__actions > .hp-link:not(.hp-menu__item--listing-submit) {
        display: inline-flex !important;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        max-width: 260px;
        padding: 0 14px !important;
        border: 1px solid rgba(7, 36, 86, 0.08);
        border-radius: 9999px;
        background: #fff;
        color: rgba(15, 23, 39, 0.78);
        box-shadow: 0 3px 14px rgba(7, 36, 86, 0.07);
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    }

    .site-header .header-navbar__actions .hp-menu__item--user > a:hover,
    .site-header .header-navbar__actions .hp-menu__item--user > button:hover,
    .site-header .header-navbar__actions > .hp-link:not(.hp-menu__item--listing-submit):hover {
        transform: translateY(-1px);
        border-color: rgba(79, 70, 229, 0.20);
        box-shadow: 0 6px 18px rgba(7, 36, 86, 0.10);
    }

    /* -------- Añadir un anuncio -------- */
    .site-header .header-navbar__actions .hp-menu__item--listing-submit,
    .site-header .header-navbar__actions .hp-menu__item--listing-submit.button,
    .site-header .header-navbar__actions .hp-menu__item--listing-submit.button--secondary {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 44px;
        margin: 0 !important;
        padding: 0 18px !important;
        border: 0 !important;
        border-radius: 9999px !important;
        background: #4F46E5 !important;
        color: #fff !important;
        box-shadow: 0 7px 18px rgba(79, 70, 229, 0.24);
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
        transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
    }

    .site-header .header-navbar__actions .hp-menu__item--listing-submit:hover,
    .site-header .header-navbar__actions .hp-menu__item--listing-submit.button:hover,
    .site-header .header-navbar__actions .hp-menu__item--listing-submit.button--secondary:hover {
        background: #4338CA !important;
        color: #fff !important;
        transform: translateY(-1px);
        box-shadow: 0 10px 22px rgba(79, 70, 229, 0.30);
    }

    .site-header .header-navbar__actions .hp-menu__item--listing-submit .hp-icon {
        margin: 0 !important;
        font-size: 15px;
    }
}

/* =========================================================
   TABLET / MÓVIL — dejamos que ListingHive gestione el header.
   Solo conservamos botones redondeados.
   ========================================================= */
@media only screen and (max-width: 74.99em) {
    .site-header .header-navbar__actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .site-header .header-navbar__actions .hp-menu__item--listing-submit,
    .site-header .header-navbar__actions .button,
    .site-header .header-navbar__actions a.button {
        border-radius: 9999px;
    }
}

@media only screen and (max-width: 47.99em) {
    .site-header .header-navbar__actions {
        gap: 6px;
    }

    .site-header .header-navbar__actions .hp-menu__item--listing-submit,
    .site-header .header-navbar__actions .button,
    .site-header .header-navbar__actions a.button {
        min-height: 40px;
        padding: 0 12px !important;
        font-size: .875rem;
    }
}


/* -------- Mi perfil: enlace independiente en las acciones del header -------- */
.site-header .header-navbar__actions .ct-header-profile-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px !important;
    border: 1px solid rgba(7, 36, 86, 0.08);
    border-radius: 9999px;
    background: #fff;
    color: rgba(15, 23, 39, 0.78);
    box-shadow: 0 3px 14px rgba(7, 36, 86, 0.07);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.site-header .header-navbar__actions .ct-header-profile-link:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, 0.20);
    box-shadow: 0 6px 18px rgba(7, 36, 86, 0.10);
    color: #4F46E5;
}
.site-header .header-navbar__actions .ct-header-profile-link .hp-icon {
    margin: 0 !important;
    font-size: 15px;
}

@media only screen and (max-width: 47.99em) {
    .site-header .header-navbar__actions .ct-header-profile-link {
        min-height: 40px;
        padding: 0 12px !important;
        font-size: .875rem;
    }
}
