/*
 * Fuel Facial Plastics Gallery
 * Version: 4.1.0;
 */

:root {
	--gallery-marker: polygon(85% 0, 50% 75%, 15% 0, 0 0, 50% 100%, 100% 0);
	--gallery-spacing: clamp(0.5rem,2vw,1.5rem);
	--gallery-primary-color: #172D4E;
}

/*--------------------------------------------------------------
# Animations
--------------------------------------------------------------*/
/*Pop animation*/
@media (prefers-reduced-motion:no-preference) {
	.gallery-trigger .loading + .fm-gallery-cat > * {
		transform: scale(0.5);
		opacity: 0;
	}

	.gallery-trigger .loading + .fm-gallery-cat > * {
		--delay:calc(var(--i, 0) * 200ms);
		animation: popAnimation 300ms ease var(--delay) forwards
	}
}

@keyframes popAnimation {
	0% {transform: scale(0.5); opacity: 0;}
	80% {transform: scale(1.1)}
	100% {transform: scale(1); opacity: 1}
}

@keyframes zoom {
	from {transform: scale(1);}
	to {transform: scale(1.03);}
}

.loading {
	overflow: hidden;
}

.loading:after {
	content: "";
	margin-left: 1rem;
	width: 1em;
	height: 1em;
	border-radius: 50%;
	border: 0.2em solid rgba(64,126,159,25%);
	border-top-color: #407e9f;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {transform: rotate(360deg);}
}

.fm-gallery {
	margin-bottom: 2rem;
	position: relative;
	z-index: 2;
}

.fm-gallery p:empty {
	display: none;
}

.filter-header {
	color: #fff;
	grid-column: sidebar;
	position: relative;
	padding: 0.94em 0.8em 1.2em;
	font-size: clamp(1rem,2vw,1.5rem);
	background: #546d92;
}

.gallery-trigger {
	background: var(--gallery-primary-color);
}

.gallery-trigger summary {
	font-size: clamp(0.9rem,2vw,1.2rem);
	padding: 0.35em 3em 0.35em 1em;
	color: #fff;
	background: #365380;
	cursor: pointer;
	border-bottom: 1px solid rgba(255, 255, 255, 0.25);
	position: relative;
	display: flex;
	align-items: center;
}

.gallery-trigger summary::-webkit-details-marker,
.gallery-trigger summary::marker {
	display: none;
}

.gallery-trigger:hover summary,
.gallery-trigger:focus summary,
.gallery-trigger[open] summary {
	background: #234272;
}

.gallery-trigger summary::before {
	content: '';
	position: absolute;
	right: 1.5rem;
	width: 0.7rem;
	height: 0.35rem;
	background: #fff;
	transition: transform 250ms;
	-webkit-clip-path: var(--gallery-marker);
	clip-path: var(--gallery-marker);
}

.gallery-trigger[open] summary::before {
	transform: rotate(-180deg);
}

.fm-gallery-screen-reader {
	display: inline-block;
	position: absolute;
	inset: -10000rem auto auto 1em;
	z-index: 99999;
	transition: none;
}

.fm-gallery-cat {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(clamp(7rem,15vw,13rem), 1fr));
	align-content: start;
	gap: var(--gallery-spacing);
	padding: 0 clamp(0.6rem,3vw,2rem);
	height: 16.5rem;
	overflow: auto;
	border-top: var(--gallery-spacing) solid var(--gallery-primary-color);
	border-bottom: var(--gallery-spacing) solid var(--gallery-primary-color);
	position: relative;
	z-index: 1;
	border-top: 1px solid var(--gallery-primary-color);
	border-bottom: 1px solid var(--gallery-primary-color);
	padding-top: var(--gallery-spacing);
	padding-bottom: var(--gallery-spacing);
	background: var(--gallery-primary-color);
}

.fm-gallery-group {
	display: grid;
	grid-template-rows: repeat(1, 1fr) repeat(2, auto);
	gap: 0.2rem clamp(0.2rem,0.8vw,0.7rem);
	align-items: stretch;
	padding: clamp(0.2rem,0.7vw,0.6rem);
	cursor: zoom-in;
	background: #fff;
	transition: transform 150ms;
}

.fm-gallery-group:hover {
	transform: scale(1.05);
}

.fm-gallery-group:focus {
	outline: 1px dotted #fff;
	outline-offset: 0.2rem;
}

.op-img.post-op {
	grid-column: 2;
}

.fm-gallery-group > .op-img {
	height: 100%;
}

.fm-gallery-group img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.op-txt {
	text-align: center;
	color: #979797;
	font-size: 0.6rem;
}

.slide-excerpt:empty {
	display: none;
}

.fm-gallery-group .count {
	display: grid;
	grid-column: 2;
	justify-self: flex-end;
	font-size: clamp(0.45rem,0.8vw,0.7rem);
	color: #000;
}

.fm-gallery-group .count * {
	grid-area: 1/1;
}

.fm-gallery-group .count svg {
	margin: -0.65em 0 -0.65em 0.2em;
}

/* Lightbox Slider */
.fm-gallery-cat.loaded {
	overflow: hidden;
}

.lightbox-slider {
	border: 1px solid #fff;
	background: #fff;
	position: absolute;
	inset: 0;
	margin: auto;
	max-width: 75%;
	max-height: 80%;
	z-index: 999;
	cursor: default;
	aspect-ratio: var(--ratio);
	display: grid;
	gap: 0.5rem 0;
	padding: clamp(0.5rem,2vw,3rem) clamp(0.5rem,2vw,3rem);
	grid-template-rows: 1fr auto;
}

