/**
 * Single Page Tour Listing 24siteshop — frontend.
 *
 * Column count comes from a class, not an inline style: inline styles beat
 * media queries, so an inline --sptl24-cols would defeat the mobile override.
 */

.sptl24-wrap {
	--sptl24-accent: #25d366;
	--sptl24-radius: 18px;
	--sptl24-card-bg: #fff;
	--sptl24-border: rgba(16, 24, 40, 0.09);
	--sptl24-text: #101828;
	--sptl24-muted: #667085;
	--sptl24-surface: #f2f4f7;

	/* Overridden inline by the shortcode; 100% means fill the container. */
	--sptl24-max: 100%;

	/* Hero shape. The cap stops height growing forever on a wide layout. */
	--sptl24-hero-ratio: 16 / 9;
	--sptl24-hero-max: 340px;

	box-sizing: border-box;
	width: 100%;
}

.sptl24-list {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
	width: 100%;
	max-width: var(--sptl24-max, 100%);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

/* Desktop column counts. The mobile override lives at the bottom of this
   file and wins on source order at equal specificity. */
.sptl24-wrap--cols-1 .sptl24-list {
	grid-template-columns: 1fr;
}

.sptl24-wrap--cols-2 .sptl24-list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sptl24-wrap--cols-3 .sptl24-list {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* A single full-width card can afford a shallower crop; tiled cards are
   already narrow, so they keep a taller one. */
.sptl24-wrap--cols-1 {
	--sptl24-hero-ratio: 21 / 9;
	--sptl24-hero-max: 380px;
}

.sptl24-wrap--cols-3 {
	--sptl24-hero-max: 260px;
}

.sptl24-list *,
.sptl24-list *::before,
.sptl24-list *::after {
	box-sizing: border-box;
}

/* ---------- Card ---------- */

.sptl24-card {
	position: relative;
	overflow: hidden;
	background: var(--sptl24-card-bg);
	border: 1px solid var(--sptl24-border);
	border-radius: var(--sptl24-radius);
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.04),
		0 12px 28px -16px rgba(16, 24, 40, 0.24);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.sptl24-card:hover {
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.05),
		0 18px 40px -18px rgba(16, 24, 40, 0.3);
}

/* No media at all — an accent rule replaces the hero so nothing looks broken. */
.sptl24-card--text {
	border-top: 3px solid var(--sptl24-accent);
}

/* ---------- Hero ---------- */

.sptl24-hero {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--sptl24-surface);
	line-height: 0;
}

/* Only image heroes get the shallow crop — a video hero keeps 16:9 so the
   player is never letterboxed. */
.sptl24-hero:not(.sptl24-hero--video) {
	aspect-ratio: var(--sptl24-hero-ratio, 16 / 9);
	max-height: var(--sptl24-hero-max, 340px);
}

.sptl24-hero-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.sptl24-card:hover .sptl24-hero-img {
	transform: scale(1.02);
}

.sptl24-hero--video {
	line-height: normal;
}

/* ---------- Price ---------- */

