.gallery-center {
	min-width: 0;
}

.gallery-heading {
	padding: 8px 0 15px;
}

.gallery-heading h1 {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: 29px;
	line-height: 1.25;
}

.gallery-heading h1 span {
	font-size: 22px;
}

.gallery-heading p {
	margin: 10px 0 0;
	color: #786b61;
	font-size: 13px;
}

[data-theme="dark"] .gallery-heading p {
	color: var(--home-muted);
}

.gallery-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 58px;
	margin-bottom: 14px;
}

.gallery-filters {
	display: flex;
	align-items: center;
	gap: 9px;
}

.gallery-filters button {
	min-height: 34px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	color: var(--home-text);
	font-size: 12px;
	font-weight: 500;
}

.gallery-filters button:hover,
.gallery-filters button.is-active {
	border-color: var(--home-orange);
	background: var(--home-orange);
	color: #fff;
}

.gallery-tools {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gallery-sort {
	display: flex;
	align-items: center;
	height: 36px;
	padding: 0 8px 0 11px;
	border: 1px solid var(--home-line);
	border-radius: 8px;
	background: var(--home-card);
	color: var(--home-orange);
}

.gallery-sort .dashicons {
	width: 15px;
	height: 15px;
	font-size: 15px;
}

.gallery-sort select {
	max-width: 92px;
	padding: 0 2px 0 5px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--home-orange);
	font-size: 10px;
}

.gallery-view-switch {
	display: flex;
	gap: 5px;
}

.gallery-view-switch button {
	width: 36px;
	height: 36px;
	min-height: 36px;
	padding: 0;
	border: 1px solid var(--home-line);
	border-radius: 8px;
	background: var(--home-card);
	color: var(--home-muted);
}

.gallery-view-switch button:hover,
.gallery-view-switch button.is-active {
	border-color: var(--home-orange);
	background: var(--home-orange);
	color: #fff;
}

.gallery-view-switch .dashicons {
	width: 17px;
	height: 17px;
	font-size: 17px;
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px 18px;
}

.gallery-card {
	min-width: 0;
}

.gallery-card__open {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	height: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 9px;
	background: #eee1d3;
	box-shadow: var(--home-shadow);
	color: #fff;
}

.gallery-card__open:hover {
	background: #eee1d3;
	color: #fff;
}

.gallery-card__open img {
	width: 100%;
	aspect-ratio: 5 / 3;
	transition: transform 0.4s ease, filter 0.3s ease;
}

.gallery-card__zoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgb(31 24 20 / 44%);
	opacity: 0;
	flex-direction: column;
	transition: opacity 0.25s ease;
}

.gallery-card__zoom .dashicons {
	width: 28px;
	height: 28px;
	font-size: 28px;
}

.gallery-card__zoom b {
	margin-top: 4px;
	font-size: 11px;
}

.gallery-card__open:hover img,
.gallery-card__open:focus-visible img {
	transform: scale(1.035);
	filter: saturate(0.9);
}

.gallery-card__open:hover .gallery-card__zoom,
.gallery-card__open:focus-visible .gallery-card__zoom {
	opacity: 1;
}

.gallery-card__content {
	padding: 10px 7px 0;
}

.gallery-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: space-between;
}

