/**
 * Card Slider Gallery
 *
 * Just the carousel. The heading, button and background around it are
 * Salient elements. Sizes, colours and fonts are written per instance by
 * card-slider.php, and only when set; this file holds layout, behaviour and
 * fallbacks.
 */

.cl-csl,
.cl-csl *,
.cl-csl *::before,
.cl-csl *::after {
	box-sizing: border-box;
}

.cl-csl {
	--cl-csl-w: 50%;
	--cl-csl-h: 504px;
	--cl-csl-gap: 32px;
	--cl-csl-arrow-x: 5%;
	--cl-csl-side: 0.45;
	--cl-csl-shade: rgba(0, 0, 0, 0.75);
	--cl-csl-lines: 2;
	position: relative;
	overflow: hidden;
	text-align: left;
}

/* Slider. The first card has half the leftover width as a left margin, so
   it sits in the middle before the script runs. (Padding on the track would
   shrink the width the card percentages are measured against.) */
.cl-csl__slider {
	position: relative;
}

.cl-csl__viewport {
	overflow: hidden;
	touch-action: pan-y;
}

/* In a Salient "Centered Content" column, responsive.css sets every ul to
   display: block !important at tablet and phone sizes (stacking all the
   cards), and style.css centres ul text on desktop. Hence the !important
   and the text-align here. */
html body .cl-csl ul.cl-csl__track {
	display: flex !important;
	text-align: left;
	gap: var(--cl-csl-gap);
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	will-change: transform;
}

html body .cl-csl li.cl-csl__slide {
	flex: 0 0 var(--cl-csl-w);
	width: var(--cl-csl-w);
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	opacity: var(--cl-csl-side);
	transition: opacity 0.5s ease;
}

html body .cl-csl li.cl-csl__slide:first-child {
	margin-left: calc((100% - var(--cl-csl-w)) / 2) !important;
}

html body .cl-csl li.cl-csl__slide::before {
	content: none !important;
}

html body .cl-csl li.cl-csl__slide.is-current {
	opacity: 1;
}

.cl-csl__slide:not(.is-current) {
	cursor: pointer;
}

html body .cl-csl.is-jumping li.cl-csl__slide {
	transition: none;
}

.cl-csl__card {
	position: relative;
	height: var(--cl-csl-h);
	margin: 0;
	overflow: hidden;
	border-radius: 12px;
	background-color: rgba(255, 255, 255, 0.06);
	color: #FFFFFF;
	isolation: isolate;
}

.cl-csl__media {
	position: absolute;
	inset: 0;
}

html body .cl-csl img.cl-csl__img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.5s ease;
}

html body .cl-csl img.cl-csl__img.is-active {
	opacity: 1;
}

.cl-csl__shade {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	height: 60%;
	background: linear-gradient(to top, var(--cl-csl-shade), transparent);
	pointer-events: none;
}

.cl-csl__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 6px;
	background-color: rgba(0, 0, 0, 0.4);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

html body .cl-csl--align-center .cl-csl__info {
	align-items: center;
	text-align: center;
}

html body .cl-csl--align-center ul.cl-csl__meta {
	justify-content: center;
}

.cl-csl__info {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 3;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px;
}

html body .cl-csl ul.cl-csl__meta {
	display: flex !important;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

html body .cl-csl li.cl-csl__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

html body .cl-csl .cl-csl__meta-item img {
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
	object-fit: contain;
}

.cl-csl--white-icons .cl-csl__meta-item img {
	filter: brightness(0) invert(1);
}

html body .cl-csl .cl-csl__title {
	margin: 0 !important;
	padding: 0 !important;
	color: inherit;
	font-size: 28px;
	line-height: 1.15;
}

html body .cl-csl p.cl-csl__body {
	display: -webkit-box;
	margin: 0;
	padding: 0;
	overflow: hidden;
	color: inherit;
	font-size: 16px;
	line-height: 1.45;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--cl-csl-lines);
}

html body .cl-csl--no-clamp p.cl-csl__body {
	display: block;
	-webkit-line-clamp: none;
}

/* A separate cover link fills the card, so a click anywhere on it goes to
   the same address; the text sits above it but lets clicks through, apart
   from the link itself. */
html body .cl-csl a.cl-csl__cover {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: block;
}

/* The text and link share one wrapper, so they open as a single movement.
   The wrapper's -8px margin cancels the info column's gap while it is
   closed; the body's 8px top margin puts it back inside the clipped area. */
.cl-csl__reveal {
	display: grid;
	grid-template-rows: 1fr;
	margin-top: -8px;
	transition: grid-template-rows 0.4s ease, opacity 0.4s ease;
}

.cl-csl__reveal-inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-height: 0;
	overflow: hidden;
}

html body .cl-csl .cl-csl__reveal-inner > :first-child {
	margin-top: 8px;
}

.cl-csl--align-center .cl-csl__reveal-inner {
	align-items: center;
}

html body .cl-csl a.cl-csl__link {
	display: inline-block;
	pointer-events: auto;
	padding-top: 2px;
	color: inherit;
	font-size: 14px;
	line-height: 1.5;
	text-decoration: underline;
	text-underline-offset: 3px;
}

