/*
 * Activity enquiry picker.
 *
 * Colours are the site's own: #218035 is the green used on every primary
 * button (white on it is 4.99:1), #1c2011 the body ink, #5f656b the muted
 * text already used for inactive tabs (5.9:1 on white).
 */

.leaf-ae {
	--ae-green: #218035;
	--ae-green-dark: #1a6a2b;
	--ae-green-soft: #edf5ef;
	--ae-ink: #1c2011;
	--ae-muted: #5f656b;
	--ae-line: #d9ded8;
	--ae-bg: #f7f9f7;

	/* Little space below: the picker is now the last thing on the page, and
	   the CTA bar already reserves its own height beneath the groups. */
	margin: 48px 0 0;
	font-family: inherit;
	color: var(--ae-ink);
}

/* The template prints page content inside a <p>, so reset what that brings. */
.page-content > p:empty {
	display: none;
}

/* ------------------------------------------------------------- intro --- */

.leaf-ae__intro {
	max-width: 680px;
	margin: 0 auto 28px;
	text-align: center;
}

.leaf-ae__eyebrow {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ae-green);
}

.leaf-ae .leaf-ae__title {
	margin: 0 0 10px;
	font-size: clamp(26px, 3.2vw, 36px);
	line-height: 1.2;
	color: var(--ae-ink);
}

.leaf-ae__lede {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: var(--ae-muted);
}

/* ---------------------------------------------------- category filter --- */

/*
 * Seven pills need about 1,310px on one line, so on most laptop widths they
 * wrap anyway - and a free wrap strands "Special Experiences" alone on the
 * second row. Capping the width makes the break deliberate: All plus three
 * categories, then the other three, at every desktop size.
 */
.leaf-ae__cats {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	max-width: 780px;
	margin: 0 auto 24px;
}

.leaf-ae__cats[hidden] {
	display: none;
}

.leaf-ae .leaf-ae__cat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 40px;
	padding: 8px 12px 8px 14px;
	border: 1px solid var(--ae-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ae-ink);
	font: inherit;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}

.leaf-ae .leaf-ae__cat:hover {
	border-color: var(--ae-green);
}

.leaf-ae .leaf-ae__cat[aria-pressed="true"] {
	background: var(--ae-green);
	border-color: var(--ae-green);
	color: #fff;
}

.leaf-ae__cat-count {
	min-width: 22px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--ae-bg);
	color: var(--ae-muted);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}

.leaf-ae__cat[aria-pressed="true"] .leaf-ae__cat-count {
	background: rgba(255, 255, 255, .22);
	color: #fff;
}

/* A category with something selected in it gets a filled count, so the
   visitor can see at a glance where their choices are. */
.leaf-ae__cat.has-picks .leaf-ae__cat-count {
	background: var(--ae-green);
	color: #fff;
}

.leaf-ae__cat.has-picks[aria-pressed="true"] .leaf-ae__cat-count {
	background: #fff;
	color: var(--ae-green);
}

.leaf-ae__cat.has-picks .leaf-ae__cat-count::before {
	content: "\2713\00a0";
}

/* ------------------------------------------------------------- groups --- */

.leaf-ae__groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.leaf-ae__group {
	min-width: 0;
	margin: 0;
	padding: 20px 22px 22px;
	border: 1px solid var(--ae-line);
	border-radius: 14px;
	background: #fff;
}

.leaf-ae__group[hidden] {
	display: none;
}

/* Filtered to a single category: let it use the full width. */
.leaf-ae__groups.is-single {
	grid-template-columns: minmax(0, 1fr);
}

.leaf-ae .leaf-ae__legend {
	float: left;
	width: 100%;
	margin: 0 0 14px;
	padding: 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--ae-ink);
}

.leaf-ae .leaf-ae__chips {
	clear: both;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The theme gives every list item a bottom margin. */
.leaf-ae .leaf-ae__chips li {
	margin: 0;
	padding: 0;
}

.leaf-ae__chip {
	position: relative;
	display: inline-flex;
	margin: 0;
	cursor: pointer;
}

/* The checkbox stays in the page for keyboards and screen readers; the span
   next to it is what is drawn. */
.leaf-ae__chip input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.leaf-ae__chip span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--ae-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ae-ink);
	font-size: 15px;
	line-height: 1.3;
	transition: background-color .15s, border-color .15s, color .15s;
}

.leaf-ae__chip:hover span {
	border-color: var(--ae-green);
	background: var(--ae-green-soft);
}

.leaf-ae__chip input:checked + span {
	border-color: var(--ae-green);
	background: var(--ae-green);
	color: #fff;
}

/* A tick in front of a chosen activity, drawn in CSS so there is no layout
   jump: the space is not reserved when unselected, and the change happens on
   a click, which layout-shift scoring excludes. */
