/* Author: Adrian Martinez Fuentes - UO295454 */

/* Paleta de colores:
    - Fondo de la web: F4E1C1 (Crema oscuro)
    - Texto de la web: 1F3B4D (Azul Marino Oscuro, 9.1 contraste con F4E1C1)
    - Fondo de Header: 1F3B4D (Azul Marino)
    - Texto de nav y h1: FFFFFF (Blanco, 11.73 contraste con 1F3B4D)
*/ 

/* ###################### Estilos generales ###################### */
/* Especificidad 001 */
html {
    font-family: "helvetica neue", helvetica, arial, sans-serif;
}

/* Especificidad 001 en cada selector */
html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #F4E1C1;
    color: #1F3B4D;
    overflow-x: hidden;
    margin: 0em;
}

/* Especificidad 001 en cada selector */
header, menu {
    background-color: #0A1A2E;
    color: #FFFFFF;
}

/* Especificidad 002 */
header > h1 {
    color: #FFFFFF;
    /* backgroud-color heredado de header */
    text-decoration: none;
    font-size: 1.75em;
    margin: 0.5em;
    flex: 1 1 auto; 
    text-align: left; 
    white-space: nowrap; 
}

/* Especificidad 003, 003, 003 */
header > nav a, menu li a, header > h1 a {
    text-decoration: none;           
    color: #FFFFFF;
    /* backgroud-color heredado de menu */
    padding: 0.3em 0.5em; 
    border-radius: 0.25em;
    white-space: nowrap; 
    text-align: center;
    flex: 0 0 auto; 
    font-size: 1.5em;
}

/* Especificidad 002 */
menu li {
    list-style: none
}

@media (max-width: 840px) {
    /* Especificidad 003 */
    body > header > h1 {
        font-size: 1.35em;
    }

    /* Especificidad 004, 003 */
    body > header > nav a, menu li a {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde */
        font-size: 1.25em;
    }
}

@media (max-width: 490px) {
    /* Especificidad 003 */
    body > header > h1 {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde del header */
        font-size: 1.15em;
    }

    /* Especificidad 004, 003 */
    body > header > nav a, menu li a {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde */
        font-size: 1.05em;
    }
}

/* Especificidad 002 */
body > p {
    font-size: 1.2em;
    margin-left: 0.4em;;
}

/* Especificidad 002 */
body a {
    color: #6B0000;
    text-decoration: none;
    /* background-color heredado de body */
}

/* Especificidad 013, 012 */
body > p > a:hover, main a:hover {
    text-decoration: underline
}

/* Especificidad 014 */
main > menu > li > a:hover {
    text-decoration: none;
}

/* Quitamos las migas de navegacion */
@media (max-width: 1023px) {
    /* Especificidad 002 */
    body > p {
        display: none;
    }
}

/* Especificidad 012, 013, 013 */
nav a:hover, menu li a:hover, header > h1 > a:hover {
    color: #F9C97B;
    /* backgroud-color heredado de la regla header, menu */
}

/* Especificidad 010 */
.active {
    color: #F9C2DE;
    /* backgroud-color heredado de la regla header, menu */
}

/* Espcificidad 002 */
body > button { /* Boton de ayuda global */
    margin-left: auto;
    margin-right: 2em;
    margin-top: 1em;
}

/* Especificidad 001 */
main {
    margin: 0.5em;
    flex: 1; 
}

/* Especificidad 001 */
h2 {
    text-align: center;
    margin: auto;
}

/* Especificidad 001 en cada selector */
h3, h4 {
    text-align: left;
    text-decoration: underline;
}

/* Especificidad 001 */
h4 {
    font-size: 1.05em;
}

/* Especificidad 002 */
header > h3 {
    text-align: center;
    text-decoration: none;
}

/* Especificidad 001 */
button {
    display: block;
    margin: 1em auto;
    padding: 0.5em 1em;
    font-size: 1em;
    background-color: #1F3B4D;
    color: #FFFFFF;
    cursor: pointer;
}

