/* Storgaard Slider */
.sgs {
	--sgs-speed: 700ms;
	position: relative;
	width: 100%;
	height: var(--sgs-h, 600px);
	overflow: hidden;
	background: #111;
	color: var(--sgs-text, #fff);
	isolation: isolate;
}
.sgs--content { max-width: var(--sgs-max, 1140px); margin-left: auto; margin-right: auto; }
/* Full width breaks out of the theme's content column. --sgs-vw is the viewport width
   without scrollbar (set by slider.js); 100vw is the fallback. */
.sgs--full {
	width: var(--sgs-vw, 100vw);
	max-width: none;
	margin-left: calc(50% - var(--sgs-vw, 100vw) / 2);
	margin-right: calc(50% - var(--sgs-vw, 100vw) / 2);
}
.sgs--fullscreen { height: 100vh; height: 100svh; }

@media (max-width: 767px) {
	.sgs { height: var(--sgs-h-m, 400px); }
	.sgs--fullscreen { height: 100vh; height: 100svh; }
}

.sgs .sgs__track { position: absolute; inset: 0; }

.sgs .sgs__slide {
	position: absolute;
	inset: 0;
	visibility: hidden;
	opacity: 0;
	z-index: 0;
}
.sgs .sgs__slide.is-active { visibility: visible; opacity: 1; z-index: 1; }

/* Fade */
.sgs--fade .sgs__slide { transition: opacity var(--sgs-speed) ease, visibility 0s linear var(--sgs-speed); }
.sgs--fade .sgs__slide.is-active { transition: opacity var(--sgs-speed) ease, visibility 0s; }

/* Slide: JS sets the start position, CSS animates. */
.sgs--slide .sgs__slide { opacity: 1; }
.sgs--slide .sgs__slide.is-moving { visibility: visible; transition: transform var(--sgs-speed) cubic-bezier(.65, 0, .35, 1); }

.sgs .sgs__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
	border: 0;
	border-radius: 0;
}
.sgs--focus-top .sgs__img { object-position: center top; }
.sgs--focus-bottom .sgs__img { object-position: center bottom; }

/* Background video: covers the slide like object-fit: cover. */
.sgs .sgs__video {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	pointer-events: none;
	container-type: size;
}
.sgs .sgs__video iframe,
.sgs .sgs__video video {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100cqw, 177.78cqh);
	height: max(100cqh, 56.25cqw);
	max-width: none;
	margin: 0;
	border: 0;
	transform: translate(-50%, -50%);
	opacity: 0;
	transition: opacity .8s ease;
}
.sgs .sgs__video.is-ready iframe,
.sgs .sgs__video.is-ready video { opacity: 1; }

/* Text layer */
.sgs .sgs__content {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	padding: 48px 72px;
	box-sizing: border-box;
}
.sgs--text-center .sgs__content { justify-content: center; text-align: center; }
.sgs--text-left .sgs__content { justify-content: flex-start; text-align: left; }
.sgs--text-right .sgs__content { justify-content: flex-end; text-align: left; }

.sgs .sgs__inner { max-width: 640px; }

.sgs--style-overlay .sgs__content { background: rgba(0, 0, 0, var(--sgs-overlay, .35)); }
.sgs--style-overlay.sgs--text-left .sgs__content { background: linear-gradient(90deg, rgba(0, 0, 0, calc(var(--sgs-overlay, .35) * 1.6)) 0%, rgba(0, 0, 0, 0) 75%); }
.sgs--style-overlay.sgs--text-right .sgs__content { background: linear-gradient(270deg, rgba(0, 0, 0, calc(var(--sgs-overlay, .35) * 1.6)) 0%, rgba(0, 0, 0, 0) 75%); }
.sgs--style-box .sgs__inner { background: rgba(0, 0, 0, var(--sgs-overlay, .35)); padding: 32px 36px; }
.sgs--style-none .sgs__inner { text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }

.sgs .sgs__heading {
	margin: 0 0 .4em;
	color: inherit;
	font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3.25rem);
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -.01em;
	text-transform: none;
}
.sgs .sgs__text {
	margin: 0 0 1.4em;
	color: inherit;
	font-size: clamp(1rem, .9rem + .4vw, 1.25rem);
	line-height: 1.5;
}
.sgs .sgs__inner > :last-child { margin-bottom: 0; }

.sgs .sgs__btn {
	display: inline-block;
	padding: .85em 1.8em;
	background: var(--sgs-btn-bg, #fff);
	color: var(--sgs-btn-text, #111);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	text-shadow: none;
	border: 0;
	border-radius: 3px;
	transition: filter .2s ease, transform .2s ease;
}
.sgs .sgs__btn:hover { filter: brightness(.92); color: var(--sgs-btn-text, #111); }
.sgs .sgs__btn:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

/* Controls */
.sgs .sgs__arrow,
.sgs .sgs__pause,
.sgs .sgs__dot {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	cursor: pointer;
	font: inherit;
	line-height: 1;
	box-shadow: none;
	min-width: 0;
	min-height: 0;
	text-transform: none;
	letter-spacing: 0;
}
.sgs .sgs__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	color: #fff;
	transition: background .2s ease;
}
.sgs .sgs__arrow:hover { background: rgba(0, 0, 0, .6); }
.sgs__arrow--prev { left: 16px; }
.sgs__arrow--next { right: 16px; }
.sgs .sgs__arrow span {
	display: block;
	width: 12px;
	height: 12px;
	margin: 0 auto;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}
.sgs__arrow--prev span { transform: translateX(2px) rotate(-135deg); }
.sgs__arrow--next span { transform: translateX(-2px) rotate(45deg); }

.sgs .sgs__bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}
.sgs .sgs__dots { display: flex; gap: 2px; }
.sgs .sgs__dot {
	width: 24px;
	height: 24px;
	background: transparent;
	position: relative;
}
.sgs .sgs__dot::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
	transition: transform .2s ease, background .2s ease;
}
.sgs .sgs__dot.is-active::before { background: #fff; transform: scale(1.3); }

.sgs .sgs__pause {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	color: #fff;
}
.sgs .sgs__pause span {
	display: block;
	width: 8px;
	height: 10px;
	margin: 0 auto;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
	box-sizing: border-box;
}
.sgs.is-paused .sgs__pause span {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 5px 0 5px 9px;
	border-color: transparent transparent transparent currentColor;
	margin-left: 10px;
}

.sgs .sgs__arrow:focus-visible,
.sgs .sgs__pause:focus-visible,
.sgs .sgs__dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 767px) {
	.sgs .sgs__content { padding: 32px 24px 56px; }
	.sgs--text-left .sgs__content,
	.sgs--text-right .sgs__content { justify-content: center; text-align: center; }
	.sgs--style-overlay.sgs--text-left .sgs__content,
	.sgs--style-overlay.sgs--text-right .sgs__content { background: rgba(0, 0, 0, var(--sgs-overlay, .35)); }
	.sgs--style-box .sgs__inner { padding: 20px 22px; }
	.sgs .sgs__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.sgs { --sgs-speed: 1ms; }
}
