/* Smart Related Posts — frontend styles
 * Intentionally low-specificity so Elementor style controls and child themes
 * can override freely. Uses CSS custom properties for easy theming.
 */
.srp {
	--srp-gap: 20px;
	--srp-radius: 8px;
	margin: 2rem 0;
}
.srp__heading {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	line-height: 1.2;
}
.srp__track {
	display: grid;
	gap: var(--srp-gap);
	grid-template-columns: repeat(4, 1fr);
}
.srp__item {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: var(--srp-radius);
	transition: transform .2s ease, box-shadow .2s ease;
	overflow: hidden;
}
.srp__item:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.srp__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}
.srp__thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #eee;
}
.srp__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.srp__item:hover .srp__img { transform: scale(1.05); }
.srp__body { padding: 14px 16px 18px; }
.srp__title {
	margin: 0 0 .4rem;
	font-size: 1rem;
	line-height: 1.3;
}
.srp__date {
	display: block;
	font-size: .8rem;
	opacity: .7;
}
.srp__excerpt {
	margin: .5rem 0 0;
	font-size: .875rem;
	line-height: 1.45;
	opacity: .85;
}

/* ---- List layout ---- */
.srp--list .srp__track { grid-template-columns: 1fr; }
.srp--list .srp__link { flex-direction: row; gap: 16px; align-items: center; }
.srp--list .srp__thumb { width: 160px; flex: 0 0 160px; aspect-ratio: 4 / 3; border-radius: var(--srp-radius); }
.srp--list .srp__body { padding: 0; }

/* ---- Thumbnail strip ---- */
.srp--thumbnail .srp__body { padding: 8px 4px 0; }
.srp--thumbnail .srp__title { font-size: .9rem; }
.srp--thumbnail .srp__date,
.srp--thumbnail .srp__excerpt { display: none; }

/* ---- Carousel ---- */
.srp--carousel .srp__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 6px;
	scrollbar-width: thin;
}
.srp--carousel .srp__item {
	scroll-snap-align: start;
	flex: 0 0 clamp(220px, 28%, 320px);
}

/* ---- Responsive fallbacks (when Elementor responsive cols not set) ---- */
@media (max-width: 1024px) {
	.srp:not([data-srp-layout="carousel"]) .srp__track { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.srp:not([data-srp-layout="carousel"]) .srp__track { grid-template-columns: 1fr; }
	.srp--list .srp__thumb { width: 110px; flex-basis: 110px; }
}

.srp--notice {
	padding: 1rem;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	color: #646970;
	text-align: center;
}

/* ---- Carousel nav buttons (added by JS) ---- */
.srp__nav {
	position: absolute;
	top: 45%;
	transform: translateY(-50%);
	z-index: 5;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(0,0,0,.55);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease;
}
.srp__nav:hover { background: rgba(0,0,0,.8); }
.srp__nav--prev { left: -6px; }
.srp__nav--next { right: -6px; }
