/* =========================================================================
   TOUBKAL-MAROC — Tour reviews (ACF "Avis" post type) — carousel + popup
   Loaded on Single Tour pages.
   ========================================================================= */

.tbk-tour-reviews {
	--tbk-line: #ececec;

	background: var(--tbk-cream);
	color: var(--tbk-ink);
	font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", sans-serif;
	padding: 5rem 0;
}

.tbk-tour-reviews__inner {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.tbk-tour-reviews__carousel {
	position: relative;
}

/* ---- Header ------------------------------------------------------------ */

.tbk-tour-reviews__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 1.4rem;
}

.tbk-tour-reviews__rating {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--tbk-ink);
}

.tbk-tour-reviews__rating .tbk-star {
	width: 22px;
	height: 22px;
	color: var(--tbk-accent);
}

.tbk-tour-reviews__score {
	font-weight: 800;
	font-size: 1.5rem;
	line-height: 1;
}

.tbk-tour-reviews__count {
	font-size: 1rem;
	color: var(--tbk-ink-soft);
}

.tbk-tour-reviews__title {
	font-family: "Ubuntu", sans-serif;
	font-weight: 800;
	font-size: clamp(1.35rem, 0.9rem + 1.2vw, 1.7rem);
	line-height: 1.15;
	margin: 0.55rem 0 0;
	color: var(--tbk-ink);
}

.tbk-tour-reviews__nav-group {
	display: inline-flex;
	gap: 12px;
	flex: none;
	padding-top: 4px;
}

.tbk-tour-reviews__nav {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--tbk-chip);
	color: var(--tbk-ink);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.tbk-tour-reviews__nav:hover:not(:disabled) {
	background: var(--tbk-accent);
	color: #fff;
}

.tbk-tour-reviews__nav:disabled {
	opacity: 0.4;
	cursor: default;
}

.tbk-tour-reviews.tbk-is-static .tbk-tour-reviews__nav-group {
	display: none;
}

/* ---- Carousel ---------------------------------------------------------- */

.tbk-tour-reviews__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 2px 0 2px;
	cursor: grab;
}

.tbk-tour-reviews__viewport::-webkit-scrollbar {
	display: none;
}

.tbk-tour-reviews__viewport.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.tbk-tour-reviews__track {
	display: flex;
	align-items: stretch;
	gap: 24px;
	padding: 0;
}

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

.tbk-tour-reviews .tbk-review {
	display: flex;
	flex-direction: column;
	flex: 0 0 calc((100% - 48px) / 3);
	max-width: calc((100% - 48px) / 3);
	box-sizing: border-box;
	scroll-snap-align: start;
	background: #fff;
	border: 1px solid var(--tbk-line);
	border-radius: var(--tbk-r-card);
	padding: 24px;
	box-shadow: 0 8px 22px rgba(var(--tbk-ink-rgb), 0.05);
	margin: 0;
}

.tbk-tour-reviews .tbk-review__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.tbk-tour-reviews .tbk-review__avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex: none;
}

.tbk-tour-reviews .tbk-review__avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--tbk-accent-soft);
	color: var(--tbk-accent-dark);
	font-weight: 800;
	font-size: 1.15rem;
}

.tbk-tour-reviews .tbk-review__ident {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	flex: 1;
}

.tbk-tour-reviews .tbk-review__name {
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--tbk-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tbk-tour-reviews .tbk-review__score-row {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tbk-tour-reviews .tbk-review__score-row .tbk-star {
	width: 16px;
	height: 16px;
	color: var(--tbk-accent);
}

.tbk-tour-reviews .tbk-review__score {
	font-weight: 800;
	font-size: 1rem;
	color: var(--tbk-ink);
}

.tbk-tour-reviews .tbk-review__date {
	flex: none;
	margin-left: auto;
	font-style: italic;
	font-size: 0.88rem;
	color: var(--tbk-ink-soft);
	white-space: nowrap;
	padding-top: 2px;
}

.tbk-tour-reviews .tbk-review__quote {
	margin-top: 16px;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--tbk-ink);
}

.tbk-tour-reviews .tbk-review__quote p {
	margin: 0;
}

/* Clamp only inside the carousel, not in the popup. */
.tbk-tour-reviews .tbk-tour-reviews__track .tbk-review__quote {
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---- Footer / more reviews -------------------------------------------- */

.tbk-tour-reviews__footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 6px;
}

.tbk-tour-reviews__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	padding: 6px 2px;
	cursor: pointer;
	font: inherit;
	font-weight: 800;
	font-size: 1rem;
	color: var(--tbk-ink);
	transition: color 0.2s ease;
}

.tbk-tour-reviews__more:hover {
	color: var(--tbk-accent);
}

/* ---- Popup item styling (shared .tbk-modal chrome lives in tbk-modal.css) */

.tbk-modal .tbk-review {
	flex: none;
	width: auto;
	max-width: 100%;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	padding: 0 0 28px;
	margin: 0 0 28px;
	border-bottom: 1px solid var(--tbk-line);
}

.tbk-modal .tbk-review:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}

.tbk-modal .tbk-review__quote {
	display: block;
	overflow: visible;
	margin-top: 18px;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 991px) {
	.tbk-tour-reviews .tbk-review {
		flex-basis: calc((100% - 24px) / 2);
		max-width: calc((100% - 24px) / 2);
	}
}

@media (max-width: 600px) {
	.tbk-tour-reviews {
		padding: 4rem 0;
	}

	.tbk-tour-reviews .tbk-review {
		flex-basis: 100%;
		max-width: 100%;
	}
}
