/**
 * Travel Testimonials — front-end styles.
 *
 * Slider geometry is driven entirely by CSS custom properties so that the
 * number of visible cards, the gap, the border and the image options can all be
 * changed without touching this file:
 *
 *   --ttm-visible      cards per slide (set by JS, 1–4)
 *   --ttm-gap          gutter between cards
 *   --ttm-offset       how many cards the track is shifted by (JS)
 *   --ttm-drag         live drag offset in px (JS)
 *   --ttm-radius       card corner radius
 *   --ttm-border-w/c   card border
 *   --ttm-accent       accent colour (button, dots, destination)
 *   --ttm-image-height / --ttm-image-radius
 */

/* -------------------------------------------------------------------------
   Shell
   ------------------------------------------------------------------------- */
.ttm {
	--ttm-visible: 3;
	--ttm-offset: 0;
	--ttm-drag: 0px;
	--ttm-gap: 24px;
	--ttm-radius: 18px;
	--ttm-border-w: 1px;
	--ttm-border-c: #e7ecf3;
	--ttm-card-bg: #ffffff;
	--ttm-accent: #0d9488;
	--ttm-image-height: 190px;
	--ttm-image-radius: 14px;
	--ttm-card-w: calc((100% - (var(--ttm-visible) - 1) * var(--ttm-gap)) / var(--ttm-visible));

	position: relative;
	box-sizing: border-box;
	font-size: 16px;
	line-height: 1.5;
	color: #475569;
}

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

.ttm-viewport {
	overflow: hidden;
	padding: 14px 10px 26px;
	touch-action: pan-y; /* vertical scrolling stays with the page, horizontal drags the slider */
}

/* Both arrows live together at the top right, in a row of their own. */
.ttm--arrows .ttm-viewport {
	padding-top: 58px;
}

.ttm-track {
	display: flex;
	align-items: stretch;
	gap: var(--ttm-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	width: 100%;
	transform: translate3d(calc(var(--ttm-offset) * -1 * (var(--ttm-card-w) + var(--ttm-gap)) + var(--ttm-drag)), 0, 0);
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.ttm-track.is-dragging {
	transition: none;
}

/* -------------------------------------------------------------------------
   Card
   ------------------------------------------------------------------------- */
.ttm-card {
	flex: 0 0 var(--ttm-card-w);
	width: var(--ttm-card-w);
	min-width: 0;
	display: flex;
	margin: 0;
}

.ttm-card-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--ttm-card-bg);
	border: var(--ttm-card-border-w, var(--ttm-border-w)) solid var(--ttm-card-border-c, var(--ttm-border-c));
	border-radius: var(--ttm-card-radius, var(--ttm-radius));
	overflow: hidden;
	transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease, opacity 0.35s ease;
}

.ttm--shadow .ttm-card-inner {
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* Per-entry styling no longer exists — every card in a slider is identical,
   controlled by the slider's own variables. */

.ttm-card:hover .ttm-card-inner {
	transform: translateY(-4px);
}

.ttm--shadow .ttm-card:hover .ttm-card-inner {
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.13);
}

/* -------------------------------------------------------------------------
   Top image
   ------------------------------------------------------------------------- */
.ttm-media {
	position: relative;
	flex: none;
	width: 100%;
	height: var(--ttm-image-height);
	overflow: hidden;
	background: linear-gradient(135deg, #dbeafe 0%, #ccfbf1 100%);
}

.ttm-media__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ttm-media__initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: calc(var(--ttm-image-height) / 4.2);
	font-weight: 700;
	letter-spacing: 0.04em;
	color: rgba(15, 23, 42, 0.45);
}

/* Square / banner */
.ttm-media--square {
	border-radius: var(--ttm-card-image-radius, var(--ttm-image-radius));
}

/* Circle */
.ttm-media--circle {
	width: min(var(--ttm-image-height), 150px);
	height: min(var(--ttm-image-height), 150px);
	margin: 18px auto 2px;
	border-radius: 50%;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.ttm-media--circle + .ttm-body {
	padding-top: 10px;
}

/* Curved bottoms (square/banner only) — SVG masks scale to the element. */
.ttm-curve--concave {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H100 V100 Q50 68 0 100 Z' fill='%23ffffff'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H100 V100 Q50 68 0 100 Z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.ttm-curve--convex {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H100 V72 Q50 100 0 72 Z' fill='%23ffffff'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H100 V72 Q50 100 0 72 Z' fill='%23ffffff'/%3E%3C/svg%3E");
}

.ttm-curve--concave,
.ttm-curve--convex {
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center bottom;
	mask-position: center bottom;
}

/* A circle is already round — no bottom curve. */
.ttm-media--circle.ttm-curve--concave,
.ttm-media--circle.ttm-curve--convex {
	-webkit-mask-image: none;
	mask-image: none;
}

/* -------------------------------------------------------------------------
   Card body
   ------------------------------------------------------------------------- */
.ttm-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
	padding: 16px 20px 20px;
}

.ttm-name {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
}

.ttm-place {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 0.8125rem;
}

.ttm-destination {
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ttm-accent);
}

.ttm-sep {
	color: #cbd5e1;
}

.ttm-date {
	color: #94a3b8;
}

/* Rating */
.ttm-rating {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	line-height: 1;
}

.ttm-rating__stars {
	display: inline-flex;
	gap: 2px;
	font-size: 1rem;
}

.ttm-star--on {
	color: #f59e0b;
}

.ttm-star--off {
	color: #dfe6ef;
}

