/**
 * Business Hubs Widget Styles
 *
 * Three views driven by a state class on the root element:
 *   .awyb-business-hubs--region   -> hub thumbnails full width (map hidden)
 *   .awyb-business-hubs--company  -> selected hub's company chips + paging,
 *                                    beside the map zoomed to the hub
 *   .awyb-business-hubs--detail   -> a single company selected on the map
 */

.awyb-business-hubs {
	--awyb-bh-marker: #3b6348;
	--awyb-bh-foreground: #0a0a0a;
	--awyb-bh-body: #262626;
	--awyb-bh-blue: #177bc4;
	--awyb-bh-border: #e5e5e5;
	display: block;
	width: 100%;
}

.awyb-business-hubs__container {
	display: flex;
	align-items: flex-start;
	gap: 64px;
	padding: 0 24px;
	justify-content: space-between;
}

/* ------------------------------------------------------------------ Map column */
.awyb-business-hubs__map-column {
	flex: 1 1 0;
	min-width: 0;
}

/* Region view: no map — the hub thumbnails render full width. The map only
   appears once a hub is selected (company/detail views). */
.awyb-business-hubs--region .awyb-business-hubs__map-column {
	display: none;
}

.awyb-business-hubs__map {
	position: relative;
	width: 100%;
	min-height: 524px;
}

.awyb-business-hubs__map img {
	max-width: 100%;
	height: auto;
}

.awyb-business-hubs__map-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 524px;
	padding: 24px;
	text-align: center;
	color: var(--awyb-bh-body);
	background: #f4f4f4;
	border: 1px dashed #cccccc;
	border-radius: 8px;
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
}

