/*
 * Front page in two equal columns (inc/home-tools.php): the store on the
 * left, the free Rust tools on the right, over the full width of the page.
 * Same tokens and type as rust.css: square corners, condensed capitals, the
 * game's greys, its green for the store and its red for the tools.
 *
 * The columns are one grid of paired rows, so a pair always has the same
 * height. The product cards on the left have no height of their own (they
 * fill their row), and the last block of every box on the right stretches,
 * so neither side leaves an empty strip whichever is taller.
 *
 * Nothing waits for a script: the tool tabs are radio inputs and CSS.
 * 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-sp {
	--sp-gap: clamp(12px, 1.1vw, 18px);
	--sp-pad: clamp(14px, 1.2vw, 20px);
	--sp-store: var(--brs-green-hi);
	--sp-tools: var(--brs-red);
	--sp-box: #1b1b1a;
	--sp-line: rgba(255, 255, 255, .07);
	display: flex;
	flex-direction: column;
	gap: var(--sp-gap);
	width: 100%;
	margin: 6px 0 calc(var(--sp-gap) * 2);
	font-family: var(--brs-font);
}

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

/* ---------- Buttons ---------- */

.brs-sp .brs-btn--hot,
.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-btn--hot .ri { color: #fff !important; }
.brs-btn--hot:hover { filter: brightness(1.1); }

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

/* ---------- Opening: two equal halves ---------- */

.brs-sp-hero {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--sp-gap);
}

.brs-sp-hero__copy {
	padding: clamp(20px, 2vw, 32px) var(--sp-pad);
	border: 1px solid var(--sp-line);
	border-left: 3px solid var(--brs-red);
	background: linear-gradient(115deg, #22201d, #171716 70%);
}

.brs-sp-hero__copy > h1 {
	margin: 0 0 12px !important;
	color: #f2ece4 !important;
	font-size: clamp(26px, 2.2vw, 40px) !important;
	font-weight: 700 !important;
	line-height: 1.04 !important;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.brs-sp-hero__copy > p {
	max-width: 70ch;
	margin: 0 0 18px;
	color: var(--brs-mute);
	font-size: clamp(15px, .95vw, 17px);
	line-height: 1.55;
}

.brs-sp-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
.brs-sp-hero__cta .brs-btn { height: 48px; padding: 0 20px; }

.brs-sp-hero__promise {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 1px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--sp-line);
	background: var(--sp-line);
}

.brs-sp-hero__promise li {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px var(--sp-pad);
	background: var(--sp-box);
}

.brs-sp-hero__promise .ri {
	flex: none;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	background: #262624;
	color: var(--brs-gold);
	font-size: 24px;
}

.brs-sp-hero__promise b {
	display: block;
	color: #ece6de;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
}

.brs-sp-hero__promise small {
	display: block;
	margin-top: 3px;
	color: var(--brs-dim);
	font-size: 14px;
	line-height: 1.35;
}

/* ---------- The two columns ---------- */

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

.brs-sp-cell {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: var(--sp-pad);
	border: 1px solid var(--sp-line);
	border-top: 3px solid var(--sp-store);
	background: var(--sp-box);
}

.brs-sp-cell.is-tools { border-top-color: var(--sp-tools); }

/* Box heading */
.brs-sp-head {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 0 0 14px;
}

.brs-sp-head__ico {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	background: #262624;
}

.brs-sp-head__ico .ri { color: var(--brs-gold); font-size: 24px; }
body.brs .brs-sp-head__ico img { width: 36px; height: 36px; }

.brs-sp-head__txt { flex: 1; min-width: 0; }

.brs-sp-head__txt > h2 {
	margin: 0 !important;
	color: #ece6de !important;
	font-size: clamp(19px, 1.3vw, 23px) !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	text-transform: uppercase;
}

.brs-sp-head__txt > p {
	margin: 3px 0 0;
	color: var(--brs-dim);
	font-size: 14px;
	line-height: 1.35;
}

.brs-sp-head__more {
	flex: none;
	display: inline-flex;
	gap: 6px;
	align-items: center;
	height: 36px;
	padding: 0 12px;
	background: var(--brs-btn);
	color: #c9c3bc !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	text-transform: uppercase;
	white-space: nowrap;
}

.brs-sp-head__more .ri { color: var(--brs-icon); font-size: 18px; }
.brs-sp-head__more:hover { background: var(--brs-btn-hi); color: #fff !important; }

/* ---------- Product cards that fill their row ---------- */

.brs-sp-grid {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: repeat(var(--rows, 2), minmax(150px, 1fr));
	gap: 10px;
}

.brs-sp-grid .brs-card {
	aspect-ratio: auto;
	height: auto;
	min-height: 0;
}

.brs-sp-grid .brs-card__title { font-size: clamp(16px, 1.05vw, 20px); }
.brs-sp-grid .brs-card__sub { font-size: 13px; }
.brs-sp-grid .brs-card__body { padding: 12px 12px 10px; }

/* ---------- Row 1: the doors ---------- */

.brs-sp-cats {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-auto-rows: minmax(130px, 1fr);
	gap: 10px;
}

.brs-sp-cat {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
	padding: 12px;
	background: #262624;
	color: var(--brs-text) !important;
	text-decoration: none !important;
	isolation: isolate;
}

body.brs .brs-sp-cat__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: saturate(.85) brightness(.75);
	transition: transform .5s cubic-bezier(.2, .8, .2, 1), filter .3s ease;
}

.brs-sp-cat::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 20, 19, .1) 20%, rgba(20, 20, 19, .92) 88%);
}

