/**
 * mod_jf_slideshow 2.0.0 — site styles
 * Static rules; per-instance colors/sizes come as CSS variables via inline style.
 */

.jf-slideshow {
	position: relative;
	overflow: hidden;
}

.jf-slideshow .carousel-control-next,
.jf-slideshow .carousel-control-prev,
.jf-slideshow .carousel-indicators {
	z-index: 3;
}

/* =====================================================================
   Arrows — three styles (minimal | circle | box), three sizes, colors
   via --jf-arr-bg / --jf-arr-color, corner choice via radius class.
   ===================================================================== */

.jf-slideshow {
	--jf-arr-size: 46px;
	--jf-arr-bg: rgba(10, 16, 28, 0.4);
	--jf-arr-color: #ffffff;
}

.jf-slideshow.jf-arr-size--small  { --jf-arr-size: 34px; }
.jf-slideshow.jf-arr-size--large  { --jf-arr-size: 60px; }

.jf-slideshow .carousel-control-prev,
.jf-slideshow .carousel-control-next {
	width: calc(var(--jf-arr-size) + 32px);
}

/* custom chevron icon (mask → colorable) */
.jf-slideshow .carousel-control-prev-icon,
.jf-slideshow .carousel-control-next-icon {
	width: var(--jf-arr-size);
	height: var(--jf-arr-size);
	background-image: none;
	background-color: transparent;
	position: relative;
	transition: background-color 160ms ease-out, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}

.jf-slideshow .carousel-control-prev-icon::after,
.jf-slideshow .carousel-control-next-icon::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--jf-arr-color);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z' fill='%23000'/%3E%3C/svg%3E") center / 46% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z' fill='%23000'/%3E%3C/svg%3E") center / 46% no-repeat;
}

.jf-slideshow .carousel-control-next-icon::after {
	transform: scaleX(-1);
}

