/* TM Project Gallery: photo grid, filters, lightbox and the single project page.
   Fonts and text colors come from the theme. --tmpg-* custom properties come from the plugin (Divi options). */

.tmpg,
.tmpj,
.tmpg-lb {
	--tmpg-gap: 8px;
	--tmpg-focus: var(--tmpg-accent, #2ea3f2);
	--tmpg-tint: #eef2f6;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	.tmpg,
	.tmpj,
	.tmpg-lb {
		/* A darker accent keeps the focus ring at 3:1 or better on white. */
		--tmpg-focus: color-mix(in srgb, var(--tmpg-accent, #2ea3f2) 70%, #000);
		--tmpg-tint: color-mix(in srgb, var(--tmpg-accent, #2ea3f2) 11%, #fff);
	}
}

@media (min-width: 981px) {
	.tmpg,
	.tmpj {
		--tmpg-gap: 10px;
	}
}

.tmpg-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.tmpg [hidden],
.tmpj [hidden],
.tmpg-lb [hidden] {
	display: none !important;
}

/* Filters */

.tmpg .tmpg-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 16px;
	margin: 0 0 28px;
}

.tmpg .tmpg-filter {
	position: relative;
	flex: 0 1 300px;
	min-width: 0;
}

.tmpg .tmpg-filter::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 18px;
	width: 8px;
	height: 8px;
	border-right: 2px solid #333;
	border-bottom: 2px solid #333;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.tmpg .tmpg-select {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 44px 10px 16px;
	font: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: #333;
	background: #fff;
	border: 1px solid #767676;
	border-radius: 4px;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.tmpg .tmpg-select:hover {
	border-color: #333;
}

.tmpg .tmpg-select:focus-visible {
	outline: 3px solid var(--tmpg-focus);
	outline-offset: 2px;
}

.tmpg .tmpg-empty {
	margin: 24px 0 0;
	padding: 0;
	text-align: center;
}

/* Photo grid: square tiles, 2 / 3 / 4 columns (Divi's phone, tablet and desktop breakpoints). */

.tmpg .tmpg-grid,
.tmpj .tmpg-grid,
#left-area .tmpg .tmpg-grid {
	/* #left-area: Divi styles "#left-area ul" when the shortcode sits in a classic (non-builder) page. */
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--tmpg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: normal;
}

@media (min-width: 768px) {
	.tmpg .tmpg-grid,
	.tmpj .tmpg-grid,
	#left-area .tmpg .tmpg-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 981px) {
	.tmpg .tmpg-grid,
	.tmpj .tmpg-grid,
	#left-area .tmpg .tmpg-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.tmpg .tmpg-item,
.tmpj .tmpg-item,
#left-area .tmpg .tmpg-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tmpg .tmpg-tile,
.tmpj .tmpg-tile {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #e9e9e9;
	cursor: zoom-in;
}

.tmpg .tmpg-tile img,
.tmpj .tmpg-tile img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.tmpg .tmpg-tile:hover img,
.tmpj .tmpg-tile:hover img {
	transform: scale(1.04);
}

.tmpg .tmpg-tile:focus-visible,
.tmpj .tmpg-tile:focus-visible,
.tmpj .tmpj-hero__media:focus-visible,
.tmpj .tmpj-card__link:focus-visible,
.tmpj .tmpj-btn:focus-visible {
	outline: 3px solid var(--tmpg-focus);
	outline-offset: 3px;
}

/* Lightbox (a modal <dialog>, so it sits above the theme header and the page is inert behind it). */

html.tmpg-lock {
	overflow: hidden;
}

html.tmpg-lock body {
	padding-right: var(--tmpg-scrollbar, 0px);
}

.tmpg-lb {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	color: #fff;
	background: rgba(12, 12, 12, 0.96);
	border: 0;
}

.tmpg-lb::backdrop {
	background: rgba(12, 12, 12, 0.96);
}

.tmpg-lb[open] {
	display: flex;
	flex-direction: column;
	animation: tmpg-fade 0.18s ease-out;
}

.tmpg-lb__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
}

.tmpg-lb__frame {
	position: absolute;
	top: 64px;
	right: 76px;
	bottom: 8px;
	left: 76px;
}

.tmpg-lb__img {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: auto;
	transition: opacity 0.2s ease;
	user-select: none;
}

.tmpg-lb__img:not([src]) {
	visibility: hidden;
}

.tmpg-lb__frame.is-loading .tmpg-lb__img {
	opacity: 0.35;
}

.tmpg-lb__frame.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tmpg-spin 0.8s linear infinite;
}

.tmpg-lb .tmpg-lb__btn {
	position: absolute;
	z-index: 2;
	display: block;
	width: 48px;
	height: 48px;
	min-width: 0;
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: 0;
	line-height: 0;
	background: rgba(0, 0, 0, 0.55);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.2s ease;
}

.tmpg-lb .tmpg-lb__btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

.tmpg-lb .tmpg-lb__btn:focus-visible,
.tmpg-lb .tmpg-lb__link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.tmpg-lb .tmpg-lb__btn::before,
.tmpg-lb .tmpg-lb__btn::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
}

.tmpg-lb .tmpg-lb__close {
	top: 10px;
	right: 10px;
}

.tmpg-lb .tmpg-lb__close::before,
.tmpg-lb .tmpg-lb__close::after {
	width: 22px;
	height: 2px;
	margin: -1px 0 0 -11px;
	background: #fff;
	transform: rotate(45deg);
}

.tmpg-lb .tmpg-lb__close::after {
	transform: rotate(-45deg);
}

.tmpg-lb .tmpg-lb__prev,
.tmpg-lb .tmpg-lb__next {
	top: 50%;
	margin-top: -24px;
}

.tmpg-lb .tmpg-lb__prev {
	left: 14px;
}

.tmpg-lb .tmpg-lb__next {
	right: 14px;
}

.tmpg-lb .tmpg-lb__prev::before,
.tmpg-lb .tmpg-lb__next::before {
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	border-top: 3px solid #fff;
	border-left: 3px solid #fff;
}

.tmpg-lb .tmpg-lb__prev::before {
	transform: translateX(2px) rotate(-45deg);
}

.tmpg-lb .tmpg-lb__next::before {
	transform: translateX(-2px) rotate(135deg);
}

.tmpg-lb__bar {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 24px;
	padding: 6px 24px 10px;
	padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.tmpg-lb .tmpg-lb__caption,
.tmpg-lb .tmpg-lb__count {
	margin: 0;
	padding: 0;
	font-size: 16px;
	line-height: 1.5;
}

.tmpg-lb .tmpg-lb__caption {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 18px;
	color: #fff;
}

.tmpg-lb .tmpg-lb__title {
	padding: 10px 0;
	font-weight: 700;
}

.tmpg-lb .tmpg-lb__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0;
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tmpg-lb .tmpg-lb__link:hover {
	color: #fff;
	text-decoration-thickness: 2px;
}

.tmpg-lb .tmpg-lb__count {
	color: #d0d0d0;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
	.tmpg-lb__frame {
		top: 64px;
		right: 0;
		bottom: 4px;
		left: 0;
	}

	.tmpg-lb .tmpg-lb__prev,
	.tmpg-lb .tmpg-lb__next {
		top: auto;
		bottom: 12px;
		margin-top: 0;
	}

	.tmpg-lb .tmpg-lb__prev {
		left: 10px;
	}

	.tmpg-lb .tmpg-lb__next {
		right: 10px;
	}

	.tmpg-lb__bar {
		padding: 4px 16px 10px;
	}

	.tmpg-lb .tmpg-lb__caption,
	.tmpg-lb .tmpg-lb__count {
		font-size: 15px;
	}
}

@media (forced-colors: active) {
	/* High-contrast modes drop backgrounds: draw the close cross in the system text color instead. */
	.tmpg-lb .tmpg-lb__close::before,
	.tmpg-lb .tmpg-lb__close::after {
		background: CanvasText;
		forced-color-adjust: none;
	}

	.tmpg-lb .tmpg-lb__btn {
		border: 2px solid ButtonText;
	}
}

@keyframes tmpg-fade {
	from {
		opacity: 0;
	}
}

@keyframes tmpg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Single project page */

.tmpj.container {
	padding-bottom: 64px;
}

.tmpj .tmpj-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

@media (min-width: 981px) {
	.tmpj .tmpj-hero {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		gap: 48px;
	}
}

.tmpj .tmpj-hero__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #e9e9e9;
	cursor: zoom-in;
}

.tmpj .tmpj-hero__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.tmpj .tmpj-title {
	margin: 0 0 16px;
	padding: 0;
	line-height: 1.25;
}

.tmpj .tmpj-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
	line-height: normal;
}

