/* ==========================================================================
   Thai Go Features grid
   ========================================================================== */

.tg-features {
	--tg-navy: #0a2a66;
	--tg-ink: #1d2b4f;
	--tg-muted: #6b7689;
	--tg-border: #e7ebf3;
	--tg-card-radius: 22px;

	position: relative;
	width: 100%;
	box-sizing: border-box;
	padding: 100px 24px 100px;
	/* Linear veil (light-blue at top → semi-white at bottom) over the temple
	   photo: fades the top and keeps cards readable while the temple shows
	   through toward the bottom. The image layer is a custom property so the
	   Elementor "Section Background" image control can override just the photo. */
	--tg-features-bg: url('../images/feature-bg.webp');
	background-color: transparent;
	background-image:
		linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0) 12%),
		linear-gradient(180deg, #e8f1ff 0%, rgba(255, 255, 255, 0.6) 100%),
		var(--tg-features-bg);
	background-position: center top;
	background-size: cover;
	background-repeat: no-repeat;
	border-radius: 40px 40px 0 0;
	font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tg-features *,
.tg-features *::before,
.tg-features *::after {
	box-sizing: border-box;
}

/* White blur strip bleeding UP over the hero above — smooths the seam between
   the hero and this section (mirrors .tg-hero__fade, but owned by this section
   so it paints on top of the previous one). */
.tg-features__fade {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	width: 100vw;
	top: -90px;
	height: 180px;
	background: linear-gradient(180deg, #ffffff 0%, #ffffff 35%, rgba(255, 255, 255, 0) 100%);
	filter: blur(20px);
	z-index: 5;
	pointer-events: none;
}

.tg-features__inner {
	position: relative;
	z-index: 1;
	max-width: 1350px;
	margin: 0 auto;
}

/* .tg-features prefix raises specificity above Elementor's `.elementor-kit-N hN`
   (0,0,1,1) so color/size/weight aren't overridden by the global kit. */
.tg-features .tg-features__title {
	text-align: center;
	color: var(--tg-navy);
	font-family: "Instrument Sans", sans-serif;
	font-size: 40px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 0 0 48px;
}

/* Bento grid: 6 columns. wide = 3 cols, third = 2 cols. */
.tg-features__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 22px;
}

.tg-feature--wide  { grid-column: span 3; }
.tg-feature--third { grid-column: span 2; }

/* ---- Card -------------------------------------------------------------- */
.tg-feature {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	box-shadow: 0px 4px 16px rgba(0, 42, 137, 0.1);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	border-radius: 24px;
	/* Horizontal padding lives on child text elements so .tg-feature__media
	   fills wall-to-wall and is clipped by the card's border-radius. */
	padding: 26px 0 0;
	overflow: hidden;
	min-height: 320px;
}
.tg-feature--no-media {
	min-height: 0;
	padding-bottom: 26px;
}
.tg-features .tg-feature--no-media .tg-feature__desc {
	margin-bottom: 0;
}

.tg-feature__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	padding-left: 26px;
	padding-right: 26px;
}

.tg-features .tg-feature__title {
	color: var(--tg-navy);
	font-family: "Instrument Sans", sans-serif;
	font-size: 32px;
	font-weight: 500;
	margin: 0;
}

.tg-feature__badge {
	font-size: 14px;
	font-weight: 700;
	color: #9a6411;
	background: #fbeccd;
	border-radius: 999px;
	padding: 7px 18px;
	white-space: nowrap;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.tg-features .tg-feature__desc {
	color: var(--tg-navy);
	font-family: "Instrument Sans", sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.55;
	margin: 0;
	max-width: 95%;
	padding-left: 26px;
	padding-right: 26px;
}

/* ---- Buttons (e.g. QR Pass) -------------------------------------------- */
.tg-feature__btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 22px;
	margin-bottom: 22px;
	padding-left: 26px;
	padding-right: 26px;
}
.tg-feature__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
	padding: 10px 15px;
	border-radius: 30px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
	border: 1.5px solid #1559d6;
	color: #1559d6 !important;
	background: #fff;
	cursor: pointer;
	transition: opacity .15s ease;
}
.tg-feature__btn.is-primary {
	background: #1559d6;
	color: #fff !important;
}
/* Keep the colours identical on hover/focus (the theme recolours bg + text) */
.tg-feature__btn:hover,
.tg-feature__btn:focus {
	color: #1559d6 !important;
	background: #fff !important;
	border-color: #1559d6 !important;
	opacity: .9;
}
.tg-feature__btn.is-primary:hover,
.tg-feature__btn.is-primary:focus {
	color: #fff !important;
	background: #1559d6 !important;
	border-color: #1559d6 !important;
}

/* ---- Media: fills the card height; images contained + centred ---------- */
.tg-feature__media {
	position: relative;
	margin: 0;
	min-height: 220px;
	height: 100%;
	overflow: hidden;
	/* Grid overlay: both images share one cell (stacked, no absolute) and
	   float centred horizontally + vertically. */
	display: grid;
	grid-template-rows: 1fr;
	grid-template-columns: 1fr;
	place-items: end;
}
.tg-feature__img {
	grid-area: 1 / 1;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	box-sizing: border-box;
}
.tg-feature__img--hover {
	pointer-events: none;
	align-self: stretch;
	justify-self: stretch;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	object-fit: contain;
	box-sizing: border-box;
}
/* Card image wired to a Bokun booking (opens the booking modal on click). */
.tg-feature__media--bookable {
	cursor: pointer;
}
.tg-feature__img,
.tg-feature__img--hover {
	/* !important so the swap survives the site's reduce-motion rule
	   (html * { transition-duration: 0s !important }). */
	transition: opacity .4s ease-in-out, transform .4s ease !important;
}
/* FADE (default): hover image crossfades over the base. */
.tg-feature--anim-fade .tg-feature__img--hover {
	opacity: 0;
}
/* VERTICAL: single image slides up on hover (no 2nd image needed).
   .tg-feature__media-crop is the clipping wrapper — height 100% + overflow:hidden
   so translateY on the inner image clips cleanly without affecting the card. */