/* circle + box: filled control surface */
.jf-slideshow.jf-arr--circle .carousel-control-prev-icon,
.jf-slideshow.jf-arr--circle .carousel-control-next-icon,
.jf-slideshow.jf-arr--box .carousel-control-prev-icon,
.jf-slideshow.jf-arr--box .carousel-control-next-icon {
	background-color: var(--jf-arr-bg);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.jf-slideshow.jf-arr--circle .carousel-control-prev-icon,
.jf-slideshow.jf-arr--circle .carousel-control-next-icon {
	border-radius: 50%;
}

.jf-slideshow.jf-arr--box.jf-arr-radius--square  .carousel-control-prev-icon,
.jf-slideshow.jf-arr--box.jf-arr-radius--square  .carousel-control-next-icon { border-radius: 0; }
.jf-slideshow.jf-arr--box.jf-arr-radius--rounded .carousel-control-prev-icon,
.jf-slideshow.jf-arr--box.jf-arr-radius--rounded .carousel-control-next-icon { border-radius: 10px; }
.jf-slideshow.jf-arr--box.jf-arr-radius--round   .carousel-control-prev-icon,
.jf-slideshow.jf-arr--box.jf-arr-radius--round   .carousel-control-next-icon { border-radius: 50%; }

@media (hover: hover) and (pointer: fine) {
	.jf-slideshow.jf-arr--circle .carousel-control-prev:hover .carousel-control-prev-icon,
	.jf-slideshow.jf-arr--circle .carousel-control-next:hover .carousel-control-next-icon,
	.jf-slideshow.jf-arr--box .carousel-control-prev:hover .carousel-control-prev-icon,
	.jf-slideshow.jf-arr--box .carousel-control-next:hover .carousel-control-next-icon {
		background-color: color-mix(in srgb, var(--jf-arr-bg) 70%, #000);
		transform: scale(1.06);
	}
}

.jf-slideshow .carousel-control-prev:active .carousel-control-prev-icon,
.jf-slideshow .carousel-control-next:active .carousel-control-next-icon {
	transform: scale(0.94);
}

/* ---------- vertical sliding ---------- */

.jf-slideshow.vertical.carousel .carousel-item {
	overflow: hidden;
}

.jf-slideshow.vertical.carousel .carousel-item-next:not(.carousel-item-start),
.jf-slideshow.vertical.carousel .active.carousel-item-end {
	transform: translateY(100%);
}

.jf-slideshow.vertical.carousel .carousel-item-prev:not(.carousel-item-end),
.jf-slideshow.vertical.carousel .active.carousel-item-start {
	transform: translateY(-100%);
}

/* ---------- effect keyframes ---------- */

@keyframes jfZoom {
	from { transform: scale(1); }
	to   { transform: scale(1.5); }
}

@keyframes JFSfadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* =====================================================================
   Overlay system
   Variables (overridable per instance):
   --jf-ov-bg        box background        (card, lowerthird)
   --jf-ov-text      text color
   --jf-ov-accent    accent (kicker, buttons)
   --jf-ov-maxwidth  box max width         (card, minimal)
   --jf-ov-padding   box padding           (card)
   ===================================================================== */

.jf-slideshow .jf-overlay {
	--jf-ov-accent: var(--primary, #0d6efd);
	--jf-ov-maxwidth: 640px;
	--jf-ov-padding: 35px;
	/* --jf-ov-text is intentionally NOT defaulted here — each template
	   provides a fallback that matches its own background */

	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	pointer-events: none; /* arrows below stay clickable ... */
	padding: clamp(16px, 4vw, 56px);
}

.jf-slideshow .jf-overlay__box {
	pointer-events: auto; /* ... but overlay content is interactive */
	max-width: min(var(--jf-ov-maxwidth), 100%);
}

.jf-slideshow .jf-overlay__image {
	display: block;
	height: auto;
	max-width: 40vw;
	margin-bottom: clamp(10px, 2vw, 24px);
}

.jf-slideshow .jf-overlay__kicker {
	display: inline-block;
	color: var(--jf-ov-accent);
	font-size: clamp(0.75rem, 1.2vw, 0.95rem);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin-bottom: 0.5em;
}

.jf-slideshow .jf-overlay__headline {
	font-size: clamp(1.75rem, 3.5vw, 3.25rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.015em;
	margin: 0 0 0.28em;
	color: inherit;
	text-wrap: balance;
}

.jf-slideshow .jf-overlay__subheadline {
	font-size: clamp(1.1rem, 2vw, 1.75rem);
	font-weight: 300;
	line-height: 1.25;
	margin: 0 0 0.4em;
	color: inherit;
}

.jf-slideshow .jf-overlay__text {
	font-size: clamp(0.95rem, 1.4vw, 1.15rem);
	line-height: 1.55;
	margin: 0;
}

.jf-slideshow .jf-overlay__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: clamp(16px, 3vw, 30px);
}

.jf-slideshow .jf-overlay__buttons .btn {
	background: var(--jf-ov-accent);
	border: 1px solid var(--jf-ov-accent);
	border-radius: 10px;
	padding: 0.6em 1.5em;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms ease-out, filter 160ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
	.jf-slideshow .jf-overlay__buttons .btn:hover {
		transform: translateY(-1px);
		box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
		filter: brightness(1.05);
	}
}

.jf-slideshow .jf-overlay__buttons .btn:active {
	transform: scale(0.97);
}

/* secondary button reads as ghost */
.jf-slideshow .jf-overlay__buttons .btn2 {
	background: transparent;
	border-color: currentColor;
	color: inherit;
}

/* ---------- overlay entrance ---------- */

/* per-slide overlays ride with their slide and ease in shortly after */
.jf-slideshow .carousel-item .jf-overlay .jf-overlay__box {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 550ms cubic-bezier(0.23, 1, 0.32, 1) 180ms, transform 550ms cubic-bezier(0.23, 1, 0.32, 1) 180ms;
}

.jf-slideshow .carousel-item.active .jf-overlay .jf-overlay__box {
	opacity: 1;
	transform: translateY(0);
}

/* global overlay: single gentle entrance on load */
.jf-slideshow > .jf-overlay .jf-overlay__box {
	animation: jfOverlayIn 700ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes jfOverlayIn {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.jf-slideshow .carousel-item .jf-overlay .jf-overlay__box {
		transition: opacity 300ms ease;
		transform: none;
	}
	.jf-slideshow > .jf-overlay .jf-overlay__box {
		animation: none;
	}
}

/* ---------- positioning grid (card, minimal) ---------- */

.jf-overlay--pos-top-left      { align-items: flex-start; justify-content: flex-start; }
.jf-overlay--pos-top-center    { align-items: flex-start; justify-content: center; text-align: center; }
.jf-overlay--pos-top-right     { align-items: flex-start; justify-content: flex-end; }
.jf-overlay--pos-middle-left   { align-items: center;     justify-content: flex-start; }
.jf-overlay--pos-middle-center { align-items: center;     justify-content: center; text-align: center; }
.jf-overlay--pos-middle-right  { align-items: center;     justify-content: flex-end; }
.jf-overlay--pos-bottom-left   { align-items: flex-end;   justify-content: flex-start; }
.jf-overlay--pos-bottom-center { align-items: flex-end;   justify-content: center; text-align: center; }
.jf-overlay--pos-bottom-right  { align-items: flex-end;   justify-content: flex-end; }

/* ---------- template: card (frosted panel) ---------- */

.jf-overlay--card .jf-overlay__box {
	background: var(--jf-ov-bg, rgba(255, 255, 255, 0.85));
	color: var(--jf-ov-text, #1d2633); /* light panel → dark text default */
	-webkit-backdrop-filter: blur(14px) saturate(1.35);
	backdrop-filter: blur(14px) saturate(1.35);
	padding: clamp(22px, 2.6vw, var(--jf-ov-padding));
	border-radius: var(--jf-ov-radius, 12px);
	border: 1px solid rgba(255, 255, 255, 0.4);
}

.jf-overlay--card.jf-overlay--shadow .jf-overlay__box {
	box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08), 0 18px 48px -12px rgba(16, 24, 40, 0.35);
}

/* ---------- template: center (hero text, like legacy text overlay) ---------- */

.jf-overlay--center {
	text-align: center;
}

.jf-overlay--center .jf-overlay__box {
	color: var(--jf-ov-text, #fff);
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
	max-width: min(1100px, 95%); /* hero text needs width — ignore the card cap */
}

.jf-overlay--center .jf-overlay__buttons {
	justify-content: center;
}

/* on photo-hero templates the kicker inherits the light text color —
   the accent color keeps styling the buttons */
.jf-overlay--center .jf-overlay__kicker,
.jf-overlay--minimal .jf-overlay__kicker {
	color: inherit;
	opacity: 0.85;
}

/* filename captions collide with full-width overlay templates — hide them there */
.jf-slideshow:has(.jf-overlay--center) .carousel-caption,
.jf-slideshow:has(.jf-overlay--lowerthird) .carousel-caption {
	display: none !important;
}

.jf-overlay--center .jf-overlay__headline {
	font-size: clamp(2.25rem, 6vw, 5.5rem);
	font-weight: 600;
}

.jf-overlay--center .jf-overlay__subheadline {
	font-size: clamp(1.25rem, 3vw, 2.5rem);
	font-weight: 200;
}

/* ---------- template: lowerthird (gradient bar at the bottom) ---------- */

.jf-slideshow .jf-overlay--lowerthird {
	padding: 0;
	align-items: flex-end;
}

.jf-overlay--lowerthird .jf-overlay__box {
	width: 100%;
	max-width: 100%;
	color: var(--jf-ov-text, #fff); /* dark gradient → light text default */
	padding: clamp(28px, 5vw, 72px) clamp(16px, 5vw, 64px) clamp(16px, 3vw, 40px);
	background: linear-gradient(to top,
		var(--jf-ov-bg, rgba(9, 15, 26, 0.88)) 0%,
		color-mix(in srgb, var(--jf-ov-bg, rgba(9, 15, 26, 0.88)) 55%, transparent) 55%,
		transparent 100%);
}

.jf-overlay--lowerthird .jf-overlay__headline {
	font-size: clamp(1.4rem, 2.8vw, 2.5rem);
}

.jf-overlay--lowerthird .jf-overlay__subheadline {
	font-size: clamp(1rem, 1.8vw, 1.4rem);
}

/* ---------- template: minimal (kicker + headline + accent line) ---------- */

.jf-overlay--minimal .jf-overlay__box {
	border-left: 4px solid var(--jf-ov-accent);
	padding-left: clamp(14px, 2vw, 28px);
	color: var(--jf-ov-text, #fff);
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.jf-overlay--minimal .jf-overlay__headline {
	font-weight: 300;
}

.jf-overlay--minimal .jf-overlay__buttons .btn {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
}

/* ---------- template: split (image + text panel, hero style) ---------- */

.jf-overlay--split .jf-overlay__box {
	text-align: left;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 0 clamp(22px, 3.5vw, 52px);
	align-content: center;
	align-items: start;
	background: var(--jf-ov-bg, rgba(255, 255, 255, 0.94));
	color: var(--jf-ov-text, #1d2633);
	-webkit-backdrop-filter: blur(10px) saturate(1.2);
	backdrop-filter: blur(10px) saturate(1.2);
	border-radius: var(--jf-ov-radius, 12px);
	padding: clamp(20px, 2.6vw, 44px);
	max-width: min(max(var(--jf-ov-maxwidth), 980px), 100%);
	width: 100%;
}

.jf-overlay--split.jf-overlay--shadow .jf-overlay__box {
	box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08), 0 18px 48px -12px rgba(16, 24, 40, 0.32);
}

.jf-overlay--split .jf-overlay__image {
	grid-column: 1;
	grid-row: 1 / span 12;
	align-self: center;
	width: 100% !important;
	height: 100%;
	max-height: 340px;
	object-fit: cover;
	border-radius: 8px;
	margin: 0;
	max-width: none;
}

.jf-overlay--split .jf-overlay__kicker,
.jf-overlay--split .jf-overlay__headline,
.jf-overlay--split .jf-overlay__subheadline,
.jf-overlay--split .jf-overlay__text,
.jf-overlay--split .jf-overlay__buttons {
	grid-column: 2;
}

.jf-overlay--split .jf-overlay__headline {
	font-size: clamp(1.5rem, 2.8vw, 2.6rem);
	margin: 0 0 0.35em;
}

/* calm vertical rhythm inside the text column */
.jf-overlay--split .jf-overlay__kicker { margin-bottom: 0.9em; }
.jf-overlay--split .jf-overlay__subheadline { margin: 0 0 0.5em; }
.jf-overlay--split .jf-overlay__text { margin: 0; max-width: 52ch; }
.jf-overlay--split .jf-overlay__buttons { margin-top: clamp(18px, 2.2vw, 28px); }

/* no image configured: plain single-column panel */
.jf-overlay--split .jf-overlay__box:not(:has(.jf-overlay__image)) {
	display: block;
}

@media (max-width: 860px) {
	.jf-overlay--split .jf-overlay__box {
		display: block;
	}
	.jf-overlay--split .jf-overlay__image {
		max-height: 160px;
		margin-bottom: 14px;
	}
}

/* ---------- mobile behavior ---------- */

@media (max-width: 768px) {
	.jf-overlay--mobile-hide {
		display: none;
	}

	.jf-overlay--mobile-compact .jf-overlay__text,
	.jf-overlay--mobile-compact .jf-overlay__kicker,
	.jf-overlay--mobile-compact .jf-overlay__image {
		display: none;
	}

	.jf-overlay--mobile-compact .jf-overlay__buttons .btn {
		font-size: 0.8rem;
		padding: 0.35rem 0.75rem;
	}

	.jf-slideshow .jf-overlay {
		padding: 12px;
	}

	.jf-overlay--card .jf-overlay__box {
		padding: 18px;
	}
}

/* =====================================================================
   Per-slide advanced captions (single image mode) — ported from v1
   ===================================================================== */

.jf-slideshow .carousel-item__caption {
	position: absolute;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.jf-slideshow .carousel-item__caption_cnt {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

@media (min-width: 576px)  { .jf-slideshow .carousel-item__caption_cnt { max-width: 540px; } }
@media (min-width: 768px)  { .jf-slideshow .carousel-item__caption_cnt { max-width: 720px; } }
@media (min-width: 992px)  { .jf-slideshow .carousel-item__caption_cnt { max-width: 960px; } }
@media (min-width: 1200px) { .jf-slideshow .carousel-item__caption_cnt { max-width: 1140px; } }
@media (min-width: 1400px) { .jf-slideshow .carousel-item__caption_cnt { max-width: 1320px; } }

.jf-slideshow .carousel-item figcaption {
	position: relative;
	background: #fff;
	padding: 35px;
	transition: all ease 0.35s;
	opacity: 0;
}

.jf-slideshow .carousel-item.active figcaption {
	opacity: 1;
}

.jf-slideshow .carousel-item.carousel-item-prev:not(.carousel-item-end) figcaption,
.jf-slideshow .carousel-item.carousel-item-start.active figcaption {
	opacity: 0;
	transition: opacity 1s ease 0s;
}

.jf-slideshow.vertical.carousel .carousel-item-prev:not(.carousel-item-start) figcaption,
.jf-slideshow.vertical.carousel .carousel-item-end.active figcaption {
	opacity: 0;
}

.jf-slideshow .carousel-item figcaption .slides__caption-headline {
	font-size: clamp(2rem, 3.5vw, 4rem);
	line-height: 0.9;
	margin: 0;
	font-weight: 300;
}

.jf-slideshow .carousel-item figcaption .slides__caption-text {
	font-weight: 200;
	font-size: clamp(1rem, 5vw, 1.75rem);
	position: relative;
	left: 5px;
	top: 10px;
}
