/**
 * Provider directory — [hw360_provider_directory]
 *
 * Loaded only on pages where the shortcode actually rendered entries. Colours
 * come from theme.json presets, never from literals, so a palette change in
 * the theme carries here without this file being touched.
 *
 * Status is never signalled by colour alone (WCAG 2.2 AA, SC 1.4.1): every
 * coloured state below sits beside a glyph and a written phrase supplied by
 * the template.
 */

.hw-provider-directory {
	margin: 0 0 2.5rem;
	color: var(--wp--preset--color--navy, #0D1019);
}

.hw-provider-directory .hw-tabular {
	font-variant-numeric: tabular-nums;
}

.hw-provider-directory__summary {
	margin: 0 0 1.25rem;
	font-size: 1rem;
	line-height: 1.6;
}

/* ---------- Jump bar ---------------------------------------------------- */

/* Letters wrap rather than scroll: a horizontal scroller hides its own
   contents on the narrow screens where most of this traffic lands. */
.hw-provider-directory__jump {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin: 0 0 2rem;
	padding: 0.75rem;
	border: 1px solid var(--wp--preset--color--card-border, #E5E6E8);
	border-radius: 10px;
	background: var(--wp--preset--color--warm-white, #F8F9FB);
}

.hw-provider-directory__jump-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 0.5rem;
	border-radius: 8px;
	background: var(--wp--preset--color--white, #FFFFFF);
	color: var(--wp--preset--color--trust-teal, #1F4C5F);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.hw-provider-directory__jump-link:hover,
.hw-provider-directory__jump-link:focus-visible {
	background: var(--wp--preset--color--trust-teal, #1F4C5F);
	color: var(--wp--preset--color--white, #FFFFFF);
}

/* ---------- Letter groups ----------------------------------------------- */

.hw-provider-directory__letter {
	margin: 2rem 0 0.75rem;
	padding-bottom: 0.375rem;
	border-bottom: 2px solid var(--wp--preset--color--trust-teal, #1F4C5F);
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	/* The anchor target: a fixed header must not land on top of the heading
	   the reader just jumped to. */
	scroll-margin-top: 6rem;
}

.hw-provider-directory__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- One provider ------------------------------------------------ */

.hw-provider-card {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	padding: 1rem 1.125rem 1.125rem;
	border: 1px solid var(--wp--preset--color--card-border, #E5E6E8);
	border-radius: 12px;
	background: var(--wp--preset--color--white, #FFFFFF);
	box-shadow: 0 1px 2px rgba(13, 16, 25, 0.05);
}

.hw-provider-card__name {
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--wp--preset--color--link-blue, #005FCC);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.hw-provider-card__name:hover,
.hw-provider-card__name:focus-visible {
	color: var(--wp--preset--color--trust-teal, #1F4C5F);
}

.hw-provider-card__register,
.hw-provider-card__checked,
.hw-provider-card__entity,
.hw-provider-card__meds {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem;
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--wp--preset--color--grey-muted, #6B7280);
}

.hw-provider-card__icon {
	flex: 0 0 auto;
	font-weight: 700;
}

.hw-provider-card__register--checked {
	color: var(--wp--preset--color--success-text, #166534);
	font-weight: 600;
}

.hw-provider-card__register--unchecked {
	color: var(--wp--preset--color--warning-amber, #8A4B00);
	font-weight: 600;
}

.hw-provider-card__entity span {
	color: var(--wp--preset--color--navy, #0D1019);
}

.hw-provider-card__meds {
	color: var(--wp--preset--color--navy, #0D1019);
	font-size: 0.875rem;
	font-weight: 600;
}

.hw-provider-card__meds--empty {
	font-weight: 400;
	color: var(--wp--preset--color--grey-muted, #6B7280);
}

.hw-provider-card__doses {
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--wp--preset--color--grey-muted, #6B7280);
}

/* Stale prices are the one state that changes weight as well as colour — it
   is a caution, and it has to survive a greyscale print. */
.hw-provider-card__checked--stale {
	color: var(--wp--preset--color--warning-amber, #8A4B00);
	font-weight: 600;
}

.hw-provider-card__warning {
	font-weight: 700;
}

/* ---------- Standing note ----------------------------------------------- */

.hw-provider-directory__note {
	margin: 2rem 0 0;
	padding: 0.875rem 1rem;
	border-left: 3px solid var(--wp--preset--color--trust-teal, #1F4C5F);
	background: var(--wp--preset--color--warm-white, #F8F9FB);
	font-size: 0.8125rem;
	line-height: 1.55;
	color: var(--wp--preset--color--grey-muted, #6B7280);
}

/* Inside a dark section the theme flips surfaces; the cards stay light so the
   register wording keeps its contrast ratio rather than inheriting one. */
.hw-surface-dark .hw-provider-directory__summary,
.hw-surface-dark .hw-provider-directory__letter {
	color: inherit;
}

@media (prefers-reduced-motion: no-preference) {
	.hw-provider-directory__jump-link,
	.hw-provider-card__name {
		transition: color 120ms ease, background-color 120ms ease;
	}
}
