:root {
    --header-height: 64px;
    --sidebar-width: 260px;
}

body{
    font-family: 'Inter', sans-serif;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos de la portada */
#portada{
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background-image:
        linear-gradient(
    to top,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0.7) 10%,
    rgba(255,255,255,0.4) 30%,
    rgba(255,255,255,0) 100%
    ),
        url('../images/Portada-mjconsultoria.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
}

#portada img{
    width: 50vw;
    height: auto;
    margin-bottom: 1vh;
}

#portada .line{
    width: 60vw;
    height: 0.5vh;
    background-color: rgba(125, 28, 61, 30);
    margin: 0.5vh 0;
}
#portada p{
    font-size: 1.5em;
    font-family: 'Cinzel', serif;
    margin: 1vh 0;
    color: #4A4B40;
}

/* Estilos del layout */
#layout{
    display: grid;
    grid-template-areas:
    "header header header"
    "sidebar content content"
    "footer footer footer";

    grid-template-columns: auto 1fr 1fr;
    grid-template-rows: auto;
    min-height: 100vh;
    position:relative;
    gap: 10px;
}

/* Estilos del header */
#layout header{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: var(--header-height);
    transform: translateY(-100%);   /* oculto arriba */

    z-index: 100;
    transition: transform 250ms ease;

    grid-area: header;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    pointer-events: none; /* evita clics mientras oculto */
}
/* estado visible */
#layout header.visible{
    transform: translateY(0);
    pointer-events: auto;
}

#layout header img:first-child{
    width: 170px;
    height: auto;
}

#layout header img:nth-child(n+2){
    width: 20px;
    height: auto;

    margin-left: auto;
    margin-right: 0.5rem;
}

/* Estilos del aside */

/* sidebar oculto por la izquierda */
#layout aside {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: 50px; /* ancho mínimo solo para los íconos */
    height: calc(100vh - var(--header-height));
    background: #ffffff;
    box-shadow: 2px 0 12px -2px rgba(0,0,0,0.12);
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 110;
    overflow: hidden;
    transform: translateX(-100%); /* escondido al inicio */
}

#layout aside.visible {
    transform: translateX(0); /* se desplaza a la pantalla */
}

#layout aside.expanded {
    width: 260px; /* ancho del sidebar al expandirse */
}

#layout aside.ready {
    /* opcional: puedes añadir un pequeño efecto de aparición */
    transition: transform 0.3s ease, width 0.3s ease;
}

#layout aside .icon {
    display: block;
    width: 30px; /* tamaño de los íconos */
    height: 30px;
    margin: 10px auto;
    transition: transform 0.3s ease;
}

#layout aside.expanded .icon {
    transform: scale(1.2);
}

#sidebar .iconos img {
    width: 24px;
    height: 24px;
}


/* ajustes responsivos: en pantallas muy pequeñas quizás quieras otro comportamiento */
@media (max-width: 640px) {
    :root { --sidebar-width: 80vw; }
    #toggleBubble { left: 6px; width: 40px; height: 40px; }
}

#layout main{
    grid-area: content;
    padding: 1rem;
}

#layout footer{
    grid-area: footer;
    background-color: #4A4B40;
    color: #ffffff;
    text-align: center;
    padding: 1rem;
}


