/*
 * Front page as a catalogue hub (inc/home-hub.php). Same tokens and type as
 * rust.css: square corners, condensed capitals, the game's greys and its red
 * and gold. Its own selectors (brs-hub-*): nothing here touches the two-column
 * design or any other page.
 *
 * Each category band is two parts side by side: the cards keep their own
 * shape and set the height, the description panel stretches to it, so no
 * band leaves an empty strip. On phones everything is one column.
 * Selectors on text use direct children: the translator wraps names such as
 * "Rust" in spans of its own, which must keep the text's colour.
 */

.brs-hub {
	--hb-gap: clamp(12px, 1.1vw, 18px);
	--hb-pad: clamp(16px, 1.6vw, 28px);
	--hb-box: #1b1b1a;
	--hb-line: rgba(255, 255, 255, .07);
	display: flex;
	flex-direction: column;
	gap: calc(var(--hb-gap) * 1.6);
	width: 100%;
	margin: 6px 0 calc(var(--hb-gap) * 2);
	font-family: var(--brs-font);
}

body.brs .brs-hub img { max-width: none; }

.brs-hub .brs-btn--hot {
	background: linear-gradient(180deg, #d4492f, #a5321f) !important;
	color: #fff !important;
	box-shadow: 0 0 0 1px rgba(255, 140, 110, .25) inset;
}

.brs-hub .brs-btn--hot:hover { filter: brightness(1.1); }

.brs-hub a:focus-visible,
.brs-hub summary:focus-visible,
.brs-hub input:focus-visible,
.brs-hub button:focus-visible {
	outline: 2px solid var(--brs-gold);
	outline-offset: 2px;
}

/* ---------- Opening ---------- */

.brs-hub-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: var(--hb-gap);
	align-items: stretch;
}

.brs-hub-hero__copy {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(24px, 3vw, 52px) var(--hb-pad);
	border: 1px solid var(--hb-line);
	background:
		linear-gradient(90deg, rgba(205, 64, 43, .14), transparent 55%),
		linear-gradient(180deg, #211f1c, #171716);
}

.brs-hub-hero__copy > h1 {
	margin: 0 0 14px !important;
	color: #f4eee6 !important;
	font-size: clamp(30px, 3vw, 54px) !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	text-transform: uppercase;
}

.brs-hub-hero__copy > p {
	max-width: 68ch;
	margin: 0 0 22px;
	color: var(--brs-mute);
	font-size: clamp(15px, 1vw, 18px);
	line-height: 1.55;
}

.brs-hub-search {
	display: flex;
	align-items: stretch;
	height: 56px;
	margin: 0 0 14px;
	border: 1px solid #3a3835;
	background: #121211;
}

.brs-hub-search:focus-within { border-color: var(--brs-gold); }
.brs-hub-search > .ri { flex: none; align-self: center; margin: 0 4px 0 16px; color: var(--brs-icon); font-size: 24px; }

body.brs .brs-hub-search input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 12px;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: #f0eae2;
	font-family: var(--brs-font);
	font-size: 17px;
}

.brs-hub-search button.brs-btn { height: 100%; padding: 0 26px; font-size: 16px; }

.brs-hub-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brs-hub-chips > span { color: var(--brs-dim); font-size: 14px; font-weight: 700; text-transform: uppercase; }

.brs-hub-chips > a {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	height: 32px;
	padding: 0 12px;
	background: #262624;
	color: #ddd6ce !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	text-transform: uppercase;
}

