* {
    box-sizing: border-box;
}

body {
    margin: 0px;
    padding: 0px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: 150px auto 75px;
    grid-template-areas: 'header header header header header'
        'contenido contenido contenido contenido lateral'
        'footer footer footer footer footer';

    font-family: Arial, Helvetica, sans-serif;
    background-color: whitesmoke;
    gap: 10px;
    min-height: 90vh;
    width: 80%;
    margin: auto;
}

header {
    grid-area: header;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: cornflowerblue;
    vertical-align: middle;
    text-align: center;
    padding-top: 70px;
}


header img {
    display: none;
}

header ul {
    list-style: none;
    margin: 0px;
    padding: 0px;
}

header ul li {
    display: inline;
    margin: 15px;
}


header ul li a {
    text-decoration: none;
    color: white;
    font-size: 1.4em;
}

header input {
    height: 40px;
    border: 1px solid black;
    border-radius: 5px;
    max-width: 80%;
    margin-top: -10px;
}

article {
    grid-area: contenido;
}

#contenido {
    padding: 10px;
    line-height: 1.3em;
    background-color: white;
}

article #detalle {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* grid-template-rows: 150px; */
    gap: 15px;
}

article #detalle .detalles {
    /* max-width: 80%; */
    background-color: beige;
    padding: 15px;
    border-radius: 3px;
    justify-self: center;
    text-align: justify;
}

aside {
    grid-area: lateral;
    background-color: antiquewhite;
}

aside ul {
    list-style: none;
    margin: 0px;
    padding: 0px;
}

aside ul li {
    display: block;
    border-bottom: 1px solid salmon;
    padding: 6px;
    padding-left: 15px;
}

aside ul li:hover {
    background-color: bisque;
}

aside ul li a {
    display: block;
    text-decoration: none;
    color: brown;
}


footer {
    background-color: cadetblue;
    grid-area: footer;
}

footer ul {
    margin: 0px;
    padding: 0px;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-top: 30px;
    justify-items: center;
}

@media screen and (min-width : 640px) and (max-width : 1040px) {
    body {
        width: 100%;
    }

    header ul li {
        margin: 10px;
    }

    header ul li a {
        font-size: 1.1em;
    }

    article #detalle {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (max-width : 640px) {

    body {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto 75px;
        grid-template-areas: 'header header'
            'contenido contenido'
            'lateral lateral'
            'footer footer';
        gap: 10px;
        width: 100%;
    }



    header {
        position: fixed;
        top: 0px;
        left: 0px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: 'menu buscador'
            'listado listado';
        padding-top: 10px;
        padding-left: 5px;
        padding-bottom: 5px;
    }

    header img {
        display: inline;
        max-width: 35px;
        grid-area: menu;
    }

    header nav {
        grid-area: listado;
        display: none;
    }

    header ul {
        list-style: none;
        margin: 0px;
        padding: 0px;
    }

    header ul li {
        display: block;
        text-align: left;
        margin: 0px;
    }

    header ul li a {
        display: block;
        text-decoration: none;
        color: white;
        font-size: 1.1em;
        border-top: 1px solid rgb(152, 188, 253);
        padding: 8px;
    }

    header ul li:first-child a {
        border-top: 0px;
    }

    header input {
        display: inline;
        grid-area: buscador;
        margin: 0px;
        justify-self: right;
        width: 80%;
        margin-right: 10px;
    }

    #contenido{
        text-align: justify;
        line-height: 1.4em;
        padding: 20px;
        margin-top: 35px;
    }
    article #detalle {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background-color: white;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        width: 100%;
    }

    article #detalle {
        border-radius: 0.8cm;
        grid-template-columns: 1fr;
        background-color: grey;
        padding: 0.7cm;
    }

    article #detalle .detalles {
        background-color: white;
        border: 1px solid black;
    }

    #contenido {
        text-align: justify;
        font-size: 14pt;
    }
    #contenido  p{
        orphans: 3;
        widows: 3;
    }

    footer,
    aside,
    header {
        display: none;
    }



}