/* ==========================================================================
   Components: buttons, badges, cards, forms, tables, notices, pagination
   ========================================================================== */

/* --- Buttons ----------------------------------------------------------- */
.hp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--hp-space-2xs);
	min-height: 44px;
	padding: 0.6rem 1.35rem;
	border: 1px solid transparent;
	border-radius: var(--hp-radius-md);
	background-color: var(--hp-color-primary);
	color: #fff;
	font-size: var(--hp-text-sm);
	font-weight: 650;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color var(--hp-transition), border-color var(--hp-transition), color var(--hp-transition);
}
.hp-btn:hover { background-color: var(--hp-color-primary-dark); color: #fff; }
.hp-btn--accent { background-color: var(--hp-color-accent); }
.hp-btn--accent:hover { background-color: var(--hp-color-accent-dark); }
.hp-btn--ghost {
	background-color: transparent;
	border-color: var(--hp-color-border-strong);
	color: var(--hp-color-text);
}
.hp-btn--ghost:hover { background-color: var(--hp-color-surface-alt); color: var(--hp-color-text); }
.hp-btn--invert { background-color: #fff; color: var(--hp-color-primary-dark); }
.hp-btn--invert:hover { background-color: var(--hp-color-signal-soft); color: var(--hp-color-primary-dark); }
.hp-btn--sm { min-height: 36px; padding: 0.35rem 0.9rem; font-size: var(--hp-text-xs); }
.hp-btn--block { width: 100%; }
.hp-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* --- Eyebrow / badges --------------------------------------------------- */
.hp-eyebrow {
	display: inline-block;
	font-family: var(--hp-font-body);
	font-size: var(--hp-text-2xs);
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--hp-color-accent);
	text-decoration: none;
}
a.hp-eyebrow:hover { color: var(--hp-color-accent-dark); text-decoration: underline; }

.hp-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.2rem 0.55rem;
	border-radius: var(--hp-radius-sm);
	background-color: var(--hp-color-surface-alt);
	color: var(--hp-color-text);
	font-size: var(--hp-text-2xs);
	font-weight: 650;
	letter-spacing: 0.02em;
	white-space: nowrap;
}
.hp-badge--signal { background-color: var(--hp-color-signal-soft); color: var(--hp-color-warning); }
.hp-badge--primary { background-color: var(--hp-color-primary-soft); color: var(--hp-color-primary-dark); }
.hp-badge--demo {
	background-color: var(--hp-color-signal-soft);
	color: var(--hp-color-warning);
	border: 1px dashed var(--hp-color-signal);
}
.hp-badge--sponsored { background-color: var(--hp-color-surface-alt); color: var(--hp-color-text-muted); }

/* --- Cards -------------------------------------------------------------- */
.hp-card {
	display: flex;
	flex-direction: column;
	gap: var(--hp-space-2xs);
	background-color: var(--hp-color-surface);
	position: relative;
}
.hp-card__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--hp-radius-md);
	background-color: var(--hp-color-surface-alt);
	aspect-ratio: 16 / 10;
}
.hp-card__media img { width: 100%; height: 100%; object-fit: cover; }
.hp-card__media--square { aspect-ratio: 1 / 1; }
.hp-card__media--tall { aspect-ratio: 4 / 5; }
.hp-card__title {
	font-size: var(--hp-text-md);
	line-height: var(--hp-leading-snug);
	margin: 0;
}
.hp-card__title a { text-decoration: none; color: var(--hp-color-text); }
.hp-card__title a:hover { color: var(--hp-color-primary-dark); text-decoration: underline; text-decoration-thickness: 1px; }
.hp-card__excerpt { color: var(--hp-color-text-muted); font-size: var(--hp-text-sm); margin: 0; }
.hp-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	font-size: var(--hp-text-2xs);
	color: var(--hp-color-text-muted);
}
.hp-card--boxed {
	border: var(--hp-rule);
	border-radius: var(--hp-radius-md);
	padding: var(--hp-space-sm);
	height: 100%;
}
.hp-card--row { flex-direction: row; align-items: flex-start; gap: var(--hp-space-sm); }
.hp-card--row .hp-card__media { flex: 0 0 108px; aspect-ratio: 1 / 1; }
.hp-card--row .hp-card__body { flex: 1 1 auto; }
.hp-card--lead .hp-card__title { font-size: var(--hp-text-2xl); }
.hp-card--compact .hp-card__title { font-size: var(--hp-text-sm); font-family: var(--hp-font-body); font-weight: 650; }

/* Numbered list cards are only used where rank is real (Most read). */
.hp-ranked { counter-reset: hp-rank; list-style: none; padding: 0; margin: 0; }
.hp-ranked > li {
	counter-increment: hp-rank;
	display: flex;
	gap: var(--hp-space-sm);
	padding-block: var(--hp-space-xs);
	border-top: var(--hp-rule);
}
.hp-ranked > li:first-child { border-top: 0; }
.hp-ranked > li::before {
	content: counter(hp-rank);
	font-family: var(--hp-font-display);
	font-size: var(--hp-text-lg);
	color: var(--hp-color-border-strong);
	line-height: 1;
	min-width: 1.2em;
}

