.bgl-gallery {
	width: 100%;
}

.bgl-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	width: 100%;
}

.bgl-item {
	position: relative;
	display: block;
	width: 100%;
	height: 260px;
	padding: 0;
	margin: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: none !important;
	background: #eee;
	user-select: none;
}

.bgl-item:focus,
.bgl-item:focus-visible,
.bgl-item:active,
.bgl-item:hover {
	border: none !important;
	outline: none !important;
	outline-offset: 0 !important;
	box-shadow: none !important;
}

.bgl-img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block;
	transition: transform 0.35s ease;
}

.bgl-zoom-yes .bgl-item:hover .bgl-img {
	transform: scale(1.08);
}

/* Mørkt overlay ved hover */
.bgl-overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.bgl-item:hover .bgl-overlay,
.bgl-item:focus-visible .bgl-overlay {
	opacity: 1;
}

/* Forstørrelsesglas-ikon: rød cirkel der følger musen, ligesom i Ydelser-pluginet */
.bgl-zoom-icon {
	position: absolute;
	top: 0;
	left: 0;
	width: 42px;
	height: 42px;
	margin-top: -21px;
	margin-left: -21px;
	border-radius: 50%;
	background-color: #E8493C;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	will-change: transform;
	z-index: 2;
}

.bgl-zoom-icon svg {
	width: 55%;
	height: 55%;
	stroke: #fff;
}

.bgl-zoom-icon i {
	font-size: 21px;
	line-height: 1;
}

.bgl-item:hover .bgl-zoom-icon,
.bgl-item:focus-visible .bgl-zoom-icon {
	opacity: 1;
}

/* Masonry-layout: naturlige billedhøjder i stedet for ensartede rækker */
.bgl-layout-masonry .bgl-grid {
	display: block;
	column-count: var(--bgl-columns, 3);
	column-gap: var(--bgl-gap, 16px);
}

.bgl-layout-masonry .bgl-item {
	display: inline-block;
	width: 100%;
	height: auto !important;
	margin-bottom: var(--bgl-gap, 16px);
	break-inside: avoid;
}

.bgl-layout-masonry .bgl-img {
	height: auto !important;
	object-fit: unset !important;
}

@media (max-width: 767px) {
	.bgl-layout-masonry .bgl-grid {
		column-count: 1 !important;
	}
}

/* Bricks-layout: mosaik med blandede felt-størrelser */
.bgl-layout-bricks .bgl-grid {
	display: grid;
	grid-auto-flow: dense;
	grid-auto-rows: var(--bgl-item-height, 260px);
}

.bgl-layout-bricks .bgl-item {
	height: 100% !important;
}

.bgl-layout-bricks .bgl-item:nth-child(5n+1) {
	grid-column: span 2;
	grid-row: span 2;
}

.bgl-layout-bricks .bgl-item:nth-child(7n+3) {
	grid-row: span 2;
}

@media (max-width: 767px) {
	.bgl-layout-bricks .bgl-grid {
		grid-template-columns: 1fr !important;
	}

	.bgl-layout-bricks .bgl-item:nth-child(5n+1),
	.bgl-layout-bricks .bgl-item:nth-child(7n+3) {
		grid-column: span 1;
		grid-row: span 1;
	}
}

/* Karrusel-layout: en enkelt række med uendelig løkke-navigation */
.bgl-carousel {
	position: relative;
	width: 100%;
}

.bgl-layout-carousel .bgl-track-wrapper {
	overflow: hidden !important;
	width: 100%;
}

.bgl-layout-carousel .bgl-grid {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: var(--bgl-gap, 16px);
	transition: transform 0.4s ease;
}

.bgl-layout-carousel .bgl-item {
	flex: 0 0 calc((100% - (var(--bgl-columns, 3) - 1) * var(--bgl-gap, 16px)) / var(--bgl-columns, 3)) !important;
	width: auto !important;
}

.bgl-carousel-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background-color: #E8493C;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
}

.bgl-carousel-nav svg {
	stroke: #fff;
}

.bgl-carousel-nav:hover {
	filter: brightness(0.92);
}

.bgl-nav-prev {
	left: -20px;
}

.bgl-nav-next {
	right: -20px;
}

@media (max-width: 767px) {
	.bgl-layout-carousel .bgl-item {
		flex-basis: 100%;
	}

	.bgl-nav-prev {
		left: 4px;
	}

	.bgl-nav-next {
		right: 4px;
	}
}

/* Lightbox */
.bgl-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.9);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bgl-lightbox.bgl-lightbox-open {
	display: flex;
	opacity: 1;
}

.bgl-lightbox-img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.bgl-lightbox-close {
	position: absolute;
	top: 24px;
	right: 24px;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bgl-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.bgl-lightbox-nav:hover {
	background: rgba(255, 255, 255, 0.25);
}

.bgl-lightbox-prev {
	left: 24px;
}

.bgl-lightbox-next {
	right: 24px;
}

@media (max-width: 767px) {
	.bgl-grid {
		grid-template-columns: 1fr !important;
	}

	.bgl-lightbox-nav {
		width: 40px;
		height: 40px;
	}

	.bgl-lightbox-prev {
		left: 8px;
	}

	.bgl-lightbox-next {
		right: 8px;
	}
}