.sptl24-price {
	font-weight: 700;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.sptl24-price--badge {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 2;
	padding: 8px 14px;
	color: #fff;
	font-size: 0.95rem;
	line-height: 1.2;
	background: rgba(16, 24, 40, 0.78);
	border-radius: 999px;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.sptl24-price--inline {
	flex: 0 0 auto;
	padding: 6px 12px;
	color: var(--sptl24-text);
	font-size: 0.95rem;
	background: var(--sptl24-surface);
	border-radius: 999px;
}

/* ---------- Body ---------- */

.sptl24-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px;
}

.sptl24-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.sptl24-title {
	margin: 0;
	color: var(--sptl24-text);
	font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.015em;
}

/* ---------- Description ---------- */

.sptl24-desc {
	position: relative;
	color: var(--sptl24-muted);
	font-size: 1rem;
	line-height: 1.65;
}

.sptl24-desc-inner > *:first-child {
	margin-top: 0;
}

.sptl24-desc-inner > *:last-child {
	margin-bottom: 0;
}

.sptl24-desc.is-clamped .sptl24-desc-inner {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sptl24-desc-toggle {
	margin-top: 8px;
	padding: 0;
	color: var(--sptl24-text);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	background: none;
	border: 0;
	cursor: pointer;
}

.sptl24-desc-toggle:hover {
	color: var(--sptl24-accent);
}

/* ---------- Terrain badges ---------- */

.sptl24-specs {
	display: grid;
	/* Two up in a normal card, collapsing to one when the card gets narrow. */
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sptl24-spec {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 10px 12px;
	background: var(--sptl24-surface);
	border-radius: 10px;
}

.sptl24-spec-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--sptl24-muted);
	background: var(--sptl24-card-bg);
	border-radius: 8px;
}

.sptl24-spec-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.sptl24-spec-label {
	color: var(--sptl24-muted);
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.sptl24-spec-value {
	color: var(--sptl24-text);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: break-word;
}

/* Difficulty is colour-coded when the wording is recognised; anything else
   falls through to the neutral style above. */
.sptl24-spec--difficulty.is-easy .sptl24-spec-icon {
	color: #0a7c2f;
	background: #e6f6ec;
}

.sptl24-spec--difficulty.is-moderate .sptl24-spec-icon {
	color: #8a6100;
	background: #fff6e0;
}

.sptl24-spec--difficulty.is-hard .sptl24-spec-icon {
	color: #a34700;
	background: #fff0e6;
}

.sptl24-spec--difficulty.is-extreme .sptl24-spec-icon {
	color: #a31212;
	background: #fdeaea;
}

/* ---------- Videos ---------- */

/* One video fills the width; several tile into a grid that collapses to a
   single column on narrow screens. */
.sptl24-videos {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.sptl24-videos.is-grid {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.sptl24-video {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
}

.sptl24-hero--video .sptl24-video {
	border-radius: 0;
}

.sptl24-video-play {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sptl24-video-poster {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.25s ease;
}

.sptl24-video-play:hover .sptl24-video-poster {
	opacity: 0.88;
}

.sptl24-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	transition: transform 0.2s ease;
}

.sptl24-play-bg {
	fill: rgba(16, 24, 40, 0.72);
	transition: fill 0.2s ease;
}

.sptl24-video-play:hover .sptl24-play-badge {
	transform: translate(-50%, -50%) scale(1.06);
}

.sptl24-video-play:hover .sptl24-play-bg {
	fill: #ff0000;
}

.sptl24-video iframe,
.sptl24-video-el {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

/* ---------- CTA ---------- */

.sptl24-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-top: 2px;
	padding: 14px 20px;
	color: #fff !important;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	background: var(--sptl24-accent);
	border: 0;
	border-radius: 12px;
	box-shadow: 0 8px 18px -10px var(--sptl24-accent);
	cursor: pointer;
	transition: filter 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.sptl24-cta:hover,
.sptl24-cta:focus {
	color: #fff !important;
	filter: brightness(0.94);
	box-shadow: 0 12px 22px -10px var(--sptl24-accent);
}

.sptl24-cta:active {
	transform: translateY(1px);
}

.sptl24-cta-icon {
	flex: 0 0 auto;
}

/* ---------- Notices / pagination ---------- */

.sptl24-notice {
	max-width: var(--sptl24-max, 760px);
	margin: 0 auto;
	padding: 14px 16px;
	color: #7a5c00;
	font-size: 0.9rem;
	background: #fff8e5;
	border: 1px dashed #f0c000;
	border-radius: 10px;
}

.sptl24-notice--inline {
	margin: 0;
}

.sptl24-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	max-width: var(--sptl24-max, 760px);
	margin: 28px auto 0;
}

.sptl24-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	color: var(--sptl24-text, #101828);
	text-decoration: none;
	border: 1px solid rgba(16, 24, 40, 0.12);
	border-radius: 9px;
}

.sptl24-pagination .page-numbers.current {
	color: #fff;
	background: var(--sptl24-accent, #25d366);
	border-color: transparent;
}

/* ---------- Focus ---------- */

.sptl24-list a:focus-visible,
.sptl24-list button:focus-visible {
	outline: 3px solid var(--sptl24-accent, #25d366);
	outline-offset: 2px;
}

/* ---------- Tablet and below: always one column ---------- */

@media (max-width: 860px) {
	/* Equal specificity to .sptl24-wrap--cols-N .sptl24-list, declared later,
	   so this wins whatever the desktop column count is. */
	.sptl24-wrap .sptl24-list {
		grid-template-columns: 1fr;
	}

	.sptl24-wrap {
		--sptl24-hero-ratio: 16 / 9;
		--sptl24-hero-max: 380px;
	}
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
	.sptl24-list {
		gap: 20px;
	}

	.sptl24-body {
		padding: 18px;
		gap: 14px;
	}

	/* A 21:9 crop on a phone is a 150px sliver — go taller as it gets narrower. */
	.sptl24-wrap {
		--sptl24-hero-ratio: 4 / 3;
		--sptl24-hero-max: 320px;
	}

	/* Never squeeze two videos side by side on a phone. */
	.sptl24-videos.is-grid {
		grid-template-columns: 1fr;
	}

	.sptl24-play-badge svg {
		width: 48px;
		height: 34px;
	}
}

/* ---------- Dark mode (only if the theme opts in) ---------- */

@media (prefers-color-scheme: dark) {
	.sptl24-wrap.sptl24-auto-dark {
		--sptl24-card-bg: #161b22;
		--sptl24-border: rgba(255, 255, 255, 0.1);
		--sptl24-text: #e6edf3;
		--sptl24-muted: #9198a1;
		--sptl24-surface: #21262d;
	}
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.sptl24-list * {
		animation: none !important;
		transition: none !important;
	}

	.sptl24-card:hover .sptl24-hero-img {
		transform: none;
	}
}