/* Especificidad 001 */
aside {
    width: 100%; 
    height: auto; 
    display: flex;  
    flex-direction: column;
    min-width: 100%;
    margin: 1em auto;
}

/* Especificidad 002 */
aside > h3 {
    font-size: 1.15em;
    margin-bottom: 0.25em;
}

/* Especificidad 001 */
footer {
    background-color: #0A1A2E;
    color: #FFFFFF;
    text-align: center;
}

/* Especificidad 002 */
footer p {
    margin: 0.5em;
    text-align: center;
}

/* ###################### Estilizacion de listas  ###################### */
/* Especificidad 001 en cada selector */
ul, ol, dl, p {
    font-size: 1.25em;
}

/* Especificidad 001 en cada selector */
ul, ol {
    background-color: #EDD9B0; 
    /* color heredado de body */
    list-style-position: inside;
    margin: auto;
}

/* Especificidad 005 */
main section ul li a {
    display: inline;
}

/* Especificidad 001 */
ul {
    list-style-type: circle;
}

@media (max-width: 768px) {
    /* Especificidad 003 */
    main section > ul {
        font-size: 1em;
    }
}

@media (max-width: 460px) {
    /* Especificidad 003 */
    main section > ul {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde */
        font-size: 0.85em;
    }
}

/* Especificidad 001 */
ol {
    list-style-type: square;
}

/* Especificidad 001 */
li {
    margin-bottom: 0.625em;
    line-height: 1.5;
}

/* Especificidad 002 */
li a {
    color: #570000;
    /* background-color heredado de li */
}

/* Especificidad 001 en cada selector */
dt, dd {
    line-height: 1.5;
}

/* Especificidad 001 */
dt {
    text-decoration: underline;
}

/* Especificidad 001 */
dd {
    margin-bottom: 1.5em;
}

/* ###################### Estilizacion de tablas ###################### */
/* Especificidad 001 */
table {
    table-layout: fixed;
    width: 90%;
    font-family: Arial, sans-serif;
    margin: 2em auto;
    background-color: #FFFFFF;
    /* color heredado de body */
    box-shadow: 0 0.22em 0.5em #0000001a; 
}

/* Especificidad 002 */
table caption {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    margin-right: 0.4em;
    font-size: 1.5em;
    text-decoration: underline;
    color: #333333;
    /* background-color heredado de table */
}

/* Especificidad 001 en cada selector */
th, td {
    padding: 1em 2em; 
    text-align: left;
}

/* Especificidad 001 */
th {
    background-color: #F4F4F4;
    color: #333333;
    font-weight: bold;
}

/* Especificidad 011 */
tr:nth-child(even) {
    background-color: #f9f9f9;
    /* color heredado de body */
}

/* Especificidad 011 */
tr:hover {
    background-color: #f1f1f1;
    /* color heredado de body */
}

/* Especificidad 011 */
th:nth-child(1) {
    width: 30%;
}

/* ###################### Elementos multimedia ###################### */
/* Especificidad 001 */
video {
    width: 60%;
    height: auto;
}

/* Especificidad 001 */
img {
    width: 40%;
    height: auto;
}

/* ###################### Ayuda global de la web ###################### */
/* Especificidad 003 */
body > button+dialog {
    width: 80%;
    max-width: 100%;
    max-height: 60%;
    margin-top: 10em;
    padding: 1.5em;
    background-color: #FFFFFF;
    /* color heredado de body */
    z-index: 1000;
    resize: both;
    overflow: auto;
}

/* Especificidad 004 en cada uno de los 2 selectores */
body > button+dialog h2, body > button+dialog h3 {
    font-size: 1.5em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #383838;
    /* background-color heredado de dialog */
}

/* Especificidad 004 */
body > button+dialog p {
    font-size: 1.2em;
    margin-bottom: 0.5em;
    color: #424242;
    /* background-color heredado de dialog */
}

