/**
 * JF Resource Templates — components that are NOT part of the compiled
 * Bootstrap bundle (jf-templates.min.css).
 *
 * Kept as a separate, hand-written file on purpose: these components don't
 * depend on any Bootstrap variable or mixin, so they don't need the SCSS
 * build step. Edit this file directly — there is no source file to compile.
 *
 *   1. Slider   — the CSS half of [data-jf-slider] in jf-templates.js
 *   2. Clamp    — the "Read more" text truncation
 *   3. Editor notice — the yellow "nothing here yet" box editors see
 *
 * ── About the .swiper-* class names ──────────────────────────────────────
 * No Swiper library is loaded any more; the slider is plain JS + the rules
 * below. The class names stayed because the compiled stylesheet styles the
 * sections through them (arrow colors, slide padding, per-section tweaks).
 * Renaming them would mean re-testing the compiled bundle for no visible gain,
 * so they live on as CSS hooks. Behaviour is always driven by the
 * data-jf-* attributes instead.
 */

/* ==========================================================================
   1. SLIDER
   The track is a horizontally scrolling flex row with scroll snapping, so
   touch swiping and trackpad gestures are handled by the browser. The JS
   only sets --jf-slider-per-view and moves scrollLeft for arrows/autoplay.
   ========================================================================== */

[data-jf-slider] {
	position: relative;
}

/* The scrolling track. */
[data-jf-slider] .swiper-wrapper {
	display: flex;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;

	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;

	/* Hide the scrollbar: the arrows and dots are the controls here. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

[data-jf-slider] .swiper-wrapper::-webkit-scrollbar {
	display: none;
}

/*
 * Each slide takes an equal share of the visible width. --jf-slider-per-view
 * is written by the JS from the data-per-view attribute and updated on
 * resize, which is what makes the slider responsive.
 */
[data-jf-slider] .swiper-slide {
	flex: 0 0 calc(100% / var(--jf-slider-per-view, 1));
	max-width: calc(100% / var(--jf-slider-per-view, 1));
	box-sizing: border-box;
	scroll-snap-align: start;
}

/* Someone who prefers reduced motion gets instant jumps, not smooth scrolls. */
@media (prefers-reduced-motion: reduce) {
	[data-jf-slider] .swiper-wrapper {
		scroll-behavior: auto;
	}
}

/* --------------------------------------------------------------------------
   Arrows.
   Swiper's stylesheet used to supply the base positioning and the arrow
   glyph; the compiled bundle only ever styled colour, size and offsets on
   top of that. These rules replace the part Swiper was providing — the
   bundle's own rules still layer over them.
   -------------------------------------------------------------------------- */

[data-jf-slider] .swiper-button-prev,
[data-jf-slider] .swiper-button-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;

	display: flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	padding: 0;

	border: none;
	background: transparent;
	cursor: pointer;
	user-select: none;
}

/* The arrows are real <button>s (keyboard-reachable); keep a theme's own
   button styles from repainting them. */
[data-jf-slider] .swiper-button-prev:hover,
[data-jf-slider] .swiper-button-next:hover,
[data-jf-slider] .swiper-button-prev:focus,
[data-jf-slider] .swiper-button-next:focus {
	background: transparent !important;
	box-shadow: none !important;
}

[data-jf-slider] .swiper-button-prev {
	left: 0;
}

[data-jf-slider] .swiper-button-next {
	right: 0;
}