/* --- Forms -------------------------------------------------------------- */
.hp-field { display: block; margin-bottom: var(--hp-space-sm); }
.hp-label {
	display: block;
	margin-bottom: var(--hp-space-3xs);
	font-size: var(--hp-text-sm);
	font-weight: 650;
}
.hp-hint { display: block; font-size: var(--hp-text-xs); color: var(--hp-color-text-muted); margin-top: 2px; }
.hp-input,
.hp-select,
.hp-textarea {
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--hp-color-border-strong);
	border-radius: var(--hp-radius-md);
	background-color: var(--hp-color-surface);
	color: var(--hp-color-text);
	font-size: var(--hp-text-sm);
}
.hp-textarea { min-height: 120px; }
.hp-input:focus,
.hp-select:focus,
.hp-textarea:focus { border-color: var(--hp-color-primary); }
.hp-input[aria-invalid="true"] { border-color: var(--hp-color-error); }
.hp-error {
	display: block;
	margin-top: var(--hp-space-3xs);
	color: var(--hp-color-error);
	font-size: var(--hp-text-xs);
	font-weight: 650;
}
.hp-input-group { display: flex; gap: var(--hp-space-2xs); flex-wrap: wrap; }
.hp-input-group .hp-input { flex: 1 1 200px; }
.hp-checkbox { display: flex; gap: var(--hp-space-2xs); align-items: flex-start; font-size: var(--hp-text-sm); }
.hp-checkbox input { margin-top: 0.3em; }

/* --- Notices, disclosures, disclaimers ---------------------------------- */
.hp-notice {
	padding: var(--hp-space-sm) var(--hp-space-md);
	border-left: 3px solid var(--hp-color-primary);
	background-color: var(--hp-color-canvas);
	font-size: var(--hp-text-sm);
	color: var(--hp-color-text-muted);
	border-radius: 0 var(--hp-radius-md) var(--hp-radius-md) 0;
}
.hp-notice p { margin: 0; }
.hp-notice p + p { margin-top: var(--hp-space-2xs); }
.hp-notice--disclosure { border-left-color: var(--hp-color-signal); background-color: var(--hp-color-signal-soft); color: var(--hp-color-text); }
.hp-notice--medical { border-left-color: var(--hp-color-accent); }
.hp-notice strong { color: var(--hp-color-text); }

/* --- Tables ------------------------------------------------------------- */
.hp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-block: var(--hp-space-md); }
.hp-table { min-width: 640px; font-size: var(--hp-text-sm); }
.hp-table th,
.hp-table td { padding: var(--hp-space-2xs) var(--hp-space-sm); text-align: left; vertical-align: top; border-bottom: var(--hp-rule); }
.hp-table thead th {
	background-color: var(--hp-color-canvas);
	font-size: var(--hp-text-2xs);
	letter-spacing: 0.03em;
	border-bottom: 2px solid var(--hp-color-text);
}
.hp-table tbody tr:nth-child(even) { background-color: rgba(0, 0, 0, 0.015); }

/* --- Pagination --------------------------------------------------------- */
.hp-pagination { margin-top: var(--hp-space-xl); }
.hp-pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--hp-space-3xs); justify-content: center; }
.hp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.6rem;
	border: var(--hp-rule);
	border-radius: var(--hp-radius-md);
	font-size: var(--hp-text-sm);
	text-decoration: none;
}
.hp-pagination .page-numbers:hover { background-color: var(--hp-color-surface-alt); }
.hp-pagination .page-numbers.current { background-color: var(--hp-color-primary); border-color: var(--hp-color-primary); color: #fff; }
.hp-pagination .page-numbers.dots { border-color: transparent; }

/* --- A-Z index ---------------------------------------------------------- */
.hp-alpha {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding-block: var(--hp-space-sm);
	border-block: var(--hp-rule);
	margin-bottom: var(--hp-space-md);
}
.hp-alpha a,
.hp-alpha span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--hp-radius-sm);
	font-size: var(--hp-text-sm);
	font-weight: 650;
	text-decoration: none;
}
.hp-alpha a { background-color: var(--hp-color-canvas); color: var(--hp-color-primary-dark); }
.hp-alpha a:hover,
.hp-alpha a[aria-current="true"] { background-color: var(--hp-color-primary); color: #fff; }
.hp-alpha span { color: var(--hp-color-border-strong); }

/* --- Breadcrumbs -------------------------------------------------------- */
.hp-breadcrumbs { padding-block: var(--hp-space-sm); font-size: var(--hp-text-xs); color: var(--hp-color-text-muted); }
.hp-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.hp-breadcrumbs li::after { content: "/"; margin-left: 0.35rem; color: var(--hp-color-border-strong); }
.hp-breadcrumbs li:last-child::after { content: ""; }
.hp-breadcrumbs a { text-decoration: none; }
.hp-breadcrumbs a:hover { text-decoration: underline; }

/* --- Ads ---------------------------------------------------------------- */
.hp-ad {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--hp-space-3xs);
	margin-block: var(--hp-space-lg);
	padding: var(--hp-space-sm);
	background-color: var(--hp-color-canvas);
	border: 1px dashed var(--hp-color-border-strong);
	border-radius: var(--hp-radius-md);
	text-align: center;
}
.hp-ad__label {
	font-size: var(--hp-text-3xs);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--hp-color-text-muted);
}
.hp-ad__slot { width: 100%; min-height: 90px; display: flex; align-items: center; justify-content: center; color: var(--hp-color-text-muted); font-size: var(--hp-text-xs); }
.hp-ad--sticky-mobile {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 60;
	margin: 0;
	border-radius: 0;
	border-inline: 0;
	border-bottom: 0;
	background-color: var(--hp-color-surface);
	box-shadow: var(--hp-shadow-md);
}

