/* ======= Reset básico ======= */
#header {
    background: #0b1724; /* azul bien oscuro tirando a negro */
    color: #f5f5f5;
}

#header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

#navPanel {
    display: none;
}

/* Logo + subtítulo */
#logo {
    margin: 0;
    font-size: 0;
    flex: 0 0 auto;
}

#logo a {
    display: inline-block;
}

.site-subtitle {
    margin: 0 0 0 16px;
    font-size: 0.9rem;
    color: #c4c4c4;
    flex: 1 1 auto;
}

/* ======= Toggle (hamburguesa) para mobile ======= */
.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none; /* se muestra solo en mobile */
    cursor: pointer;
    margin-left: auto;
    width: 32px;
    height: 24px;
    position: relative;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 2px;
    background: #ffffff;
    transition: transform 0.25s ease, top 0.25s ease, opacity 0.25s ease;
}

.nav-toggle-label span {
    top: 50%;
    transform: translateY(-50%);
}

.nav-toggle-label span::before {
    top: -8px;
}

.nav-toggle-label span::after {
    top: 8px;
}

/* ======= Navegación Desktop ======= */
#nav {
    flex: 0 0 auto;
    margin-top: 20px;
}

#nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

#nav > ul > li {
    position: relative;
    margin-left: 12px;
}

#nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    color: #e5e5e5;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

#nav a i {
    font-size: 1rem;
    width: 20px; /* mantiene alineación */
    text-align: center;
    color: #e5e5e5;
    transition: color .2s ease;
}

#nav a:hover i {
    color: #ffffff;
}

/* Ícono imagen dentro del item (HackLab, HackerTech) */
.item-icon-with-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.item-icon-with-img img {
    display: block;
    width: 20px;
    height: 20px;
}

/* Hover desktop */
#nav > ul > li > a:hover {
    background: #1f3c5c;      /* azul medio */
    color: #ffffff;
}

/* ======= Submenús (desktop) ======= */
.has-submenu > .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #111821;      /* casi negro azuloso */
    padding: 8px 0;
    border-radius: 4px;
    min-width: 200px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
    display: none!important;
    z-index: 20;
}

.has-submenu > .submenu li {
    margin: 0;
    white-space: nowrap;
}

.has-submenu > .submenu a {
    width: 100%;
    padding: 8px 16px;
    color: #dcdcdc;
    font-size: 0.9rem;
}

.has-submenu > .submenu a:hover {
    background: #264a6f;       /* azul un poco más claro */
}

/* Mostrar submenú en hover / focus */
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    display: block!important;
}

#header .container {
    justify-content: center; /* centra horizontalmente */
    text-align: center;
}

#logo {
    margin-right: 12px;
}

/* ======= RESPONSIVE ======= */

@media (max-width: 900px) {

    #header .container {
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Ocultar subtítulo */
    .site-subtitle {
        display: none;
    }

    /* Logo centrado en mobile */
    #logo {
        flex: 1 1 100%;
        text-align: center;
        margin-right: 0;
    }

    /* Mostrar hamburguesa */
    .nav-toggle-label {
        display: block;
        order: 2;
        margin-left: 0;
    }

    /* Menú abajo */
    #nav {
        flex: 1 1 100%;
        width: 100%;
        order: 3;
        margin-top: 10px;
    }

    #nav ul {
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        background: #0f1c2b;
        border-radius: 6px;
        border: 1px solid #1f2b38;
        transition: max-height 0.25s ease;
    }

    #nav > ul > li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    #nav > ul > li:last-child {
        border-bottom: none;
    }

    #nav a {
        padding: 10px 16px;
        font-size: 0.95rem;
    }

    .nav-toggle:checked + .nav-toggle-label + #nav ul {
        max-height: 600px;
    }

    .nav-toggle:checked + .nav-toggle-label span {
        transform: translateY(-50%) rotate(45deg);
    }
    .nav-toggle:checked + .nav-toggle-label span::before {
        top: 0;
        transform: rotate(-90deg);
    }
    .nav-toggle:checked + .nav-toggle-label span::after {
        top: 0;
        opacity: 0;
    }

    .has-submenu > .submenu {
        position: static;
        box-shadow: none;
        background: #131f31;
        display: none!important;
        margin: 0;
        border-top: 1px solid #1f2b38;
    }

    .has-submenu > .submenu a {
        padding-left: 32px;
        font-size: 0.9rem;
    }

    .has-submenu:focus-within > .submenu,
    .has-submenu:hover > .submenu {
        display: block;
    }
}

