/*
 * The floating banner block (limeconnect/floating-banner).
 * z-index 990: above the page, below header/menu (1000+), lightbox, Cookiebot,
 * Popup Maker and Userlike, so anything modal covers it.
 * Set by floating-banner.js: --lcc-floating-banner-h on <html> (room the
 * banner takes); html.lcc-floating-banner-on (body padding);
 * html.lcc-floating-banner-lift (chat launcher raised);
 * html.lcc-floating-banner-corner (card or pill, no body padding on wide
 * screens); .lcc-floating-banner--card / --pill (design);
 * .lcc-floating-banner--reserve (launcher corner kept free when the lift
 * fails); .lcc-floating-banner--paused (hidden without closing, also while the
 * consent dialog is open). The button colour is a
 * .lcc-floating-banner__button--{primary,teal,aqua,dark,white} modifier,
 * rendered by the server.
 */

.lcc-floating-banner {
	--lcc-floating-banner-ink: var(--wp--preset--color--neutral-900, #26272b);
	--lcc-floating-banner-muted: #45474f;

	position: fixed;
	z-index: 990;
	/* Centred by auto margins, not a transform, so the entrance animation is
	   the only transform and the script can read the layout box. */
	left: 0;
	right: 0;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 16px;
	width: min(880px, calc(100% - 32px));
	margin: 0 auto;
	padding: 15px 8px 15px 16px;
	border: 1px solid rgba(38, 39, 43, 0.12);
	border-radius: 16px;
	background-color: #e9faf2;
	background-image:
		linear-gradient(
			90deg,
			#d7f2c7 0%,
			#e8f8e4 28%,
			#e9faf2 48%,
			#def9fe 72%,
			#dcf8ff 100%
		);
	box-shadow: 0 12px 32px rgba(14, 26, 38, 0.16);
	color: var(--lcc-floating-banner-ink);
	font-size: 15px;
	line-height: 1.35;
	animation: lcc-floating-banner-in 200ms ease-out both;
}

.lcc-floating-banner[hidden] {
	display: none;
}

.lcc-floating-banner.lcc-floating-banner--paused {
	visibility: hidden;
}

.lcc-floating-banner__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.7);
}

.lcc-floating-banner__icon::before {
	content: '';
	width: 0;
	height: 0;
	margin-left: 3px;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 10px solid var(--lcc-floating-banner-ink);
}