.gallery-card__title h2 {
	overflow: hidden;
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gallery-label {
	padding: 2px 7px;
	border-radius: 999px;
	background: #fff2df;
	color: #e89a4e;
	font-size: 8px;
	white-space: nowrap;
}

.gallery-label--life { background: #eef4e9; color: #7d9f6b; }
.gallery-label--illustration { background: #f0edff; color: #8975cc; }
.gallery-label--wallpaper { background: #e9f3fa; color: #5d9bb8; }

.gallery-card__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 8px;
	color: var(--home-muted);
	font-size: 9px;
}

.gallery-card__meta span {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.gallery-card__meta .dashicons {
	width: 13px;
	height: 13px;
	font-size: 13px;
}

.gallery-grid.is-list-view {
	grid-template-columns: 1fr;
}

.is-list-view .gallery-card {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	padding: 10px;
	border: 1px solid var(--home-line);
	border-radius: 11px;
	background: var(--home-card);
	box-shadow: var(--home-shadow);
}

.is-list-view .gallery-card__content {
	padding: 8px 12px 8px 0;
}

.is-list-view .gallery-card__title h2 {
	font-size: 16px;
}

.is-list-view .gallery-card__meta {
	margin-top: 18px;
}

.gallery-empty {
	padding: 50px 20px;
	margin: 0;
	border: 1px dashed var(--home-line);
	border-radius: var(--home-radius);
	color: var(--home-muted);
	text-align: center;
}

.gallery-closing {
	margin: 24px 0 0;
	color: var(--home-muted);
	font-family: Georgia, "Noto Serif SC", serif;
	font-size: 13px;
	text-align: center;
}

.gallery-closing span {
	color: var(--home-orange);
}

body.has-gallery-lightbox {
	overflow: hidden;
}

.gallery-lightbox {
	width: min(92vw, 1180px);
	max-width: none;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.gallery-lightbox::backdrop {
	background: rgb(24 18 15 / 88%);
	backdrop-filter: blur(7px);
}

.gallery-lightbox__panel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gallery-lightbox figure {
	overflow: hidden;
	width: min(86vw, 1100px);
	margin: 0;
	border-radius: 13px;
	background: #161311;
	box-shadow: 0 25px 80px rgb(0 0 0 / 42%);
}

.gallery-lightbox figure img {
	width: 100%;
	max-height: 78vh;
	object-fit: contain;
}

.gallery-lightbox figcaption {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 13px 17px;
	color: #fff;
}

.gallery-lightbox figcaption strong {
	font-size: 14px;
}

.gallery-lightbox figcaption span {
	color: #bcb2ab;
	font-size: 11px;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 25%);
	background: rgb(20 16 14 / 72%);
	color: #fff;
	backdrop-filter: blur(5px);
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
	background: var(--home-orange);
	color: #fff;
}

.gallery-lightbox__close {
	top: -48px;
	right: 0;
	width: 40px;
	height: 40px;
	min-height: 40px;
	border-radius: 50%;
}

.gallery-lightbox__close .dashicons {
	width: 23px;
	height: 23px;
	font-size: 23px;
}

.gallery-lightbox__nav {
	top: 50%;
	width: 45px;
	height: 45px;
	min-height: 45px;
	border-radius: 50%;
	transform: translateY(-50%);
}

.gallery-lightbox__prev {
	left: -58px;
}

.gallery-lightbox__next {
	right: -58px;
}

@media (max-width: 1199px) {
	.gallery-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gallery-toolbar {
		align-items: flex-start;
		flex-direction: column;
	}

	.gallery-tools {
		align-self: flex-end;
		margin-top: -50px;
	}
}

@media (max-width: 680px) {
	.gallery-heading {
		padding-top: 12px;
	}

	.gallery-heading h1 {
		font-size: 26px;
	}

	.gallery-toolbar {
		align-items: stretch;
		gap: 12px;
	}

	.gallery-filters {
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.gallery-filters::-webkit-scrollbar {
		display: none;
	}

	.gallery-filters button {
		white-space: nowrap;
	}

	.gallery-tools {
		align-self: stretch;
		justify-content: space-between;
		margin-top: 0;
	}

	.gallery-grid {
		grid-template-columns: 1fr;
	}

	.is-list-view .gallery-card {
		grid-template-columns: 120px minmax(0, 1fr);
		gap: 12px;
	}

	.is-list-view .gallery-card__content {
		padding-right: 4px;
	}

	.is-list-view .gallery-card__title {
		align-items: flex-start;
		flex-direction: column;
	}

	.is-list-view .gallery-card__title h2 {
		font-size: 13px;
	}

	.is-list-view .gallery-card__meta {
		gap: 7px;
		margin-top: 10px;
	}

	.gallery-lightbox {
		width: 96vw;
	}

	.gallery-lightbox figure {
		width: 92vw;
	}

	.gallery-lightbox__nav {
		top: auto;
		bottom: -58px;
		transform: none;
	}

	.gallery-lightbox__prev {
		left: calc(50% - 54px);
	}

	.gallery-lightbox__next {
		right: calc(50% - 54px);
	}

	.gallery-lightbox__close {
		top: -50px;
		right: 2vw;
	}

	.gallery-lightbox figcaption {
		align-items: flex-start;
		flex-direction: column;
		gap: 2px;
	}
}
