/*
 * Nexus Client — Public Consent Banner styles
 * Sticky bottom-center cookie banner.
 *
 * THEME-IMMUNE BY DESIGN: this banner renders inside arbitrary client
 * themes (Salient, The7, Astra, …) whose global element styles (h2, p,
 * button) inflate it into a half-screen slab (seen live on
 * fairwaygreen.com mobile). Every layout-critical property below is set
 * EXPLICITLY in px and locked with !important, the whole subtree gets a
 * geometry reset, and the banner is hard-capped: it can never exceed
 * 560px wide or 42vh/280px tall, at any resolution.
 */

.tmb-consent-banner,
.tmb-consent-banner * {
	box-sizing: border-box !important;
	min-height: 0 !important;
	min-width: 0 !important;
	float: none !important;
	text-shadow: none !important;
}

.tmb-consent-banner {
	position: fixed !important;
	left: 50% !important;
	right: auto !important;
	top: auto !important;
	bottom: 16px !important;
	transform: translateX(-50%);
	width: min(560px, calc(100vw - 24px)) !important;
	max-width: calc(100vw - 24px) !important;
	max-height: min(42vh, 280px) !important;
	height: auto !important;
	overflow-y: auto;
	margin: 0 !important;
	padding: 0 !important;
	z-index: 2147483600;
	background: #111827 !important;
	color: #f9fafb !important;
	border: 0 !important;
	border-radius: 10px !important;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25) !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	font-size: 13px !important;
	line-height: 1.45 !important;
	text-align: left !important;
	animation: tmb-consent-slide-in .25s ease-out;
}

@keyframes tmb-consent-slide-in {
	from { transform: translate(-50%, 24px); opacity: 0; }
	to   { transform: translate(-50%, 0);    opacity: 1; }
}

.tmb-consent-banner[hidden] {
	display: none !important;
}

.tmb-consent-banner-inner {
	position: relative !important;
	display: flex !important;
	flex-wrap: wrap;
	gap: 10px 12px !important;
	padding: 14px 44px 14px 16px !important;
	margin: 0 !important;
	align-items: center !important;
	width: auto !important;
}

