/**
 * Nexus Local Branch Card block (tmb-client/nexus-local-branch-card).
 *
 * Self-contained: reads the Nexus theme tokens when present and falls back to
 * literal values elsewhere. Every image carries width/height attributes and a
 * fixed CSS box, so nothing shifts when it loads. Tap targets are >= 44px.
 */

.nexus-local-branch-card {
	padding: clamp( 40px, 5vw, 72px ) 0;
	background: var( --nexus-paper, #fcfaf3 );
	color: var( --nexus-ink, #1a1a1a );
	font-family: var( --nexus-font-body, inherit );
}

.nexus-local-branch-card__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: var( --nexus-container, 1200px );
	margin: 0 auto;
	padding: 0 var( --nexus-gutter, 24px );
}

.nexus-local-branch-card__header {
	margin-bottom: clamp( 20px, 3vw, 32px );
	max-width: 760px;
}

.nexus-local-branch-card__heading {
	margin: 0;
	font-family: var( --nexus-font-display, inherit );
	font-size: clamp( 26px, 3.2vw, 36px );
	line-height: 1.2;
	color: var( --nexus-green-deep, #0f3528 );
}

.nexus-local-branch-card__intro {
	margin: 12px 0 0;
	font-size: 16px;
	line-height: 1.6;
	color: var( --nexus-muted, #6b6558 );
}

.nexus-local-branch-card__grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( min( 100%, 340px ), 1fr ) );
	gap: clamp( 16px, 2vw, 24px );
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A single branch should not stretch across 1200px. */
.nexus-local-branch-card--cards:not( .nexus-local-branch-card--multi ) .nexus-local-branch-card__grid {
	grid-template-columns: minmax( 0, 560px );
}

.nexus-local-branch-card--list .nexus-local-branch-card__grid {
	grid-template-columns: repeat( auto-fill, minmax( min( 100%, 300px ), 1fr ) );
}

.nexus-local-branch-card__item {
	display: flex;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.nexus-local-branch-card__card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	min-width: 0;
	padding: clamp( 20px, 2.4vw, 28px );
	background: var( --nexus-white, #fff );
	border: 1px solid var( --nexus-rule-soft, #ece5d4 );
	border-radius: var( --nexus-radius-md, 16px );
	box-shadow: var( --nexus-shadow-card, 0 18px 42px -28px rgba( 15, 53, 40, 0.28 ) );
	overflow-wrap: anywhere;
}

/* Brand row */
.nexus-local-branch-card__brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.nexus-local-branch-card__logo-wrap {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 88px;
	height: 48px;
}

.nexus-local-branch-card__logo {
	display: block;
	width: auto;
	height: auto;
	max-width: 88px;
	max-height: 48px;
	object-fit: contain;
}

.nexus-local-branch-card__brand-text {
	min-width: 0;
}

.nexus-local-branch-card__brand-name {
	margin: 0;
	font-family: var( --nexus-font-display, inherit );
	font-size: 20px;
	line-height: 1.25;
	color: var( --nexus-green-deep, #0f3528 );
}

.nexus-local-branch-card__branch {
	margin: 2px 0 0;
	font-size: 14px;
	line-height: 1.4;
	color: var( --nexus-muted, #6b6558 );
}

/* Address + phone */
.nexus-local-branch-card__address {
	margin: 0;
	font-style: normal;
	font-size: 15px;
	line-height: 1.55;
}

.nexus-local-branch-card__phone {
	margin: 0;
}

.nexus-local-branch-card__tel {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	color: var( --nexus-green, #1e5340 );
	text-decoration: none;
}

.nexus-local-branch-card__tel:hover .nexus-local-branch-card__tel-number,
.nexus-local-branch-card__tel:focus-visible .nexus-local-branch-card__tel-number {
	text-decoration: underline;
}

.nexus-local-branch-card__icon {
	flex: 0 0 auto;
}

/* Manager */
.nexus-local-branch-card__manager {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-top: 16px;
	border-top: 1px solid var( --nexus-rule-soft, #ece5d4 );
}

.nexus-local-branch-card__headshot {
	flex: 0 0 72px;
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	background: var( --nexus-green-soft, #e8f0ea );
}

.nexus-local-branch-card__manager-text {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
	line-height: 1.35;
}

.nexus-local-branch-card__manager-name {
	font-weight: 700;
	font-size: 16px;
}

.nexus-local-branch-card__manager-title {
	font-size: 14px;
	color: var( --nexus-muted, #6b6558 );
}

/* Actions */
.nexus-local-branch-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	margin-top: auto;
	padding-top: 4px;
}

.nexus-local-branch-card__quote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	border-radius: var( --nexus-radius-pill, 999px );
	background: var( --nexus-green, #1e5340 );
	color: var( --nexus-white, #fff );
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color var( --nexus-transition, 0.18s ease );
}

.nexus-local-branch-card__quote:hover,
.nexus-local-branch-card__quote:focus-visible {
	background: var( --nexus-green-deep, #0f3528 );
	color: var( --nexus-white, #fff );
}

.nexus-local-branch-card__map {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
	font-size: 15px;
	color: var( --nexus-green, #1e5340 );
	text-decoration: underline;
	text-underline-offset: 3px;
}

.nexus-local-branch-card__tel:focus-visible,
.nexus-local-branch-card__quote:focus-visible,
.nexus-local-branch-card__map:focus-visible {
	outline: 3px solid var( --nexus-orange, #e68640 );
	outline-offset: 2px;
}

/* List layout (state pages): a denser card. */
.nexus-local-branch-card--list .nexus-local-branch-card__card {
	gap: 12px;
}

.nexus-local-branch-card--list .nexus-local-branch-card__brand-name {
	font-size: 18px;
}

.nexus-local-branch-card--list .nexus-local-branch-card__tel {
	font-size: 18px;
}

.nexus-local-branch-card--list .nexus-local-branch-card__headshot {
	flex-basis: 56px;
	width: 56px;
	height: 56px;
}

.nexus-local-branch-card__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

.nexus-local-branch-card__empty {
	padding: 16px;
	border: 1px dashed #c3c4c7;
	color: #50575e;
}

@media ( max-width: 480px ) {
	.nexus-local-branch-card__inner {
		padding: 0 16px;
	}

	.nexus-local-branch-card__actions {
		flex-direction: column;
		align-items: stretch;
	}

	.nexus-local-branch-card__map {
		justify-content: center;
	}
}
