/* ------------------------------------------------------------
	Single Gallery Styles

	Single gallery view and lightbox. BEM naming.
------------------------------------------------------------ */

/* Single gallery view */
.st-gallery-single {
	width: 100%;
}

.st-gallery-single__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 1.875rem;
	gap: 1.875rem;
}

.st-gallery-single__title-section {
	flex: 1;
}

.st-gallery-single__title {
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--wp--preset--color--foreground, #1d2327);
	margin: 0 0 1.5rem;
	line-height: 1.2;
}

.st-gallery-single__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin-bottom: 3rem;
}

.st-gallery-single__meta-label {
	font-weight: 600;
	color: var(--wp--preset--color--foreground, #1d2327);
	margin-right: 0.25rem;
}

.st-gallery-single__category,
.st-gallery-single__date,
.st-gallery-single__photographers,
.st-gallery-single__photo-count {
	color: var(--wp--preset--color--foreground, #1d2327);
}

.st-gallery-single__hashtag {
	color: var(--wp--preset--color--primary, #2271b1);
	font-weight: 600;
	font-size: 1rem;
}

.st-gallery-single__controls {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.st-gallery-single__layout-toggle {
	display: flex;
	background: var(--wp--preset--color--neutral-light, #f0f0f1);
	border-radius: 0.25rem;
	padding: 0.25rem;
	gap: 0.125rem;
}

.st-gallery-single__layout-btn {
	padding: 0.5rem 0.75rem;
	border: none;
	background: transparent;
	border-radius: 0.375rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.st-gallery-single__layout-btn:hover {
	background: var(--wp--preset--color--neutral-medium, #e2e3e5);
}

.st-gallery-single__layout-btn--active {
	background: var(--wp--preset--color--primary, #2271b1);
	color: #fff;
}

.st-gallery-single__layout-icon {
	font-size: 1rem;
}

.st-gallery-single__fullscreen-btn {
	padding: 0.625rem;
	border: 2px solid var(--wp--preset--color--neutral, #c3c4c7);
	background: #fff;
	border-radius: 0.25rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.st-gallery-single__fullscreen-btn:hover {
	border-color: var(--wp--preset--color--primary, #2271b1);
	background: var(--wp--preset--color--neutral-light, #f0f0f1);
}

.st-gallery-single__fullscreen-icon {
	font-size: 1rem;
}

.st-gallery-single__description {
	margin-bottom: 2.5rem;
	font-size: 1.1rem;
	line-height: 1.7;
	color: var(--wp--preset--color--foreground, #1d2327);
}

.st-grid--masonry .st-gallery-single__photo-item {
	break-inside: avoid;
	page-break-inside: avoid;
}

/* Fullscreen Gallery */
.st-gallery-single__gallery--fullscreen {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #fff;
	z-index: 9999;
	overflow-y: auto;
	padding: 1.5rem;
	margin: 0;
}

.st-gallery-fullscreen {
	overflow: hidden;
}

.st-gallery-single__photo-item {
	position: relative;
	border-radius: var(--st-gallery-single-corner-radius);
	overflow: hidden;
	cursor: pointer;
	background: var(--wp--preset--color--neutral-light, #f0f0f1);
}

.st-gallery-single__photo-item:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #2271b1);
	outline-offset: 2px;
}

.st-gallery-single__photo-image,
.st-gallery-single__photo-item img {
	width: 100%;
	height: auto;
	display: block;
	vertical-align: middle;
}

.st-grid:not(.st-grid--masonry) .st-gallery-single__photo-item {
	display: flex;
	flex-direction: column;
}

.st-grid:not(.st-grid--masonry) .st-gallery-single__photo-image,
.st-grid:not(.st-grid--masonry) .st-gallery-single__photo-item img {
	object-fit: cover;
	aspect-ratio: 4/3;
}

.st-gallery-single__photo-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
	color: #fff;
	padding: 1.875rem 1.5rem 1rem;
	font-size: 0.875rem;
	line-height: 1.4;
	border-bottom-left-radius: var(--st-gallery-single-corner-radius);
	border-bottom-right-radius: var(--st-gallery-single-corner-radius);
}

.st-gallery-single__photo-overlay {
	position: absolute;
	top: 1rem;
	right: 1rem;
}

.st-gallery-single__photo-expand {
	width: 2.5rem;
	height: 2.5rem;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	backdrop-filter: blur(0.5rem);
}

.st-gallery-single__photo-expand:hover {
	background: #fff;
	transform: scale(1.1);
}

.st-gallery-single__expand-icon {
	font-size: 1rem;
}

.st-gallery-single__layout-btn:focus-visible,
.st-gallery-single__fullscreen-btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary, #2271b1);
	outline-offset: 2px;
}

.st-gallery-single__error {
	text-align: center;
	padding: 2.5rem 1.5rem;
	background: var(--wp--preset--color--warning-bg, #fff3cd);
	border: 1px solid var(--wp--preset--color--warning, #ffc107);
	border-radius: 0.25rem;
	color: var(--wp--preset--color--warning-text, #856404);
	margin: 1.5rem 0;
}

@media (max-width: 48rem) {
	.st-gallery-single {
		padding: 0 1rem;
		--st-gallery-single-gap: 1rem;
	}

	.st-gallery-single__header {
		flex-direction: column;
		gap: 1.5rem;
	}

	.st-gallery-single__title {
		font-size: 2rem;
	}

	.st-gallery-single__meta {
		flex-direction: column;
		gap: 0.625rem;
	}

	.st-gallery-single__controls {
		align-self: center;
	}
}

@media (max-width: 30rem) {
	.st-gallery-single {
		--st-gallery-single-gap: 0.5rem;
	}
}
