/* header.css */

.site-header {
    background-color: #222;
    color: white;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
    display: flex;
    justify-content: flex-start; 
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
    min-height: 70px;
    position: relative; 
}

.site-header h1{
    color: white;
}

/* --- Estilos del Logo y Título --- */
.site-branding {
    z-index: 101;
    min-width: 0;
}

.site-branding a {
    display: flex; 
    align-items: center; 
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-branding a:hover {
    color: var(--secondary-color);
}

.site-logo-img {
    height: 40px; 
    width: auto;
    display: block;
    margin-right: 0.75rem; 
    flex-shrink: 0; 
}

.site-title {
    font-size: 1.8rem;
    margin: 0; 
    font-weight: 700;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* --- Estilos de la Navegación (para escritorio) --- */
.main-nav {
    display: block; 
    margin-left: auto; 
    padding-left: 1rem; 
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
.main-nav li {
    margin-left: calc(var(--spacing-unit) * 1.5);
}
.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 0;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}


/* --- Magia del CSS sin JS --- */
.menu-toggle-checkbox {
    display: none;
}

.menu-toggle-button {
    /* Oculto por defecto en escritorio */
    display: none; 
    
    background: none;
    border: 2px solid white; 
    color: white; 
    
    /* Estilos base (serán sobreescritos por flex en móvil) */
    font-size: 1.6rem;
    width: 40px;
    height: 36px;
    padding: 0;
    line-height: 32px; 
    text-align: center; 
    
    border-radius: 4px;
    cursor: pointer;
    z-index: 101;
    margin-left: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.menu-toggle-button:hover {
    background-color: var(--secondary-color);
    color: #222;
}


/* --- Media Queries: Estilos para Móvil --- */
@media (max-width: 768px) {
    
    .site-header {
        padding: var(--spacing-unit);
    }
    
    .menu-toggle-button {
        /* Se muestra en móvil usando flex para centrar */
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1; /* Reseteamos line-height */
        padding-left: 0; /* Reseteamos padding-left */
    }

    .site-title {
        display: none; 
    }

    .main-nav {
        display: none; 
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding-top: 80px;
        padding-bottom: 20px;
        background-color: #222;
        z-index: 100; 
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        margin-left: 0; 
        padding-left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .main-nav li {
        margin: 1rem 0;
    }
    
    .menu-toggle-checkbox:checked 
    ~ .main-nav {
        display: block;
    }
}