.tmb-consent-banner-body {
	flex: 1 1 260px !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* h2 — themes love to make these 40px with huge margins. Locked. */
.tmb-consent-banner-title,
h2.tmb-consent-banner-title {
	margin: 0 0 3px 0 !important;
	padding: 0 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: #fff !important;
	font-family: inherit !important;
	border: 0 !important;
	background: none !important;
}

.tmb-consent-banner-text,
p.tmb-consent-banner-text {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 12.5px !important;
	line-height: 1.45 !important;
	letter-spacing: normal !important;
	color: #d1d5db !important;
	font-family: inherit !important;
	max-width: none !important;
}

.tmb-consent-banner-actions {
	display: flex !important;
	gap: 8px !important;
	flex-shrink: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
}

/* Buttons — themes force 100% width / 60px min-height / uppercase. Locked. */
.tmb-consent-btn,
button.tmb-consent-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-block !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	border: 1px solid transparent !important;
	border-radius: 6px !important;
	padding: 7px 14px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
	font-family: inherit !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

.tmb-consent-btn--decline,
button.tmb-consent-btn--decline {
	background: transparent !important;
	color: #d1d5db !important;
	border-color: #4b5563 !important;
}

.tmb-consent-btn--decline:hover,
button.tmb-consent-btn--decline:hover {
	border-color: #9ca3af !important;
	color: #fff !important;
	background: transparent !important;
}

.tmb-consent-btn--accept,
button.tmb-consent-btn--accept {
	background: #2563eb !important;
	color: #fff !important;
	border-color: #2563eb !important;
}

.tmb-consent-btn--accept:hover,
button.tmb-consent-btn--accept:hover {
	background: #1d4ed8 !important;
	border-color: #1d4ed8 !important;
}

.tmb-consent-btn:focus {
	outline: 2px solid #93c5fd !important;
	outline-offset: 2px;
}

.tmb-consent-banner-dismiss,
button.tmb-consent-banner-dismiss {
	position: absolute !important;
	top: 4px !important;
	right: 6px !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 4px !important;
	color: #9ca3af !important;
	font-size: 20px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	cursor: pointer;
	padding: 4px 8px !important;
	box-shadow: none !important;
}

.tmb-consent-banner-dismiss:hover,
button.tmb-consent-banner-dismiss:hover {
	color: #fff !important;
	background: transparent !important;
}

/* Phones - slim, full-width bottom bar.

   Two bugs lived in the previous card treatment and both are fixed here.

   1. .tmb-consent-banner-body kept `flex: 1 1 260px` from the desktop row
      layout while the mobile rule flipped the container to `flex-direction:
      column`. In a column, flex-basis is a HEIGHT - so the two-line body was
      forced to 260px tall, pushing the Accept / Decline row to y=733 inside a
      banner clipped at 199px by `max-height: min(30vh, 220px)`. On an iPhone
      13 viewport the visitor saw a 199px dark slab with a title, one sentence,
      a large empty area and NO visible way to accept or decline - the buttons
      were only reachable by discovering you could scroll inside a small fixed
      sheet. Measured on tmb-registry staging, 2026-09-17.

   2. Even rendered correctly the card covered ~30% of the first screen, on a
      page whose primary CTA already sits below the fold on mobile.

   The bar below is one edge-to-edge row: screen-reader-only title, one line
   of copy, and the two actions. It occupies roughly 10% of an iPhone-class
   viewport, nothing is clipped, and the buttons are real 44px touch targets. */
@media (max-width: 600px) {
	.tmb-consent-banner {
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		/* Not !important: an !important transform would outrank the keyframes
		   below and kill the slide-up. Later same-specificity rule wins. */
		transform: none;
		width: 100% !important;
		max-width: 100% !important;
		/* Content is sized to fit; no clipping, so no hidden buttons. */
		max-height: none !important;
		overflow: visible !important;
		border-radius: 0 !important;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .28) !important;
		animation: tmb-consent-slide-up .25s ease-out;
	}

	.tmb-consent-banner-inner {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 10px !important;
		padding: 10px 12px !important;
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* THE FIX: never inherit the desktop row basis as a column height. */
	.tmb-consent-banner-body {
		flex: 1 1 auto !important;
		min-width: 0 !important;
	}

	/* Kept in the DOM for aria-labelledby, removed from the visual bar. */
	.tmb-consent-banner-title,
	h2.tmb-consent-banner-title {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}

	.tmb-consent-banner-text,
	p.tmb-consent-banner-text {
		font-size: 12.5px !important;
		line-height: 1.35 !important;
		color: #e5e7eb !important;
	}

	.tmb-consent-banner-actions {
		flex-direction: column !important;
		gap: 6px !important;
		flex: 0 0 auto !important;
	}

	/* 44px minimum touch target on both axes (Apple HIG / WCAG 2.5.5 AAA;
	   the site-wide QA bar is 44x44 at 375px). Was 40px, which the Sep 29
	   tap-target audit flagged as 78x40 on every first visit. Flex-centred
	   so the label stays vertically centred inside the taller box. */
	.tmb-consent-btn,
	button.tmb-consent-btn {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		min-height: 44px !important;
		min-width: 44px !important;
		padding: 10px 16px !important;
		white-space: nowrap !important;
	}

	/* Redundant next to two one-tap actions, and it was the only control
	   visible while the buttons were clipped - which trained visitors to
	   dismiss without a decision. */
	.tmb-consent-banner-dismiss,
	button.tmb-consent-banner-dismiss {
		display: none !important;
	}
}

@keyframes tmb-consent-slide-up {
	from { transform: translateY(100%); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}