.lcc-floating-banner__text {
	flex: 1;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	color: var(--lcc-floating-banner-muted);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lcc-floating-banner__text strong,
.lcc-floating-banner__text b {
	color: var(--lcc-floating-banner-ink);
}

.lcc-floating-banner__short {
	display: none;
}

/* Arrow button rules repeated from the theme (inc/button-styles.php), which
   prints them only on pages with a button block. */
/* Button colours: a fixed set of theme palette colours, picked in the block's
   sidebar, primary lime by default. Ink is chosen per colour for contrast. */
.lcc-floating-banner__button {
	--lcc-floating-banner-btn-bg: var(--wp--preset--color--primary, #bee034);
	--lcc-floating-banner-btn-ink: var(--wp--preset--color--neutral-900, #26272b);

	flex: none;
	margin: 0;
	font-weight: 600;
}

.lcc-floating-banner__button--teal {
	--lcc-floating-banner-btn-bg: var(--wp--preset--color--brand-1, #6fcdb6);
}

.lcc-floating-banner__button--aqua {
	--lcc-floating-banner-btn-bg: var(--wp--preset--color--aqua, #a6efff);
}

.lcc-floating-banner__button--dark {
	--lcc-floating-banner-btn-bg: var(--wp--preset--color--neutral-900, #26272b);
	--lcc-floating-banner-btn-ink: var(--wp--preset--color--white, #fff);
}

.lcc-floating-banner__button--white {
	--lcc-floating-banner-btn-bg: var(--wp--preset--color--white, #fff);
	--lcc-floating-banner-btn-border: rgba(38, 39, 43, 0.2);
}

.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button {
	position: relative;
	display: flex;
	align-items: center;
	padding: 18.5px calc(45px + var(--wp--preset--font-size--body-1, 1.125rem)) 18.5px 30px;
	border-radius: 99px;
	background-color: var(--lcc-floating-banner-btn-bg);
	box-shadow: inset 0 0 0 1px var(--lcc-floating-banner-btn-border, transparent);
	color: var(--lcc-floating-banner-btn-ink);
	font-family: var(--wp--preset--font-family--headline, inherit);
	font-size: var(--wp--preset--font-size--body-1, 1.125rem);
	font-weight: 600;
	line-height: 22.5px;
	text-decoration: none;
	white-space: nowrap;
	transition: all 300ms, transform 300ms cubic-bezier(0.25, 0.4, 0.55, 1.4);
}

.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button::before {
	display: none;
}

.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 30px;
	display: block;
	width: var(--wp--preset--font-size--body-1, 1.125rem);
	height: var(--wp--preset--font-size--body-1, 1.125rem);
	background: currentColor;
	-webkit-mask: url('data:image/svg+xml,%3Csvg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill-rule="evenodd" clip-rule="evenodd" d="M8.18875 1.23334L14.7852 7.5L8.18876 13.7667L6.81125 12.3167L10.8288 8.5H1.66667V6.5H10.8288L6.81125 2.68333L8.18875 1.23334Z" fill="%23545762"/%3E%3C/svg%3E%0A');
	mask: url('data:image/svg+xml,%3Csvg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill-rule="evenodd" clip-rule="evenodd" d="M8.18875 1.23334L14.7852 7.5L8.18876 13.7667L6.81125 12.3167L10.8288 8.5H1.66667V6.5H10.8288L6.81125 2.68333L8.18875 1.23334Z" fill="%23545762"/%3E%3C/svg%3E%0A');
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	transform: translateY(-50%);
	transition: transform ease-out 200ms;
}

/* Theme's small size (general.css); !important because the arrow style sets
   its padding with !important. */
.lcc-floating-banner .is-style-klingit-primary-button-arrow.is-style-button-size--small .wp-element-button {
	padding: 12.3px calc(var(--wp--preset--font-size--body-1, 1.125rem) + 23.3px) 12.3px 20px !important;
	font-size: 15px;
}

.lcc-floating-banner .is-style-klingit-primary-button-arrow.is-style-button-size--small .wp-element-button::after {
	right: 20px;
	width: calc(var(--wp--preset--font-size--body-1, 1.125rem) * 2 / 3);
	height: calc(var(--wp--preset--font-size--body-1, 1.125rem) * 2 / 3);
}

/* Dark ring: the theme's #dfef99 is ~1.1:1 on the bar. !important because the
   theme sets its ring with !important. */
.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button:focus-visible {
	border-radius: 999px;
	outline: 3px solid var(--lcc-floating-banner-ink) !important;
	outline-offset: 2px;
}

@media (hover: hover) {
	.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button:hover {
		background-color: var(--lcc-floating-banner-btn-bg);
		color: var(--lcc-floating-banner-btn-ink);
		transform: scale(1.04, 1.02);
	}

	.lcc-floating-banner .is-style-klingit-primary-button-arrow .wp-element-button:hover::after {
		transform: translate(4px, -50%);
	}
}

.lcc-floating-banner__close {
	flex: none;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lcc-floating-banner-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.lcc-floating-banner__close:hover {
	background: rgba(38, 39, 43, 0.08);
}

.lcc-floating-banner__close:focus-visible {
	outline: 3px solid var(--lcc-floating-banner-ink);
	outline-offset: 2px;
}

.lcc-floating-banner.lcc-floating-banner--reserve {
	padding-right: 104px;
}

html.lcc-floating-banner-on body {
	padding-bottom: var(--lcc-floating-banner-h, 0);
}

/* Userlike's classes are hashed, so target its test ids; translate adds to its
   own offsets. */
html.lcc-floating-banner-lift [data-test-id='userlike-container'] [data-test-id='button'] > div,
html.lcc-floating-banner-lift [data-test-id='userlike-container'] [data-test-id='notifications'] > div,
html.lcc-floating-banner-lift .chat-button-label-container > * {
	translate: 0 calc(-1 * var(--lcc-floating-banner-h, 0px));
	transition: translate 200ms ease-out;
}

@media (max-width: 767px) {
	.lcc-floating-banner {
		left: 0;
		right: 0;
		bottom: 0;
		gap: 8px;
		width: auto;
		margin: 0;
		padding: 8px 4px max(8px, env(safe-area-inset-bottom, 0px)) 12px;
		border-width: 1px 0 0;
		border-radius: 0;
		box-shadow: 0 -6px 20px rgba(14, 26, 38, 0.12);
		font-size: 14px;
	}

	.lcc-floating-banner__icon {
		display: none;
	}

	.lcc-floating-banner__text {
		color: var(--lcc-floating-banner-ink);
		font-weight: 600;
	}

	/* Visually hidden, still read by screen readers. */
	.lcc-floating-banner__long {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.lcc-floating-banner__short {
		display: inline;
	}
}

@media (max-width: 339px) {
	.lcc-floating-banner__text {
		flex: 0 0 0;
	}

	.lcc-floating-banner__short {
		display: none;
	}

	.lcc-floating-banner__button {
		margin-right: auto;
	}
}

@keyframes lcc-floating-banner-in {
	from {
		opacity: 0;
		transform: translateY(100%);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lcc-floating-banner {
		animation: none;
	}

	html.lcc-floating-banner-lift [data-test-id='userlike-container'] [data-test-id='button'] > div,
	html.lcc-floating-banner-lift [data-test-id='userlike-container'] [data-test-id='notifications'] > div,
	html.lcc-floating-banner-lift .chat-button-label-container > * {
		transition: none;
	}
}

/* Designs. The bar is the default; the script adds lcc-floating-banner--card or
   lcc-floating-banner--pill from the block's design or ?lt_design. */
.lcc-floating-banner__media,
.lcc-floating-banner__meta {
	display: none;
}

/* Card and pill sit in a corner: no room needed at the bottom of the page. */
@media (min-width: 768px) {
	html.lcc-floating-banner-on.lcc-floating-banner-corner body {
		padding-bottom: 0;
	}
}

/* Card and pill start --lcc-floating-banner-left from the left (the block's
   offsetLeft, default 88px): right of Cookiebot's consent button
   (#CookiebotWidget, about 48px wide at 24px from the left), which shows there
   once a visitor has answered the dialog. */

/* Card: bottom left, poster on top, text wraps. */
.lcc-floating-banner.lcc-floating-banner--card {
	right: auto;
	left: var(--lcc-floating-banner-left, 88px);
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	width: 340px;
	margin: 0;
	padding: 12px 12px 16px;
	border-radius: 20px;
	background-image: linear-gradient(160deg, #d7f2c7 0%, #e9faf2 55%, #dcf8ff 100%);
}

.lcc-floating-banner--card .lcc-floating-banner__icon {
	display: none;
}

.lcc-floating-banner--card .lcc-floating-banner__poster {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 12px;
}

.lcc-floating-banner--card .lcc-floating-banner__media {
	position: relative;
	display: block;
}

.lcc-floating-banner--card .lcc-floating-banner__media::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 52px;
	height: 52px;
	margin: -26px 0 0 -26px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9) url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"%3E%3Cpath d="M7 5l8 5-8 5z" fill="%2326272b"/%3E%3C/svg%3E') center / 22px no-repeat;
	box-shadow: 0 4px 12px rgba(14, 26, 38, 0.2);
}

.lcc-floating-banner--card .lcc-floating-banner__meta {
	display: block;
	margin: 0 4px;
	color: var(--lcc-floating-banner-muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.lcc-floating-banner--card .lcc-floating-banner__text {
	margin: -6px 4px 0;
	white-space: normal;
}

.lcc-floating-banner--card .lcc-floating-banner__button {
	margin: 0 4px;
}

.lcc-floating-banner--card .lcc-floating-banner__button .wp-element-button {
	justify-content: center;
}

.lcc-floating-banner--card .lcc-floating-banner__close {
	position: absolute;
	top: 18px;
	right: 18px;
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.9);
	font-size: 20px;
}

.lcc-floating-banner--card .lcc-floating-banner__close:hover {
	background: #fff;
}

/* Pill: small, bottom left, one line. */
.lcc-floating-banner.lcc-floating-banner--pill {
	right: auto;
	left: var(--lcc-floating-banner-left, 88px);
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	gap: 10px;
	width: auto;
	max-width: calc(100% - 120px);
	margin: 0;
	padding: 6px 4px 6px 6px;
	border-radius: 999px;
}

.lcc-floating-banner--pill .lcc-floating-banner__text {
	flex: none;
	color: var(--lcc-floating-banner-ink);
	font-weight: 600;
}

.lcc-floating-banner--pill .lcc-floating-banner__long {
	display: none;
}

.lcc-floating-banner--pill .lcc-floating-banner__short {
	display: inline;
}

.lcc-floating-banner--pill .lcc-floating-banner__close {
	width: 36px;
	height: 36px;
	font-size: 20px;
}

@media (max-width: 767px) {
	.lcc-floating-banner.lcc-floating-banner--card {
		left: 8px;
		right: 8px;
		bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		display: grid;
		grid-template-columns: 112px 1fr;
		grid-template-areas: 'media text' 'media button';
		align-items: center;
		gap: 6px 12px;
		width: auto;
		padding: 8px 44px 8px 8px;
		border-width: 1px;
		border-radius: 16px;
		box-shadow: 0 8px 24px rgba(14, 26, 38, 0.18);
	}

	.lcc-floating-banner--card .lcc-floating-banner__media {
		grid-area: media;
	}

	.lcc-floating-banner--card .lcc-floating-banner__poster {
		border-radius: 10px;
	}

	.lcc-floating-banner--card .lcc-floating-banner__media::after {
		width: 32px;
		height: 32px;
		margin: -16px 0 0 -16px;
		background-size: 14px;
	}

	.lcc-floating-banner--card .lcc-floating-banner__meta {
		display: none;
	}

	.lcc-floating-banner--card .lcc-floating-banner__text {
		grid-area: text;
		margin: 0;
	}

	.lcc-floating-banner--card .lcc-floating-banner__long {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip-path: none;
		white-space: normal;
	}

	.lcc-floating-banner--card .lcc-floating-banner__short {
		display: none;
	}

	.lcc-floating-banner--card .lcc-floating-banner__button {
		grid-area: button;
		margin: 0;
	}

	.lcc-floating-banner--card .lcc-floating-banner__close {
		top: 4px;
		right: 4px;
		background: transparent;
	}

	.lcc-floating-banner.lcc-floating-banner--pill {
		left: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		max-width: calc(100% - 24px);
		padding: 4px 2px 4px 12px;
		border-width: 1px;
		border-radius: 999px;
		box-shadow: 0 8px 24px rgba(14, 26, 38, 0.18);
	}

	.lcc-floating-banner--pill .lcc-floating-banner__text {
		flex: 0 1 auto;
		min-width: 0;
	}
}
