/* KP HCC News Carousel v2
   Everything below is driven by CSS variables. The values are set from
   Dashboard > KP HCC Carousel and printed as an inline style on the carousel,
   so the defaults here only apply if that style is missing. */

.kphcc-nc-outer { width: 100%; }

.kphcc-nc {
	--kc-green: #046a38;
	--kc-red: #d62828;
	--kc-blue: #0aa3e0;
	--kc-orange: #f2683c;
	--kc-text: #1d2b24;
	--kc-muted: #5f6f67;
	--kc-border: #dfe5e1;
	--kc-bg: #ffffff;
	--kc-arrow-bg: #046a38;
	--kc-arrow-fg: #ffffff;
	--kc-max: 1200px;
	--kc-gap: 24px;
	--kc-pv-d: 3;
	--kc-pv-t: 2;
	--kc-pv-m: 1;
	--kc-ratio: 4 / 3;
	--kc-fit: cover;
	--kc-pos: center top;
	--kc-radius: 8px;
	--kc-pad: 18px;
	--kc-lift: -3px;
	--kc-font: inherit;
	--kc-h-size: 28px;
	--kc-h-weight: 600;
	--kc-h-style: dotted;
	--kc-h-width: 1px;
	--kc-t-size: 17px;
	--kc-t-size-m: 16px;
	--kc-t-weight: 600;
	--kc-t-lh: 1.4;
	--kc-lines: 3;
	--kc-t-align: left;
	--kc-date-size: 12px;
	--kc-more-size: 14px;
	--kc-arrow-size: 44px;
	--kc-arrow-radius: 50%;
	--kc-arrow-top: 28%;
	--kc-dot-size: 11px;

	--kc-per-view: var(--kc-pv-d);
	--kc-gap-eff: var(--kc-gap);
	position: relative;
	max-width: var(--kc-max);
	margin: 0 auto;
	padding: 0 8px;
	box-sizing: border-box;
	font-family: var(--kc-font);
}
.kphcc-nc *, .kphcc-nc *::before, .kphcc-nc *::after { box-sizing: border-box; }

.kphcc-nc .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Heading */
.kphcc-nc .kphcc-nc__heading {
	margin: 0 0 28px;
	padding: 0 0 8px;
	font-family: inherit;
	font-size: var(--kc-h-size);
	line-height: 1.2;
	font-weight: var(--kc-h-weight);
	color: var(--kc-green);
	border: 0;
	border-bottom: var(--kc-h-width) var(--kc-h-style) var(--kc-red);
}

.kphcc-nc__wrap { position: relative; }

/* Track: native scroll-snap gives smooth swipe on touch with no library */
.kphcc-nc .kphcc-nc__track {
	display: flex;
	gap: var(--kc-gap-eff);
	margin: 0;
	padding: 4px 2px 10px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.kphcc-nc .kphcc-nc__track::-webkit-scrollbar { display: none; }
.kphcc-nc .kphcc-nc__track:focus-visible { outline: 3px solid var(--kc-blue); outline-offset: 2px; }

.kphcc-nc .kphcc-nc__slide {
	flex: 0 0 calc((100% - (var(--kc-gap-eff) * (var(--kc-per-view) - 1))) / var(--kc-per-view));
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
	display: flex; /* every card stretches to the tallest one */
}

/* Card */
.kphcc-nc .kphcc-nc__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--kc-bg);
	border: 1px solid var(--kc-border);
	border-radius: var(--kc-radius);
	overflow: hidden;
	transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.kphcc-nc--style-shadow .kphcc-nc__card { border-color: transparent; box-shadow: 0 4px 16px rgba(0, 0, 0, .10); }
.kphcc-nc--style-flat .kphcc-nc__card { border-color: transparent; box-shadow: none; }
.kphcc-nc .kphcc-nc__card:hover,
.kphcc-nc .kphcc-nc__card:focus-within {
	border-color: var(--kc-green);
	box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
	transform: translateY(var(--kc-lift));
}

/* Same image box for every card, whatever the original proportions */
.kphcc-nc .kphcc-nc__media {
	display: block;
	aspect-ratio: var(--kc-ratio);
	overflow: hidden;
	background: #eef3f0;
}
.kphcc-nc .kphcc-nc__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: var(--kc-fit);
	object-position: var(--kc-pos);
	margin: 0;
	transition: transform .35s ease;
}
.kphcc-nc .kphcc-nc__card:hover .kphcc-nc__media img { transform: scale(1.04); }
.kphcc-nc .kphcc-nc__ph {
	display: block; width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--kc-green) 0%, #0b8d4d 100%);
}

.kphcc-nc .kphcc-nc__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: var(--kc-pad);
	font-family: inherit;
}
.kphcc-nc .kphcc-nc__date {
	display: block;
	margin: 0 0 8px;
	font-size: var(--kc-date-size);
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--kc-muted);
}

/* Title: size from settings, clamped so cards stay aligned */
.kphcc-nc .kphcc-nc__title {
	margin: 0 0 12px;
	padding: 0;
	font-family: inherit;
	font-size: var(--kc-t-size);
	line-height: var(--kc-t-lh);
	font-weight: var(--kc-t-weight);
	text-align: var(--kc-t-align);
	text-transform: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--kc-lines);
	line-clamp: var(--kc-lines);
	overflow: hidden;
	min-height: calc(var(--kc-t-lh) * 1em * var(--kc-lines));
}
.kphcc-nc .kphcc-nc__title a {
	color: var(--kc-text);
	text-decoration: none;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
}
.kphcc-nc .kphcc-nc__title a:hover,
.kphcc-nc .kphcc-nc__title a:focus { color: var(--kc-green); }