.leaf-ae__chip input:checked + span::before {
	content: "";
	width: 6px;
	height: 11px;
	margin: -3px 2px 0 1px;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.leaf-ae__chip input:focus-visible + span,
.leaf-ae .leaf-ae__cat:focus-visible,
.leaf-ae .leaf-ae__cta:focus-visible,
.leaf-ae .leaf-ae__clear:focus-visible {
	outline: 3px solid var(--ae-green);
	outline-offset: 2px;
}

/* ---------------------------------------------------------- action bar --- */

/*
 * Sticky to the bottom of the viewport while the picker is on screen, and
 * settling at the end of the form once you scroll past it, so it never sits
 * on top of the activity cards below. Its height is fixed and it only fades
 * in and out, so selecting the first activity moves nothing on the page.
 */
.leaf-ae__bar {
	position: sticky;
	bottom: 12px;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
	margin-top: 20px;
	padding: 12px 14px 12px 22px;
	border: 1px solid var(--ae-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 12px 28px rgba(16, 42, 22, .16);
}

/* Enhanced and empty: keep the space, hide the bar. */
.leaf-ae.is-enhanced:not(.has-selection) .leaf-ae__bar {
	visibility: hidden;
	opacity: 0;
	transform: translateY(12px);
}

.leaf-ae.is-enhanced .leaf-ae__bar {
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.leaf-ae__summary {
	min-width: 0;
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
}

.leaf-ae__summary-count {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-weight: 600;
	color: var(--ae-ink);
}

.leaf-ae__summary-list {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--ae-muted);
	font-size: 14px;
}

.leaf-ae__summary-list:empty {
	display: none;
}

.leaf-ae__actions {
	display: flex;
	flex: none;
	align-items: center;
	gap: 8px;
}

.leaf-ae .leaf-ae__clear {
	min-height: 44px;
	padding: 8px 14px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ae-muted);
	font: inherit;
	font-size: 15px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.leaf-ae .leaf-ae__clear:hover {
	color: var(--ae-ink);
}

/* Nothing to clear without JavaScript tracking the selection. */
.leaf-ae:not(.is-enhanced) .leaf-ae__clear {
	display: none;
}

.leaf-ae .leaf-ae__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--ae-green);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s;
}

.leaf-ae .leaf-ae__cta:hover {
	background: var(--ae-green-dark);
}

.leaf-ae__wa {
	flex: none;
}

/*
 * The floating chat button sits in the bottom-right corner, exactly where the
 * CTA lands. While there is a selection it is lifted clear of the bar. The
 * move follows a click, so it is not scored as a layout shift.
 */
#wp-nt-aio-wrapper {
	transition: bottom .25s ease;
}

body.leaf-ae-active #wp-nt-aio-wrapper {
	bottom: 104px !important;
}

@media (max-width: 900px) {
	.leaf-ae__groups {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 600px) {
	.leaf-ae {
		margin: 32px 0 0;
	}

	.leaf-ae__cats {
		flex-wrap: nowrap;
		justify-content: flex-start;
		max-width: none;
		overflow-x: auto;
		margin-right: -16px;
		margin-left: -16px;
		padding: 2px 16px 6px;
		scrollbar-width: none;
	}

	.leaf-ae__cats::-webkit-scrollbar {
		display: none;
	}

	.leaf-ae .leaf-ae__cat {
		flex: none;
	}

	.leaf-ae__group {
		padding: 16px 16px 18px;
	}

	/*
	 * At phone width one row cannot hold a count, Clear and a full-length
	 * button - the count wrapped to two lines, so the bar changed height as
	 * the text changed. Two fixed rows instead: count and Clear on top, and a
	 * full-width button underneath, which is also the easier thumb target.
	 */
	.leaf-ae__bar {
		flex-wrap: wrap;
		gap: 4px 12px;
		bottom: 8px;
		padding: 8px 12px 12px 16px;
	}

	.leaf-ae__summary {
		flex: 1 1 0;
	}

	.leaf-ae__summary-list {
		display: none;
	}

	.leaf-ae__actions {
		display: contents;
	}

	.leaf-ae .leaf-ae__clear {
		min-height: 40px;
		padding: 4px 6px;
	}

	.leaf-ae .leaf-ae__cta {
		flex: 1 1 100%;
		justify-content: center;
	}

	body.leaf-ae-active #wp-nt-aio-wrapper {
		bottom: 140px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.leaf-ae.is-enhanced .leaf-ae__bar,
	.leaf-ae__chip span,
	.leaf-ae .leaf-ae__cat,
	#wp-nt-aio-wrapper {
		transition: none;
	}
}