/* Mobile-only detail header (back + company name above the map). */
.awyb-business-hubs__detail-header {
	display: none;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.awyb-business-hubs__detail-title {
	margin: 0;
	font-family: var(--font-family-headings, "Resolve Sans"), sans-serif;
	font-weight: 700;
	font-size: 32px;
	line-height: 1.1;
	color: var(--awyb-bh-foreground);
}

/* ------------------------------------------------------------------ Content column */
.awyb-business-hubs__content-column {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.awyb-business-hubs__view {
	display: none;
	flex-direction: column;
	gap: 24px;
}

.awyb-business-hubs--region .awyb-business-hubs__view--region,
.awyb-business-hubs--company .awyb-business-hubs__view--company.is-active,
.awyb-business-hubs--detail .awyb-business-hubs__view--company.is-active {
	display: flex;
}

.awyb-business-hubs__section-title {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.awyb-business-hubs__title,
.awyb-business-hubs__hub-title {
	margin: 0;
	font-family: var(--font-family-headings, "Resolve Sans"), sans-serif;
	font-weight: 700;
	font-size: 48px;
	line-height: 48px;
	letter-spacing: 0;
	color: var(--awyb-bh-foreground);
}

.awyb-business-hubs__intro,
.awyb-business-hubs__intro p,
.awyb-business-hubs__hub-copy,
.awyb-business-hubs__hub-copy p {
	margin: 0;
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: var(--awyb-bh-body);
}

/* ------------------------------------------------------------------ Hub thumbnails (region view) */
/* The region view has no map, so the grid spans the full container width. */
.awyb-business-hubs__thumbnails {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 28px 24px;
}

.awyb-business-hubs__hub {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: center;
}

.awyb-business-hubs__hub:hover {
	background-color: transparent !important;
}

.awyb-business-hubs__hub-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 999px;
	overflow: hidden;
	background: #ececec;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.awyb-business-hubs__hub-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.awyb-business-hubs__hub:hover .awyb-business-hubs__hub-thumb,
.awyb-business-hubs__hub:focus-visible .awyb-business-hubs__hub-thumb {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.awyb-business-hubs__hub-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: 100%;
	min-width: 0;
}

/* Names may wrap to a second line; keep the line-height tight but readable
   and break long single words rather than overflowing the grid cell. */
.awyb-business-hubs__hub-name {
	display: block;
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
	font-weight: 700;
	font-size: 20px;
	line-height: 1.15;
	color: var(--awyb-bh-foreground);
	text-transform: none;
	white-space: normal;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.awyb-business-hubs__hub-count {
	margin-top: 4px;
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
	font-weight: 400;
	font-size: 14px;
	line-height: 1;
	color: var(--awyb-bh-body);
	text-transform: none;
}

/* ------------------------------------------------------------------ Hub head + back (company view) */
.awyb-business-hubs__hub-head {
	display: flex;
	align-items: center;
	gap: 20px;
}

.awyb-business-hubs__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--awyb-bh-foreground);
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.awyb-business-hubs__back :hover {
	background-color: transparent !important;
}

.awyb-business-hubs__back svg {
	width: 28px;
	height: 28px;
}

.awyb-business-hubs__back:hover {
	transform: translateX(-3px);
	background-color: transparent !important;
	color: #000;
}

/* ------------------------------------------------------------------ Company chips (company view) */
.awyb-business-hubs__companies {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 16px;
}

.awyb-business-hubs__company {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: #ffffff;
	border: 1px solid var(--awyb-bh-border);
	cursor: pointer;
	font-family: var(--font-family-headings, "Resolve Sans"), sans-serif;
	font-weight: 700;
	font-size: 24px;
	line-height: 32px;
	letter-spacing: 0;
	border-radius: 0;
	color: #000000;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.awyb-business-hubs__company:hover {
	border-color: var(--awyb-bh-blue);
	background: var(--awyb-bh-blue);
	color: #ffffff;
}

.awyb-business-hubs__company.is-selected {
	background: var(--awyb-bh-blue);
	border-color: var(--awyb-bh-blue);
	color: #ffffff;
}

.awyb-business-hubs__company[hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------ Pagination */
.awyb-business-hubs__pager {
	display: flex;
	align-items: center;
	gap: 24px;
}

.awyb-business-hubs__pager[hidden] {
	display: none;
}

.awyb-business-hubs__pager-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	padding: 10px;
	border: none;
	border-radius: 9999px;
	background: #000000;
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: opacity 0.2s ease;
}

.awyb-business-hubs__pager-btn svg {
	width: 24px;
	height: 24px;
}

.awyb-business-hubs__pager-btn:disabled {
	background: #f5f5f5;
	color: #a3a3a3;
	cursor: default;
}

.awyb-business-hubs__empty {
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
	color: var(--awyb-bh-body);
}

/* ------------------------------------------------------------------ Map marker tooltip card
 * Rendered by Interactive Geo Maps (outside the widget), so these are top-level
 * selectors rather than scoped under .awyb-business-hubs. */
.awyb-hub-marker {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 4px 8px;
	text-align: center;
	font-family: var(--font-family-body, "Founders Grotesk"), sans-serif;
}

.awyb-hub-marker__name {
	font-family: var(--font-family-headings, "Resolve Sans"), sans-serif;
	font-weight: 700;
	font-size: 22px;
	line-height: 1.2;
	color: #0a0a0a;
}

.awyb-hub-marker__address {
	font-size: 14px;
	line-height: 1.3;
	color: #6b6b6b;
}

.awyb-hub-marker__link {
	font-size: 14px;
	font-weight: 600;
	color: #0a0a0a;
	text-decoration: underline;
}

/* ------------------------------------------------------------------ Company info card (HTML overlay over the map) */
.awyb-business-hubs__card {
	position: absolute;
	z-index: 6;
	transform: translate(-50%, calc(-100% - 16px));
	background: #ffffff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
	padding: 16px 22px;
	min-width: 150px;
	max-width: 260px;
	pointer-events: auto;
}

.awyb-business-hubs__card[hidden] {
	display: none;
}

.awyb-business-hubs__card::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	border: 12px solid transparent;
	border-top-color: #ffffff;
}

.awyb-business-hubs__card-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}

/* ------------------------------------------------------------------ Tablet */
@media (max-width: 1024px) {
	.awyb-business-hubs__container {
		gap: 40px;
	}

	.awyb-business-hubs__thumbnails {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 28px 16px;
	}

	.awyb-business-hubs__title,
	.awyb-business-hubs__hub-title {
		font-size: 40px;
		line-height: 1.05;
	}

	.awyb-business-hubs__company {
		font-size: 20px;
		line-height: 28px;
	}
}

/* ------------------------------------------------------------------ Mobile (stacked, 3-level nav) */
@media (max-width: 767px) {
	.awyb-business-hubs__thumbnails {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.awyb-business-hubs__container {
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
		padding: 0 20px;
	}

	.awyb-business-hubs__map,
	.awyb-business-hubs__map-placeholder {
		min-height: 320px;
	}

	.awyb-business-hubs__title,
	.awyb-business-hubs__hub-title {
		font-size: 32px;
	}

	.awyb-business-hubs__company {
		font-size: 18px;
		line-height: 24px;
		padding: 12px 16px;
	}

	/* The map column comes first visually on mobile. */
	.awyb-business-hubs__map-column {
		order: -1;
	}

	/* Mobile flow: the region (hub selection) and company (chips) steps hide the
	   map; only the detail step shows it. */
	.awyb-business-hubs--region .awyb-business-hubs__map-column,
	.awyb-business-hubs--company .awyb-business-hubs__map-column {
		display: none;
	}

	.awyb-business-hubs--detail .awyb-business-hubs__detail-header {
		display: flex;
	}

	/* On mobile, selecting a company swaps the chip list for the map detail. */
	.awyb-business-hubs--detail .awyb-business-hubs__view--company.is-active {
		display: none;
	}
}