/* Especificidad 004 */
body > button+dialog ul {
    list-style-type: disc;
    padding-left: 1.5em;
}

/* Especificidad 005 */
body > button+dialog ul li {
    font-size: 1.2em;
    margin-bottom: 0.5em;
}

/* Especificidad 004 */
body > button+dialog button {
    display: block;
    margin: 1em auto 0;
    padding: 0.5em 1em;
    font-size: 1em;
    background-color: #1F3B4D;
    color: #fff;
}

/* Especificidad 014 */
body > button+dialog button:hover {
    background-color: #163240;
    /* color heredado de button */
}

/* Media Queries para el dialogo de ayuda */
@media (max-width: 768px) {
    /* Especificidad 003 */
    body > button+dialog {
        /* Redefinir width es necesario para que el dialogo se ajuste al ancho de la pantalla */
        width: 70%;
        /* Redefinir el padding es necesario para que el contenido no se desborde del dialogo */
        padding: 1em;
    }

    /* Especificidad 004 */
    body > button+dialog h2 {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde del dialogo */
        font-size: 1.5em;
    }

    /* Especificidad 004 */
    body > button+dialog h3 {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde del dialogo */
        font-size: 1.3em;
    }

    /* Especificidades 004, 005 */
    body > button+dialog p, body > button+dialog ul li {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde del dialogo */
        font-size: 1em;
    }
}

@media (max-width: 768px) {
    /* Especificidad 003 */
    body > button+dialog {
        /* Redefinir width es necesario para que el dialogo se ajuste al ancho de la pantalla */
        width: 52%;
    }
}

/* ###################### Estilo del API.HTML ###################### */
/* Especificidades 003 */
main section button {
    padding: 1em 2em;
    font-size: 1.5em; 
    cursor: pointer;
}

/* Especificidad 012 */
main > section:nth-of-type(2) {
    margin: 0 auto;
    font-size: 0.75em;
}

/* Especificidad 012 */
main  > section:nth-of-type(3) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%; 
    margin: 0 auto; 
}

/* Especificidad 012 */
main  > section:nth-of-type(4) {
    flex-direction: column;
    justify-content: center;
    width: 100%; 
    margin: 2em auto;
}

/* Especificidad 013 */
main  > section:nth-of-type(4) > button {
    width: 80%;
    padding: 1em;
    margin-bottom: 1em;
    font-size: 1em;
    cursor: pointer;
}

/* Especificidad 001 */
canvas {
    margin: 1em auto;
}

/* Especificidad 023 */
main  > section:nth-of-type(4) > button:hover {
    background-color: #163240;
    /* color heredado de button */
}

/* Especificidad 012 */
main  > dialog:nth-of-type(1) {
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #1F3B4D;
    /* background-color heredado de dialog */
    padding: 2em;
    box-shadow: 0 0.25em 0.4em #00000033;
    width: 80%;
    max-width: 50%;
    margin: auto;
}

/* Especificidad 013 */
main > dialog:nth-of-type(1) > h2 {
    margin-bottom: 1em;
}

/* Especificidad 013 */
main  > dialog:nth-of-type(1) > p {
    margin: 0.5em 0;
}

/* ###################### Estilo para formularios ###################### */
/* Especificidad: 001 */
form {
    display: flex;
    flex-direction: column;  
    background-color: #f9f9f9;
    /* color heredado de body */
    border: 0.5em solid #dddddd;
    border-radius: 0.5em;
    padding: 2em;
    box-sizing: border-box; 
    width: 100%;
    margin: 1em auto; 
}

/* Especificidad: 002 */
form label {
    margin-top: 1em;
    font-weight: bold;
}

/* Especificidad: 012 */
form input[type="file"] {
    cursor: pointer;
}

/* Especificidad: 022 */
form input[type="file"]:hover {
    background-color: #e9e9e9;
    /* color heredado de body */
}

