/**
 * Shared blog components: breadcrumbs, chips, sections, post-card grid,
 * pagination, page headers, reserved ad slots.
 */

/* ---------------------------------------------------------------------
 * Breadcrumbs
 * ------------------------------------------------------------------ */
.bhg-breadcrumbs {
	margin-bottom: var(--bhg-space-5);
	font-size: var(--bhg-text-sm);
}

.bhg-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bhg-space-1) var(--bhg-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--bhg-color-text-muted);
}

.bhg-breadcrumbs__item + .bhg-breadcrumbs__item::before {
	content: "›";
	margin-right: var(--bhg-space-2);
	color: var(--bhg-color-text-muted);
}

.bhg-breadcrumbs a {
	color: var(--bhg-color-text-muted);
	text-decoration: none;
}

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

.bhg-breadcrumbs [aria-current="page"] {
	color: var(--bhg-color-text);
	overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------------
 * Chips
 * ------------------------------------------------------------------ */
.bhg-chip {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0 var(--bhg-space-3);
	border: var(--bhg-border-width) solid rgb(0 240 240 / 0.35);
	border-radius: var(--bhg-radius-pill);
	background: var(--bhg-brand-accent-soft);
	color: var(--bhg-color-accent);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-bold);
	letter-spacing: var(--bhg-tracking-wide);
	text-decoration: none;
	text-transform: uppercase;
}

.bhg-chip:hover {
	border-color: var(--bhg-color-accent);
	color: var(--bhg-color-heading);
}

.bhg-chip--quiet {
	border-color: var(--bhg-color-border);
	background: var(--bhg-color-surface);
	color: var(--bhg-color-text);
	letter-spacing: 0;
	text-transform: none;
}

/* ---------------------------------------------------------------------
 * Sections, page headers
 * ------------------------------------------------------------------ */
.bhg-section {
	padding-block: var(--bhg-space-section);
}

.bhg-section + .bhg-section {
	padding-top: 0;
}

.bhg-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--bhg-space-2) var(--bhg-space-4);
	margin-bottom: var(--bhg-space-6);
}

.bhg-section__title {
	font-size: var(--bhg-text-2xl);
}

.bhg-section__link {
	display: inline-flex;
	align-items: center;
	gap: var(--bhg-space-2);
	font-weight: var(--bhg-weight-semibold);
	text-decoration: none;
}

.bhg-section__link .bhg-icon {
	width: 1.1rem;
	height: 1.1rem;
}

.bhg-page-header {
	margin-bottom: var(--bhg-space-8);
}

.bhg-page-header__title {
	font-size: var(--bhg-text-4xl);
}

.bhg-page-header__intro {
	max-width: var(--bhg-measure);
	margin-top: var(--bhg-space-3);
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-lg);
}

/* ---------------------------------------------------------------------
 * Post cards and grid
 * ------------------------------------------------------------------ */
.bhg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
	gap: var(--bhg-space-6);
	margin: 0;
	padding: 0;
	list-style: none;
}

.bhg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: var(--bhg-border-width) solid var(--bhg-color-border);
	border-radius: var(--bhg-radius-lg);
	background: var(--bhg-color-surface);
	transition:
		border-color var(--bhg-duration-base) var(--bhg-ease-out),
		transform var(--bhg-duration-base) var(--bhg-ease-out);
}

.bhg-card:hover {
	border-color: var(--bhg-color-border-strong);
	transform: translateY(-2px);
}

.bhg-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--bhg-color-surface-raised);
}

.bhg-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bhg-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: radial-gradient(circle at 30% 20%, var(--bhg-brand-navy), var(--bhg-color-surface-raised));
}

.bhg-card__badge {
	position: absolute;
	bottom: var(--bhg-space-3);
	left: var(--bhg-space-3);
	display: inline-flex;
	align-items: center;
	gap: var(--bhg-space-1);
	padding: var(--bhg-space-1) var(--bhg-space-3);
	border-radius: var(--bhg-radius-pill);
	background: rgb(5 10 24 / 0.85);
	color: var(--bhg-color-heading);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-bold);
}

.bhg-card__badge .bhg-icon {
	width: 0.9rem;
	height: 0.9rem;
	color: var(--bhg-color-accent);
}

.bhg-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--bhg-space-2);
	padding: var(--bhg-space-5);
}

.bhg-card__cat {
	color: var(--bhg-color-accent);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-bold);
	letter-spacing: var(--bhg-tracking-wide);
	text-decoration: none;
	text-transform: uppercase;
}

.bhg-card__title {
	font-size: var(--bhg-text-lg);
	line-height: var(--bhg-leading-snug);
}

.bhg-card__title a {
	color: var(--bhg-color-heading);
	text-decoration: none;
}

/* Whole card clickable via the title link. */
.bhg-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.bhg-card__cat {
	position: relative;
	z-index: 1;
}

.bhg-card__title a:focus-visible {
	outline: none;
}

