.photo-gallery {
	display: grid;
	grid-template-columns:
		repeat(auto-fill, minmax(180px, 1fr));

	gap: 12px;
	margin-top: 2em;
}

.photo-gallery button.gallery-item {
	-webkit-appearance: none;
	appearance: none;

	display: block;

	width: 100% !important;
	height: auto !important;
	aspect-ratio: 4 / 3 !important;

	padding: 0 !important;
	margin: 0 !important;

	border: 0 !important;
	border-radius: 4px;
	box-shadow: none !important;

	background: #eee !important;

	cursor: pointer;
	overflow: hidden;

	min-width: 0 !important;
	min-height: 0 !important;
}

.photo-gallery button.gallery-item img {
	display: block;

	width: 100% !important;
	height: 100% !important;

	max-width: none;

	object-fit: cover;
	object-position: center;

	margin: 0 !important;
	padding: 0 !important;

	transition:
		transform 0.2s ease,
		opacity 0.2s ease;
}

.photo-gallery button.gallery-item:hover img {
	transform: scale(1.03);
	opacity: 0.9;
}


.gallery-credit {
	font-size: 0.9em;
}


/* Full-screen viewer */

.photo-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;

	background: rgba(0, 0, 0, 0.92);

	overflow-y: auto;
	overflow-x: hidden;

	padding: 50px 20px 40px;
	box-sizing: border-box;
}

.photo-lightbox.is-open {
	display: flex;
}


.photo-lightbox-content {
	width: 100%;
	max-width: 1200px;

	margin: 0 auto;

	display: flex;
	flex-direction: column;
	align-items: center;

	min-height: min-content;
}


.photo-lightbox-content img {
	max-width: 100%;

	max-height:
		calc(100vh - 140px);

	width: auto;
	height: auto;

	object-fit: contain;
}


.photo-lightbox-info {
	width: 100%;

	max-width: 1200px;

	margin-top: 12px;

	text-align: center;

	color: #fff;
}

#photo-lightbox-image {
	display: block;

	max-width: 100%;
	max-height: calc(100vh - 230px);

	width: auto;
	height: auto;

	object-fit: contain;
}


#photo-counter {
	font-size: 0.85em;

	opacity: 0.7;

	margin-bottom: 4px;
}


#photo-caption {
	margin-bottom: 6px;
}


#photo-full-link {
	color: #fff;

	font-size: 0.85em;

	opacity: 0.75;
}


#photo-full-link:hover {
	opacity: 1;
}


/* Lightbox controls */

.photo-lightbox button.photo-close,
.photo-lightbox button.photo-nav {
	-webkit-appearance: none;
	appearance: none;

	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;

	background: transparent !important;

	color: #fff !important;

	font-family: inherit;
	font-weight: normal;

	padding: 0 !important;
	margin: 0 !important;

	min-width: 0 !important;

	text-transform: none !important;
	letter-spacing: normal !important;

	cursor: pointer;

	outline: none;
}


/* Close button */

.photo-lightbox button.photo-close {
	position: fixed;

	top: 18px;
	right: 24px;

	z-index: 10002;

	width: 44px;
	height: 44px;

	font-size: 42px;
	line-height: 40px;

	text-align: center;
}


/* Previous / next arrows */

.photo-lightbox button.photo-nav {
	position: fixed;

	top: 50%;

	transform: translateY(-50%);

	z-index: 10002;

	width: 60px;
	height: 90px;

	font-size: 42px;
	line-height: 90px;

	text-align: center;

	background: rgba(0, 0, 0, 0.25) !important;
}


.photo-lightbox button.photo-nav:hover {
	background: rgba(255, 255, 255, 0.12) !important;
}


.photo-lightbox button.photo-prev {
	left: 15px;
}


.photo-lightbox button.photo-next {
	right: 15px;
}


/* Mobile */

@media screen and (max-width: 736px) {

	.photo-lightbox button.photo-nav {
		width: 44px;
		height: 70px;

		font-size: 34px;
		line-height: 70px;
	}

	.photo-lightbox button.photo-prev {
		left: 5px;
	}

	.photo-lightbox button.photo-next {
		right: 5px;
	}

	.photo-lightbox button.photo-close {
		top: 10px;
		right: 12px;
	}
}

/* Photo archive editor */

.photo-editor-message {
	margin: 1em 0 2em;
	padding: 1em 1.25em;

	background: #f2f2f2;

	border-left: 4px solid #f56a6a;
}


.photo-editor-grid {
	display: grid;

	grid-template-columns:
		repeat(auto-fill, minmax(340px, 1fr));

	gap: 25px;

	margin-top: 2em;
}


.photo-editor-card {
	border: 1px solid #ddd;

	padding: 18px;

	background: #fff;
}


.photo-editor-preview {
	width: 100%;

	aspect-ratio: 4 / 3;

	overflow: hidden;

	background: #eee;

	margin-bottom: 12px;
}


.photo-editor-preview img {
	display: block;

	width: 100%;
	height: 100%;

	object-fit: cover;

	object-position: 50% 50%;
}


.photo-editor-id {
	font-size: 0.85em;

	margin-bottom: 1.25em;

	color: #777;
}


.photo-editor-card label {
	display: block;

	margin-bottom: 1em;
}


.photo-editor-card textarea,
.photo-editor-card input[type="text"] {
	width: 100%;
}


.crop-control {
	margin-top: 1.25em;

	padding-top: 1em;

	border-top: 1px solid #ddd;
}


.crop-control input[type="range"] {
	width: 100%;
}


.crop-reset {
	margin-top: 0.25em;
}


.photo-editor-save {
	margin: 2em 0;

	text-align: right;
}


@media screen and (max-width: 736px) {

	.photo-editor-grid {
		grid-template-columns: 1fr;
	}

}

.photo-comments {
	width: 100%;
	max-width: 900px;

	margin: 30px auto 0;
	padding: 25px;

	background: #fff;
	color: #444;

	text-align: left;

	box-sizing: border-box;
}

.photo-comments h3 {
	margin-bottom: 0.4em;
}

.comment-list {
	margin: 20px 0;
}

.archive-comment {
	padding: 15px 0;
	border-bottom: 1px solid #ddd;
}

.archive-comment:last-child {
	border-bottom: 0;
}

.archive-comment p {
	margin-top: 8px;
	margin-bottom: 0;
}

.archive-comment-form {
	margin-top: 25px;
}

.archive-comment-form label {
	display: block;
	margin-bottom: 15px;
}

.archive-comment-form small {
	display: block;
	font-weight: normal;
	opacity: 0.7;
}

.comment-message {
	margin-bottom: 20px;
	padding: 12px 15px;
	background: #f2f2f2;
	font-weight: bold;
}

.comment-honeypot {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}