/* Especificidad: 002 */
form button {
    background-color: #1F3B4D;
    color: #FFFFFF;
    padding: 1em 2em;
    cursor: pointer;
    width: 100%;  
}

/* Especificidad: 012 */
form button:hover {
    background-color: #163240;
    /* color heredado de form button */
}

/* Especificidades: 022, 012, 022 */
form input[type="text"]:focus, form textarea:focus, form input[type="file"]:focus {
    outline: none; 
}

/* Especificidad 003 */
form p a {
    color: #0000ff;
    /* backgroud-color heredado de form */
}

/* Media Queries */
@media (max-width: 490px) {
    /* Especificidad 002 */
    form label {
        font-size: 1em;
    }

    /* Especificidad 002 */
    form button {
        /* Redefinir el padding es necesario para que el boton se vea mejor en pantallas pequeñas */
        padding: 0.5em 1em;
    }
}

/* ###################### Estilo para los mapas ###################### */
/* Especificidad 002 */
main > div {
    height: 60vh;
    width: 100%;
    margin-bottom: 1.5em
}

/* Especiicidad 002 */
main > img {
    margin: 2.5em auto;
}

@media (max-width: 768px) {
    /* Especificidad 002 */
    main > img {
        /* Redefinir el tamaño de la imagen es necesario para que no se desborde del contenedor */
        width: 100%;
        height: auto;
    }
}

/* Especificidad 001 */
svg {
    display: inline-block; 
    max-width: 100%; 
    height: auto;
}

/* ###################### Estilo para XML (circuitos.html) ###################### */
/* Especificidad 003 */
main > section a {
    display: block;
    text-align: left;
    font-weight: bold;
}

/* Especificidad 003 en cada selector */
main > section img, main > section video {
    width: 70%;
    height: auto;
    margin-right: 2em;
    object-fit: cover;
    border-radius: 0.5em;
}

/* Especificidad 013 */
main > section a:hover {
    text-decoration: underline;
}

/* Especificidad 003 */
main section blockquote {
    margin: 1em 0;
    padding: 1em;
    background-color: #f9f9f9;
    font-style: italic;
    color: #3B3B3B;
}

/* ###################### Estilo para Carrusel (viajes.php) ###################### */
/* Especificidad 002 */
div+article {
    width: 100%;
    max-width: 100vh;
    height: 70vh;
    min-height: 50vh;
    position: relative;
    overflow: hidden; 
    margin: 2em auto;
    border-radius: 1em;
}

/* Especificidad 004 */
main > div+article img {
    width: 100%;
    max-width: 100vh;
    height: 60vh;
    position: absolute;
    transition: all 0.5s;
    object-fit: cover;
    border-radius: 0.5em;
}

/* Especificidad 004 */
main > div+article button {
    position: absolute;
    width: 2em;
    height: 2em;
    padding: 0.5em;
    border: none;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
    background-color: #fff;
    color: #1F3B4D;
    font-size: 1em;
    display: flex;
    flex-direction: column;
    align-items:center;
    justify-content: center;
}

/* Especificidad 014 */
main > div+article button:active {
    transform: scale(1.1);
}

/* Especificidad 014 */
main > div+article button:nth-of-type(2) {
    top: 50%;
    left: 2%;
}

/* Especificidad 014 */
main > div+article button:nth-of-type(1) {
    top: 50%;
    right: 2%;
}

/* ###################### Estilo para el parrafo de cambio de moneda (viajes.php) ###################### */
/* Especificidad 002 */
main > p {
    margin-bottom: 3em;
    font-size: 1.4em;
}

@media (max-width: 768px) {
    /* Especificidad 002 */
    main > p {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde */
        font-size: 1.2em;
    }
}

@media (max-width: 450px) {
    /* Especificidad 002 */
    main > p {
        /* Redefinir el tamaño de la fuente es necesario para que el texto no se desborde */
        font-size: 1em;
    }
}