.ttm-rating__value {
	font-size: 0.75rem;
	font-weight: 700;
	color: #64748b;
}

.ttm-rating__max {
	color: #94a3b8;
	font-weight: 500;
}

/* Excerpt */
.ttm-excerpt {
	margin: 2px 0 0;
}

.ttm-excerpt p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: #475569;
}

/* Button */
.ttm-button {
	align-self: flex-start;
	margin-top: auto;
	padding: 9px 18px;
	border: 1px solid var(--ttm-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--ttm-accent);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.ttm-button:hover,
.ttm-button:focus-visible {
	background: var(--ttm-accent);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(13, 148, 136, 0.22);
}

/* -------------------------------------------------------------------------
   Arrows + dots
   ------------------------------------------------------------------------- */
.ttm-nav {
	position: absolute;
	top: 9px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--ttm-border-c);
	border-radius: 50%;
	background: #fff;
	color: #334155;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.ttm-nav:hover {
	background: var(--ttm-accent);
	border-color: var(--ttm-accent);
	color: #fff;
}

.ttm-nav:focus-visible {
	outline: 2px solid var(--ttm-accent);
	outline-offset: 3px;
}

.ttm-nav[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
}

.ttm-nav--prev {
	right: 58px; /* sits immediately to the left of the next arrow */
}

.ttm-nav--next {
	right: 10px;
}

.ttm-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 2px 0 0;
	padding: 0 10px 6px;
}

.ttm-dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #cbd5e1;
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.ttm-dot:hover {
	background: #94a3b8;
}

.ttm-dot.is-active {
	width: 26px;
	background: var(--ttm-accent);
}

.ttm-dot:focus-visible {
	outline: 2px solid var(--ttm-accent);
	outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Popup
   ------------------------------------------------------------------------- */
.ttm-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ttm-modal[hidden] {
	display: none;
}

.ttm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.62);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.ttm-modal__dialog {
	position: relative;
	width: 75vw;
	max-width: 75vw;
	max-height: 88vh;
	overflow: hidden auto;
	scrollbar-width: none;      /* scrolling still works, the bar is just hidden */
	-ms-overflow-style: none;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 40px 80px rgba(15, 23, 42, 0.32);
	opacity: 0;
	transform: translateY(18px) scale(0.98);
	transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
	-webkit-overflow-scrolling: touch;
}

.ttm-modal__dialog::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.ttm-modal.is-open .ttm-modal__backdrop {
	opacity: 1;
}

.ttm-modal.is-open .ttm-modal__dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.ttm-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #0f172a;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.ttm-modal__close:hover {
	background: #0f172a;
	color: #fff;
	transform: rotate(90deg);
}

.ttm-modal__content:empty {
	display: none;
}

/* Popup card reuses the front-end variables from the slider it was opened from. */
.ttm-popup {
	--ttm-image-height: 220px;
	display: flex;
	flex-direction: column;
}

.ttm-popup .ttm-media {
	border-radius: 0;
}

.ttm-popup .ttm-media--circle {
	margin: 26px auto 0;
}

.ttm-popup__body {
	padding: 22px 28px 30px;
}

/* Wide popup: lay the photo beside the text instead of above it. */
@media (min-width: 800px) {
	.ttm-popup {
		flex-direction: row;
		align-items: stretch;
		min-height: 46vh;
	}

	.ttm-popup .ttm-media {
		width: 38%;
		height: auto;
	}

	.ttm-popup .ttm-media--circle {
		width: min(var(--ttm-image-height), 160px);
		height: min(var(--ttm-image-height), 160px);
		margin: 26px auto;
		align-self: center;
	}

	.ttm-popup__body {
		width: 62%;
		padding: 36px 42px 40px;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.ttm-popup__name {
		font-size: 1.625rem;
	}
}

.ttm-popup__name {
	margin: 0 0 4px;
	font-size: 1.375rem;
	font-weight: 700;
	color: #0f172a;
}

.ttm-popup__body .ttm-place {
	margin-bottom: 10px;
}

.ttm-popup__text {
	margin-top: 14px;
	font-size: 1rem;
	line-height: 1.75;
	color: #475569;
}

.ttm-popup__text p {
	margin: 0 0 1em;
}

.ttm-popup__text p:last-child {
	margin-bottom: 0;
}

body.ttm-modal-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
   Block editor preview
   ------------------------------------------------------------------------- */
.ttm-block-preview {
	pointer-events: none; /* the preview is a picture — clicks select the block */
}

.ttm-block-label {
	margin: 10px 0 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #1e293b;
}

/* -------------------------------------------------------------------------
   Misc
   ------------------------------------------------------------------------- */
.ttm-empty {
	padding: 18px;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	color: #64748b;
	text-align: center;
}

.ttm-full {
	display: none;
}

/* Small screens: swipe takes over from the arrows. */
@media (max-width: 640px) {
	.ttm-viewport {
		padding: 12px 6px 20px;
	}

	.ttm-body {
		padding: 14px 16px 18px;
	}

	.ttm-modal {
		padding: 12px;
	}

	.ttm-modal__dialog {
		width: 100%;
		max-width: 100%;
		max-height: 92vh;
	}

	.ttm-popup__body {
		padding: 18px 20px 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ttm-track,
	.ttm-card-inner,
	.ttm-button,
	.ttm-nav,
	.ttm-dot,
	.ttm-modal__backdrop,
	.ttm-modal__dialog,
	.ttm-modal__close {
		transition-duration: 0.01ms !important;
	}
}
