/*
Luciano García - 18/07/2019 - www.luciano.es
Abrir una imagen en una ventana modal - Versión 3

Basado en https://www.w3schools.com/howto/howto_css_modal_images.asp
Se complementa con yfvm3.js
Instrucciones en yfvm3.js
*/

@charset "utf-8";
@media all;

/* El div modal, que contendrá los botones de control, la imagen y el pie de foto */
div#yfvm {
	display: none;
	position: fixed;
	z-index: 1;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgb(0,0,0);
	background-color: rgba(0,0,0,0.9);
	/* Evita seleccionar texto, el cambio de color de fondo en los botones al pinchar deprisa, doble o triple click */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* El div contenedor de los botones de control */
div#yfvm div:first-child {
	position: fixed;
	top: 15px;
	right: 35px;
	color: red;
	font-size: 200%; 
	font-weight: bold;
}

/* Cada uno de los botones de control */
div#yfvm div:first-child button { 
	width: 1.5em; 
}
div#yfvm div:first-child button:hover {
	color: #bbb;
	text-decoration: none;
	cursor: pointer;
}
div#yfvm div:first-child button:nth-child(1n) {	/* Primer botón */ }
div#yfvm div:first-child button:nth-child(2n) {	/* Segundo botón */ }
div#yfvm div:first-child button:nth-child(3n) {	/* Tercer botón */ }

/* La imagen dentro de la ventana modal */
div#yfvm img {
	margin: auto;
	display: block;
}

/* El div que contiene el pie de foto */
div#yfvm div:last-child { 
	margin: auto;
	display: block;
	width: 80%;
	text-align: center;
	color: #ccc;
	padding: 10px 0;
}

/* Animación de la imagen y el pie de foto */
div#yfvm img, div#yfvm div:last-child {  
	-webkit-animation-name: yfvm_zoom;
	-webkit-animation-duration: 0.6s;
	animation-name: yfvm_zoom;
	animation-duration: 0.6s;
}
@-webkit-keyframes yfvm_zoom {
	from {-webkit-transform:scale(0)} 
	to {-webkit-transform:scale(1)}
}
@keyframes yfvm_zoom {
	from {transform:scale(0)} 
	to {transform:scale(1)}
}