/* The chevrons themselves. Colour and size come from the compiled bundle. */
[data-jf-slider] .swiper-button-prev::after,
[data-jf-slider] .swiper-button-next::after {
	display: block;
	font-size: 20px;
	line-height: 1;
	color: var(--swiper-theme-color, #d3d3d3);
}

[data-jf-slider] .swiper-button-prev::after {
	content: "\2039"; /* ‹ */
}

[data-jf-slider] .swiper-button-next::after {
	content: "\203A"; /* › */
}

/* --------------------------------------------------------------------------
   Pagination dots.
   -------------------------------------------------------------------------- */

[data-jf-slider] .swiper-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

[data-jf-slider] .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #d3d3d3;
	opacity: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

[data-jf-slider] .swiper-pagination-bullet-active {
	background: var(--accent-cta, #2563eb);
	transform: scale(1.25);
}

/* ==========================================================================
   2. TEXT CLAMP
   Applied by the JS only when the text is genuinely longer than the allowed
   number of lines, so nothing here fires on short testimonials.
   ========================================================================== */

.jf-clamp.is-clamped {
	display: -webkit-box;
	-webkit-line-clamp: var(--jf-clamp-lines, 6);
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jf-clamp__toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 6px;
	padding: 0;

	border: none;
	background: none;
	cursor: pointer;

	color: var(--accent-cta, #2563eb);
	font: inherit;
	font-weight: 600;
}

.jf-clamp__toggle:hover {
	color: var(--accent-cta-hover, var(--accent-cta, #2563eb));
}

/* ==========================================================================
   3. EDITOR NOTICE
   Only ever rendered for logged-in editors, when a section has no content.
   ========================================================================== */

.jf-editor-notice {
	padding: 20px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
}

/* ==========================================================================
   Pagination — page numbers under the Testimonials grid and Case Studies list
   Built by the pagination module in jf-templates.js ([data-jf-paginate]).
   Colours come from the Pagination fields on Template Styles; every one of
   them falls back to a default, so an empty field never leaves it unstyled.
   ========================================================================== */

[data-jf-paginate] > .is-paged-out {
	display: none !important;
}

.jfrt-wrapper .jf-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	/* Space above: the page's "Space above pagination" fields when set. */
	margin-top: var(--jf-pagination-space, 2.5rem);
}

@media (max-width: 767.98px) {
	.jfrt-wrapper .jf-pagination {
		margin-top: var(--jf-pagination-space-mobile, 2.5rem);
	}
}

.jfrt-wrapper .jf-pagination .jf-pagination__page,
.jfrt-wrapper .jf-pagination .jf-pagination__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.jfrt-wrapper .jf-pagination .jf-pagination__page {
	background: var(--pagination-bg, #f5f5f5);
	color: var(--pagination-text-color, var(--paragraph-color, #4d4d4d));
}

.jfrt-wrapper .jf-pagination .jf-pagination__page:hover {
	background: var(--pagination-hover-bg, #e6e6e6);
	color: var(--pagination-hover-text-color, var(--pagination-text-color, var(--paragraph-color, #4d4d4d)));
}

.jfrt-wrapper .jf-pagination .jf-pagination__page.is-active,
.jfrt-wrapper .jf-pagination .jf-pagination__page.is-active:hover {
	background: var(--pagination-active-bg, var(--brand-color, #123451));
	color: var(--pagination-active-text-color, #fff);
	cursor: default;
}

.jfrt-wrapper .jf-pagination .jf-pagination__arrow {
	background: transparent;
	color: var(--pagination-arrow-color, var(--heading-color, #000));
}

.jfrt-wrapper .jf-pagination .jf-pagination__arrow:hover:not(:disabled) {
	background: var(--pagination-bg, #f5f5f5);
}

.jfrt-wrapper .jf-pagination .jf-pagination__arrow:disabled {
	opacity: 0.3;
	cursor: default;
}

.jfrt-wrapper .jf-pagination .jf-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 40px;
	color: var(--pagination-text-color, var(--paragraph-color, #4d4d4d));
	font-size: 1.125rem;
	user-select: none;
}

.jfrt-wrapper .jf-pagination button:focus-visible {
	outline: 2px solid var(--pagination-active-bg, var(--brand-color, #123451));
	outline-offset: 2px;
}

@media (max-width: 575.98px) {
	.jfrt-wrapper .jf-pagination {
		gap: 6px;
	}

	.jfrt-wrapper .jf-pagination .jf-pagination__page,
	.jfrt-wrapper .jf-pagination .jf-pagination__arrow {
		width: 36px;
		height: 36px;
		font-size: 1rem;
	}
}

/* ==========================================================================
   Logo slider arrows — thin grey chevrons on either side of the strip
   The compiled bundle draws them with the Swiper icon font (small, bold,
   blue); this replaces the glyph with a drawn chevron in the colour from
   "Slider Arrow Color" / "Slider Arrow Hover Color" on Template Styles.
   !important because the bundle's own ::after rule uses it.
   ========================================================================== */

.jfrt-wrapper [data-jf-slider] .swiper-button-prev,
.jfrt-wrapper [data-jf-slider] .swiper-button-next {
	width: 40px;
	height: 56px;
	margin-top: 0;
	padding: 0;
	border: 0;
	background: none !important;
	box-shadow: none;
	color: var(--slider-arrow-color, #c4c4c4) !important;
	cursor: pointer;
	transform: translateY(-50%);
	transition: color 0.2s ease;
}

.jfrt-wrapper [data-jf-slider] .swiper-button-prev:hover,
.jfrt-wrapper [data-jf-slider] .swiper-button-next:hover,
.jfrt-wrapper [data-jf-slider] .swiper-button-prev:focus-visible,
.jfrt-wrapper [data-jf-slider] .swiper-button-next:focus-visible {
	color: var(--slider-arrow-hover-color, #8a8a8a) !important;
}

/* The chevron: two sides of a rotated square, drawn in currentColor. */
.jfrt-wrapper [data-jf-slider] .swiper-button-prev::after,
.jfrt-wrapper [data-jf-slider] .swiper-button-next::after {
	content: "" !important;
	display: block;
	width: 14px;
	height: 14px;
	font-size: 0 !important;
	border-top: 2.5px solid currentColor;
	border-right: 2.5px solid currentColor;
	border-radius: 1px;
	color: inherit !important;
}

.jfrt-wrapper [data-jf-slider] .swiper-button-next::after {
	transform: translateX(-3px) rotate(45deg);
}

.jfrt-wrapper [data-jf-slider] .swiper-button-prev::after {
	transform: translateX(3px) rotate(-135deg);
}

@media (max-width: 575.98px) {
	.jfrt-wrapper [data-jf-slider] .swiper-button-prev,
	.jfrt-wrapper [data-jf-slider] .swiper-button-next {
		width: 28px;
	}

	.jfrt-wrapper [data-jf-slider] .swiper-button-prev::after,
	.jfrt-wrapper [data-jf-slider] .swiper-button-next::after {
		width: 11px;
		height: 11px;
		border-width: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jfrt-wrapper [data-jf-slider] .swiper-button-prev,
	.jfrt-wrapper [data-jf-slider] .swiper-button-next {
		transition: none;
	}
}
