/*
 * Colour strategy: this widget is dropped into an unknown theme, light or
 * dark. Anything sitting directly on the page background (badge, summary,
 * pagination status) inherits the theme's own text colour instead of
 * hardcoding one, since the theme already guarantees that colour contrasts
 * with its own background. Anything sitting on a surface WE paint (the
 * light carousel card, the white pagination buttons) gets an explicit,
 * fixed dark colour with !important so a theme's heading/paragraph rules
 * can't leak white-on-white text onto it.
 */
.tar-widget {
	--tar-green: #00aa6c;
	--tar-border: #e2e5e9;
	--tar-on-light: #23282d;
	--tar-on-light-muted: #6b7280;
	box-sizing: border-box;
	color: inherit;
	font-size: 15px;
	line-height: 1.5;
}

.tar-widget *,
.tar-widget *::before,
.tar-widget *::after {
	box-sizing: inherit;
}

.tar-loading,
.tar-error,
.tar-empty {
	color: inherit;
	font-size: 0.95em;
	opacity: 0.75;
}

.tar-notice {
	background: #fff8e5;
	border: 1px solid #f0d58c;
	border-radius: 4px;
	color: #6b5300;
	font-size: 0.9em;
	padding: 0.6em 0.9em;
}

/* Rating badge */
.tar-badge {
	align-items: start;
	display: inline-grid;
	gap: 0.4rem 0.9rem;
	grid-template-columns: auto auto;
	justify-content: start;
}

.tar-badge__link {
	color: inherit;
	display: inline-block;
	text-decoration: none;
}

.tar-badge__brand {
	align-items: center;
	display: inline-flex;
	gap: 0.5rem;
}

.tar-logo {
	display: block;
	height: 1.3rem;
	max-width: 8rem;
	object-fit: contain;
	width: auto;
}

.tar-badge__rating {
	align-items: center;
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.tar-badge__count {
	color: inherit;
	font-size: 0.9em;
	opacity: 0.75;
}

.tar-badge__ranking {
	color: inherit;
	font-size: 0.85em;
	grid-column: 1 / -1;
	opacity: 0.75;
}

/* Logo gets its own fixed-white plate so it stays legible on any theme background */
.tar-logo-wrap {
	background: #fff;
	border-radius: 4px;
	display: inline-flex;
	padding: 0.2rem 0.5rem;
}

/* Stars: empty stars fade the surrounding text colour so they read on light
   or dark; filled stars stay TripAdvisor green, which works on both. */
.tar-stars {
	align-items: center;
	color: currentColor;
	display: inline-flex;
	gap: 0.14rem;
	line-height: 1;
}

.tar-stars--compact {
	gap: 0.08rem;
}

.tar-stars__star {
	color: currentColor;
	font-size: 1rem;
	opacity: 0.3;
}

.tar-stars--compact .tar-stars__star {
	font-size: 0.95rem;
}

.tar-stars__star.is-filled {
	color: var(--tar-green);
	opacity: 1;
}

/* Reviews block shared by carousel + list modes */
.tar-reviews__summary {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: space-between;
	margin-bottom: 1rem;
}

@media (min-width: 640px) {
	.tar-reviews__summary {
		flex-direction: row;
		align-items: center;
	}
}

.tar-reviews__title {
	color: inherit;
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 0.15rem;
}

.tar-reviews__meta {
	color: inherit;
	font-size: 0.9em;
	opacity: 0.75;
}

.tar-reviews__link {
	background: #fff;
	border: 1px solid var(--tar-green);
	border-radius: 4px;
	color: var(--tar-green);
	display: inline-block;
	flex-shrink: 0;
	font-size: 0.85em;
	font-weight: 600;
	padding: 0.4em 0.9em;
	text-decoration: none;
	white-space: nowrap;
}

.tar-reviews__link:hover,
.tar-reviews__link:focus {
	background: var(--tar-green);
	color: #fff;
}

.tar-review {
	border: 1px solid var(--tar-border);
	border-radius: 0.75rem;
	padding: 1.1rem 1.3rem;
}

.tar-review + .tar-review {
	margin-top: 0.9rem;
}

.tar-review__title {
	color: inherit;
	font-size: 1em;
	font-weight: 600;
	margin: 0 0 0.5rem;
}

.tar-review__text {
	color: inherit;
	margin: 0.6rem 0;
}

.tar-review__meta {
	color: inherit;
	font-size: 0.85em;
	opacity: 0.75;
}

/* The carousel paints its own light card behind reviews, so force dark,
   fixed-contrast text there regardless of what the surrounding theme does
   with headings and paragraphs. */
.tar-carousel .tar-review__title,
.tar-carousel .tar-review__text {
	color: var(--tar-on-light) !important;
	opacity: 1;
}

.tar-carousel .tar-review__meta {
	color: var(--tar-on-light-muted) !important;
	opacity: 1;
}

.tar-review__source {
	color: var(--tar-green);
	display: inline-block;
	font-size: 0.85em;
	font-weight: 600;
	margin-top: 0.5rem;
	text-decoration: none;
}

/* Carousel mode */
.tar-carousel {
	background: linear-gradient(180deg, #fbfcfc 0%, #f5f8f7 100%);
	border: 1px solid var(--tar-border);
	border-radius: 1rem;
	overflow: hidden;
	position: relative;
}

.tar-carousel__track {
	min-height: 12rem;
	padding: 1.5rem 3.5rem;
}

.tar-carousel .tar-review {
	border: none;
	padding: 0;
}

.tar-carousel__nav {
	align-items: center;
	background: rgba(20, 90, 95, 0.85);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	display: flex;
	height: 2.25rem;
	justify-content: center;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 2.25rem;
}

.tar-carousel__nav:hover {
	background: var(--tar-green);
}

.tar-carousel__nav--prev {
	left: 0.75rem;
}

.tar-carousel__nav--next {
	right: 0.75rem;
}

.tar-carousel__dots {
	display: flex;
	gap: 0.4rem;
	justify-content: center;
	padding-bottom: 1rem;
}

.tar-carousel__dot {
	background: #c9d2d6;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	height: 0.5rem;
	padding: 0;
	width: 0.5rem;
}

.tar-carousel__dot.is-active {
	background: var(--tar-green);
}

/* List mode pagination */
.tar-pagination {
	align-items: center;
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	margin-top: 1.1rem;
}

.tar-pagination__status {
	color: inherit;
	font-size: 0.85em;
	opacity: 0.75;
}

/* Fixed white pill regardless of theme, so it needs fixed dark text too. */
.tar-pagination__button {
	background: #fff;
	border: 1px solid var(--tar-border);
	border-radius: 4px;
	color: var(--tar-on-light) !important;
	cursor: pointer;
	font-size: 0.85em;
	padding: 0.4em 0.9em;
}

.tar-pagination__button:hover:not(:disabled) {
	border-color: var(--tar-green);
	color: var(--tar-green) !important;
}

.tar-pagination__button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

/* Admin meta box */
.tar-meta-box .tar-search-results {
	margin: 0.75rem 0;
}

.tar-search-result {
	align-items: center;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	padding: 0.6rem 0.9rem;
}

.tar-search-result + .tar-search-result {
	margin-top: 0.5rem;
}

.tar-search-result__name {
	font-weight: 600;
}

.tar-search-result__address,
.tar-search-result__id {
	color: #646970;
	font-size: 0.85em;
}

.tar-shortcode-hints {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	margin-top: 1rem;
	padding: 0.8rem 1rem;
}

.tar-shortcode-hints p {
	margin: 0.3em 0;
}
