:root {
	--photo-info-padding: 20px;
}

#photo-view {
	width: 100%;
	height: 100%;
	
	background-color: var(--perma-dark);
	opacity: 1;
	
	position: fixed;
	top: 0;
	left: 0;
	
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;

	z-index: 5;
}

#photo-view .photo-button.info-button {
	background-image: url('../images/info.png');
	
	/* info sidebar width + padding + 10px */
	right: 350px;
}

#photo-view .photo-button.info-button.isclosed {
	right: max(10px, env(safe-area-inset-right)) !important;
}

#photo-view .photo {
	width: calc(100% - 340px);
	height: 100%;
	
	position: fixed;
	top: 0;
	left: 0;
	
	display: table;
	text-align: center;
}

#photo-view .photo #photo-holder,
#photo-view .photo #photo-holder-prev,
#photo-view .photo #photo-holder-next {
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	display: inline-block;
	position: absolute;
	top: 0;
	left: 0;
}

#photo-view .photo #photo-holder-prev {
	left: -100%;
}

#photo-view .photo #photo-holder-next {
	left: 100%;
}

#photo-view .info {
	/* When changing this value, chagne #photo-view .photo width as well */
	width: 300px;
	min-height: 100%;
	
	position: fixed;
	right: 0;
	top: 0;
	
	padding: var(--photo-info-padding);
	
	background-color: var(--lighter);
	
	overflow: auto;
}

#photo-view .info h2.title {
	text-align: center;
	padding-bottom: 15px;
	margin-top: 0;
	border-bottom: 1px solid var(--light);
}

#photo-view .mapwrap {
	width: calc(100% + 40px);
	height: 250px;
	margin-left: -20px;
	float: left;
	margin-bottom: calc(var(--normal-spacing) * 3);
	margin-top: calc(var(--normal-spacing) * 3);
}

#photo-view .mapwrap iframe {
	border: 0;
	display: inline-block;
	width: 100%;
	height: 100%;
}

#photo-view .mapwrap.no-desc-no-title {
	margin-top: 0;
	min-height: 60%;
}

#photo-view .comments .comment:first-child {
	margin-top: 15px;
}

#photo-view .comments .comment {
	border-top: 1px solid var(--light);
	background-color: var(--lighter);
	margin-bottom: 1px;
	padding: 5px;
}

#photo-view .comments small {
	color: var(--gray);
}

#photo-view .comments textarea {
	width: 100%;
	height: 30px;
	resize: none;
	font-family: inherit;
	font-size: 0.85em;
}

#photo-view .comments .comment .name {
	font-weight: bold;
}

#photo-view .comments .comment .content {
	margin-top: 5px;
	text-indent: 15px;
}

.photo .navarrow:hover {
	opacity: 1;
	transition: opacity var(--transition-quick);
}

.photo .navarrow {
	position: absolute;
	background-position: center center;
	background-repeat: no-repeat;
	width: 42px;
	height: 75px;
	top: calc(50% - 37.5px);
	z-index: 2;

	opacity: 0.1;
}

.video-swipe-overlay {
	display: none;

	-webkit-tap-highlight-color: rgba(255, 255, 255, 0); 
}

#photo-view .cropper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	border: 2px solid var(--lighter);
	box-sizing: border-box;
	cursor: move;
	touch-action: none;
	z-index: 1;
}

#photo-view .phototools {
	margin-top: var(--normal-spacing);
}

#photo-view .phototools, #photo-view .actions {
	display: inline-block;
}

@media screen and (max-width: 1000px) {	
	#photo-view .photo {
		width: 100%;
		
		position: static;
		
		display: table;
		text-align: center;
		margin: 0 auto;
	}

	#photo-view .photo.with-info {
		height: calc(100% - 60px);
	}

	#photo-view .photo #photo-holder,
	#photo-view .photo #photo-holder-prev,
	#photo-view .photo #photo-holder-next {
		height: 100%;
		transition: height var(--transition-quick);
	}

	#photo-view .photo.with-info #photo-holder,
	#photo-view .photo.with-info #photo-holder-prev,
	#photo-view .photo.with-info #photo-holder-next {
		height: calc(100% - 60px);
		transition: height var(--transition-quick);
	}

	#photo-view .info {
		width: 100%;
		min-height: 100%;
		box-sizing: border-box;
		padding-left: calc(var(--photo-info-padding) + env(safe-area-inset-left));
		padding-right: calc(var(--photo-info-padding) + env(safe-area-inset-right));
		
		position: static;
	}

	#photo-view .photo-button.info-button,
	#photo-view .photo-button.info-button.isclosed,
	.admin {
		right: max(env(safe-area-inset-right), 10px) !important;
	}

	#photo-view .info h2.title {
		text-align: left;
		max-width: calc(100% - 50px);
		border-bottom: none;
	}
	
	#photo-view h2.detail {
		border-bottom: none;
		margin-top: 0;
		margin-bottom: 30px;
		text-align: left;
		max-width: calc(100% - 50px);
	}

	.video-swipe-overlay {
		display: block;

		position: absolute;
		width: 100%;
		height: calc(100% - 110px);
		visibility: visible;
		z-index: 1;
		top: 0;
		left: 0;
	}
}
