/*
 * Brewing Guide — the article list.
 *
 * Every colour, size, space, radius, shadow and duration comes from
 * assets/css/design-tokens.css. Nothing here defines a new colour or a new
 * font: the page header is the warm cream surface with brown text, the eyebrow,
 * links and pagination are the copper conversion colour, and the headings are
 * the shared heading face. A [data-theme="dark"] remap of the role tokens
 * recolours the whole page with no extra rules.
 *
 * The cards are the shared card component (.card--article) from cards.css; only
 * the list's own rhythm, its page header, its empty state and its pagination
 * live here.
 */

/* ---------------------------------------------------------- page header --- */

.hcr-guide__header {
	padding-block: var(--space-16) var(--space-12);
	background: var(--color-surface);
	border-bottom: var(--border-width) solid var(--color-border);
}

.hcr-guide__header-inner {
	max-width: var(--container-max);
}

.hcr-guide__eyebrow {
	margin: 0 0 var(--space-3);
	color: var(--color-primary-600);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-guide__title {
	position: relative;
	margin: 0 0 var(--space-5);
	padding-bottom: var(--space-5);
	max-width: var(--container-narrow);
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: var(--text-4xl);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tighter);
	line-height: var(--leading-tight);
}

/* A short copper rule under the heading — the accent, used once. */
.hcr-guide__title::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 4rem;
	height: 3px;
	background: var(--color-primary-600);
	border-radius: var(--radius-full);
}

.hcr-guide__lede {
	margin: 0;
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-lg);
	line-height: var(--leading-normal);
}

/* ----------------------------------------------------------- the list --- */

.hcr-guide__list {
	background: var(--color-bg);
}

.hcr-guide__count {
	margin: 0 0 var(--space-8);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

/* 1 column on phones, 2 from 40em, 3 from 64em — inherited from .card-grid. */
.hcr-guide__grid {
	align-items: stretch;
}

/* -------------------------------------------------------- topic chips --- */

/* A single horizontal row above the grid. It wraps rather than scrolling, so
   there is no horizontal overflow at 320px. */
.hcr-topics {
	margin: 0 0 var(--space-8);
}

.hcr-topics__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-3);
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hcr-topics__item {
	margin: 0;
}

.hcr-topic-chip {
	display: inline-flex;
	gap: var(--space-2);
	align-items: center;
	min-height: 2.5rem;
	padding: var(--space-2) var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-full);
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	line-height: var(--leading-snug);
	text-decoration: none;
	transition:
		background var(--duration-fast) var(--ease-default),
		border-color var(--duration-fast) var(--ease-default),
		color var(--duration-fast) var(--ease-default);
}

.hcr-topic-chip:hover,
.hcr-topic-chip:focus-visible {
	background: var(--color-primary-50);
	border-color: var(--color-primary-300);
	color: var(--color-primary-700);
}

.hcr-topic-chip:focus-visible {
	outline: 3px solid var(--color-primary-400);
	outline-offset: 3px;
}

/* The count rides in a soft pill so it reads as a number, not as part of the
   label. */
.hcr-topic-chip__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	padding: 0 var(--space-1);
	border-radius: var(--radius-full);
	background: var(--color-surface);
	color: var(--color-text-muted);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
	font-variant-numeric: tabular-nums;
}

/* The active topic: copper fill, and never colour-only — the chip also carries
   aria-current="page" and a heavier weight. */
.hcr-topic-chip.is-active,
.hcr-topic-chip[aria-current="page"] {
	background: var(--color-primary-600);
	border-color: var(--color-primary-600);
	color: var(--color-on-primary);
	font-weight: var(--weight-semibold);
}

.hcr-topic-chip.is-active:hover,
.hcr-topic-chip.is-active:focus-visible,
.hcr-topic-chip[aria-current="page"]:hover,
.hcr-topic-chip[aria-current="page"]:focus-visible {
	background: var(--color-primary-700);
	border-color: var(--color-primary-700);
	color: var(--color-on-primary);
}

.hcr-topic-chip.is-active .hcr-topic-chip__count,
.hcr-topic-chip[aria-current="page"] .hcr-topic-chip__count {
	background: var(--color-primary-800);
	color: var(--color-on-primary);
}

/* ------------------------------------------------- the article card tweaks --- */

/* The topic chip reads as a label rather than a product badge: copper on the
   photo, so it carries the accent without competing with the title. */
.hcr-article-card .card__badge {
	background: var(--color-primary-600);
	color: var(--color-on-primary);
}

.hcr-article-card .card__title {
	font-size: var(--text-xl);
}

/* Date · reading time, in sentence case — it is a fact, not a label. */
.hcr-article-card .card__meta {
	letter-spacing: var(--letter-normal);
	text-transform: none;
}

.hcr-article-card .card__excerpt {
	flex: 1 1 auto;
}

/* ---------------------------------------------------------- empty state --- */

.hcr-guide__empty {
	max-width: var(--container-narrow);
	margin-inline: auto;
	padding: var(--space-10) var(--space-6);
	background: var(--color-surface);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	text-align: center;
}

.hcr-guide__empty-title {
	margin: 0 0 var(--space-4);
	color: var(--color-text);
	font-family: var(--font-heading);
	font-size: var(--text-2xl);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-snug);
}

.hcr-guide__empty-text {
	margin: 0 auto var(--space-8);
	max-width: var(--measure);
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-guide__empty-actions {
	margin: 0;
}

/* ---------------------------------------------------------- pagination --- */

.hcr-pagination {
	margin-top: var(--space-12);
}

.hcr-pagination ul,
.hcr-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hcr-pagination li {
	margin: 0;
}

.hcr-pagination a.page-numbers,
.hcr-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: var(--space-2) var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-full);
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	text-decoration: none;
	transition:
		background var(--duration-fast) var(--ease-default),
		border-color var(--duration-fast) var(--ease-default),
		color var(--duration-fast) var(--ease-default);
}

.hcr-pagination a.page-numbers:hover,
.hcr-pagination a.page-numbers:focus-visible {
	background: var(--color-primary-50);
	border-color: var(--color-primary-300);
	color: var(--color-primary-700);
}

.hcr-pagination span.current {
	background: var(--color-primary-600);
	border-color: var(--color-primary-600);
	color: var(--color-on-primary);
}

.hcr-pagination span.dots {
	border-color: transparent;
	background: none;
	color: var(--color-text-muted);
}

.hcr-pagination .prev,
.hcr-pagination .next {
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-pagination a:focus-visible {
	outline: 3px solid var(--color-primary-400);
	outline-offset: 3px;
}

/* ------------------------------------------- the Page's editable content --- */

.hcr-guide__content {
	padding-top: 0;
}

.hcr-guide__prose {
	max-width: var(--measure);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-guide__prose h2,
.hcr-guide__prose h3 {
	margin: var(--space-8) 0 var(--space-3);
	color: var(--color-text);
	font-family: var(--font-heading);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-snug);
}

.hcr-guide__prose a {
	color: var(--color-link);
	text-underline-offset: 3px;
}

.hcr-guide__prose a:hover,
.hcr-guide__prose a:focus-visible {
	color: var(--color-link-hover);
}

@media (min-width: 48em) {
	.hcr-guide__header {
		padding-block: var(--space-20) var(--space-16);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hcr-pagination a.page-numbers,
	.hcr-topic-chip {
		transition: none;
	}
}
