/* Centro Educatic Empleos | Navegación pública responsive.
 * Se carga después de public.css y portal-theme.css.
 * En móvil con JS: logo + hamburguesa, panel desplegable accesible.
 * Sin JS, el menú original sigue siendo visible (mejora progresiva).
 */
.mobile-menu-toggle { display:none; }
.mobile-nav-backdrop[hidden] { display:none !important; }

@media (max-width:900px) {
    /* El encabezado ocupa una sola fila al activarse el menú hamburguesa. */
    .navbar.is-mobile-ready {
        position:sticky;top:0;z-index:80;
        overflow:visible;
        border-bottom:1px solid #d5e9de;
        background:rgba(255,255,255,.98);
    }
    .navbar.is-mobile-ready > .container {
        position:relative;z-index:3;
        display:flex;flex-direction:row;align-items:center;justify-content:space-between;
        gap:12px;min-height:65px;padding:9px 0;
    }
    .navbar.is-mobile-ready .brand {display:inline-flex;align-self:center;gap:9px;min-width:0;margin:0;}
    .navbar.is-mobile-ready .brand-mark {width:40px;height:40px;flex:0 0 40px;border-radius:12px;}
    .navbar.is-mobile-ready .brand-icon {width:22px;height:22px;}
    .navbar.is-mobile-ready .brand-name {font-size:.88rem;line-height:1.15;white-space:nowrap;}
    .navbar.is-mobile-ready .brand-copy small {font-size:.62rem;}
    .navbar.is-mobile-ready .mobile-menu-toggle {
        display:inline-flex;align-items:center;justify-content:center;gap:9px;
        min-height:44px;min-width:44px;padding:9px 12px;
        border:1px solid #cde7d8;border-radius:11px;
        background:linear-gradient(140deg,#effaf3,#fff);
        color:#0f7f64;font:inherit;font-size:.8rem;font-weight:850;
        cursor:pointer;
        box-shadow:0 4px 12px rgba(12,89,64,.045);
        transition:background .22s ease,border-color .22s ease,box-shadow .22s ease;
        -webkit-tap-highlight-color:transparent;
    }
    .navbar.is-mobile-ready .mobile-menu-toggle:hover,
    .navbar.is-mobile-ready .mobile-menu-toggle[aria-expanded="true"] {
        background:#e4f8ed;border-color:#a9d9c0;
        box-shadow:0 6px 17px rgba(15,96,67,.09);
    }
    .navbar.is-mobile-ready .mobile-menu-toggle:focus-visible {outline:3px solid #7bd5b0;outline-offset:3px;}
    .mobile-menu-toggle-lines {
        position:relative;display:flex;flex-direction:column;align-items:center;
        justify-content:center;gap:4px;width:19px;height:19px;flex:0 0 19px;
    }
    .mobile-menu-toggle-lines span {
        display:block;width:19px;height:2px;border-radius:4px;background:currentColor;
        transition:transform .2s ease,opacity .2s ease;
    }
    .navbar.is-mobile-ready.is-mobile-open .mobile-menu-toggle-lines span:nth-child(1) {transform:translateY(6px) rotate(45deg);}
    .navbar.is-mobile-ready.is-mobile-open .mobile-menu-toggle-lines span:nth-child(2) {opacity:0;}
    .navbar.is-mobile-ready.is-mobile-open .mobile-menu-toggle-lines span:nth-child(3) {transform:translateY(-6px) rotate(-45deg);}

    /* Panel: posición absoluta junto a la barra, por delante del overlay. */
    .navbar.is-mobile-ready .nav-actions {
        position:absolute;top:calc(100% - 1px);left:0;right:0;
        z-index:5;display:flex;flex-direction:column;align-items:stretch;
        justify-content:flex-start;flex-wrap:nowrap;gap:5px;
        width:100%;max-width:none;
        max-height:calc(100dvh - 82px);
        padding:15px;
        overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
        background:#fff;border:1px solid #d9eae0;border-top:3px solid #8bdcb3;
        border-radius:0 0 18px 18px;
        box-shadow:0 21px 40px rgba(11,51,38,.17);
        visibility:hidden;opacity:0;pointer-events:none;
        transform:translateY(-8px);
        transition:opacity .22s ease,transform .22s ease,visibility .22s;
        scrollbar-width:thin;
    }
    .navbar.is-mobile-ready.is-mobile-open .nav-actions {
        opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);
    }
    .navbar.is-mobile-ready .nav-actions > .nav-link,
    .navbar.is-mobile-ready .nav-dropdown > summary {
        display:flex;align-items:center;justify-content:space-between;
        width:100%;min-height:46px;
        padding:12px 14px;border:1px solid transparent;border-radius:10px;
        color:#365849;white-space:normal;font-size:.87rem;font-weight:800;line-height:1.4;
        background:transparent;
    }
    .navbar.is-mobile-ready .nav-actions > .nav-link:hover,
    .navbar.is-mobile-ready .nav-dropdown > summary:hover,
    .navbar.is-mobile-ready .nav-dropdown[open] > summary {
        background:#f0faf4;border-color:#daeee2;color:#0b8364;
    }
    .navbar.is-mobile-ready .nav-actions > .nav-link.active {
        color:#0b8264;border-color:#cfe8da;background:#e7f8ee;
        box-shadow:inset 3px 0 #159b80;
    }
    .navbar.is-mobile-ready .nav-dropdown {position:static;width:100%;min-width:0;}
    .navbar.is-mobile-ready .nav-dropdown > summary {cursor:pointer;list-style:none;}
    .navbar.is-mobile-ready .nav-dropdown > summary::after {content:"⌄";margin-left:10px;transition:transform .2s ease;}
    .navbar.is-mobile-ready .nav-dropdown[open] > summary::after {transform:rotate(180deg);}
    .navbar.is-mobile-ready .nav-dropdown > .dropdown-panel {
        position:static;top:auto;left:auto;right:auto;
        display:grid;gap:4px;min-width:0;width:100%;max-height:none;
        margin:4px 0 9px;padding:7px;
        border:1px solid #d9ebe0;border-radius:12px;
        background:#f5fbf7;box-shadow:none;
    }
    .navbar.is-mobile-ready .dropdown-link {
        display:block;min-width:0;padding:12px 13px;border-radius:9px;
        background:#fff;text-decoration:none;
    }
    .navbar.is-mobile-ready .dropdown-link:hover {background:#e6f7ed;}
    .navbar.is-mobile-ready .dropdown-link strong {color:#24543d;font-size:.82rem;line-height:1.4;overflow-wrap:anywhere;}
    .navbar.is-mobile-ready .dropdown-link span {color:#728b7a;font-size:.72rem;line-height:1.5;overflow-wrap:anywhere;}
    .navbar.is-mobile-ready .dropdown-form {border-top:1px solid #dbece2;padding-top:6px;}
    .navbar.is-mobile-ready .dropdown-action-button {min-height:42px;padding:10px 13px;font-size:.82rem;}
    .navbar.is-mobile-ready .nav-user {
        max-width:100%;padding:10px 13px;white-space:normal;overflow-wrap:anywhere;
        background:#f2faf5;border-radius:9px;color:#365d4a;font-weight:820;
    }
    .navbar.is-mobile-ready .nav-actions > .button.ghost,
    .navbar.is-mobile-ready .nav-logout-form,
    .navbar.is-mobile-ready .nav-auth-actions {width:100%;margin:4px 0 0;}
    .navbar.is-mobile-ready .nav-logout-form .button {width:100%;}
    .navbar.is-mobile-ready .nav-auth-actions {
        display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;
        border-top:1px solid #e0efe6;padding-top:13px;
    }
    .navbar.is-mobile-ready .nav-auth-actions a {
        min-width:0;min-height:44px;padding:10px 8px;
        font-size:.78rem;font-weight:850;white-space:normal;text-align:center;
    }
    .navbar.is-mobile-ready .nav-auth-actions svg {width:16px;height:16px;}
    /* Backdrop is moved to <body> to prevent sticky header/backdrop-filter
       from creating a fixed-position containing block on mobile browsers. */
    body > .mobile-nav-backdrop:not([hidden]) {
        display:block;position:fixed;inset:0;z-index:79;
        background:rgba(6,29,22,.39);
        animation:portalNavFade .2s ease both;
    }
    /* Never lock the page scroll: closed or visually hidden menus
       must never leave a document with overflow:hidden. */
}
/* Reduce the two-row social bar from the screenshot on mobile. */
@media (max-width:620px) {
    .portal-social-inner {
        min-height:34px;flex-direction:row;align-items:center;justify-content:center;
        padding:3px 0;gap:7px;
    }
    .portal-social-list {
        display:flex;flex-wrap:nowrap;justify-content:center;gap:4px;
        width:100%;overflow-x:auto;scrollbar-width:none;
    }
    .portal-social-list::-webkit-scrollbar {display:none;}
    .portal-social-list a {flex:0 0 28px;width:28px;height:28px;border-radius:8px;}
    .portal-social-list svg {width:14px;height:14px;}
    .portal-social-message {display:none;}
    .navbar.is-mobile-ready .nav-actions {left:0;right:0;padding:12px;}
    .navbar.is-mobile-ready .brand-mark {width:39px;height:39px;flex-basis:39px;}
    .navbar.is-mobile-ready .mobile-menu-toggle {padding:9px 10px;}
}
@media (max-width:370px) {
    .navbar.is-mobile-ready .mobile-menu-toggle-text {display:none;}
    .navbar.is-mobile-ready .mobile-menu-toggle {width:44px;height:44px;padding:0;}
    .navbar.is-mobile-ready .brand-name {font-size:.82rem;}
    .navbar.is-mobile-ready .nav-auth-actions {grid-template-columns:1fr;}
}
@keyframes portalNavFade {from{opacity:0;}to{opacity:1;}}
@media (prefers-reduced-motion:reduce) {
    .mobile-menu-toggle,.mobile-menu-toggle-lines span,
    .navbar.is-mobile-ready .nav-actions,
    .navbar.is-mobile-ready .nav-dropdown > summary::after {
        transition:none !important;
    }
    body > .mobile-nav-backdrop:not([hidden]) {animation:none !important;}
}
