/* Resource Slider — base styles. Colors, spacing, and visible-card count are
   set as CSS custom properties inline by the [resource_slider] shortcode. */

.resource-slider {
	--rs-visible: 4;
	--rs-gap: 24px;
	--rs-max-width: none;
	--rs-image-fit: cover;
	--rs-heading-color: #1565c0;
	--rs-text-color: #3c3c3c;
	--rs-accent-color: #1565c0;

	position: relative;
	width: 100%;
	box-sizing: border-box;
	padding: 0 44px; /* room for arrows */
	font-family: inherit;
}

.resource-slider .rs-viewport {
	overflow: hidden;
	width: 100%;
}

.resource-slider .rs-track {
	display: flex;
	gap: var(--rs-gap);
	transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.32, 1);
	will-change: transform;
}

/* Each card takes an equal share of the viewport based on --rs-visible,
   optionally capped by --rs-max-width so it never grows past a fixed size
   on wide screens. */
.resource-slider .rs-slide {
	flex: 0 0 calc((100% - (var(--rs-visible) - 1) * var(--rs-gap)) / var(--rs-visible));
	max-width: var(--rs-max-width);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

.resource-slider .rs-slide-media {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
	background: #eee;
}

.resource-slider .rs-slide-media img {
	width: 100%;
	height: 100%;
	object-fit: var(--rs-image-fit);
	display: block;
	transition: transform 0.3s ease;
}

.resource-slider a.rs-slide-media:hover img {
	transform: scale(1.04);
}

.resource-slider .rs-slide-body {
	padding-top: 10px;
}

.resource-slider .rs-slide-title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--rs-heading-color);
	text-decoration: none;
	margin-bottom: 4px;
}

a.rs-slide-title:hover {
	text-decoration: underline;
}

.resource-slider .rs-slide-desc {
	font-size: 13px;
	line-height: 1.5;
	color: var(--rs-text-color);
}

.resource-slider .rs-slide-desc p {
	margin: 0 0 4px;
}

.resource-slider .rs-slide-desc p:last-child {
	margin-bottom: 0;
}

/* Arrows */
.resource-slider .rs-prev,
.resource-slider .rs-next {
	position: absolute;
	top: 40%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: var(--rs-accent-color);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.resource-slider .rs-prev { left: 0; }
.resource-slider .rs-next { right: 0; }

.resource-slider .rs-prev:disabled,
.resource-slider .rs-next:disabled {
	opacity: 0.35;
	cursor: default;
}

.resource-slider .rs-prev:hover:not(:disabled),
.resource-slider .rs-next:hover:not(:disabled) {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Dots */
.resource-slider .rs-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 18px;
}

.resource-slider .rs-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: none;
	background: #d5d5d5;
	padding: 0;
	cursor: pointer;
}

.resource-slider .rs-dot.active {
	background: var(--rs-accent-color);
}

/* Responsive fallback: shrink visible count on smaller screens regardless
   of the desktop `visible` setting. */
@media (max-width: 900px) {
	.resource-slider .rs-slide {
		flex-basis: calc((100% - var(--rs-gap)) / 2);
	}
}

@media (max-width: 560px) {
	.resource-slider {
		padding: 0 36px;
	}
	.resource-slider .rs-slide {
		flex-basis: 100%;
	}
}
