/* 
Pajaro
Raul Cervera Soler
*/

/* Para que el padding y border no aumenten el ancho total */
*,
*::before,
*::after {
    box-sizing: border-box;
}



:root {
    font-size: 1.3vw;
}



body {
    font-family: Arial, Helvetica, sans-serif;
    background-image: url('fondo.jpg');
    background-size: 130vw auto;
    background-repeat: repeat-y;
    background-position-x: center;
    color: #222;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 1rem;
}

h1, h2, h3 {
    color: #003366;
    margin: 0.5em 0;
}

h1 {
    font-size: 2.2rem;
    border-bottom: 3px solid #003366;
    padding-bottom: 0.2em;
}

h2 {
    font-size: 1.7rem;
    font-style: italic;
    color: #336699;
}

h3 {
    margin-top: 0;
    font-size: 1rem;
    background: #003366;
    color: #fff;
    padding: 0.3em;
    border-radius: 0.5em;
}

p {
    margin: 0.8em 0;
    text-align: justify;
    font-size: 1.2rem;
}

#resumen > ul, #contenidos > ul, #profesores > dl {
    font-size: 1.2rem;
}

#bibliografia > .p1 {
    display: none;
}

ul.ul1, ul.ul2 {
    margin: 0.8em 0 1.2em 1.5em;
    list-style: square;
}

li {
    margin-bottom: 0.4em;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover, a:focus {
    text-decoration: underline;
    color: #003366;
    outline: 2px solid #003366; /* foco visible para teclado */
    outline-offset: 2px;
}

dt {
    font-weight: bold;
    color: #003366;
    margin-top: 1em;
}

dd {
    margin: 0.4em 0 0.8em 1em;
    font-style: italic;
}
#titulo {
    position: fixed;
    top: 0;
    width: 100%;
    left: 0;
    display: flex;
    flex-wrap: wrap; /* esto hace que las cosas bajen cuando se quedan sin espacio */
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background-color: rgba(234, 179, 193, 0.87);
}

#titulo::before {
    content: "";
    display: inline-block;
    width: 115px;
    height: 90px;
    background-image: url('coche.png'); /* pongo la imagen */
    background-repeat: no-repeat; /* evito que la repita hasta que no ocupe el tamanyo indicado */
    background-size: contain; /* hago que se reescale al tamayo del div (height y width) */
    background-position: center;
    flex: none;
}

#titulo > h1 {
    display: inline-block;
    margin: 0;
    padding: 0;
}

#titulo > h2 {
    display: block;
    width: 100%;
    text-align: center;
}

#resumen {
    padding-top: 3.5cm;
}



#contenedor {
    max-width: 960px;
    margin: 1em auto;
    margin-right: 3vw;
    margin-left: 25vw;
    background: #fffb;
    padding: 1.5em;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 0.8em;
}

/* Secciones con espacio abajo */
#intro, #apartados, #enlacesintra, #enlaces, #enlacesversiones {
    margin-bottom: 2em;
}

#enlacesintra {
    position: fixed;
    border-radius: 0.6em;
    margin-left: 1vw;
    width: 22vw;
    background-color: rgba(218, 181, 221, 0.749);
    left: 0;
    top: 5.2cm;
    flex: 0 1 auto;
}

#enlaces {
    border-radius: 0.6em;
    background-color: rgba(218, 181, 221, 0.749);
}


#enlacesversiones {
    position: fixed;
    border-radius: 0.6em;
    margin-left: 1vw;
    width: 22vw;
    background-color: rgba(218, 181, 221, 0.749);
    left: 0;
    top: 9.5cm;
    flex: 0 1 auto;
}

#enlaces > div > ul, #enlacesintra > ul, #enlacesversiones > ul {
    padding-left: 2rem;
}

#enlaces > div > ul {
    font-size: 1.3rem;
}

#enlacesintra > ul {
    padding-right: 1rem;
}

p.p1, p.p2, p.p3, p.p4 {
    background: #eef2f7;
    border-left: 5px solid #003366;
    padding: 0.8em;
    border-radius: 0.3em;
}

ul.ul1 li.li1, ul.ul1 li.li2, ul.ul1 li.li3, ul.ul1 li.li4 {
    font-weight: bold;
}

a.a1, a.a2, a.a3, a.a4 {
    
}

@media (min-width: 768px) /* tamanyo de tablet */ {
    #enlaces {
        position: fixed;
        border-radius: 0.6em;
        margin-left: 1vw;
        width: 22vw;
        background-color: rgba(218, 181, 221, 0.749);
        left: 0;
        top: 7.6cm;
        flex: 0 1 auto;
    }

    #enlacesintra > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 0;
        overflow: hidden;
        transition: max-height .50s ease;
        pointer-events: none;
    }
    
    #enlaces > div > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 0;
        overflow: hidden;
        transition: max-height .50s ease;
        pointer-events: none;
    }
    
    #enlacesversiones > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 0;
        overflow: hidden;
        transition: max-height .50s ease;
        pointer-events: none;
    }
    
    #enlacesintra:hover > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 60vh; /* ajusta si necesitas más/menos espacio */
        pointer-events: auto;
    }
    
    /* Al hacer hover sobre #enlacesintra ocultar (con fade) los hermanos siguientes */
    #enlacesintra:hover ~ #enlaces, /* cuando hago hover sobre #enlacesintra, si tiene un hermano #enlaces (lo tiene), se aplica esta regla */
    #enlacesintra:hover ~ #enlacesversiones {
        opacity: 0; /* efecto fade out */
        transform: translateY(-12px); /* sube un poco el elemento, para que pareza que desaparece hacia arriba */
        pointer-events: none; /* hace que deje de ser accesible por raton (para que no interfieran mientras estan invisibles) */
    }
    
    
    #enlaces:hover ~ #enlacesversiones {
        opacity: 0; /* efecto fade out */
        transform: translateY(-12px); /* sube un poco el elemento, para que pareza que desaparece hacia arriba */
        pointer-events: none; /* hace que deje de ser accesible por raton (para que no interfieran mientras estan invisibles) */
    }
    
    
    #enlacesintra, #enlaces, #enlacesversiones {
        font-size: 0.7rem;
        transform: translateY(0);
        transition: opacity .35s ease, transform .35s ease;
        will-change: opacity, transform;
    }
    
    #enlaces > div:hover > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 60vh; /* ajusta si necesitas más/menos espacio */
        pointer-events: auto;
    }
    
    #enlacesversiones:hover > *:not(h3) { /* se aplica esto a todos los elementos que no son h3 (h3 es el titulo que se mantiene siempre visible) */
        max-height: 60vh; /* ajusta si necesitas más/menos espacio */
        pointer-events: auto;
    }

    #enlaces > div > ul {
        font-size: 0.7rem;
    }

    #enlacesversiones {
        top: 13.6cm;
    }

}