.bhg-card:has(.bhg-card__title a:focus-visible) {
	outline: 2px solid var(--bhg-color-focus);
	outline-offset: 2px;
}

.bhg-card__excerpt {
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-sm);
	line-height: var(--bhg-leading-snug);
}

.bhg-card__meta {
	display: flex;
	flex-wrap: wrap;
	white-space: nowrap;
	gap: var(--bhg-space-2);
	margin-top: auto;
	padding-top: var(--bhg-space-2);
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-xs);
}

/* Featured card: side by side from 48em. */
.bhg-card--featured .bhg-card__title {
	font-size: var(--bhg-text-2xl);
}

@media (min-width: 48em) {
	.bhg-card--featured {
		display: grid;
		grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	}

	.bhg-card--featured .bhg-card__media {
		aspect-ratio: auto;
		min-height: 100%;
	}

	.bhg-card--featured .bhg-card__body {
		justify-content: center;
		padding: var(--bhg-space-8);
	}
}

/* ---------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------ */
.bhg-pagination {
	margin-top: var(--bhg-space-10);
}

.bhg-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--bhg-space-2);
}

.bhg-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: var(--bhg-tap-target);
	min-height: var(--bhg-tap-target);
	padding: 0 var(--bhg-space-3);
	border: var(--bhg-border-width) solid var(--bhg-color-border);
	border-radius: var(--bhg-radius-md);
	background: var(--bhg-color-surface);
	color: var(--bhg-color-text);
	font-weight: var(--bhg-weight-semibold);
	text-decoration: none;
}

.bhg-pagination a.page-numbers:hover {
	border-color: var(--bhg-color-accent);
	color: var(--bhg-color-heading);
}

.bhg-pagination .page-numbers.current {
	border-color: var(--bhg-color-accent);
	background: var(--bhg-color-accent);
	color: var(--bhg-color-on-accent);
}

.bhg-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

/* ---------------------------------------------------------------------
 * Reserved ad slots: hidden until ads are switched on; then a fixed
 * min-height reserves the space so nothing shifts when the ad loads.
 * ------------------------------------------------------------------ */
.bhg-ad-slot[hidden] {
	display: none !important;
}

.bhg-ad-slot {
	display: block;
	min-height: 280px;
	margin-block: var(--bhg-space-8);
	border-radius: var(--bhg-radius-md);
	background: var(--bhg-color-surface);
}

@media (min-width: 48em) {
	.bhg-ad-slot {
		min-height: 250px;
	}
}

/* ---------------------------------------------------------------------
 * Game hub banner
 * ------------------------------------------------------------------ */
.bhg-hub {
	padding-top: 0;
}

.bhg-hub__banner {
	position: relative;
	overflow: hidden;
	padding-block: var(--bhg-space-6) var(--bhg-space-12);
	border-bottom: var(--bhg-border-width) solid var(--bhg-color-border);
	background:
		radial-gradient(40rem 22rem at 85% 0%, rgb(0 240 240 / 0.14), transparent 70%),
		linear-gradient(180deg, var(--bhg-brand-navy) 0%, var(--bhg-color-bg) 100%);
}

.bhg-hub__eyebrow {
	color: var(--bhg-color-accent);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-bold);
	letter-spacing: var(--bhg-tracking-wide);
	text-transform: uppercase;
}

.bhg-hub__title {
	margin-top: var(--bhg-space-2);
	font-size: var(--bhg-text-5xl);
}

.bhg-hub__intro {
	max-width: var(--bhg-measure);
	margin-top: var(--bhg-space-4);
	color: var(--bhg-color-text);
	font-size: var(--bhg-text-lg);
}

.bhg-hub__count {
	margin-top: var(--bhg-space-4);
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-sm);
}

.bhg-hub__featured {
	margin-bottom: var(--bhg-space-12);
}

.bhg-hub__more {
	margin-bottom: var(--bhg-space-6);
}

.bhg-empty {
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-lg);
}

/* ---------------------------------------------------------------------
 * Filters, search again, pages, 404, author profile
 * ------------------------------------------------------------------ */
.bhg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bhg-space-2);
	margin: var(--bhg-space-5) 0 0;
	padding: 0;
	list-style: none;
}

.bhg-search-again {
	max-width: 36rem;
	margin-top: var(--bhg-space-5);
}

.bhg-search-again .bhg-search-form {
	margin-inline: 0;
}

.bhg-page .bhg-page-header,
.bhg-page .bhg-prose {
	max-width: var(--bhg-measure);
}

.bhg-page__updated {
	margin-top: var(--bhg-space-2);
	color: var(--bhg-color-text-muted);
	font-size: var(--bhg-text-sm);
}

.bhg-404__inner {
	max-width: 40rem;
	margin-inline: auto;
	padding-block: var(--bhg-space-8);
	text-align: center;
}

.bhg-404__inner .bhg-page-header__intro,
.bhg-404__inner .bhg-search-again {
	margin-inline: auto;
}

.bhg-404__inner .bhg-filter {
	justify-content: center;
}

