/**
 * Procedure family — diagnosis-to-treatment editorial hierarchy.
 */

.brb-family-nav {
	background: var(--brb-color-surface);
	border-block-end: 1px solid var(--brb-color-border);
}

.brb-family-nav-inner {
	width: min(100%, var(--brb-layout-content));
	margin-inline: auto;
	padding: 0.625rem var(--brb-layout-padding-mobile);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scrollbar-width: none;
}

.brb-family-nav-inner::-webkit-scrollbar { display: none; }

.brb-family-nav-list {
	display: flex;
	gap: 0.5rem;
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
}

.brb-family-nav-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.5rem 0.875rem;
	border: 1px solid transparent;
	border-radius: var(--brb-radius-pill);
	background: transparent;
	color: var(--brb-color-muted);
	font-size: var(--brb-type-small);
	font-weight: var(--brb-weight-bold);
	text-decoration: none;
	white-space: nowrap;
}

.brb-family-nav-link:hover,
.brb-family-nav-link:focus-visible {
	border-color: var(--brb-color-border);
	background: var(--brb-color-surface-strong);
	color: var(--brb-color-brand);
}

.brb-family-nav-link.is-current {
	border-color: var(--brb-color-brand);
	background: var(--brb-color-brand-soft);
	color: var(--brb-color-brand);
}

.brb-family-nav-link:focus-visible {
	outline: 3px solid var(--brb-color-focus);
	outline-offset: 2px;
}

/*
 * Owner-approved shared Detail sibling rail.
 *
 * The Theme renderer above remains the single membership/order authority.
 * The visual contract is opt-in while the Detail rollout is piloted: only a
 * page that consumes the approved cream Detail Hero receives this treatment.
 * This keeps every other family route unchanged until its own owner gate.
 */
body:has(.detail-hero),
body:has(.brb-internal-hero--detail-standard) {
	--brb-detail-rail-surface: #fdfbf7;
	--brb-detail-rail-border: rgba(213, 198, 178, 0.58);
	--brb-detail-rail-pill: rgba(255, 253, 249, 0.58);
	--brb-detail-rail-text: #6b6058;
	--brb-detail-rail-brand: #7d1a33;
}

body:has(.detail-hero) .brb-family-nav,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav {
	background: var(--brb-detail-rail-surface);
	border-block-end-color: #eee5da;
}

body:has(.detail-hero) .brb-family-nav-inner,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-inner {
	width: min(100%, var(--brb-layout-content));
	padding-block: 2px;
	padding-inline: var(--brb-layout-padding-mobile);
	scroll-padding-inline: calc(var(--brb-layout-padding-mobile) + 4px);
	-webkit-overflow-scrolling: touch;
	-ms-overflow-style: none;
	touch-action: pan-x pan-y;
}

body:has(.detail-hero) .brb-family-nav-list,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-list {
	flex-wrap: nowrap;
	align-items: center;
	gap: 5px;
}

body:has(.detail-hero) .brb-family-nav-item,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-item {
	flex: 0 0 auto;
}

body:has(.detail-hero) .brb-family-nav-link,
body:has(.detail-hero) .brb-family-nav-link:visited,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link:visited {
	position: relative;
	min-height: 0;
	padding: 3px 9px;
	border: 1px solid var(--brb-detail-rail-border);
	border-radius: 9px;
	background: var(--brb-detail-rail-pill);
	color: var(--brb-detail-rail-text);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: -0.012em;
	line-height: 19px;
	transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

body:has(.detail-hero) .brb-family-nav-link::before,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link::before {
	content: "";
	position: absolute;
	inset: -3px -2px;
}

body:has(.detail-hero) .brb-family-nav-link:hover,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link:hover {
	border-color: #c9b79f;
	background: var(--brb-detail-rail-pill);
	color: #2b211d;
}

body:has(.detail-hero) .brb-family-nav-link:focus-visible,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link:focus-visible {
	border-color: var(--brb-detail-rail-brand);
	background: var(--brb-detail-rail-pill);
	color: #2b211d;
	outline: 2px solid rgba(125, 26, 51, 0.28);
	outline-offset: 2px;
}

body:has(.detail-hero) .brb-family-nav-link.is-current,
body:has(.detail-hero) .brb-family-nav-link.is-current:visited,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link.is-current,
body:has(.brb-internal-hero--detail-standard) .brb-family-nav-link.is-current:visited {
	border-color: var(--brb-detail-rail-brand);
	background: var(--brb-detail-rail-brand);
	color: #fdf6ef;
	font-weight: 650;
}

.brb-family-hero {
	display: flex;
	align-items: center;
	min-height: clamp(20rem, 46svh, 32rem);
	background:
		linear-gradient(90deg, transparent 0 76%, rgba(125, 36, 64, 0.04) 76% 100%),
		var(--brb-color-surface);
	border-block-end: 1px solid var(--brb-color-border);
}

.brb-family-eyebrow {
	margin: 0 0 1rem;
	color: var(--brb-color-brand);
	font-size: var(--brb-type-small);
	font-weight: var(--brb-weight-bold);
	letter-spacing: 0.08em;
}

.brb-family-title {
	max-width: 13em;
	margin: 0;
	font-family: var(--brb-font-display);
	font-size: var(--brb-type-h1);
	font-weight: var(--brb-weight-bold);
	line-height: var(--brb-leading-display);
	letter-spacing: -0.045em;
	word-break: keep-all;
}

.brb-family-title span { display: block; }

.brb-family-lead {
	max-width: var(--brb-layout-prose);
	margin: 1.5rem 0 0;
	color: var(--brb-color-muted);
	font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
	line-height: 1.8;
	word-break: keep-all;
}

.brb-family-section-title {
	max-width: 20em;
	margin: 0 0 clamp(1.75rem, 4vw, 3rem);
	font-size: var(--brb-type-h2);
	font-weight: var(--brb-weight-bold);
	line-height: var(--brb-leading-heading);
	letter-spacing: -0.035em;
	word-break: keep-all;
}

.brb-family-diagnosis .brb-hub-inner,
.brb-family-process .brb-hub-inner,
.brb-family-cost .brb-hub-inner {
	border-block-start: 1px solid var(--brb-color-border-soft);
}

.brb-family-card-list,
.brb-family-info-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--brb-space-grid);
	margin: 0;
	padding: 0;
	list-style: none;
}

