/* ============================================================
   TDM Review Widget — Stylesheet
   Colours driven by CSS custom properties set via PHP
   so the accent can be changed from the Settings page
   without editing this file.
   ============================================================ */

/* Default values — overridden by inline :root block from PHP */
:root {
	--tdm-accent:       #9B4035;
	--tdm-accent-muted: #c98a7f;
}

/* ------------------------------------------------------------
   Shared utilities
   ------------------------------------------------------------ */

.tdm-no-reviews {
	color: #999;
	font-style: italic;
}

.tdm-loading {
	padding: 24px 0;
	opacity: 0.4;
}

.tdm-loading::after {
	content: '';
	display: block;
	width: 28px;
	height: 28px;
	border: 3px solid var(--tdm-accent);
	border-top-color: transparent;
	border-radius: 50%;
	animation: tdm-spin 0.7s linear infinite;
}

@keyframes tdm-spin {
	to { transform: rotate(360deg); }
}

.tdm-route {
	display: block;
	font-size: 0.75em;
	color: var(--tdm-accent-muted);
	letter-spacing: 0.03em;
	margin-top: 3px;
	font-style: normal;
}

.tdm-stars {
	display: inline-flex;
	gap: 1px;
	line-height: 1;
}

.tdm-star {
	font-style: normal;
}

.tdm-star-on {
	color: var(--tdm-accent);
}

.tdm-star-off {
	color: #ddd;
}

/* ------------------------------------------------------------
   Sidebar layout — Minimal (default)
   Matches the "Fine Words from Fine Clients" section style:
   italic serif text, no quote marks, name attribution below
   ------------------------------------------------------------ */

.tdm-sidebar {
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.tdm-sidebar-item {
	border: none;
	padding: 0;
}

/*
 * JS controls which 3 of the 8 pooled reviews are visible on each load.
 * No CSS pre-hiding is used here because the JS shuffle re-appends items
 * to the end of the list, which shifts their nth-child position and causes
 * CSS positional selectors to conflict with the intended visibility.
 * Without-JS: all 8 reviews display (more content, fine for SEO).
 * With-JS:    shuffleSidebar() hides 5 and shows 3 via inline display:none.
 */

.tdm-sidebar-stars {
	margin-bottom: 8px;
	font-size: 0.85em;
}

.tdm-sidebar-text {
	font-style: italic;
	font-family: Georgia, "Times New Roman", Times, serif;
	color: #2d2d2d;
	font-size: 1em;
	line-height: 1.7;
	margin: 0 0 12px 0;
	padding: 0;
	border: none;
	/* No quote marks */
}

.tdm-sidebar-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tdm-sidebar-name {
	font-size: 0.82em;
	font-weight: 700;
	color: #2d2d2d;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-style: normal;
	font-family: inherit;
}

.tdm-sidebar .tdm-route {
	font-size: 0.72em;
}

/* When photos are enabled, meta row is horizontal (avatar + name stack) */
.tdm-sidebar-meta {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

.tdm-sidebar-avatar-wrap {
	flex-shrink: 0;
}

.tdm-sidebar-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.tdm-sidebar-avatar.tdm-avatar-placeholder {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--tdm-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	font-style: normal;
}

.tdm-sidebar-name-wrap {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Boxed variant — each review in a soft card */
.tdm-sidebar--boxed .tdm-sidebar-item {
	background: #faf8f7;
	border: 1px solid #ede8e5;
	border-radius: 8px;
	padding: 20px 22px;
}

/* ------------------------------------------------------------
   Carousel wrapper & Swiper overrides
   ------------------------------------------------------------ */

.tdm-carousel-wrap {
	position: relative;
	padding-left: 44px;
	padding-right: 44px;
}

.tdm-carousel-wrap .swiper-button-prev,
.tdm-carousel-wrap .swiper-button-next {
	color: var(--tdm-accent);
	top: 50%;
	transform: translateY(-50%);
}

.tdm-carousel-wrap .swiper-button-prev::after,
.tdm-carousel-wrap .swiper-button-next::after {
	font-size: 18px;
	font-weight: 700;
}

.tdm-carousel-wrap .swiper-button-prev {
	left: 0;
}

.tdm-carousel-wrap .swiper-button-next {
	right: 0;
}

.tdm-swiper .swiper-slide {
	height: auto;
	display: flex;
}

/* ------------------------------------------------------------
   Review card — clean white, subtle shadow, terracotta accents
   ------------------------------------------------------------ */

.tdm-card {
	background: #ffffff;
	border: 1px solid #ede8e5;
	border-radius: 8px;
	box-shadow: 0 2px 16px rgba(60, 20, 10, 0.06);
	padding: 28px 22px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

/* ---- Avatar ---- */

.tdm-avatar-wrap {
	margin-bottom: 14px;
	flex-shrink: 0;
}

.tdm-avatar {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 2px solid #ede8e5;
}

.tdm-avatar-placeholder {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #9B4035;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1;
	user-select: none;
}

/* ---- Name ---- */

.tdm-card-name {
	display: block;
	font-size: 0.82em;
	font-weight: 700;
	color: #2d2d2d;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin-bottom: 2px;
}

/* ---- Route ---- */

.tdm-card .tdm-route {
	margin-bottom: 14px;
	text-align: center;
}

/* ---- Review text ---- */

.tdm-text-wrap {
	flex: 1 1 auto;
	width: 100%;
	text-align: left;
	margin-bottom: 16px;
}

.tdm-text {
	font-family: Georgia, "Times New Roman", Times, serif;
	font-style: italic;
	font-size: 0.9em;
	line-height: 1.7;
	color: #2d2d2d;
	margin: 0 0 6px;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tdm-text.tdm-text-expanded {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.tdm-read-more-btn {
	appearance: none;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: var(--tdm-accent);
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-style: normal;
	display: inline;
}

.tdm-read-more-btn:hover,
.tdm-read-more-btn:focus-visible {
	text-decoration: underline;
	outline: none;
}

.tdm-read-more-btn.tdm-hidden {
	display: none;
}

/* ---- Card footer ---- */

.tdm-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding-top: 12px;
	border-top: 1px solid #f0ebe8;
	margin-top: auto;
	gap: 8px;
}

.tdm-date-wrap {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.tdm-google-icon {
	display: block;
	flex-shrink: 0;
}

.tdm-rel-date {
	font-size: 0.75em;
	color: var(--tdm-accent-muted);
	white-space: nowrap;
	letter-spacing: 0.02em;
}

/* View on Google links */
.tdm-google-link {
	display: inline-block;
	margin-top: 5px;
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tdm-accent);
	text-decoration: none;
}

.tdm-google-link:hover {
	text-decoration: underline;
}

.tdm-google-link-icon {
	display: flex;
	align-items: center;
	opacity: 0.85;
	transition: opacity 0.15s;
}

.tdm-google-link-icon:hover {
	opacity: 1;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 960px) {
	.tdm-carousel-wrap {
		padding-left: 38px;
		padding-right: 38px;
	}
}

@media (max-width: 600px) {
	.tdm-carousel-wrap {
		padding-left: 32px;
		padding-right: 32px;
	}

	.tdm-card {
		padding: 20px 16px 14px;
	}

	.tdm-carousel-wrap .swiper-button-prev::after,
	.tdm-carousel-wrap .swiper-button-next::after {
		font-size: 15px;
	}
}