.kphcc-nc .kphcc-nc__excerpt {
	margin: 0 0 14px;
	padding: 0;
	font-size: calc(var(--kc-t-size) * .85);
	line-height: 1.5;
	color: var(--kc-muted);
	text-align: var(--kc-t-align);
}

.kphcc-nc .kphcc-nc__more {
	margin-top: auto; /* pins the link to the bottom of every card */
	align-self: flex-start;
	font-size: var(--kc-more-size);
	font-weight: 600;
	color: var(--kc-green);
	text-decoration: none;
	border-bottom: 2px solid transparent;
}
.kphcc-nc .kphcc-nc__more::after { content: " \2192"; }
.kphcc-nc .kphcc-nc__more:hover,
.kphcc-nc .kphcc-nc__more:focus { color: var(--kc-blue); border-bottom-color: var(--kc-red); }
.kphcc-nc .kphcc-nc__body > .kphcc-nc__title:last-child { margin-bottom: 0; }

/* Arrows sit inside the carousel over the image area, never beyond the page edge */
.kphcc-nc .kphcc-nc__nav {
	position: absolute;
	top: var(--kc-arrow-top);
	z-index: 3;
	display: flex; align-items: center; justify-content: center;
	width: var(--kc-arrow-size); height: var(--kc-arrow-size);
	margin: 0; padding: 0;
	color: var(--kc-arrow-fg);
	background: var(--kc-arrow-bg);
	border: 0;
	border-radius: var(--kc-arrow-radius);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: background .2s ease, opacity .2s ease;
}
.kphcc-nc .kphcc-nc__nav--prev { left: 10px; }
.kphcc-nc .kphcc-nc__nav--next { right: 10px; }
.kphcc-nc .kphcc-nc__nav:hover { background: var(--kc-blue); }
.kphcc-nc .kphcc-nc__nav:focus-visible { outline: 3px solid var(--kc-blue); outline-offset: 2px; }
.kphcc-nc .kphcc-nc__nav[disabled] { opacity: .35; cursor: default; background: var(--kc-arrow-bg); }
.kphcc-nc .kphcc-nc__nav svg {
	width: 50%; height: 50%;
	fill: none; stroke: currentColor; stroke-width: 2.5;
	stroke-linecap: round; stroke-linejoin: round;
}

/* Dots + pause */
.kphcc-nc .kphcc-nc__footer {
	display: flex; align-items: center; justify-content: center;
	gap: 14px;
	margin-top: 14px;
}
.kphcc-nc .kphcc-nc__dots { display: flex; gap: 8px; }
.kphcc-nc .kphcc-nc__dot {
	width: var(--kc-dot-size); height: var(--kc-dot-size);
	margin: 0; padding: 0;
	border: 0; border-radius: 50%;
	background: #b8c4be;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}
.kphcc-nc .kphcc-nc__dot[aria-current="true"] { background: var(--kc-orange); transform: scale(1.25); }
.kphcc-nc .kphcc-nc__dot:focus-visible,
.kphcc-nc .kphcc-nc__pause:focus-visible { outline: 3px solid var(--kc-blue); outline-offset: 2px; }
.kphcc-nc .kphcc-nc__pause {
	width: 26px; height: 26px;
	margin: 0; padding: 0;
	font-size: 9px; line-height: 1; letter-spacing: -1px;
	color: var(--kc-muted);
	background: transparent;
	border: 1px solid var(--kc-border);
	border-radius: 50%;
	cursor: pointer;
}

/* Responsive. carousel.js measures the width of the area the carousel sits in and sets
   data-view="d|t|m" using the two breakpoints from the settings page. */
.kphcc-nc[data-view="t"] { --kc-per-view: var(--kc-pv-t); --kc-gap-eff: min(var(--kc-gap), 20px); }
.kphcc-nc[data-view="m"] { --kc-per-view: var(--kc-pv-m); --kc-gap-eff: min(var(--kc-gap), 16px); padding: 0 4px; }
.kphcc-nc[data-view="m"] .kphcc-nc__heading { font-size: min(var(--kc-h-size), 24px); margin-bottom: 20px; }
.kphcc-nc[data-view="m"] .kphcc-nc__title { font-size: var(--kc-t-size-m); }
.kphcc-nc[data-view="m"] .kphcc-nc__nav { width: calc(var(--kc-arrow-size) * .85); height: calc(var(--kc-arrow-size) * .85); }
.kphcc-nc[data-view="m"] .kphcc-nc__nav--prev { left: 6px; }
.kphcc-nc[data-view="m"] .kphcc-nc__nav--next { right: 6px; }

/* Before the script runs (or without it) fall back to the screen width. */
@media (max-width: 1024px) {
.kphcc-nc:not([data-view]) { --kc-per-view: var(--kc-pv-t); --kc-gap-eff: min(var(--kc-gap), 20px); }
}
@media (max-width: 640px) {
.kphcc-nc:not([data-view]) { --kc-per-view: var(--kc-pv-m); --kc-gap-eff: min(var(--kc-gap), 16px); padding: 0 4px; }
.kphcc-nc:not([data-view]) .kphcc-nc__heading { font-size: min(var(--kc-h-size), 24px); margin-bottom: 20px; }
.kphcc-nc:not([data-view]) .kphcc-nc__title { font-size: var(--kc-t-size-m); }
.kphcc-nc:not([data-view]) .kphcc-nc__nav { width: calc(var(--kc-arrow-size) * .85); height: calc(var(--kc-arrow-size) * .85); }
.kphcc-nc:not([data-view]) .kphcc-nc__nav--prev { left: 6px; }
.kphcc-nc:not([data-view]) .kphcc-nc__nav--next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.kphcc-nc .kphcc-nc__track { scroll-behavior: auto; }
	.kphcc-nc * { transition: none !important; }
}