.brb-family-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 44px;
	padding: var(--brb-space-card);
	border: 1px solid var(--brb-color-border);
	border-radius: var(--brb-radius-feature);
	background: var(--brb-color-surface-strong);
	box-shadow: var(--brb-shadow-card);
	color: var(--brb-color-text);
	text-decoration: none;
	transition:
		border-color var(--brb-motion-fast) var(--brb-motion-easing),
		transform var(--brb-motion-fast) var(--brb-motion-easing);
}

.brb-family-card-treatment {
	color: var(--brb-color-brand);
	font-size: var(--brb-type-small);
	font-weight: var(--brb-weight-bold);
	letter-spacing: 0.04em;
}

.brb-family-card-title {
	margin-block-start: 0;
	font-size: var(--brb-type-h3);
	font-weight: var(--brb-weight-bold);
	line-height: var(--brb-leading-heading);
	letter-spacing: -0.025em;
}

.brb-family-card-treatment + .brb-family-card-title { margin-block-start: 0.75rem; }

.brb-family-card-desc {
	margin-block-start: 0.875rem;
	color: var(--brb-color-muted);
	font-size: var(--brb-type-small);
	line-height: 1.75;
	word-break: keep-all;
}

.brb-family-card-more {
	margin-block-start: 1.25rem;
	color: var(--brb-color-brand);
	font-size: var(--brb-type-small);
	font-weight: var(--brb-weight-bold);
}

.brb-family-card-link:hover,
.brb-family-card-link:focus-visible {
	border-color: var(--brb-color-brand);
	transform: translateY(-2px);
}

.brb-family-card-link:focus-visible {
	outline: 3px solid var(--brb-color-focus);
	outline-offset: 3px;
}

/* Diagnostic and process facts stay open and editorial instead of boxed. */
.brb-family-info-list { gap: 0; }

.brb-family-info-item {
	padding: 1.5rem 0;
	border-block-start: 1px solid var(--brb-color-border);
}

.brb-family-info-item:last-child { border-block-end: 1px solid var(--brb-color-border); }

.brb-family-info-item h3 {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.5;
}

.brb-family-info-item p {
	max-width: 34rem;
	margin: 0.625rem 0 0;
	color: var(--brb-color-muted);
	font-size: var(--brb-type-small);
	line-height: 1.75;
	word-break: keep-all;
}

.brb-family-info-number {
	display: block;
	margin-block-end: 0.75rem;
	color: var(--brb-color-brand);
	font-size: var(--brb-type-small);
	font-weight: var(--brb-weight-bold);
	letter-spacing: 0.08em;
}

.brb-family-cost-note {
	max-width: var(--brb-layout-prose);
	padding: var(--brb-space-card);
	border-inline-start: 3px solid var(--brb-color-accent);
	background: var(--brb-color-accent-soft);
}

.brb-family-cost-note strong {
	display: block;
	font-size: 1.0625rem;
}

.brb-family-cost-note p {
	margin: 0.75rem 0 0;
	color: var(--brb-color-text-soft);
	font-size: var(--brb-type-small);
	line-height: 1.75;
	word-break: keep-all;
}

@media (min-width: 48rem) {
	.brb-family-nav-inner { padding-inline: var(--brb-layout-padding-desktop); }
	body:has(.detail-hero) .brb-family-nav-inner,
	body:has(.brb-internal-hero--detail-standard) .brb-family-nav-inner {
		padding-inline: var(--brb-layout-padding-desktop);
		scroll-padding-inline: calc(var(--brb-layout-padding-desktop) + 4px);
	}

	.brb-family-card-list,
	.brb-family-info-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.brb-family-info-list { column-gap: var(--brb-space-grid); }
	.brb-family-info-item:nth-last-child(-n + 2) { border-block-end: 1px solid var(--brb-color-border); }
}

@media (min-width: 80rem) {
	.brb-family-hero {
		background: linear-gradient(90deg, var(--brb-color-surface) 0 70%, var(--brb-color-feature) 70% 100%);
	}

	.brb-family-card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.brb-family-info-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.brb-family-info-item:nth-last-child(-n + 4) { border-block-end: 1px solid var(--brb-color-border); }
}

@media (prefers-reduced-motion: reduce) {
	.brb-family-card-link { transition: none; }
}
