/* Link P24 — Shortcode Grid & Carousel
   Uses `inherit` for fonts/colors wherever possible so it visually blends
   into the active theme. Site owners can override any --p24-* variable
   from Appearance → Customize → Additional CSS, e.g.:
   .p24-grid { --p24-accent: #ff5a5f; }
*/

.p24-grid {
	--p24-columns: 3;
	--p24-gap: 24px;
	--p24-radius: 10px;
	--p24-accent: currentColor;
	--p24-muted: rgba(0, 0, 0, 0.55);
	--p24-border: rgba(0, 0, 0, 0.08);
	--p24-surface: #fff;

	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: var(--p24-gap);
	margin: 24px 0;
	font-family: inherit;
	color: inherit;
}

@media (min-width: 700px) {
	.p24-grid {
		grid-template-columns: repeat(var(--p24-columns), 1fr);
	}
}

.p24-card {
	position: relative;
	background: var(--p24-surface);
	border: 1px solid var(--p24-border);
	border-radius: var(--p24-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.p24-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-3px);
}

.p24-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: var(--p24-accent, #d63638);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	padding: 4px 10px;
	border-radius: 4px;
}

/* Carousel */
.p24-carousel {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #eee;
	overflow: hidden;
}

.p24-carousel-track {
	position: relative;
	width: 100%;
	height: 100%;
}

.p24-slide {
	position: absolute;
	inset: 0;
	display: none;
}

.p24-slide.is-active {
	display: block;
}

.p24-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.p24-slide--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 13px;
	background: #f1f1f1;
}

.p24-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: none;
	cursor: pointer;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	font-size: 15px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.p24-nav-btn:hover { background: rgba(0, 0, 0, 0.7); }
.p24-prev { left: 10px; }
.p24-next { right: 10px; }

.p24-dots {
	position: absolute;
	bottom: 10px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 3;
}

.p24-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
}

.p24-dot.is-active {
	background: #fff;
}

/* Content */
.p24-content {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.p24-title-link {
	text-decoration: none;
	color: inherit;
}

.p24-title {
	font-size: 1.1rem;
	margin: 0;
	line-height: 1.3;
}

.p24-price {
	font-size: 1.4rem;
	font-weight: 700;
}

.p24-price-suffix {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--p24-muted);
}

.p24-address {
	font-size: 0.85rem;
	color: var(--p24-muted);
	margin-bottom: 6px;
}

.p24-specs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	font-size: 0.85rem;
	background: rgba(0, 0, 0, 0.02);
	border: 1px solid var(--p24-border);
	border-radius: 6px;
	padding: 10px;
	margin-bottom: 10px;
}

.p24-tags {
	margin-bottom: 12px;
}

.p24-tag {
	display: inline-block;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	padding: 3px 9px;
	border-radius: 4px;
	font-size: 0.72rem;
	font-weight: 600;
	margin-right: 6px;
}

.p24-view-btn {
	display: inline-block;
	margin-top: auto;
	text-align: center;
	padding: 10px 16px;
	border-radius: 6px;
	background: var(--p24-accent, #27ae60);
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
}

.p24-view-btn:hover {
	opacity: 0.9;
	color: #fff;
}

.p24-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 30px 0;
	flex-wrap: wrap;
}

.p24-pagination a,
.p24-pagination span {
	padding: 6px 12px;
	border: 1px solid var(--p24-border);
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
}

.p24-no-results {
	text-align: center;
	padding: 40px 0;
	color: var(--p24-muted);
}