.brs-sp-cat:hover .brs-sp-cat__img { transform: scale(1.05); filter: saturate(1) brightness(.9); }

.brs-sp-cat__n {
	position: absolute;
	top: 10px;
	right: 10px;
	min-width: 34px;
	padding: 4px 8px;
	background: rgba(26, 26, 26, .85);
	color: #e3ddd5;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
}

.brs-sp-cat__txt { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.brs-sp-cat__txt > .ri { color: var(--brs-gold); font-size: 22px; }

.brs-sp-cat__txt > b {
	color: #f0eae2;
	font-size: clamp(17px, 1.15vw, 21px);
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
}

.brs-sp-cat__txt > small {
	grid-column: 1 / -1;
	margin-top: 4px;
	color: #bdb5ac;
	font-size: 13px;
	line-height: 1.3;
}

.brs-sp-doors {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.brs-sp-tools {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.brs-sp-tool {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 14px;
	border: 1px solid var(--sp-line);
	background: linear-gradient(180deg, #262523, #1f1e1d);
	color: var(--brs-text) !important;
	text-decoration: none !important;
	transition: border-color .2s ease, background .2s ease;
}

.brs-sp-tool:hover { border-color: rgba(205, 64, 43, .6); background: linear-gradient(180deg, #2c2a27, #222120); }
body.brs .brs-sp-tool > img { width: 72px; height: 72px; margin-bottom: 8px; }

.brs-sp-tool > b {
	color: #f0eae2;
	font-size: clamp(17px, 1.15vw, 21px);
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
}

.brs-sp-tool > small { margin-top: 4px; color: var(--brs-mute); font-size: 14px; line-height: 1.35; }
.brs-sp-tool > em { margin-top: 8px; color: var(--brs-gold-text); font-size: 13px; font-style: normal; font-weight: 700; }

.brs-sp-tool > i {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	margin-top: auto;
	padding-top: 12px;
	color: #e6dfd6;
	font-size: 14px;
	font-style: normal;
	font-weight: 700;
	text-transform: uppercase;
}

.brs-sp-tool > i .ri { color: var(--brs-red); font-size: 18px; }

.brs-sp-links {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.brs-sp-link {
	display: flex;
	gap: 10px;
	align-items: center;
	min-width: 0;
	padding: 10px 12px;
	background: #232321;
	color: var(--brs-text) !important;
	text-decoration: none !important;
}

.brs-sp-link:hover { background: #2b2a28; }
body.brs .brs-sp-link > img { flex: none; width: 40px; height: 40px; }
.brs-sp-link > span { min-width: 0; }
.brs-sp-link > span > b { display: block; color: #ece6de; font-size: 15px; font-weight: 700; text-transform: uppercase; }
.brs-sp-link > span > small { display: block; overflow: hidden; color: var(--brs-dim); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Row 2: the tool showcase ---------- */

.brs-sp-tabs { flex: 1; display: flex; flex-direction: column; }
.brs-sp-tabs__in { position: absolute; opacity: 0; pointer-events: none; }

.brs-sp-tabs__nav {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	margin-bottom: 10px;
}

.brs-sp-tabs__tab {
	display: flex;
	gap: 8px;
	align-items: center;
	min-width: 0;
	padding: 8px 10px;
	border-bottom: 2px solid transparent;
	background: #232321;
	color: var(--brs-mute);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

body.brs .brs-sp-tabs__tab > img { flex: none; width: 32px; height: 32px; }
.brs-sp-tabs__tab:hover { background: #2a2a28; color: #ece6de; }

#brs-sp-t-raid:checked ~ .brs-sp-tabs__nav .is-raid,
#brs-sp-t-elec:checked ~ .brs-sp-tabs__nav .is-elec,
#brs-sp-t-base:checked ~ .brs-sp-tabs__nav .is-base {
	border-bottom-color: var(--brs-red);
	background: #302d2a;
	color: #fff;
}

#brs-sp-t-raid:focus-visible ~ .brs-sp-tabs__nav .is-raid,
#brs-sp-t-elec:focus-visible ~ .brs-sp-tabs__nav .is-elec,
#brs-sp-t-base:focus-visible ~ .brs-sp-tabs__nav .is-base { outline: 2px solid var(--brs-gold); outline-offset: 2px; }

.brs-sp-tabs__panels { flex: 1; display: flex; flex-direction: column; }
.brs-sp-panel { display: none; flex: 1; flex-direction: column; }

#brs-sp-t-raid:checked ~ .brs-sp-tabs__panels .is-raid,
#brs-sp-t-elec:checked ~ .brs-sp-tabs__panels .is-elec,
#brs-sp-t-base:checked ~ .brs-sp-tabs__panels .is-base { display: flex; }

.brs-sp-shot {
	position: relative;
	display: block;
	border: 1px solid rgba(255, 255, 255, .1);
	background: #111;
}

body.brs .brs-sp-shot > img { display: block; width: 100%; height: auto; }

.brs-sp-mark {
	position: absolute;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--brs-red);
	box-shadow: 0 0 0 4px rgba(205, 64, 43, .3), 0 4px 10px rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

.brs-sp-panel__intro {
	display: flex;
	gap: 14px;
	align-items: center;
	margin: 12px 0 10px;
}

.brs-sp-panel__intro > div { flex: 1; min-width: 0; }

.brs-sp-panel__intro h3 {
	margin: 0 0 4px !important;
	color: #f0eae2 !important;
	font-size: clamp(18px, 1.2vw, 22px) !important;
	font-weight: 700 !important;
	line-height: 1.15 !important;
	text-transform: uppercase;
}

.brs-sp-panel__intro p { margin: 0; color: var(--brs-mute); font-size: 15px; line-height: 1.45; }
.brs-sp-panel__intro .brs-btn { height: 46px; }

.brs-sp-steps {
	flex: 1;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 6px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.brs-sp-steps li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px;
	background: #222220;
}

.brs-sp-n {
	flex: none;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--brs-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
}

.brs-sp-steps b { display: block; color: #ece6de; font-size: 15px; font-weight: 700; line-height: 1.15; text-transform: uppercase; }
.brs-sp-steps p { margin: 3px 0 0; color: var(--brs-dim); font-size: 14px; line-height: 1.35; }

.brs-sp-more {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.brs-sp-more li { display: inline-flex; gap: 5px; align-items: center; color: var(--brs-mute); font-size: 14px; }
.brs-sp-more .ri { color: var(--sp-store); font-size: 16px; }

/* ---------- Row 3: raid cheat sheet ---------- */

.brs-sp-cheat { flex: 1; display: flex; }

.brs-sp-cheat table {
	width: 100%;
	height: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 15px;
}

body.brs .brs-sp-cheat table th,
body.brs .brs-sp-cheat table td {
	padding: 4px 10px !important;
	line-height: 1.2 !important;
	border: 0;
	border-bottom: 1px solid #2a2a28;
	color: var(--brs-text);
	vertical-align: middle;
}

.brs-sp-cheat thead th {
	background: #232321;
	color: var(--brs-mute);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
}

.brs-sp-cheat thead th:first-child { text-align: left; }
.brs-sp-cheat thead th > span { vertical-align: middle; }
body.brs .brs-sp-cheat thead img { width: 26px; height: 26px; margin-right: 6px; vertical-align: middle; }

.brs-sp-cheat tbody th { font-size: 14px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
.brs-sp-cheat tbody th > span { vertical-align: middle; }
body.brs .brs-sp-cheat tbody th img { width: 28px; height: 28px; margin-right: 8px; vertical-align: middle; }

body.brs .brs-sp-cheat table td {
	width: 16%;
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
}

/* rust.css paints every table cell (body.brs table td): these win over it. */
body.brs .brs-sp-cheat table th,
body.brs .brs-sp-cheat table td { background: #1d1d1c; box-shadow: inset 0 -1px #2a2a28; }
body.brs .brs-sp-cheat thead th { background: #232321; color: var(--brs-mute); }
body.brs .brs-sp-cheat tbody tr:nth-child(even) > * { background: #191918; }
body.brs .brs-sp-cheat tbody tr:hover > * { background: #2a201d; }

.brs-sp-data { margin-top: 10px; }

.brs-sp-data ul {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.brs-sp-data li { margin: 0; padding: 7px 10px; background: #222220; }
.brs-sp-data li > b { display: block; color: var(--brs-gold); font-size: 22px; font-weight: 700; line-height: 1; }
.brs-sp-data li > small { display: block; margin-top: 3px; color: var(--brs-dim); font-size: 12px; line-height: 1.2; text-transform: uppercase; }

.brs-sp-build {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 8px 0 0;
	color: var(--brs-dim);
	font-size: 13px;
}

.brs-sp-build > i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #6fbf4a; box-shadow: 0 0 0 3px rgba(111, 191, 74, .2); }

/* ---------- Row 4: questions and Discord ---------- */

.brs-sp-faq { display: flex; flex-direction: column; gap: 6px; }

.brs-sp-q { background: #222220; }

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

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

.brs-sp-discord {
	flex: 1;
	display: flex;
	gap: 14px;
	align-items: center;
	min-height: 76px;
	margin-top: 10px;
	padding: 12px 16px;
	background: linear-gradient(110deg, #4752c4, #353d93);
	color: #fff !important;
	text-decoration: none !important;
}

.brs-sp-discord > .ri { flex: none; color: #fff; font-size: 38px; }
.brs-sp-discord > span { flex: 1; min-width: 0; }
.brs-sp-discord > span > b { display: block; font-size: 19px; font-weight: 700; text-transform: uppercase; }
.brs-sp-discord > span > small { display: block; color: #dfe2ff; font-size: 14px; }

.brs-sp-discord > i {
	flex: none;
	display: inline-flex;
	gap: 4px;
	align-items: center;
	height: 38px;
	padding: 0 14px;
	background: rgba(255, 255, 255, .16);
	font-size: 14px;
	font-style: normal;
	font-weight: 700;
	text-transform: uppercase;
}

.brs-sp-discord:hover { filter: brightness(1.08); }

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

@media (max-width: 1280px) {
	.brs-sp-tools { grid-template-columns: 1fr; }
	.brs-sp-tool { display: grid; grid-template-columns: 56px 1fr auto; column-gap: 12px; align-items: center; }
	body.brs .brs-sp-tool > img { grid-row: 1 / 4; width: 56px; height: 56px; margin: 0; }
	.brs-sp-tool > i { grid-row: 1 / 4; grid-column: 3; margin: 0; padding: 0; }
	.brs-sp-tool > small,
	.brs-sp-tool > em { margin-top: 2px; }
	.brs-sp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
	.brs-sp-hero,
	.brs-sp-cols { grid-template-columns: 1fr; }
	.brs-sp-grid { grid-template-rows: none; grid-auto-rows: auto; }
	.brs-sp-grid .brs-card { aspect-ratio: 443 / 335; }
	.brs-sp-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
	.brs-sp-hero__promise li { gap: 10px; padding: 10px 12px; }
	.brs-sp-hero__promise .ri { width: 36px; height: 36px; font-size: 20px; }
	.brs-sp-hero__promise b { font-size: 14px; }
	.brs-sp-hero__promise small { display: none; }
	.brs-sp-cheat tbody th { white-space: normal; font-size: 13px; }
	.brs-sp-cheat thead th > span { display: none; }
	body.brs .brs-sp-cheat thead img { margin: 0 auto; display: block; }
	.brs-sp-cheat table { table-layout: fixed; }
	body.brs .brs-sp-cheat table td { width: 14%; }
	.brs-sp-head__txt { flex: 1 1 calc(100% - 60px); }
	.brs-sp-cat__txt > small { display: none; }
	.brs-sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.brs-sp-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; }
	.brs-sp-links { grid-template-columns: 1fr; }
	.brs-sp-tabs__nav { grid-template-columns: 1fr; }
	.brs-sp-steps { grid-template-columns: 1fr; }
	.brs-sp-data ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.brs-sp-head { flex-wrap: wrap; }
	.brs-sp-head__more { margin-left: 56px; }
	body.brs .brs-sp-cheat table td { font-size: 17px; }
	body.brs .brs-sp-cheat table th,
	body.brs .brs-sp-cheat table td { padding: 5px 6px !important; }
	body.brs .brs-sp-cheat tbody th img { display: none; }
	.brs-sp-panel__intro { flex-direction: column; align-items: stretch; }
}

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