/**
 * Base
 *
 * Reset, document defaults, and the small set of utilities components rely on.
 * Component styling never lives here.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	font-family: var(--font-body);
	font-size: var(--text-body);
	line-height: var(--leading-relaxed);
	color: var(--color-text);
	background-color: var(--color-surface);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
	display: block;
	max-width: 100%;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: var(--weight-semibold);
	line-height: var(--leading-snug);
	text-wrap: balance;
}

h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

p, li {
	text-wrap: pretty;
}

a {
	color: var(--color-link);
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--color-link-hover);
}

:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* ---------------------------------------------------------------
 * Utilities
 * --------------------------------------------------------------- */

/*
 * Visually hidden but available to screen readers. Used for context that is
 * obvious visually but absent without sight — "(required)", "(opens in a new
 * tab)". Never use display:none for this; it removes the text from the
 * accessibility tree entirely.
 */
.rc-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/*
 * Skip link. Hidden until focused, then visible — lets keyboard users bypass
 * the navigation instead of tabbing through every menu item on every page.
 */
.rc-skip-link {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: var(--z-toast);
	padding: var(--space-2) var(--space-3);
	background-color: var(--color-primary-700);
	color: var(--color-text-inverse);
	border-radius: var(--radius-md);
	font-weight: var(--weight-medium);
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform var(--duration-fast) var(--ease-standard);
}

.rc-skip-link:focus {
	transform: translateY(0);
	color: var(--color-text-inverse);
}

/* Shared page container. */
.rc-container {
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-gutter);
}

.rc-container--narrow {
	max-width: var(--container-narrow);
}

/* Vertical rhythm between page sections. */
.rc-section {
	padding-block: var(--section-padding-y);
}

.rc-section--sunken {
	background-color: var(--color-surface-sunken);
}

/* Constrains long-form text to a readable measure. */
.rc-prose {
	max-width: var(--measure);
	font-size: var(--text-body-lg);
	line-height: var(--leading-relaxed);
}

.rc-prose > * + * {
	margin-top: var(--space-3);
}

.rc-prose h2 {
	margin-top: var(--space-6);
}

.rc-prose h3 {
	margin-top: var(--space-5);
}

/*
 * The main landmark carries tabindex="-1" so the skip link can move focus to
 * it. That focus is programmatic, never reached by tabbing, so the ring is
 * suppressed only when the browser itself judges it unwarranted. :focus-visible
 * still wins, which keeps genuine keyboard focus visible.
 */
.rc-main:focus:not(:focus-visible) {
	outline: none;
}

/* Section heading above a grid or block of cards. */
.rc-section__title {
	margin-bottom: var(--space-5);
	font-size: var(--text-h2);
	line-height: var(--leading-tight);
}

/*
 * Article beside a persistent aside. Single column until there is genuinely
 * room for two — the appointment card becomes sticky at the same width, so the
 * two rules agree rather than fighting.
 */
.rc-layout-with-aside {
	display: grid;
	gap: var(--space-6);
}

@media (min-width: 1024px) {
	.rc-layout-with-aside {
		grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
		align-items: start;
	}
}

/* Lead figure at the top of a long-form entry. */
.rc-article__figure {
	margin: 0 0 var(--space-5);
	border-radius: var(--radius-lg);
	overflow: hidden;
	background-color: var(--color-neutral-100);
}

.rc-article__figure img {
	display: block;
	width: 100%;
	height: auto;
}

/* Long-form entry. */
.rc-article__footer {
	margin-top: var(--space-6);
	padding-top: var(--space-4);
	border-top: var(--border-default);
}

.rc-article__reviewed {
	font-size: var(--text-small);
	color: var(--color-text-muted);
}

.rc-article__pages {
	margin-top: var(--space-4);
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	align-items: center;
}

/* Empty state for a listing that returned nothing. */
.rc-empty {
	display: grid;
	gap: var(--space-5);
	justify-items: start;
}

.rc-empty__message {
	font-size: var(--text-body-lg);
	color: var(--color-text-muted);
}

/*
 * Pagination. The markup is WordPress core's, so these are core class names
 * rather than component ones. Targets are sized to the 44px minimum required
 * by CLAUDE.md — this audience includes patients with reduced fine motor
 * control, and a 24px page number is not reliably tappable for them.
 */
.pagination {
	margin-top: var(--space-7);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	align-items: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--target-min);
	min-height: var(--target-min);
	padding-inline: var(--space-2);
	border: var(--border-default);
	border-radius: var(--radius-md);
	color: var(--color-text);
	text-decoration: none;
}

.pagination .page-numbers:hover {
	border-color: var(--color-border-strong);
}

.pagination .page-numbers.current {
	background-color: var(--color-primary-700);
	border-color: var(--color-primary-700);
	color: var(--color-text-inverse);
}

.pagination .page-numbers.dots {
	border-color: transparent;
	min-width: auto;
}