.bhg-404__code {
	background: var(--bhg-brand-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-family: var(--bhg-font-heading);
	font-size: clamp(5rem, 3rem + 10vw, 9rem);
	font-weight: var(--bhg-weight-bold);
	line-height: 1;
}

.bhg-profile {
	display: grid;
	gap: var(--bhg-space-6);
	margin-bottom: var(--bhg-space-12);
	padding: var(--bhg-space-6);
	border: var(--bhg-border-width) solid var(--bhg-color-border);
	border-radius: var(--bhg-radius-xl);
	background:
		radial-gradient(30rem 16rem at 100% 0%, rgb(0 240 240 / 0.12), transparent 70%),
		linear-gradient(160deg, var(--bhg-brand-navy), var(--bhg-color-surface));
}

.bhg-profile__avatar img,
.bhg-profile__avatar .bhg-avatar {
	width: 96px;
	height: 96px;
	border: 3px solid var(--bhg-color-accent);
}

.bhg-profile__name {
	margin-top: var(--bhg-space-1);
	font-size: var(--bhg-text-4xl);
}

.bhg-profile__bio {
	max-width: var(--bhg-measure);
	margin-block: var(--bhg-space-3) var(--bhg-space-5);
	color: var(--bhg-color-text);
	font-size: var(--bhg-text-lg);
}

.bhg-profile__games {
	margin-top: var(--bhg-space-6);
}

.bhg-profile__games .bhg-filter {
	margin-top: 0;
}

.bhg-profile__guides {
	margin-bottom: var(--bhg-space-6);
}

@media (min-width: 48em) {
	.bhg-profile {
		grid-template-columns: auto 1fr;
		align-items: start;
		padding: var(--bhg-space-10);
	}

	.bhg-profile__avatar img,
	.bhg-profile__avatar .bhg-avatar {
		width: 128px;
		height: 128px;
	}
}

/* Small uppercase label (e.g. "Games he plays") */
.bhg-label {
	margin-bottom: var(--bhg-space-3);
	color: var(--bhg-color-text-muted);
	font-family: var(--bhg-font-body);
	font-size: var(--bhg-text-xs);
	font-weight: var(--bhg-weight-semibold);
	letter-spacing: var(--bhg-tracking-wide);
	text-transform: uppercase;
}

/* Author avatars are round everywhere. */
.bhg-author-avatar {
	flex-shrink: 0;
	border-radius: var(--bhg-radius-round);
}

/* ---------------------------------------------------------------------
 * Empty state ("New guides are on the way")
 * ------------------------------------------------------------------ */
.bhg-empty-state {
	display: grid;
	justify-items: center;
	gap: var(--bhg-space-5);
	padding: var(--bhg-space-10) var(--bhg-space-6);
	border: var(--bhg-border-width) dashed var(--bhg-color-border-strong);
	border-radius: var(--bhg-radius-lg);
	background: var(--bhg-color-surface);
	text-align: center;
}

.bhg-empty-state__text {
	max-width: 32rem;
	color: var(--bhg-color-text);
	font-size: var(--bhg-text-lg);
}

.bhg-empty-state .bhg-button .bhg-icon {
	width: 1.25rem;
	height: 1.25rem;
}

/* ---------------------------------------------------------------------
 * Shared by home and articles: mono meta line, YouTube thumbnails
 * ------------------------------------------------------------------ */
.bhg-meta-line {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bhg-space-2);
	margin: 0;
	color: var(--bhg-color-text-muted);
}

.bhg-meta-line__sep {
	color: var(--bhg-color-border-strong);
}

.bhg-yt__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--bhg-radius-md);
	background: var(--bhg-color-surface-raised);
}

.bhg-yt__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--bhg-duration-slow) var(--bhg-ease-out);
}

.bhg-yt__play {
	position: absolute;
	inset: 50% auto auto 50%;
	display: grid;
	place-items: center;
	width: 3.5rem;
	height: 2.5rem;
	border-radius: var(--bhg-radius-md);
	background: #e00;
	color: #fff;
	transform: translate(-50%, -50%);
}

.bhg-yt__play .bhg-icon {
	width: 1.5rem;
	height: 1.5rem;
}

.bhg-yt__play--small {
	width: 2rem;
	height: 1.4rem;
	border-radius: var(--bhg-radius-sm);
}

.bhg-yt__play--small .bhg-icon {
	width: 0.9rem;
	height: 0.9rem;
}

/*
 * A Short's 4:3 thumbnail holds the 9:16 frame between black bars (the
 * frame is 9/16 × 3/4 = 42.2% of the width). Cover-fit into 16:9, then
 * zoom 2.37× so the frame fills the box (centre crop). "scale" composes
 * with the hover transform.
 */
.bhg-thumb--short img {
	scale: 2.37;
}

/* Hidden ad slot between page sections: no gap while hidden. */
.bhg-ad-wrap:has(> .bhg-ad-slot[hidden]) {
	display: none;
}

.bhg-ad-wrap + .bhg-section {
	padding-top: 0;
}
