/* ============================================================
   Splide sliders — generic base + hero variant
   Loaded via the sas_theme/splide-init library, which templates
   attach with {{ attach_library('sas_theme/splide-init') }}.
   Only loads on pages that actually contain a slider.
   ============================================================ */

/* ------------------------------------------------------------
   1. GENERIC — applies to every slider on the site
   ------------------------------------------------------------ */

/* Images fill their slide and never overflow */
.js-splide .splide__slide img {
	display: block;
	width: 100%;
	height: auto;
}

/* Before JS runs, show only the first slide — kills the "flash of all slides" */
.js-splide:not(.is-initialized):not(.is-single-slide) .splide__list {
	display: block;
}
.js-splide:not(.is-initialized):not(.is-single-slide) .splide__slide:not(:first-child) {
	display: none;
}


/* ------------------------------------------------------------
   2. HERO — full-width image with overlaid title + text
      Pairs with views-view-fields--MACHINE-NAME.html.twig
   ------------------------------------------------------------ */

.slider-hero .splide__slide {
	position: relative;
}

.slajd {
	display: grid;
	grid-template-rows: auto 1fr;   /* row 1: image, row 2: band takes all remaining height */
	height: 100%;
}
/* Media and body occupy the SAME grid cell — the image sits under the text
   without position:absolute, so the image alone decides the height. */
.slajd__media,
.slajd__body {
	min-width: 0;                 /* stops long words forcing the grid wider */
}
/* mobile: two rows — full image, text band below */
.slajd__media { grid-area: 1 / 1; }
.slajd__body  { grid-area: 2 / 1; }

/* --- the image ---------------------------------------------- */

.slajd__media {
	overflow: hidden;
	aspect-ratio: 2560 / 1067;
}





/* --- the text ----------------------------------------------- */

.slajd__body {
	position: relative;
	display: flex;
	align-items: flex-start;   /* was flex-end — text now starts at the top of the band */
	color: #fff;
	background: var(--darkgreen, #14312a);
}

.slajd__inner {
	position: relative;           /* above the scrim */
	z-index: 1;
	width: 100%;
	max-width: 34rem;
	padding: 2rem 1.5rem 3rem;
}

.slajd__title {
	margin: 0 0 .75rem;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.slajd__text {
	font-size: clamp(.9375rem, 1.6vw, 1.125rem);
	line-height: 1.6;
	max-width: 46ch;
}

.slajd__text p:last-child {
	margin-bottom: 0;
}

/* Links inside the long-text field — e.g. a "Join Us" style button */
.slajd__text a {
	display: inline-block;
	margin-top: 1.25rem;
	padding: .6rem 1.5rem;
	border: 2px solid #fff;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}

.slajd__text a:hover,
.slajd__text a:focus-visible {
	background: #fff;
	color: var(--darkgreen, #14312a);
}

/* --- tablet ------------------------------------------------- */

@media (min-width: 768px) {
	/* from here up: text back over the image */
	.slajd__media,
	.slajd__body {
		grid-area: 1 / 1;
	}
	.slajd {
		grid-template-rows: none;
		height: auto;
	}
	.slajd__body {
		background: none;
		 
	}

	.slajd__body::before {
		content: "";
		position: absolute;
		inset: 0;
		pointer-events: none;
		background: linear-gradient(
			to right,
			rgba(0, 0, 0, .75) 0%,
			rgba(0, 0, 0, .5) 40%,
			rgba(0, 0, 0, 0) 75%
		);
	}
	.slajd__title {
	font-size: clamp(1.75rem, 6vw, 4rem);
	}
	.slajd__inner {
		max-width: 80rem;
		padding: 1.75rem 3.5rem;
	}
}

/* --- desktop ------------------------------------------------ */

@media (min-width: 1025px) {
	.slajd__inner {
		max-width: 60rem;
		padding: 4rem 6rem 4rem 8rem;
	}
}

@media (min-width: 1200px) {
	 
	.slajd__body {
		background: none;
		align-items: center;
	}
	.slajd__inner {
		max-width: 900px;
		padding: 4rem 8rem 4rem 8rem;
	}
}

/* --- controls ----------------------------------------------- */

.splide__arrows {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.slider-hero .splide__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4.5rem;
	height: 4.5rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	border: 2px solid #4a8f2e;
	transition: background-color .2s, box-shadow .2s;
	cursor: pointer;
	pointer-events: auto;
	opacity: 1;
}

.slider-hero .splide__arrow--prev { left: 1.5rem; }
.slider-hero .splide__arrow--next { right: 1.5rem; }

.slider-hero .splide__arrow svg {
	width: 3rem;
	height: 3rem;
	fill: none;
}

/* Two subpaths (shaft + chevron), so stroke rather than fill */
.slider-hero .splide__arrow svg path {
	fill: none;
	stroke: #6cc04a;
	stroke-width: 4;
	stroke-linecap: butt;
	stroke-linejoin: miter;
}

.slider-hero .splide__arrow:hover:not(:disabled),
.slider-hero .splide__arrow:focus-visible {
	background: #4a8f2e;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

.slider-hero .splide__arrow:hover:not(:disabled) svg path,
.slider-hero .splide__arrow:focus-visible svg path {
	stroke: #fff;
}

/* splide-core.min.css omits the prev-arrow flip the full theme has */
.slider-hero .splide__arrow--prev svg {
	transform: scaleX(-1);
}

.slider-hero .splide__pagination {
	position: absolute;
	bottom: 1.25rem;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: .625rem;
	margin: 0;
	padding: 0;
	list-style: none;
	z-index: 2;
}

.slider-hero .splide__pagination li {
	display: flex;
	line-height: 0;
}

/* Square white marker with a green edge — same language as the arrows */
.slider-hero .splide__pagination__page {
	width: 1rem;
	height: 1rem;
	margin: 0;
	padding: 0;
	border: 2px solid #4a8f2e;
	border-radius: 0;
	background: #fff;
	opacity: 1;
	cursor: pointer;
	transition: background-color .2s, width .2s;
}

.slider-hero .splide__pagination__page:hover:not(.is-active) {
	background: rgba(74, 143, 46, .35);
}

.slider-hero .splide__pagination__page.is-active {
	width: 2.75rem;
	background: #4a8f2e;
	transform: none;
}

/* Keyboard focus must stay visible against a photo */
.slider-hero .splide__arrow:focus-visible,
.slider-hero .splide__pagination__page:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}



.region-content .splide.slider-glowna li {
	padding: 0 !important;
}


/* === mobile hero fixes === */
/* Views wraps the image in .views-field > .field-content, and those have
   auto height — so the img's height:100% had nothing to resolve against. */
.slider-hero .slajd__media,
.slider-hero .slajd__media > *,
.slider-hero .slajd__media > * > * {
	height: 100%;
}

@media (max-width: 1024px) {
	/* No room for arrows next to the text — swipe and the markers cover it */
	.slider-hero .splide__arrows {
		display: none;
	}

	.slajd__inner {
		padding: 1.5rem 1.25rem 1.75rem 1.25rem;
	}

	.slajd__title {
		font-size: clamp(1.5rem, 6.5vw, 2.25rem);
	}

	.slajd__text {
		font-size: .9375rem;
	}
}