.brs-hub-chips > a > small { color: var(--brs-gold-text); font-size: 12px; }
.brs-hub-chips > a:hover { background: #33312e; color: #fff !important; }

.brs-hub-hero__meta { margin: 16px 0 0 !important; color: var(--brs-dim) !important; font-size: 14px !important; }

.brs-hub-hero__spot {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.brs-hub-hero__tag {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 4;
	display: inline-flex;
	gap: 6px;
	align-items: center;
	margin: 0;
	padding: 6px 10px;
	background: var(--brs-red-tag);
	color: #fbe3d8;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
}

.brs-hub-hero__spot .brs-card { flex: 1; aspect-ratio: auto; min-height: 340px; }
.brs-hub-hero__spot .brs-card__title { font-size: clamp(26px, 2.2vw, 40px); }
.brs-hub-hero__spot .brs-card__body { padding: 20px 22px 18px; }

/* ---------- Category doors ---------- */

.brs-hub-doors {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--hb-line);
	background: var(--hb-line);
}

.brs-hub-door {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 16px 18px;
	background: var(--hb-box);
	color: var(--brs-text) !important;
	text-decoration: none !important;
	transition: background .2s ease;
}

.brs-hub-door > .ri { flex: none; color: var(--brs-gold); font-size: 30px; }
.brs-hub-door > span > b { display: block; color: #f0eae2; font-size: 19px; font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.brs-hub-door > span > small { display: block; color: var(--brs-dim); font-size: 14px; }
.brs-hub-door:hover { background: #262523; }
.brs-hub-door:hover > .ri { color: var(--brs-red); }

/* ---------- Category bands ---------- */

.brs-hub-band {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	gap: var(--hb-gap);
	align-items: stretch;
}

.brs-hub-band.is-flip { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.brs-hub-band.is-flip .brs-hub-band__copy { order: 2; }

.brs-hub-band__copy {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: var(--hb-pad);
	border: 1px solid var(--hb-line);
	background: var(--hb-box);
	isolation: isolate;
}

body.brs .brs-hub-band__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: .22;
	filter: saturate(.6);
}

.brs-hub-band__copy::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(27, 27, 26, .55), rgba(27, 27, 26, .96) 65%);
}

.brs-hub-band__ico {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-bottom: 16px;
	background: rgba(205, 64, 43, .16);
	color: var(--brs-red);
	font-size: 28px;
}

.brs-hub-band__copy > h2 {
	margin: 0 0 10px !important;
	color: #f2ece4 !important;
	font-size: clamp(24px, 2vw, 36px) !important;
	font-weight: 700 !important;
	line-height: 1.04 !important;
	text-transform: uppercase;
}

.brs-hub-band__copy > p { margin: 0 0 16px; color: var(--brs-mute); font-size: 16px; line-height: 1.55; }

.brs-hub-points { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.brs-hub-points li { display: flex; gap: 8px; align-items: center; color: #ddd6ce; font-size: 15px; font-weight: 700; text-transform: uppercase; }
.brs-hub-points .ri { flex: none; color: var(--brs-green-hi); font-size: 18px; }

.brs-hub-band__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.brs-hub-band__links .brs-btn { height: 46px; }
.brs-hub-band__links .brs-hub-go { background: var(--brs-green); color: #eef2e4 !important; }
.brs-hub-band__links .brs-hub-go .ri { color: #d5ddc3; }
.brs-hub-band__links .brs-hub-go:hover { background: var(--brs-green-hi); }

.brs-hub-band__items {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	align-content: start;
}

.brs-hub-band__items .brs-card__title { font-size: clamp(17px, 1.2vw, 22px); }

/* ---------- Section headings (tools, guides, questions) ---------- */

.brs-hub-sec {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	justify-content: space-between;
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid #2c2b29;
}

.brs-hub-sec > div > h2 {
	margin: 0 !important;
	color: #f2ece4 !important;
	font-size: clamp(24px, 2vw, 36px) !important;
	font-weight: 700 !important;
	line-height: 1.04 !important;
	text-transform: uppercase;
}

.brs-hub-sec > div > p { margin: 4px 0 0; color: var(--brs-dim); font-size: 15px; }
.brs-hub-sec .brs-btn { flex: none; height: 44px; }

/* ---------- Tools ---------- */

.brs-hub-tools__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hb-gap); }

.brs-hub-tool {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--hb-line);
	background: var(--hb-box);
	transition: border-color .2s ease;
}

.brs-hub-tool:hover { border-color: rgba(205, 64, 43, .55); }
.brs-hub-tool__shot { display: block; aspect-ratio: 16 / 8; overflow: hidden; background: #111; }
body.brs .brs-hub-tool__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.brs-hub-tool:hover .brs-hub-tool__shot img { transform: scale(1.03); }

.brs-hub-tool__body { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 18px; }
.brs-hub-tool__body > h3 { margin: 0 0 6px !important; font-size: clamp(19px, 1.4vw, 24px) !important; font-weight: 700 !important; line-height: 1.1 !important; text-transform: uppercase; }
.brs-hub-tool__body > h3 > a { color: #f2ece4 !important; text-decoration: none !important; }
.brs-hub-tool__body > h3 > a:hover { color: #fff !important; }
.brs-hub-tool__body > p { margin: 0 0 12px; color: var(--brs-mute); font-size: 15px; line-height: 1.5; }
.brs-hub-tool__body > small { margin-top: auto; color: var(--brs-gold-text); font-size: 14px; font-weight: 700; text-transform: uppercase; }

.brs-hub-tools__more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hb-gap); margin-top: var(--hb-gap); }
.brs-hub-tools__more > a { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--hb-line); background: var(--hb-box); color: var(--brs-text) !important; text-decoration: none !important; transition: border-color .2s ease; }
.brs-hub-tools__more > a:hover { border-color: rgba(205, 64, 43, .55); }
body.brs .brs-hub-tools__more img { flex: none; width: 40px; height: 40px; object-fit: contain; }
.brs-hub-tools__more > a > span { flex: 1; min-width: 0; }
.brs-hub-tools__more b { display: block; color: #f2ece4; font-size: 18px; font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.brs-hub-tools__more small { display: block; color: var(--brs-dim); font-size: 14px; }
.brs-hub-tools__more > a > .ri { flex: none; color: var(--brs-icon); font-size: 18px; }

/* ---------- Why buy here ---------- */

.brs-hub-why {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--hb-line);
	background: var(--hb-line);
}

.brs-hub-why li { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: var(--hb-box); }
.brs-hub-why .ri { flex: none; display: grid; place-items: center; width: 48px; height: 48px; background: #262624; color: var(--brs-gold); font-size: 26px; }
.brs-hub-why b { display: block; color: #ece6de; font-size: 18px; font-weight: 700; line-height: 1.15; text-transform: uppercase; }
.brs-hub-why small { display: block; margin-top: 3px; color: var(--brs-dim); font-size: 14px; line-height: 1.35; }

/* ---------- Guides ---------- */

.brs-hub-guides__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

/* ---------- Questions ---------- */

.brs-hub-faq__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px var(--hb-gap);
	align-items: start;
}

.brs-hub-q { border: 1px solid var(--hb-line); background: var(--hb-box); }

.brs-hub-q > summary {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	color: #ece6de;
	font-size: 17px;
	font-weight: 700;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
}

.brs-hub-q > summary::-webkit-details-marker { display: none; }
.brs-hub-q > summary .ri { flex: none; color: var(--brs-icon); font-size: 18px; transition: transform .2s ease; }
.brs-hub-q[open] > summary .ri { transform: rotate(90deg); color: var(--brs-red); }
.brs-hub-q > p { margin: 0; padding: 0 16px 16px; color: var(--brs-mute); font-size: 15px; line-height: 1.55; }

.brs-hub-discord { background: #4752c4 !important; color: #fff !important; }
.brs-hub-discord .ri { color: #fff !important; }
.brs-hub-discord:hover { background: #5661d6 !important; }

/* ---------- Narrower screens ---------- */

@media (max-width: 1280px) {
	.brs-hub-doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.brs-hub-band,
	.brs-hub-band.is-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
	.brs-hub-band.is-flip .brs-hub-band__copy { order: 0; }
	.brs-hub-band__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.brs-hub-band__items .brs-card:nth-child(n+5) { display: none; }
	.brs-hub-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
	.brs-hub-hero,
	.brs-hub-band,
	.brs-hub-band.is-flip { grid-template-columns: minmax(0, 1fr); }
	.brs-hub-band__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.brs-hub-band__items .brs-card:nth-child(n+5) { display: flex; }
	.brs-hub-hero__spot .brs-card { min-height: 0; aspect-ratio: 16 / 9; }
	.brs-hub-tools__grid { grid-template-columns: 1fr; }
	.brs-hub-tools__more { grid-template-columns: 1fr; }
	.brs-hub-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.brs-hub-tool__shot { aspect-ratio: auto; min-height: 170px; }
	.brs-hub-guides__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
	.brs-hub-search { height: 50px; }
	.brs-hub-search button.brs-btn { padding: 0 16px; }
	.brs-hub-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(var(--hb-pad) * -1); padding-right: var(--hb-pad); scrollbar-width: none; }
	.brs-hub-chips::-webkit-scrollbar { display: none; }
	.brs-hub-chips > a, .brs-hub-chips > span { flex: none; }
	.brs-hub-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.brs-hub-door { padding: 12px; }
	.brs-hub-door > span > b { font-size: 16px; }
	.brs-hub-band__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.brs-hub-tool { display: flex; }
	.brs-hub-tool__shot { aspect-ratio: 16 / 8; min-height: 0; }
	.brs-hub-why { grid-template-columns: 1fr; }
	.brs-hub-faq__grid { grid-template-columns: 1fr; }
	.brs-hub-sec { flex-wrap: wrap; align-items: flex-start; }
	.brs-hub-sec .brs-btn { width: 100%; }
	.brs-hub-guides__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.brs-hub *,
	.brs-hub *::before,
	.brs-hub *::after { transition: none !important; animation: none !important; }
}
