/*
 * Hub theme (Appearance → Theme → Hub): playretrogames.com layout with the retrogames.cc cards and red brand.
 * Loaded after retrogames.css only when the hub theme is active; body has the class .theme-hub.
 * Parts: dark top bar (logo, search, random game), left systems list (.hub-frame / .hub-systems),
 * tab bar above grids (.hub-tabs), card meta line with stars (.hub-card-meta).
 */
body.theme-hub {
	--hub-bar: #1e2227;
	--hub-side: #23272e;
	--hub-side-hover: #2c3139;
	--hub-side-ink: #d7dbe0;
	--hub-side-muted: #7d858f;
	--hub-page: #f4f5f7;
	--hub-line: #e3e5e8;
	background: var(--hub-page);
}

/* ---------- Top bar ---------- */
.theme-hub .rg-topbar { display: none; }
.theme-hub .rg-nav-wrap { background: var(--hub-bar); }
.theme-hub .rg-header-main { max-width: none; padding: 0 20px; min-height: 58px; gap: 24px; }
.theme-hub a.rg-logo { flex: 0 0 210px; display: flex; align-items: center; }
.theme-hub a.rg-logo img { height: 30px; width: auto; }
.theme-hub .rg-nav { display: none; }
.theme-hub .rg-nav-search { display: none; margin-left: 0; }
.theme-hub .rg-search-toggle { background: #2c3139; border-color: #3a4048; color: #e7e9ec; }
.hub-search { flex: 1 1 auto; max-width: 640px; display: flex; align-items: stretch; height: 38px; margin: 0; }
.hub-search input[type="text"] {
	flex: 1 1 auto; min-width: 0; height: 38px; margin: 0; padding: 0 14px;
	border: 0; border-radius: 4px 0 0 4px; background: #e9ebee; color: #222; font-size: 14px;
}
.hub-search input[type="text"]:focus { outline: 2px solid var(--rg-red); outline-offset: -2px; background: #fff; }
.hub-search button {
	flex: 0 0 46px; width: 46px; height: 38px; margin: 0; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; border-radius: 0 4px 4px 0; cursor: pointer;
	background: var(--rg-red); color: #fff;
}
.hub-search button svg { display: block; }
.hub-search button:hover { background: var(--rg-red-dark); }
.theme-hub .rg-search-bar { background: var(--hub-bar); border-bottom: 0; }

/* ---------- Frame: systems | page ---------- */
.hub-frame { display: flex; align-items: stretch; }
.hub-body { flex: 1 1 auto; min-width: 0; }
.hub-systems {
	flex: 0 0 230px; width: 230px; padding: 18px 0 40px;
	background: var(--hub-side); color: var(--hub-side-ink);
}
.hub-systems h2 {
	margin: 18px 20px 6px; font-size: 11px; font-weight: 700;
	letter-spacing: .08em; text-transform: uppercase; color: #8a929c;
}
.hub-systems > h2:first-child { margin-top: 0; }
.hub-systems ul { list-style: none; margin: 0; padding: 0; }
.theme-hub .hub-systems a {
	display: flex; justify-content: space-between; gap: 10px;
	padding: 7px 20px; font-size: 14px; color: var(--hub-side-ink);
	border-left: 3px solid transparent;
}
.hub-systems a span { color: var(--hub-side-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.theme-hub .hub-systems a:hover,
.theme-hub .hub-systems a.is-current { background: var(--hub-side-hover); color: #fff; border-left-color: var(--rg-red); }
.theme-hub .hub-systems a:focus-visible { outline: 2px solid var(--rg-red); outline-offset: -2px; }

/* The page column: content + right sidebar use the full width next to the systems list. */
.hub-body .rg-main > .rg-layout { max-width: none; padding-left: 26px; }
.theme-hub .rg-content { padding-top: 22px; }
.theme-hub .rg-sidebar::before { background: #eceef1; }

/* The WordPress list hubs (/games/newest/, /games/try-now-gd/) use category.css with a fixed 1084px column. */
.hub-body .category-layout { grid-template-columns: minmax(0, 1fr) 356px; }
.hub-body .list-subhead .pagination { min-width: 0; flex: 1 1 100%; }
.hub-body .pagination .button-group { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.hub-body { overflow-x: clip; }

/* ---------- Tab bar ---------- */
.hub-tabs {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
	margin: 0 0 16px; padding: 0 6px;
	background: #fff; border: 1px solid var(--hub-line); border-radius: 4px;
}
.theme-hub .hub-tabs-title { margin: 0; padding: 0 12px 0 6px; font-size: 16px; font-weight: 700; color: #2a2a2a; border: 0; text-transform: none; }
.hub-tabs nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.hub-tabs nav::-webkit-scrollbar { display: none; }
.theme-hub .hub-tabs nav a {
	padding: 13px 12px; font-size: 14px; color: #6a6f76; white-space: nowrap;
	border-bottom: 2px solid transparent;
}
.theme-hub .hub-tabs nav a:hover { color: #2a2a2a; }
.theme-hub .hub-tabs nav a.is-on { color: var(--rg-red); border-bottom-color: var(--rg-red); }
.hub-count {
	margin-left: auto; padding: 5px 10px;
	border: 1px solid var(--rg-red); border-radius: 3px;
	color: var(--rg-red); font-size: 13px; font-variant-numeric: tabular-nums;
}
.theme-hub .rg-content > .rg-ad-slot,
.theme-hub .rg-content > .playf2p-ad { margin-bottom: 16px; }

/* ---------- Cards ---------- */
.theme-hub .rg-grid { gap: 14px; }
.theme-hub .rg-card { border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.theme-hub .rg-badge {
	left: auto; right: 6px; bottom: 6px; padding: 3px 7px;
	border-radius: 3px; background: rgba(225, 27, 27, .92); font-style: normal;
}
.theme-hub .rg-card-title { font-weight: 600; padding-bottom: 2px; }
.hub-card-meta {
	display: flex; align-items: center; gap: 6px;
	padding: 0 10px 10px; font-size: 12px; color: #8a8f96;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hub-stars { position: relative; display: inline-block; flex: 0 0 auto; color: #d9dce1; letter-spacing: 1px; line-height: 1; }
.hub-stars::before { content: "\2605\2605\2605\2605\2605"; }
.hub-stars > span { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: #f5a623; }
.hub-stars > span::before { content: "\2605\2605\2605\2605\2605"; }

/* ---------- Game page (cards like playretrogames.com) ---------- */
.hub-body .rg-main > .rg-shell:not(.rg-layout) { max-width: none; padding-left: 26px; }
.hub-card {
	margin: 0 0 16px; padding: 16px 18px;
	background: #fff; border: 1px solid var(--hub-line); border-radius: 4px;
}
.hub-game-head {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: start;
	margin-top: 0;
}
.theme-hub .hub-game-title h1 { margin: 0 0 10px; font-size: 22px; font-weight: 700; line-height: 1.25; color: #222; text-transform: none; text-wrap: balance; }
.theme-hub .hub-game-title .rg-breadcrumb { display: inline-block; margin: 0; padding: 6px 12px; background: #f1f2f4; border-radius: 3px; font-size: 13px; }
.hub-game-rating { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.hub-game-rating small { font-size: 12px; color: #6a6f76; }
.hub-stars-lg { font-size: 18px; letter-spacing: 2px; }
.hub-game-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 0; font-size: 12px; color: #8a8f96; font-variant-numeric: tabular-nums; }
.theme-hub .rg-game-info.hub-card { padding: 18px; }
.theme-hub .rg-game-info .rg-post-title h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: #222; text-transform: none; letter-spacing: 0; }
.theme-hub .hub-related h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #2a2a2a; }
.theme-hub .hub-related .rg-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme-hub .rg-newlist .hub-stars { font-size: 12px; }

/* ---------- Footer ---------- */
.theme-hub .rg-footer { background: var(--hub-bar); margin-top: 0; }
.theme-hub .rg-footer-brand img { height: 26px; width: auto; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.hub-systems { display: none; }
	.hub-body .rg-main > .rg-shell:not(.rg-layout) { padding-left: 16px; }
	.hub-body .category-layout { grid-template-columns: 1fr; }
	.hub-body .rg-main > .rg-layout { padding-left: 16px; }
}
@media (max-width: 1023px) {
	.theme-hub .rg-header-main { justify-content: flex-start; padding-left: 56px; gap: 14px; }
	.theme-hub .rg-burger { color: #e7e9ec; }
	.theme-hub a.rg-logo { flex-basis: auto; }
}
@media (max-width: 700px) {
	.hub-search { display: none; }
	.theme-hub .rg-nav-search { display: flex; margin-left: auto; }
	.theme-hub .rg-search-bar { display: block; }
	.hub-count { display: none; }
	.hub-tabs { padding: 0; }
	.theme-hub .hub-tabs-title { width: 100%; padding: 12px 12px 0; }
	.theme-hub a.rg-logo img { height: 24px; }
	.hub-game-head { grid-template-columns: 1fr; }
	.hub-game-rating { align-items: flex-start; text-align: left; }
	.theme-hub .hub-related .rg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
	.theme-hub .rg-card { transition: none; }
}
