/* lightbox.css - overlay shown by js/lightbox.js in place of the old
   popImage() popup window. Applies at every screen size: the popup it
   replaces was broken on desktop (popup blockers) and on mobile alike. */

.klb {
	display: none;
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	/* the cookie notice sits at 9999 */
	z-index: 10000;
	background: rgba(0, 0, 0, 0.93);
	padding: 48px 16px 16px 16px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
}
.klb.klb-open {
	display: -webkit-box; display: -ms-flexbox; display: flex;
	-webkit-box-align: center; -ms-flex-align: center; align-items: center;
	-webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
}

.klb-stage { max-width: 100%; margin: auto; text-align: center; }

.klb-img {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	/* budget for the top padding, caption and bottom padding, rather than a
	   vh fraction - a portrait image otherwise caps out well short of the
	   space actually available */
	max-height: calc(100vh - 140px);
	width: auto;
	height: auto;
	border: 0;
	box-shadow: 0 6px 40px rgba(0, 0, 0, 0.55);
}
.klb-loading .klb-img { min-width: 48px; min-height: 48px; }
.klb-error .klb-img { display: none; }

.klb-cap {
	max-width: 820px;
	margin: 14px auto 0 auto;
	color: #f0ede4;
	font-size: 14px;
	line-height: 1.45;
	text-align: center;
}
.klb-cap em, .klb-cap i { font-style: italic; }

/* a filled disc, so it reads as a control instead of blending into the
   sticky brand bar showing through behind it */
.klb-close {
	position: fixed;
	top: 8px; right: 10px;
	width: 40px; height: 40px;
	padding: 0;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 25px;
	line-height: 38px;
	text-align: center;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}
.klb-close:hover, .klb-close:focus {
	background: rgba(0, 0, 0, 0.85);
	color: #8d8;
	outline: none;
}

/* stop the page behind scrolling while the overlay is up */
.klb-lock, .klb-lock body { overflow: hidden; }

/* the editor marks these clickable with an inline CURSOR: pointer already;
   this adds the keyboard focus ring the bare <img onclick> never had */
#main img[data-klb]:focus { outline: 2px solid #006633; outline-offset: 2px; }

@media screen and (max-width: 1000px) {
	.klb { padding: 46px 8px 8px 8px; }
	.klb-img { max-height: calc(100vh - 124px); }
	.klb-cap { font-size: 13px; margin-top: 10px; }
}