/* --- Newsletter --------------------------------------------------------- */
.hp-newsletter { background-color: var(--hp-color-primary-dark); color: var(--hp-color-text-invert); }
.hp-newsletter__inner { display: grid; gap: var(--hp-space-lg); align-items: center; }
.hp-newsletter__title { font-size: var(--hp-text-2xl); color: var(--hp-color-text-invert); max-width: 18ch; }
.hp-newsletter__text { color: rgba(244, 247, 247, 0.82); max-width: 52ch; }
.hp-newsletter__form { display: grid; gap: var(--hp-space-2xs); }
.hp-newsletter__topics { display: flex; flex-wrap: wrap; gap: var(--hp-space-2xs); }
.hp-newsletter__topics label {
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
	padding: 0.3rem 0.65rem;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--hp-radius-pill);
	font-size: var(--hp-text-xs);
	cursor: pointer;
}
.hp-newsletter__topics input:focus-visible { outline-offset: 3px; }
.hp-newsletter .hp-input { border-color: transparent; }
.hp-newsletter__note { font-size: var(--hp-text-xs); color: rgba(244, 247, 247, 0.7); }
.hp-newsletter__message { font-size: var(--hp-text-sm); font-weight: 650; }

@media (min-width: 900px) {
	.hp-newsletter__inner { grid-template-columns: 1fr 1fr; gap: var(--hp-space-2xl); }
}

/* --- Trust cards -------------------------------------------------------- */
.hp-trust-card { padding: var(--hp-space-md); border: var(--hp-rule); border-radius: var(--hp-radius-md); background-color: var(--hp-color-surface); }
.hp-trust-card__icon { color: var(--hp-color-primary); margin-bottom: var(--hp-space-2xs); }
.hp-trust-card h3 { font-size: var(--hp-text-md); margin-bottom: var(--hp-space-3xs); }
.hp-trust-card p { font-size: var(--hp-text-sm); color: var(--hp-color-text-muted); margin: 0; }
.hp-trust-links { display: flex; flex-wrap: wrap; gap: var(--hp-space-sm) var(--hp-space-md); margin-top: var(--hp-space-md); font-size: var(--hp-text-sm); }

/* --- Share -------------------------------------------------------------- */
.hp-share { display: flex; align-items: center; gap: var(--hp-space-2xs); flex-wrap: wrap; }
.hp-share__label { font-size: var(--hp-text-xs); color: var(--hp-color-text-muted); }
.hp-share a,
.hp-share button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: var(--hp-rule);
	border-radius: var(--hp-radius-pill);
	color: var(--hp-color-text-muted);
	text-decoration: none;
}
.hp-share a:hover,
.hp-share button:hover { background-color: var(--hp-color-surface-alt); color: var(--hp-color-primary-dark); }

/* --- Tabs --------------------------------------------------------------- */
.hp-tabs__list {
	display: flex;
	gap: var(--hp-space-2xs);
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: var(--hp-space-3xs);
	border-bottom: var(--hp-rule);
	margin-bottom: var(--hp-space-md);
}
.hp-tabs__tab {
	flex: 0 0 auto;
	min-height: 40px;
	padding: 0.45rem 0.9rem;
	border-radius: var(--hp-radius-sm);
	color: var(--hp-color-text-muted);
	font-size: var(--hp-text-sm);
	font-weight: 650;
	white-space: nowrap;
	text-decoration: none;
	border-bottom: 3px solid transparent;
}
.hp-tabs__tab[aria-selected="true"],
.hp-tabs__tab.is-active { color: var(--hp-color-text); border-bottom-color: var(--hp-color-accent); }
.hp-tabs__panel[hidden] { display: none; }
.hp-tabs.is-loading { opacity: 0.55; }

/* --- Carousel / swipe rails --------------------------------------------- */
.hp-rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(240px, 1fr);
	gap: var(--hp-space-md);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding-bottom: var(--hp-space-2xs);
	scrollbar-width: thin;
}
.hp-rail > * { scroll-snap-align: start; }
.hp-rail::-webkit-scrollbar { height: 6px; }
.hp-rail::-webkit-scrollbar-thumb { background: var(--hp-color-border-strong); border-radius: var(--hp-radius-pill); }

/* --- Empty state -------------------------------------------------------- */
.hp-empty { padding: var(--hp-space-xl) 0; text-align: center; color: var(--hp-color-text-muted); }
.hp-empty h2 { margin-bottom: var(--hp-space-2xs); }