.tmpj .tmpj-tags li {
	margin: 0;
	padding: 5px 14px;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	background: var(--tmpg-tint);
	border-radius: 999px;
}

.tmpj .tmpj-hero__text .tmpj-desc {
	/* Divi pads ".project .entry-content" by 30px for its own template. */
	padding-top: 0;
	font-size: 17px;
	line-height: 1.75;
}

.tmpj .tmpj-desc p {
	padding-bottom: 1em;
}

.tmpj .tmpj-desc > :last-child {
	margin-bottom: 0;
	padding-bottom: 0;
}

.tmpj .tmpj-details {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 8px 24px;
	margin: 24px 0 0;
	padding: 20px 0 0;
	border-top: 1px solid #e2e2e2;
}

.tmpj .tmpj-details dt {
	margin: 0;
	color: #333;
	font-weight: 700;
}

.tmpj .tmpj-details dd {
	margin: 0;
	padding: 0;
}

.tmpj .tmpj-section {
	margin-top: 56px;
}

.tmpj .tmpj-section__title {
	margin: 0 0 20px;
	padding: 0;
	line-height: 1.25;
}

.tmpj .tmpj-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: normal;
}

@media (min-width: 768px) {
	.tmpj .tmpj-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tmpj .tmpj-card {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tmpj .tmpj-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.tmpj .tmpj-card__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #e9e9e9;
}

.tmpj .tmpj-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.tmpj .tmpj-card__link:hover img {
	transform: scale(1.04);
}

.tmpj .tmpj-card__title {
	margin: 12px 0 0;
	padding: 0;
	font-size: 18px;
	line-height: 1.4;
	color: #333;
}

.tmpj .tmpj-card__link:hover .tmpj-card__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tmpj .tmpj-cta {
	margin-top: 56px;
	padding: 40px 20px;
	text-align: center;
	background: #f4f4f4;
}

.tmpj .tmpj-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 10px 34px;
	font-family: inherit;
	font-size: var(--tmpg-btn-size, 20px);
	font-weight: var(--tmpg-btn-weight, 500);
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-align: center;
	text-decoration: none;
	text-transform: var(--tmpg-btn-transform, none);
	color: var(--tmpg-btn-color, #2ea3f2);
	background: var(--tmpg-btn-bg, transparent);
	border: var(--tmpg-btn-border-width, 2px) solid var(--tmpg-btn-border-color, currentColor);
	border-radius: var(--tmpg-btn-radius, 3px);
	transition: filter 0.2s ease;
}

.tmpj .tmpj-btn:hover {
	color: var(--tmpg-btn-color, #2ea3f2);
	filter: brightness(0.9);
}

@media (max-width: 767px) {
	.tmpj.container {
		padding-bottom: 48px;
	}

	.tmpj .tmpj-section {
		margin-top: 44px;
	}

	.tmpj .tmpj-cta {
		margin-top: 44px;
		padding: 32px 16px;
	}

	.tmpj .tmpj-btn {
		width: 100%;
		padding: 10px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmpg .tmpg-tile img,
	.tmpj .tmpg-tile img,
	.tmpj .tmpj-card__media img,
	.tmpg-lb__img,
	.tmpg-lb[open] {
		transition: none;
		animation: none;
	}

	.tmpg .tmpg-tile:hover img,
	.tmpj .tmpg-tile:hover img,
	.tmpj .tmpj-card__link:hover img {
		transform: none;
	}

	.tmpg-lb__frame.is-loading::after {
		animation-duration: 2.4s;
	}
}