.slide-mask {
	overflow: hidden;
	position: relative;
}

.lightbox-slider .slide-wrapper {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	position: absolute;
	inset: 0;
	gap: clamp(0.5rem,2vw,1.6rem);
}

/* Scrollbar width/height/track/handle */
:is(.fm-gallery, .fm-gallery-cat)::-webkit-scrollbar {
	width: 0.6rem;
}
.lightbox-slider .slide-wrapper::-webkit-scrollbar {
	height: 0;
}
:is(.fm-gallery, .fm-gallery-cat)::-webkit-scrollbar-track,
.lightbox-slider .slide-wrapper::-webkit-scrollbar-track {
	background: #D9D9D9;
	box-shadow: inset 0 0 5px grey;
}
:is(.fm-gallery, .fm-gallery-cat)::-webkit-scrollbar-thumb,
.lightbox-slider .slide-wrapper::-webkit-scrollbar-thumb {
	background: #365380;
}
:is(.fm-gallery, .fm-gallery-cat)::-webkit-scrollbar-thumb:hover,
.lightbox-slider .slide-wrapper::-webkit-scrollbar-thumb:hover {
	background: #234272;
}

.lightbox-slider .group-item {
	display: flex;
	flex: 1 0 100%;
	gap: clamp(0.5rem,2vw,1.6rem);
	scroll-snap-align: start;
}

.lightbox-slider .op-img {
	flex: 1 1 calc(50% - 1rem);
	overflow: hidden;
}

.lightbox-slider img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.blanket-enabled .gallery-trigger[open] .fm-gallery-cat::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.5);
	-webkit-backdrop-filter: blur(0.5rem);
	backdrop-filter: blur(0.5rem);
	z-index: 1;
}

.close-group {
	position: absolute;
	top: clamp(-0.6rem,-1vw,-0.4rem);
	right: clamp(-0.6rem,-1vw,-0.4rem);
	z-index: 3;
	width: clamp(0.8rem,2vw,1.6rem);
	height: clamp(0.8rem,2vw,1.6rem);
	border-radius: 50%;
	border: none;
	transition: background .3s;
	background: #365380;
	line-height: 0;
	padding: clamp(0.25rem,0.6vw,0.5rem);
}

.slide-nav-btn {
	position: absolute;
	inset: 0 auto;
	z-index: 2;
	width: clamp(1.1rem,7vw,5rem);
	background: none;
    border: unset;
	cursor: pointer;
}

.lightbox-slider:not(:has(.group-item:nth-child(2))) .slide-nav-btn {
	display: none;
}

.slide-nav-btn svg {
	height: clamp(0.8rem,4vw,3.2rem);
	width: clamp(0.4rem,2vw,1.6rem);
}

.prev-slide {
	right: 100%;
	text-align: left;
}

.next-slide {
	left: 100%;
	text-align: right;
}

.before-after-labels {
	display: grid;
	grid-template-columns: 50% 50%;
}

.before-after-labels .op-txt {
	font-size: clamp(0.5rem,1.2vw,1rem);
	justify-self: center;
}

.slide-info {
	padding: 0.5rem 1.5rem 0 0;
	border-top: 1px solid #ACBCD4;
}

.slide-info .post {
	grid-column: 2;
}
.slide-info .doc-cat {
	font-size: clamp(0.5rem,1.2vw,1rem);
}

.slide-info .doc-cat .divider {
	padding: 0 0.5em;
	color: #ACBCD4;
}

.slide-info .slide-excerpt {
	font-size: clamp(0.5rem, 1.2vw, 0.9rem);
	margin: 0.5em 0 clamp(-1em, 8rem - 10vw, 0rem);
}

.slide-info .count {
	position: absolute;
	inset: auto 1.6em 1em auto;
	font-size: clamp(0.4rem,1vw,0.8rem);
	width: 2.4em;
	height: 1.6em;
	text-align: center;
}

.slide-info .count strong::before {
	content: attr(data-current);
}

.slide-info .count svg {
	position: absolute;
	inset: -1.35em 0 0 -0.4em;
	width: 3.6em;
	height: 3.6em;
	max-width: unset;
}

/* Single Category Galleries */
.fm-gallery.is-single::before,
.fm-gallery.is-single :is(.filter-header, summary) {
    display: none;
}

.fm-gallery.is-single .gallery-trigger[open] .fm-gallery-cat {
    width: 100%;
}

/* Desktop */
@media only screen and (min-width: 68.5em) {
	.fm-gallery {
		display: grid !important;
		grid-template-columns: [sidebar] 30% [content] 1fr;
		grid-template-rows: max-content;
		grid-auto-rows: max-content;
		height: 40rem;
		max-height: 100dvh;
		overflow: auto;
		background: #365380;
	}

	.gallery-trigger {
		grid-column: sidebar;
	}

	.gallery-trigger summary::before {
		transform: rotate(-90deg);
	}

	.gallery-trigger[open] summary::before {
		transform: rotate(-90deg) translateY(0.8rem);
	}

	.gallery-trigger[open] .fm-gallery-cat {
		position: absolute;
		inset: 0 0 0 auto;
		width: 70%;
	}

	.fm-gallery-cat {
		min-height: max-content;
		height: 100%;
	}

	.close-group:hover {
		background: #c43232;
	}
}