/*
 * The package card — BTP_Tour_Card::render(). One card for every list of
 * tours on the site: the homepage rail, place pages, agency-city pages,
 * continent pages and the tour page's "You May Also Like".
 * ---------------------------------------------------------------------------
 * Moved here from btp-home's home.css (2026-10-23) so it styles the card
 * wherever it appears, not only inside the homepage's `.bh` sections. The
 * class names stay `bh-tour*` because the homepage's filter script and rail
 * layout address them.
 *
 * Self-contained: the colours are on the card itself, and every rule is
 * `.bh-tour .x` (0,2,0), which beats the theme's element rules and
 * Elementor's `.elementor img` (0,1,1) without `!important`.
 */

.bh-tour,
.bh-tcards {
	--bh-ink: #0f172a;
	--bh-text: #334155;
	--bh-muted: #64748b;
	--bh-line: #e6e9ef;
	--bh-soft: #f5f7fb;
	--bh-green: #0ca860;
	--bh-green-d: #08884d;
	--bh-green-50: #e8f8f0;
	--bh-red: #e11d48;
	--bh-radius: 20px;
	--bh-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
	--bh-shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 24px 48px rgba(15, 23, 42, .14);
	--bh-head: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bh-body: Poppins, Inter, system-ui, sans-serif;
}

/* ---- Grid -------------------------------------------------------------- */

.bh-tcards {
	display: grid;
	grid-template-columns: repeat(var(--bh-cols, 4), minmax(0, 1fr));
	gap: 24px;
	width: 100%;
	padding: 4px 0 8px;
}

@media (max-width: 1024px) {
	.bh-tcards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}
}

/* A phone gets a swipe row, each card 82% wide so the next one peeks in. */
@media (max-width: 640px) {
	.bh-tcards {
		display: flex;
		gap: 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		margin: 0 -16px;
		padding: 4px 16px 12px;
		/* Without this, snapping lines the first card up with the screen edge
		   and its left border is cut off; the padding alone does not count. */
		scroll-padding-inline: 16px;
	}

	.bh-tcards::-webkit-scrollbar {
		display: none;
	}

	.bh-tcards > .bh-tour {
		flex: 0 0 82%;
		scroll-snap-align: start;
	}
}

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

.bh-tour {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--bh-line);
	border-radius: var(--bh-radius);
	background: #fff;
	box-shadow: var(--bh-shadow);
	font-family: var(--bh-body);
	color: var(--bh-text);
	line-height: 1.6;
	text-align: left;
	transition: transform .3s, box-shadow .3s;
}

.bh-tour:hover {
	transform: translateY(-4px);
	box-shadow: var(--bh-shadow-lg);
}

:where(.bh-tour) *,
:where(.bh-tour) *::before,
:where(.bh-tour) *::after {
	box-sizing: border-box;
}

:where(.bh-tour) :where(h2, h3, h4, p) {
	margin: 0;
	padding: 0;
}

:where(.bh-tour) a {
	color: inherit;
	text-decoration: none;
}

.bh-tour .bh-ico {
	display: block;
	flex: none;
}

.bh-tour .bh-tour__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--bh-soft);
}

.bh-tour .bh-tour__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	border-radius: 0;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.bh-tour:hover .bh-tour__img {
	transform: scale(1.06);
}

.bh-tour .bh-tour__media::after {
	content: "";
	position: absolute;
	inset: 55% 0 0;
	background: linear-gradient(0deg, rgba(15, 23, 42, .45), rgba(15, 23, 42, 0));
	pointer-events: none;
}

.bh-tour .bh-tour__badges {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bh-tour .bh-badge {
	padding: 5px 10px;
	border-radius: 999px;
	font-family: var(--bh-head);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1.2;
}

.bh-tour .bh-badge--off { background: var(--bh-red); color: #fff; }
.bh-tour .bh-badge--best { background: #fff; color: #b45309; }

.bh-tour .bh-tour__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 18px 18px 20px;
}

.bh-tour .bh-tour__loc {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	font-weight: 500;
	color: var(--bh-muted);
}

.bh-tour .bh-tour__loc .bh-ico { color: var(--bh-green); }

.bh-tour .bh-tour__title {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	font-family: var(--bh-head);
	font-size: 17.5px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: -.01em;
	color: var(--bh-ink);
	text-transform: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.bh-tour .bh-tour__link { color: inherit; }
.bh-tour .bh-tour__link:hover { color: var(--bh-green-d); }

/* The whole card is the link. */
.bh-tour .bh-tour__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.bh-tour .bh-tour__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
}

.bh-tour .bh-tour__chips span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12.5px;
	color: var(--bh-text);
}

.bh-tour .bh-tour__chips .bh-ico { color: var(--bh-green); }

.bh-tour .bh-tour__foot {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px dashed var(--bh-line);
}

.bh-tour .bh-tour__from {
	display: block;
	font-size: 12px;
	color: var(--bh-muted);
}

.bh-tour .bh-tour__amounts {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0 8px;
}

.bh-tour .bh-tour__amounts s {
	font-size: 14px;
	color: #94a3b8;
}

.bh-tour .bh-tour__amounts strong {
	font-family: var(--bh-head);
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--bh-ink);
}

.bh-tour .bh-tour__go {
	display: grid;
	place-items: center;
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--bh-green-50);
	color: var(--bh-green);
	transition: background-color .25s, color .25s, transform .25s;
}

.bh-tour:hover .bh-tour__go {
	background: var(--bh-green);
	color: #fff;
	transform: rotate(-35deg);
}

@media (max-width: 640px) {
	.bh-tour:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.bh-tour,
	.bh-tour .bh-tour__img,
	.bh-tour .bh-tour__go { transition: none; }
}
