/*
 * HerHealth — design tokens and card shell.
 * Every rule is scoped under .hh so the plugin neither leaks into nor
 * inherits from the host theme.
 */

.hh {
	--hh-accent: var(--gcid-primary-color, #C9315F);
	--hh-accent-hover: var(--gcid-secondary-color, #96304D);
	--hh-surface: #FBF8F5;
	--hh-ink: #2E2731;
	--hh-muted: #6B6270;
	--hh-border: #EFE6DC;
	--hh-radius: 22px;
	--hh-max-width: 100%;
	--hh-font-heading: inherit;
	--hh-font-body: inherit;
	--hh-shadow: 0 8px 24px rgba(120, 80, 90, 0.06);
	--hh-tint: rgba(201, 49, 95, 0.08);
	--hh-tint-strong: rgba(201, 49, 95, 0.16);
	--hh-track: rgba(201, 49, 95, 0.14);
	--hh-ring: rgba(201, 49, 95, 0.14);

	/* Clinical colours are fixed, never accent-derived: a category must stay
	   recognizable regardless of the site palette. */
	--hh-underweight: #4F8FE8;
	--hh-normal: #3E8E5A;
	--hh-overweight: #E8A23D;
	--hh-obese: #D65B5B;

	box-sizing: border-box;
	max-width: var(--hh-max-width);
	margin: 0 auto;
	color: var(--hh-ink);
	font-family: var(--hh-font-body);
	font-size: 16px;
	line-height: 1.5;
}

@supports (background: color-mix(in srgb, red 10%, transparent)) {
	.hh {
		--hh-tint: color-mix(in srgb, var(--hh-accent) 8%, transparent);
		--hh-tint-strong: color-mix(in srgb, var(--hh-accent) 16%, transparent);
		--hh-track: color-mix(in srgb, var(--hh-accent) 14%, transparent);
		--hh-ring: color-mix(in srgb, var(--hh-accent) 14%, transparent);
	}
}

.hh *,
.hh *::before,
.hh *::after {
	box-sizing: inherit;
}

.hh [hidden] {
	display: none;
}

.hh svg {
	display: block;
	width: 100%;
	height: 100%;
}

.hh__sr-status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.hh__title {
	margin: 0 0 0.25rem;
	font-family: var(--hh-font-heading);
	font-weight: 600;
	font-size: 1.5rem;
	color: var(--hh-ink);
}

.hh__subtitle {
	margin: 0 0 1.5rem;
	color: var(--hh-muted);
	font-size: 0.9375rem;
}

/* The tab bar and the unit / gestation controls share one visual component. */
.hh__tabs,
.hh__seg {
	display: flex;
	gap: 0.375rem;
	padding: 0.25rem;
	background-color: var(--hh-track);
	border-radius: 999px;
}

.hh__tabs {
	margin: 0 0 1.5rem;
}

.hh__tab,
.hh__seg-btn {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	gap: 0.375rem;
	min-height: 44px;
	margin: 0;
	padding: 0.5rem 0.75rem;
	background-color: transparent;
	border: none;
	border-radius: 999px;
	appearance: none;
	-webkit-appearance: none;
	color: var(--hh-muted);
	font-family: var(--hh-font-body);
	font-weight: 700;
	font-size: 0.875rem;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hh__tab.is-active,
.hh__seg-input:checked + .hh__seg-btn {
	background-color: #FFFFFF;
	box-shadow: 0 1px 3px rgba(46, 39, 49, 0.16);
	color: var(--hh-accent);
}

.hh__tab:focus-visible,
.hh__seg-input:focus-visible + .hh__seg-btn {
	outline: 2px solid var(--hh-accent);
	outline-offset: 2px;
}

.hh__seg-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.hh__tab-icon {
	display: flex;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
}

.hh__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	align-items: stretch;
}

@media (min-width: 640px) {
	.hh--split .hh__grid {
		grid-template-columns: 1fr 1fr;
	}

	.hh__panel {
		padding: 2.125rem;
	}
}

.hh__panel {
	background-color: var(--hh-surface);
	border: 1px solid var(--hh-border);
	border-radius: var(--hh-radius);
	padding: 2rem;
}

.hh:not(.hh--compact)[data-shadow="1"] .hh__panel {
	box-shadow: var(--hh-shadow);
}

.hh__panel-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.hh__panel-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	padding: 14px;
	border-radius: 16px;
	background-color: var(--hh-tint);
	color: var(--hh-accent);
}

.hh__panel-title {
	margin: 0;
	font-family: var(--hh-font-heading);
	font-weight: 600;
	font-size: 1.5rem;
	color: var(--hh-ink);
}

.hh__panel--results .hh__panel-title {
	color: var(--hh-accent);
}

.hh__badge {
	margin-inline-start: auto;
	padding: 0.375rem 0.75rem;
	background-color: #E9F5EC;
	border: 1px solid #CFE8D6;
	border-radius: 999px;
	color: #2F6F46;
	font-size: 0.75rem;
	font-weight: 700;
	white-space: nowrap;
	transition: transform 0.2s ease;
}

.hh__badge.is-pulse {
	transform: scale(1.08);
}

.hh__calculate-btn,
.hh__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin-top: 1.25rem;
	padding: 0.75rem 1.25rem;
	background-color: var(--hh-accent);
	color: #FFFFFF;
	font-family: var(--hh-font-body);
	font-weight: 700;
	font-size: 0.9375rem;
	text-decoration: none;
	border: none;
	border-radius: calc(var(--hh-radius) * 0.4);
	cursor: pointer;
}

.hh[data-auto-calculate="1"] .hh__calculate-btn {
	display: none;
}

.hh__calculate-btn:hover,
.hh__cta:hover {
	background-color: var(--hh-accent-hover);
	color: #FFFFFF;
}

.hh__calculate-btn:focus-visible,
.hh__cta:focus-visible {
	outline: 2px solid var(--hh-ink);
	outline-offset: 2px;
}

/* Compact: one condensed card for sidebars and widgets. */
.hh--compact {
	background-color: var(--hh-surface);
	border: 1px solid var(--hh-border);
	border-radius: var(--hh-radius);
	padding: 1.25rem;
}

.hh--compact[data-shadow="1"] {
	box-shadow: var(--hh-shadow);
}

.hh--compact .hh__panel {
	background: none;
	border: none;
	border-radius: 0;
	padding: 0;
}

.hh--compact .hh__grid {
	gap: 1rem;
}

.hh--compact .hh__panel-icon,
.hh--compact .hh__divider,
.hh--compact .hh__stat-icon,
.hh--compact .hh__breakdown-card {
	display: none;
}

.hh--compact .hh__value {
	font-size: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
	.hh__tab,
	.hh__seg-btn,
	.hh__badge,
	.hh__gauge-marker {
		transition: none;
	}

	.hh__badge.is-pulse {
		transform: none;
	}
}
