/**
 * Front-end styles for [lf_locations_reviews].
 *
 * Color, radius, and height variables are declared inline by the shortcode
 * (see LF_Shortcode_Reviews::build_inline_css) scoped to #lf-reviews. This
 * file holds layout, type, focus, motion, and responsive rules.
 */

/* Visually hidden but available to assistive tech.
   Plugin-scoped so we don't depend on the theme exposing screen-reader-text. */
.lf-reviews .lf-reviews__sr {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.lf-reviews {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

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

/* Intro */
.lf-reviews__intro {
	font-size: 1.05rem;
	line-height: 1.6;
	margin: 0 0 2rem;
}

.lf-reviews__intro p:last-child {
	margin-bottom: 0;
}

/* Empty state */
.lf-reviews__empty {
	font-size: 1.05rem;
	line-height: 1.6;
	padding: 1.5rem;
	border: 1px dashed var(--lfr-border, #E5E7EB);
	border-radius: var(--lfr-radius, 10px);
	background: #fafafa;
}

/* State nav (chips on desktop + dropdown on mobile, matches directory plugin) */
.lf-reviews-nav {
	position: relative;
	z-index: 50;
	background: rgba(255, 255, 255, 0.96);
	padding: 1rem 0;
	margin: 0 0 2.5rem;
	border-bottom: 1px solid var(--lfr-border, #E5E7EB);
}

.lf-reviews-nav-desktop {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	padding: 0 0.5rem;
	max-width: 1100px;
	margin: 0 auto;
}

/* Dropdown mode: PHP swapped in the dropdown layout because state count
 * met or exceeded the admin threshold. Hide chips, show dropdown at all widths. */
.lf-reviews-nav-dropdown-mode .lf-reviews-nav-desktop { display: none; }
.lf-reviews-nav-dropdown-mode .lf-reviews-nav-mobile {
	display: block;
	padding: 0 0.5rem;
	max-width: 600px;
	margin: 0 auto;
}

.lf-reviews-nav-mobile {
	display: none;
	padding: 0 0.5rem;
	max-width: 600px;
	margin: 0 auto;
}

.lf-reviews-select-wrap { position: relative; width: 100%; }

.lf-reviews-select-label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--lfr-heading, #557085);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.4rem;
}

.lf-reviews-select {
	width: 100%;
	min-height: 52px;
	padding: 0.75rem 2.75rem 0.75rem 1.1rem;
	background: #ffffff;
	color: #2a2a2a;
	border: 2px solid var(--lfr-heading, #557085);
	border-radius: var(--lfr-radius, 10px);
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

.lf-reviews-select:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(85, 112, 133, 0.35);
}

.lf-reviews-select-arrow {
	position: absolute;
	right: 1rem;
	bottom: 18px;
	pointer-events: none;
	color: var(--lfr-heading, #557085);
}

/* Chips */
.lf-reviews-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.5rem 1.1rem;
	background: #f3f4f6;
	color: var(--lfr-heading, #557085);
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lf-reviews-chip:hover {
	background: #ACC1C9;
	color: #ffffff;
}

.lf-reviews-chip:focus-visible {
	outline: none;
	border-color: var(--lfr-heading, #557085);
	box-shadow: 0 0 0 3px rgba(85, 112, 133, 0.35);
}

.lf-reviews-chip-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 0.4rem;
	background: rgba(85, 112, 133, 0.15);
	color: var(--lfr-heading, #557085);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
}

.lf-reviews-chip:hover .lf-reviews-chip-count {
	background: rgba(255, 255, 255, 0.25);
	color: #ffffff;
}

/* State section */
.lf-reviews__state {
	margin: 0 0 2.5rem;
}

.lf-reviews__state:last-child {
	margin-bottom: 0;
}

.lf-reviews__heading {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--lfr-heading, #557085);
	margin: 0 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--lfr-heading-underline, #E5E7EB);
	/* scroll-margin-top is set inline per breakpoint (see build_inline_css). */
}

/* Pill list */
.lf-reviews .lf-reviews__list,
.lf-reviews ul.lf-reviews__list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
}

.lf-reviews .lf-reviews__list .lf-reviews__item,
.lf-reviews ul.lf-reviews__list li.lf-reviews__item {
	list-style: none !important;
	margin: 0;
	padding: 0;
	background: none;
}

.lf-reviews .lf-reviews__list .lf-reviews__item::before,
.lf-reviews ul.lf-reviews__list li.lf-reviews__item::before {
	display: none !important;
	content: none !important;
}

/* Pill */
.lf-reviews__pill {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.95rem 1.1rem;
	min-height: var(--lfr-height-desktop, 56px);
	background: var(--lfr-bg, #FFFFFF);
	border: 1px solid var(--lfr-border, #E5E7EB);
	border-left: 4px solid var(--lfr-accent, #D4B896);
	border-radius: var(--lfr-radius, 10px);
	text-decoration: none;
	color: inherit;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.lf-reviews__pill:hover,
.lf-reviews__pill:focus-visible {
	background: var(--lfr-hover-bg, #F0E4D3);
	border-color: var(--lfr-accent, #D4B896);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	color: inherit;
	text-decoration: none;
}

.lf-reviews__pill:focus-visible {
	outline: 3px solid var(--lfr-arrow, #557085);
	outline-offset: 2px;
}

.lf-reviews__star {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	color: var(--lfr-star, #FBBC04);
}

.lf-reviews__city {
	flex: 1;
	font-size: 1.05rem;
	font-weight: 600;
}

.lf-reviews__arrow {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: var(--lfr-arrow, #557085);
	transition: transform 0.15s ease;
}

.lf-reviews__pill:hover .lf-reviews__arrow,
.lf-reviews__pill:focus-visible .lf-reviews__arrow {
	transform: translateX(3px);
}

/* Back-to-top button */
.lf-reviews-top {
	position: fixed;
	bottom: calc(40px + env(safe-area-inset-bottom, 0px));
	width: 48px;
	height: 48px;
	min-width: 48px;
	min-height: 48px;
	border-radius: 50%;
	border: 0;
	background: var(--lfr-arrow, #557085);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
	z-index: 9999;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.lf-reviews-top--right { right: 20px; }
.lf-reviews-top--left  { left: 20px; }

.lf-reviews-top.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.lf-reviews-top:hover,
.lf-reviews-top:focus-visible {
	background: var(--lfr-heading, #455e72);
}

.lf-reviews-top:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.lf-reviews-top svg {
	width: 22px;
	height: 22px;
}

/* Mobile */
@media (max-width: 768px) {
	.lf-reviews__intro { font-size: 1rem; }
	.lf-reviews__heading { font-size: 1.25rem; }
	.lf-reviews__city { font-size: 1rem; }
	.lf-reviews__pill {
		min-height: var(--lfr-height-mobile, 60px);
		padding: 1rem 1.1rem;
	}
	/* Switch chips out, dropdown in. */
	.lf-reviews-nav { margin: 0 0 1.5rem; padding: 0.75rem 0; }
	.lf-reviews-nav-desktop { display: none; }
	.lf-reviews-nav-mobile { display: block; }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.lf-reviews__pill,
	.lf-reviews__arrow,
	.lf-reviews-chip,
	.lf-reviews-top {
		transition: none;
	}
	.lf-reviews__pill:hover,
	.lf-reviews__pill:focus-visible {
		transform: none;
	}
	.lf-reviews__pill:hover .lf-reviews__arrow,
	.lf-reviews__pill:focus-visible .lf-reviews__arrow {
		transform: none;
	}
	html.lf-reviews-smooth-scroll { scroll-behavior: auto; }
}