html body .cl-csl a.cl-csl__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Button: the site's button colours and corners (Salient nectar-cta on
   Home: #C91228, white text, 8px radius, lighter red on hover), a touch
   smaller for the cards (10px 20px, 15px). The bottom margin leaves room for
   the white button's 2px lift inside the clipped wrapper. */
html body .cl-csl a.cl-csl__link--button {
	margin-top: 16px;
	margin-bottom: 2px;
	padding: 10px 20px;
	border-radius: 8px;
	background-color: #C91228;
	color: #FFFFFF;
	font-size: 15px;
	line-height: 1.1;
	text-decoration: none;
	transition: background-color 0.3s ease, color 0.3s ease;
}

html body .cl-csl a.cl-csl__link--button:hover,
html body .cl-csl a.cl-csl__link--button:focus-visible {
	background-color: rgba(201, 18, 40, 0.8);
	color: #FFFFFF;
}

/* White button: the look of "Find a pharmacy" on the Dispensaries page (white,
   #061E21 text, 8px radius, Biennale; stays white and lifts 2px on hover), at
   the smaller card size above. */
html body .cl-csl a.cl-csl__link--white {
	background-color: #FFFFFF;
	color: #061E21;
	transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

html body .cl-csl a.cl-csl__link--white:hover,
html body .cl-csl a.cl-csl__link--white:focus-visible {
	background-color: #FFFFFF;
	color: #061E21;
	transform: translateY(-2px);
}

/* "Title only; text and link slide in together on hover" setting. Only on
   devices that can hover; touch screens always show everything. */
@media (hover: hover) {
	.cl-csl--reveal-hover .cl-csl__reveal {
		grid-template-rows: 0fr;
		opacity: 0;
	}

	.cl-csl--reveal-hover .cl-csl__slide.is-current .cl-csl__card:hover .cl-csl__reveal,
	.cl-csl--reveal-hover .cl-csl__card:focus-within .cl-csl__reveal {
		grid-template-rows: 1fr;
		opacity: 1;
	}
}

.cl-csl .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* Arrows */
html body .cl-csl button.cl-csl__arrow,
html body .cl-csl button.cl-csl__gal {
	position: absolute;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	box-shadow: none;
	cursor: pointer;
	line-height: 0;
	transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

html body .cl-csl button.cl-csl__arrow {
	z-index: 5;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	background-color: #FFFFFF;
	color: #061E21;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

html body .cl-csl button.cl-csl__arrow--prev {
	left: var(--cl-csl-arrow-x);
}

html body .cl-csl button.cl-csl__arrow--next {
	right: var(--cl-csl-arrow-x);
}

/* Keeps a 48px tap area when the arrow itself is drawn smaller. */
html body .cl-csl button.cl-csl__arrow::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100%, 48px);
	height: max(100%, 48px);
	transform: translate(-50%, -50%);
}

html body .cl-csl button.cl-csl__arrow:hover {
	transform: scale(1.06);
}

html body .cl-csl button.cl-csl__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

html body .cl-csl button.cl-csl__gal {
	z-index: 4;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	background-color: rgba(255, 255, 255, 0.8);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	color: #061E21;
	opacity: 0;
	pointer-events: none;
}

html body .cl-csl button.cl-csl__gal--prev {
	left: 16px;
}

html body .cl-csl button.cl-csl__gal--next {
	right: 16px;
}

html body .cl-csl .is-current .cl-csl__card:hover button.cl-csl__gal,
html body .cl-csl .is-current button.cl-csl__gal:focus-visible {
	opacity: 1;
	pointer-events: auto;
}

@media (hover: none) {
	html body .cl-csl .is-current button.cl-csl__gal {
		opacity: 1;
		pointer-events: auto;
	}
}

html body .cl-csl button.cl-csl__arrow svg,
html body .cl-csl button.cl-csl__gal svg {
	width: 16px;
	height: 16px;
}

html body .cl-csl button.cl-csl__arrow:focus-visible,
html body .cl-csl button.cl-csl__gal:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 3px;
}

@media (max-width: 900px) {
	.cl-csl {
		--cl-csl-w: 70%;
		--cl-csl-h: 400px;
		--cl-csl-gap: 24px;
		--cl-csl-arrow-x: 3%;
	}

	html body .cl-csl button.cl-csl__arrow {
		width: 44px;
		height: 44px;
		margin-top: -22px;
	}
}

@media (max-width: 600px) {
	.cl-csl {
		--cl-csl-w: 85%;
		--cl-csl-h: 320px;
		--cl-csl-gap: 16px;
		--cl-csl-arrow-x: 12px;
	}

	.cl-csl__info {
		padding: 16px;
	}

	html body .cl-csl button.cl-csl__arrow {
		width: 36px;
		height: 36px;
		margin-top: -18px;
	}

	html body .cl-csl button.cl-csl__arrow svg {
		width: 14px;
		height: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html body .cl-csl li.cl-csl__slide,
	html body .cl-csl img.cl-csl__img,
	.cl-csl__reveal {
		transition: none;
	}
}