.tg-feature--anim-vertical .tg-feature__img--hover {
	display: none;
}
.tg-feature--anim-vertical .tg-feature__media {
	flex: 1;
}
.tg-feature--anim-vertical .tg-feature__media-crop {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.tg-feature--anim-vertical .tg-feature__img {
	position: absolute;
	width: 100%;
	height: auto;
	max-width: none;
	max-height: none;
	transform: translateY(0);
}
/* Swap on CARD hover — real-pointer devices only. */
@media (hover: hover) {
	.tg-feature--anim-fade:hover .tg-feature__media.has-hover .tg-feature__img:not(.tg-feature__img--hover) {
		opacity: 0;
	}
	.tg-feature--anim-fade:hover .tg-feature__img--hover {
		opacity: 1;
	}
	.tg-feature--anim-vertical:hover .tg-feature__img {
		transform: translateY(-50%) !important;
	}
}
.tg-features .tg-feature--sos .tg-feature__desc {
	margin-bottom: 0;
}
/* Image sits right under the text (no auto top margin) */
.tg-features .tg-feature--audio-guides .tg-feature__media,
.tg-features .tg-feature--audio-guide .tg-feature__media,
.tg-features .tg-feature--sos .tg-feature__media {
	margin-top: 0;
}
.tg-feature__media-label {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .5px;
	color: #9aa6bd;
	text-transform: uppercase;
	align-self: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Dots only appear in the mobile carousel */
.tg-features__dots { display: none; }

/* Title line break only on mobile ("All Features Make" / "Your Trip Easier") */
.tg-features__br { display: none; }

/* Mobile-only card media (e.g. Arrival Card mascot) */
.tg-feature__media--mobile { display: none; }

/* Tablet + mobile: Swiper carousel mechanics (swiper classes added by JS).
   slidesPerView is set in JS — 1 on mobile, 2 on tablet (>=768px). */
@media (max-width: 1024px) {
	/* Clip peeking slides so they don't cause horizontal page scroll */
	.tg-features { overflow-x: clip; }
	.tg-features .tg-features__title { font-size: 38px; }

	.tg-features__cards,
	.tg-features__cards.swiper {
		overflow: visible;
		width: 100%;
		min-width: 0;
	}
	.tg-features__grid {
		display: flex;
		align-items: stretch;
		grid-template-columns: none;
		gap: 0;
		padding: 6px 0 10px;
	}
	.tg-feature--wide,
	.tg-feature--third {
		grid-column: auto;
		width: 100%;
		flex-shrink: 0;
		min-height: 0;
		/* height auto lets align-items:stretch equalise all cards to the tallest */
		height: auto;
	}

	/* Badge sits at card bottom-left on tablet (same as mobile) */
	.tg-feature {
		position: relative;
	}
	.tg-feature__badge {
		position: absolute;
		left: 26px;
		bottom: 21px;
		z-index: 2;
	}

	/* Dots = Swiper pagination, kept in flow below the carousel */
	.tg-features__dots {
		position: static;
		display: flex;
		gap: 8px;
		justify-content: center;
		margin-top: 24px;
	}
	.tg-features__dots .swiper-pagination-bullet {
		width: 10px;
		height: 10px;
		margin: 0;
		border: none;
		border-radius: 50%;
		background: #cad7f7;
		opacity: 1;
		cursor: pointer;
		transition: background .2s ease;
	}
	.tg-features__dots .swiper-pagination-bullet-active {
		border-radius: 50%;
		background: #7d96e2;
	}

	/* Show mobile/tablet image and hide desktop media on tablet */
	.tg-feature__media--mobile { display: flex; }
	.tg-feature:has(.tg-feature__media--mobile) .tg-feature__media:not(.tg-feature__media--mobile) {
		display: none;
	}

	/* Disable vertical animation on tablet — show image static, no crop clipping */
	.tg-feature--anim-vertical .tg-feature__media-crop {
		height: auto;
		overflow: visible;
	}
	.tg-feature--anim-vertical .tg-feature__img {
		position: static;
		transform: none !important;
		width: 100%;
		max-width: 100%;
	}
}

/* Mobile-only cosmetics (single-column carousel) */
@media (max-width: 767px) {
	.tg-features {
		padding: 90px 16px 64px;
		border-radius: 28px 28px 0 0;
		/* No temple image on mobile — plain light gradient */
		background: linear-gradient(180deg, #e8f1ff 0%, #ffffff 100%);
	}
	.tg-features .tg-features__title { font-size: 20px; margin-bottom: 32px; }
	.tg-features__br { display: inline !important; }
	.tg-features .tg-feature__title { font-size: 20px; }
	.tg-features .tg-feature__desc { font-size: 14px; }

	/* Card container gradient on mobile */
	.tg-feature {
		position: relative;
		background: linear-gradient(180deg, #ffffff 0%, #d6e5ff 100%);
	}
	.tg-feature__btn { padding: 10px; }

	/* "Coming Soon" badge sits at the card's bottom-left on mobile */
	.tg-feature__badge {
		position: absolute;
		left: 26px;
		bottom: 21px;
		z-index: 2;
	}
}
