/* =========================================================
   Testimonials — long reviews
   A review over the widget's word limit shows an excerpt in the card and a
   "Read more" button that opens the whole review in a popup. Built from the
   design's own tokens so it reads as part of the site; the popup follows the
   gallery lightbox's pattern (fixed, dark ground, close button, fade).
   ========================================================= */

/* --- the button in the card --- */
.tst__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	margin-top: 14px;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--font-body);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	color: var(--orange-dark);
	cursor: pointer;
	transition: color .15s ease, gap .15s ease;
}

.tst__more svg {
	width: 16px;
	height: 16px;
	flex: none;
}

.tst__more:hover {
	color: var(--orange);
	gap: 9px;
}

.tst__more:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: 4px;
	border-radius: 4px;
}

/* The full text is only for the popup; nothing shows it in the card. */
.tst__full[hidden] {
	display: none;
}

/* --- the popup --- */
body.tst-modal-open {
	overflow: hidden;
}

.tst-modal {
	position: fixed;
	inset: 0;
	z-index: 400;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(18, 17, 16, .78);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .22s ease, visibility .22s ease;
}

.tst-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.tst-modal__panel {
	position: relative;
	width: min(100%, 640px);
	max-height: calc(100dvh - clamp(32px, 8vw, 96px));
	display: flex;
	flex-direction: column;
	padding: clamp(24px, 4vw, 44px);
	border-radius: var(--r-panel);
	background: var(--paper);
	color: var(--text);
	box-shadow: 0 50px 90px -20px rgba(0, 0, 0, .55);
	transform: translateY(14px) scale(.98);
	transition: transform .26s cubic-bezier(.2, .7, .2, 1);
}

.tst-modal.is-open .tst-modal__panel {
	transform: none;
}

.tst-modal__close {
	position: absolute;
	top: clamp(12px, 2vw, 18px);
	right: clamp(12px, 2vw, 18px);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid var(--line);
	background: var(--paper);
	color: var(--text);
	cursor: pointer;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.tst-modal__close:hover {
	background: var(--ink);
	color: var(--color-white);
	border-color: var(--ink);
}

.tst-modal__close:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: 2px;
}

.tst-modal__close svg {
	width: 18px;
	height: 18px;
}

/* Who said it — avatar, handwritten name, muted role, like the card. */
.tst-modal__head {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-right: 52px; /* room for the close button */
	margin-bottom: clamp(18px, 3vw, 26px);
}

.tst-modal__avatar {
	width: 58px;
	height: 58px;
	flex: none;
	border-radius: 50%;
	overflow: hidden;
	border: 1px solid var(--line);
}

.tst-modal__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tst-modal__name {
	display: block;
	font-family: "Caveat", "Segoe Script", "Bradley Hand", cursive;
	font-weight: 700;
	font-size: 1.7rem;
	line-height: 1;
}

.tst-modal__role {
	display: block;
	margin-top: 5px;
	font-size: 0.86rem;
	color: var(--text-mut);
}

/* The review itself scrolls if it is taller than the screen. */
.tst-modal__quote {
	position: relative;
	margin: 0;
	padding: 0 2px 4px 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	font-size: clamp(1rem, 1.1vw, 1.08rem);
	line-height: 1.7;
	color: var(--text);
}

.tst-modal__quote p {
	margin: 0;
}

.tst-modal__quote p + p {
	margin-top: 0.9em;
}

/* A large orange opening quote mark, the way the section's heading is accented. */
.tst-modal__quote::before {
	content: "\201C";
	display: block;
	height: 0.55em;
	margin-bottom: 0.35em;
	font-family: var(--font-display);
	font-size: 3.2rem;
	font-weight: 500;
	line-height: 1;
	color: var(--orange);
}

@media (max-width: 480px) {
	.tst-modal {
		align-items: flex-end;
		padding: 0;
	}

	.tst-modal__panel {
		width: 100%;
		max-height: calc(100dvh - 40px);
		border-radius: var(--r-panel) var(--r-panel) 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tst-modal,
	.tst-modal__panel,
	.tst__more {
		transition: none;
	}

	.tst-modal__panel {
		transform: none;
	}
}
