/*
Luciano García - 02/11/2019 - www.luciano.es
Abrir una imagen o un div en una ventana modal - Versión 8

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

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

/* Botones anterior/siguiente de: https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp */

/* 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: green;*/
	font-size: 200%; 
	font-weight: bold;
}

/* Cada uno de los botones de control */
div#yfvm div:first-child button { 
	width: 1.5em; 
	margin: 0.25em;
	outline: none; /* Quita el recuadro azul al pinchar */
}
div#yfvm div:first-child button:hover {
	background-color: #bbb;
	text-decoration: none;
	cursor: pointer;
}

div#yfvm figure { width: 100%; margin: 0; padding: 0; }

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

/* El div que contiene el pie de foto */
div#yfvm figure figcaption { 
	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)}
}

/* Los botones Anterior y Siguiente */
div#yfvm button#ifvm_anterior,
div#yfvm button#ifvm_siguiente {
	cursor: pointer;
	position: absolute;
	top: 50%;
	width: auto;
	padding: 16px;
	margin-top: -50px;
	color: white;
	background-color: transparent;
	border: 0;
	font-weight: bold;
	font-size: 20px;
	border-radius: 0 3px 3px 0;
	user-select: none;
	-webkit-user-select: none;
	outline: none; /* Quita el recuadro azul al pinchar */
}

div#yfvm button#ifvm_anterior:hover,
div#yfvm button#ifvm_siguiente:hover {
	background-color: rgba(0, 0, 0, 0.8);
}

/* Botón Anterior */
div#yfvm button#ifvm_anterior {
	left: 0; 
	border-radius: 0 40% 40% 0;
}

/* Botón Siguiente */
div#yfvm button#ifvm_siguiente {
	right: 0;
	border-radius: 40% 0 0 40%;
}
