/* gallery.css - styles for the photo gallery */

/* Remove the margin when showing slides */
body {
	margin:0;
	background-color:#810541;
	padding:0;
}

body.touch {
	min-height:101vh;
}

footer {position:fixed; left:0; bottom:0;}
footer p {margin:0; padding:0.5em;}
footer p a {color:white;}
footer p a:hover {color:yellow;}
footer p a:visited {color:white;}
.touch footer {background:none;}
.touch footer p {text-shadow: 0.05em 0 black,0 0.05em black,-0.05em 0 black,0 -0.05em black;}

.grid footer {
	display:absolute;
	left:0; bottom:0;
}

/* Style the image container */
#slideFrame {
  position: fixed;
	top:3em; left:0;	
	width:100vw;
	height:calc(100vh - 3em);
	min-height:calc(100vh - 3em);
	background-color:#810541;
	margin:0; padding:0;
	box-sizing: border-box;
}

/* Two layers for cross-fading */
.bg-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #810541; /* bg color is needed if size=contain */
	background-size: cover;
	background-repeat:no-repeat;
	background-position: center;
	opacity: 0;
	transition: opacity 1s ease-in-out;
}

.bg-layer.visible {
	opacity: 1.0;
}

/* Grid of slides */
#slideGrid {
	position: absolute;
	display:none;
	flex-direction:row;
	flex-wrap:wrap;
	justify-content:left;
	top: 3em;
	left: 0;
	padding-bottom:3em;
	width: 100%;
	max-width:100%;
	height: auto;
	background-color:#444;
	overflow-x:clip;
}

.slide-grid div {
	position:relative;
	margin-right:4px;
}
.slide-grid div img {
	border:2px solid white; 
	height:25vh;
	cursor:pointer;
}

#showAllSlides img:first-child {display:block;}
#showAllSlides img:last-child {display:none;}
.grid #showAllSlides img:first-child {display:none;}
.grid #showAllSlides img:last-child {display:block;}

/* Next & previous buttons */
.slide-button {
	display:block;
  cursor: pointer;
  position: absolute;
  top: 45%;
  width: auto;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 20px;
	text-decoration:none;
  user-select: none;
  -webkit-user-select: none;
	z-index:2;
	text-shadow:0.05em 0 black,0 0.05em black,-0.05em 0 black,0 -0.05em black; 
}

/* Position the "previous button" to the left */
#prevSlide {
  left: 0;
  border-radius: 0 3px 3px 0;
}

/* Position the "next button" to the right */
#nextSlide {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.slide-button:visited {
	color: white;
}

#showSlides, #slideIndex {float:left; margin-left:16px;}


#slideIndex {
	display:block;	
	margin-left:16px;
	margin-top:-2px;
	font-weight:bold;
  font-size:16px;
	text-shadow:0.05em 0 black,0 0.05em black,-0.05em 0 black,0 -0.05em black; 
}
.grid #slideIndex {display:none;}

/* Containers for image text and controls */
.caption-container {
	position:fixed;
  background-color: #0000;
  margin:4px;
  color: white;
	height:32px;
	width: 100%;
	top:3em;
	left:0;
	display:block;
}

/* Caption text */
#caption {
	position:fixed;
	clear:both;
	left:50%;
	transform:translate(-50%,0);
	display:block;	
	margin:3px auto;
	font-size:16px;
	text-align:center;
	text-shadow:0.05em 0 black,0 0.05em black,-0.05em 0 black,0 -0.05em black; 
}
/* Play and stop buttons 
.play,.stop,.all-slides,.slide-no {
	display:block;
  cursor: pointer;
  position: absolute;
  bottom:5px;
  width: auto;
  color: white;
  font-weight: bold;
  font-size: 20px;
  border-radius: 0 3px 3px 0;
  -webkit-user-select: none;
  user-select: none;
	z-index:2	;
}
*/

.caption-container img {
	cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
	z-index:2	;
}

/* Delay and thumbnail size sliders */
.sliders {	
	position:fixed;
	left:0;
	bottom:0;
	height:2.1em;
	width:100vw;
	display:none;
	z-index:1;
	background-color:transparent;
	padding-top:0;
}

.touch .sliders {height:2.5em;}

.playing .sliders, .grid .sliders {display:block;}

.slider {
  width: 10em;	
	height: 1em;
	display:none;
	z-index:5;
	opacity:1.0;
	margin-top:1em;
}
	
.slider.fade {
	opacity:0.5;
	transition: opacity 2s ease-out 5s, background-color 2s ease-out 5s;
}

#delayRange {
	float:left;
	margin:5px 8px 0 16px;
}

#sizeRange {
	float:right;
	margin:5px 16px 0 8px;
}

.touch.playing footer p {
	display:none;
}

.playing #delayRange {
	display:block;
}

.playing #showAllSlides {
	display: none;
}

.grid #sizeRange {
	display:block;
}

#delaySec {
	float:left;
}

.playing #delaySec {
	display:block;
}

.slider-value {
	color:white;
	display:none;
	opacity:1;
	background-color:#372c;
	padding:7px 12px;
	margin-top:-8px;
	border-radius:4px;
}

.slider-value.fade {
	opacity:0;
	background-color:transparent;
	transition: opacity 2s ease-out 5s, background-color 2s ease-out 5s;
}

#sizePercent {
	float:right;	
}

.grid #sizePercent {
	display:block;
}

.touch footer p {opacity:0.6;}

.touch.grid footer p {opacity:0.25}

#showAllSlides img {margin-bottom:2px; width:18px;}

#showAllSlides {float:right; margin-right:24px;}
	
.slider:hover {
	opacity:1.0;
}

/*
@media screen and (orientation:portrait) {
	#delayRange {left:16px; top:-28px;}
}
*/

.play {display: block; width:18px;}
.stop {display: none; width:18px;}
.playing .play {display:none;}
.playing .stop {display:block;}
 
#slideGrid {display:none;}
.grid #slideGrid {display:flex;}
.grid .slide-button {display:none;}
.grid .bg-layer {display:none};	
.playing #allSlides {display:none;}
.grid .play, .grid .stop {display:none;}
.grid #delayRange {display:none;}
.grid #caption {display:none;}
