/* mini-gallery (home page) */
html {
	--gallery-template-row-count-user: 2;
	--gallery-template-item-width: 90px;
}
.lt2 {
	--gallery-template-item-width: 80px;
	--gallery-template-item-maxwidth: 200px;
}
.gallery_thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill,var(--gallery-template-item-width));
	grid-template-rows: repeat(var(--gallery-template-row-count-user), auto);
	justify-content: space-between;
	grid-auto-rows: 0;
	overflow: hidden;
	margin: 0;
	margin-top: -5px;
	direction:rtl;
	column-gap: var(--lt-padding-quarter);
	width: 100%;
}
.profilepage .gallery_thumbs {
	grid-template-columns: repeat(auto-fill,var(--gallery-template-item-width));
}
.lt2_rtl .gallery_thumbs {
	direction: initial;
}
.sidebar_content .gallery_thumbs {
	--gallery-template-item-width: 65px !important;

}


.gallery_thumbs > * {
	margin-top: 5px;
	justify-self: center;
}
.gallery_img {
	border-radius: var(--lt-border-radius-covers);
	border: 3px solid var(--lt-border-color);
	height: var(--gallery-template-item-width);
	width: var(--gallery-template-item-width);
}

.gallery_img.gallery_numlink {
	font-size: 15px;
	font-weight: 700;
	align-items: center;
	display: flex;
	justify-content: center;
	direction: initial;
	flex-wrap: wrap;
	flex-flow: column;
}
.gallery_numlink_num {
	margin-top: 9px;
	color: var(--lt-background-color);
	z-index: 2;
}
.gallery_numlink_len3 {
	font-size: 80%;
}
.gallery_numlink_len4 {
	font-size: 60%;
}
.gallery_numlink > i {
	float: left;
	font-size: 30px;
	position: absolute;
}

.gallery_img.selected {
	border-color: var(--lt-red-color);
	border-width: 5px;
}
a .gallery_img:hover {
	border-color: var(--lt-link-hover-color);
}

.gallery_footer_actions {
	display:flex;
	justify-content: space-between;
	margin-top: var(--lt-padding-quarter);
	align-items: center;
}
.gallery_footer_actions .ui_jump_link {
	margin-top:0.2em;
}


/* gallery page */
body.gallery #gallery {
	min-height: 100px;
}
.gallery_grid {
	--gallery-grid-item-max-width: 200px;

	display: flex;
	flex-wrap: wrap;
	gap: var(--lt-padding-half);
	row-gap: var(--lt-padding);
	justify-content: space-between;
	align-items: stretch;
}
.gg_item {
	width: var(--gallery-grid-item-max-width);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--lt-padding-quarter);
	row-gap: 0;
	xborder: 1px solid var(--lt-border-color);

	border-radius: var(--lt-border-radius);
	background: var(--lt-sidebar-tan);
	padding:var(--lt-padding-quarter) 0;
	justify-content: space-between;

	overflow: hidden;

	justify-content: space-between;
}
.gg_imagebox {
	xheight: var(--gallery-grid-item-max-width);
	xwidth: var(--gallery-grid-item-max-width);
	background: var(--lt-sidebar-tan);
	border-radius: var(--lt-border-radius-covers);
	display: flex;
	justify-content: center;
	align-items: center;
	border: var(--lt-border);

	border:none;
	xbackground: none;

	flex-grow: 1;
}
.gg_imagebox img {
	xmax-width: var(--gallery-grid-item-max-width);
	xmax-width: calc(var(--gallery-grid-item-max-width) - 50px);
	max-width:unset;
}
.gg_text {

}
.gallery .gg_text {
	text-align: center;
	padding:var(--lt-padding-half);
	padding-bottom: 0;
}
.gg_text a {
	line-break: anywhere;
}
.gg_text .editchrome {
	margin-top: var(--lt-padding-half);
	margin-bottom: var(--lt-padding);
}
body.pic .gg_text .description {
	margin-bottom: var(--lt-padding);
	margin-top: var(--lt-padding);
}
.gallery_pic img {
	max-width: 100%;
}
.overdiv {
	xmargin-top: var(--lt-padding-quarter-neg);
}

/* for gravity selection on author gallery pages */
#pics_gravity {
	padding: var(--lt-padding-half) 0;
}

#pics_gravity img.pic.selected {
	box-shadow: 0 0 0 4px var(--lt-red-light-color);
}
#pics_gravity .note {
	padding-top: var(--lt-padding-quarter);
	flex-basis: 100%;
}


@media (max-width: 900px) {
	.gallery_grid {
		--gallery-grid-item-max-width: calc(calc(33vw - calc(var(--lt-padding-quarter) * 2)) - 20px);

		gap: var(--lt-padding-quarter);
		row-gap: var(--lt-padding-quarter);
	}

}