/*
Theme Name: PS2 BIOS Studio
Theme URI: https://wordpress.org/
Author: Rasheed Alam
Description: A classic theme for a PS2 BIOS information site. Presentation only. Content and downloads live in the PS2 BIOS Core plugin.
Version: 1.3.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ps2-bios-studio
*/

:root {
	--bg: #f6f8fb;
	--text: #14243b;
	--muted: #526174;
	--accent: #087f8c;
	--accent-ink: #087c8c;
	--card: #ffffff;
	--line: #dce4ec;
	--focus: #14243b;
	--wrap: 1240px;
	--radius: 16px;
	--shadow: 0 8px 24px rgba(20, 36, 59, 0.06);
	--section: 56px;
	--section-sm: 36px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 88px;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.6;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent-ink);
}

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: 0.75rem;
	top: 0.75rem;
	transform: translateY(-150%);
	background: var(--text);
	color: #fff;
	padding: 0.5rem 0.75rem;
	z-index: 30;
	text-decoration: none;
}

.skip-link:focus {
	transform: none;
}

.wrap {
	width: min(var(--wrap), calc(100% - 64px));
	margin-inline: auto;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--card);
	border-bottom: 1px solid var(--line);
}

.header-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 76px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-right: auto;
	min-width: 0;
	color: var(--text);
	text-decoration: none;
	font-weight: 700;
}

.brand-mark {
	width: 32px;
	height: 32px;
	flex: none;
	display: block;
	color: var(--accent);
}

.brand img {
	width: 32px;
	height: 32px;
	object-fit: contain;
	flex: none;
}

.brand-name {
	display: block;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.brand-desc {
	display: none;
}

.menu-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	background: var(--card);
	color: var(--text);
	border: 1px solid var(--line);
	border-radius: 10px;
	min-height: 44px;
	padding: 0 12px;
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}

.menu-bars,
.menu-bars::before,
.menu-bars::after {
	display: block;
	width: 16px;
	height: 2px;
	background: currentColor;
	position: relative;
}

.menu-bars::before,
.menu-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-bars::before {
	top: -5px;
}

.menu-bars::after {
	top: 5px;
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 8px 20px;
	margin-left: auto;
}

.site-nav ul {
	display: flex;
	align-items: center;
	gap: 4px 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav a {
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
}

.site-nav li a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.site-nav li a:hover {
	color: var(--accent-ink);
}

.site-nav a.region-jump,
.site-nav a.region-jump:hover {
	color: #fff;
}

.button,
.button-secondary,
.button-disabled {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 16px;
	border-radius: 10px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.2;
}

.button,
.region-jump {
	background: var(--accent);
	color: #fff;
	border: 1px solid var(--accent);
}

.button:hover,
.region-jump:hover {
	filter: brightness(0.94);
}

.button-secondary {
	background: var(--card);
	color: var(--accent);
	border: 1px solid var(--accent);
}

.button-secondary:hover {
	background: var(--bg);
}

.button-disabled {
	background: transparent;
	color: var(--muted);
	border: 1px dashed var(--line);
	cursor: default;
	font-weight: 650;
}

.home .hero {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 24px;
	align-items: center;
	padding: 32px 0 0;
}

.home .eyebrow {
	margin: 0 0 8px;
	color: var(--accent-ink);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
}

.home .hero h1,
.home .hero h2 {
	margin: 0 0 12px;
	font-size: clamp(1.875rem, 1.15rem + 1.7vw, 2.75rem);
	line-height: 1.15;
	letter-spacing: -0.03em;
}

.home .lede,
.home .section-intro {
	margin: 0;
	max-width: 65ch;
	color: var(--muted);
	font-size: 1.0625rem;
	line-height: 1.6;
}

.home .actions {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 12px;
	margin-top: 20px;
}

.home .actions .button,
.home .actions .button-secondary {
	flex: 1 1 0;
	min-width: 11rem;
	min-height: 48px;
}

.home .region-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 20px;
	min-width: 0;
}

.home .region-card-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	color: var(--accent);
}

.home .region-card-head h2 {
	margin: 0;
	color: var(--text);
	font-size: 1.125rem;
	line-height: 1.3;
}

.home .region-tiles {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.home .region-tiles a {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	min-width: 0;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--bg);
	color: var(--text);
	text-decoration: none;
	font-weight: 700;
}

.home .region-tiles a:hover {
	border-color: var(--accent);
}

.home .tile-icon,
.home .tile-arrow {
	flex: none;
	color: var(--accent);
}

.home .tile-arrow {
	margin-left: auto;
}

.home .tile-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.home .tile-name {
	overflow-wrap: normal;
}

.home .tile-text small {
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 600;
}

.home .on-this-page {
	padding: 16px 0 0;
}

.home .on-this-page-panel {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--card);
	padding: 8px 12px;
}

.home .on-this-page-label {
	margin: 0;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
}

.home .on-this-page-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.home .on-this-page-links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--text);
	font-size: 0.9375rem;
	font-weight: 650;
	text-decoration: none;
}

.home .on-this-page-links a:hover {
	border-color: var(--accent);
	color: var(--accent-ink);
}

.home .on-this-page-jump {
	display: none;
}

.home .section,
.home .download-card {
	scroll-margin-top: 88px;
}

.home .section {
	padding: var(--section) 0;
}

.home .section h2 {
	margin: 0 0 8px;
	font-size: clamp(1.5rem, 2vw, 2rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.home .section-intro {
	margin-bottom: 8px;
}

.home .prose h3,
.home .guide-card h3,
.home .trouble h3 {
	margin: 0 0 8px;
	font-size: 1.125rem;
	line-height: 1.3;
}

.home .rich p,
.home .prose p,
.home .download-card p {
	overflow-wrap: break-word;
}

.home .rich p {
	max-width: 72ch;
}

.home .rich a,
.site-footer .rich a,
.fallback a {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.home .filters {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 12px 16px;
	margin: 16px 0 20px;
}

.home .search-field {
	flex: 1 1 16rem;
	min-width: min(100%, 16rem);
}

.home .search-field label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
}

.home .search-field input {
	width: 100%;
	max-width: none;
	min-height: 44px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--card);
	color: var(--text);
	font: inherit;
	padding: 8px 12px;
}

.home .region-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.home .region-filter button {
	min-height: 44px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--card);
	color: var(--text);
	font: inherit;
	font-weight: 650;
	padding: 8px 16px;
	cursor: pointer;
}

.home .region-filter button[aria-pressed="true"] {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.home .download-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}

.home .download-card {
	display: flex;
	flex-direction: column;
	gap: 0;
	height: 100%;
	min-width: 0;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px;
}

.home .download-card h3,
.home .unavailable,
.home .card-region,
.home .unavailable-note,
.home .card-kicker {
	margin: 0;
}

.home .card-kicker {
	margin-bottom: 4px;
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.home .download-card h3 {
	margin-bottom: 6px;
}

.home .card-region,
.home .unavailable-note,
.home .file-meta {
	color: var(--muted);
}

.home .file-meta {
	display: grid;
	gap: 8px;
	margin: 0;
}

.home .file-meta div {
	display: grid;
	gap: 2px;
}

.home .file-meta dt {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.home .file-meta dd {
	margin: 0;
	overflow-wrap: anywhere;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.92rem;
}

.home .card-action {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
	padding-top: 16px;
}

.home .card-action .button,
.home .unavailable .button-disabled {
	width: 100%;
}

.home .guide-steps {
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
	display: grid;
	gap: 12px;
	counter-reset: guide;
}

.home .guide-card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px 16px 8px;
	counter-increment: guide;
}

.home .guide-card h3 {
	display: flex;
	align-items: center;
	gap: 8px;
}

.home .guide-card h3::before {
	content: counter(guide);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: var(--bg);
	color: var(--accent-ink);
	font-size: 0.875rem;
}

.home .trouble-list {
	display: grid;
	gap: 12px;
	margin-top: 16px;
}

.home .trouble {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 16px 16px 8px;
}

.home .faq-list {
	display: grid;
	gap: 8px;
	margin-top: 16px;
}

.home .faq {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--card);
	padding: 0 16px;
}

.home .faq h3 {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
}

.home .faq-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 10px 0;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}

.home .faq-icon {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--accent);
}

.home .faq-toggle[aria-expanded="true"] .faq-icon {
	transform: rotate(45deg);
}

.home .faq:has(.faq-toggle[aria-expanded="true"]) {
	border-color: var(--accent);
}

.home .faq-panel {
	padding-bottom: 12px;
}

.home .filter-empty,
.home .empty-static {
	border: 1px dashed var(--line);
	border-radius: 12px;
	padding: 16px;
}

.site-footer {
	border-top: 1px solid var(--line);
	padding: 32px 0;
	color: var(--muted);
}

.site-footer p {
	margin: 0;
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(10rem, 0.8fr) minmax(10rem, 0.8fr);
	gap: 24px 32px;
	align-items: start;
}

.footer-name {
	margin: 0 0 4px;
	color: var(--text);
	font-weight: 700;
}

.site-footer .footer-note {
	margin-top: 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.site-footer .footer-note p {
	max-width: 62ch;
}

.footer-label {
	margin: 0 0 8px;
	color: var(--muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
}

.site-footer .footer-nav a {
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
	line-height: 1.4;
}

.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-nav li + li {
	margin-top: 10px;
}

.footer-nav a {
	display: inline-flex;
	align-items: center;
}

.copyright {
	margin: 0;
	color: var(--text);
	font-weight: 650;
}

.fallback {
	padding: 48px 0;
}

.fallback .admin-note {
	border-left: 3px solid var(--accent);
	padding-left: 12px;
}

main.wrap > article > h1 {
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

main.wrap {
	padding: 32px 0 48px;
}

[hidden] {
	display: none !important;
}

@media (max-width: 980px) {
	.header-bar {
		flex-wrap: wrap;
		min-height: 64px;
		padding: 8px 0;
	}

	.menu-toggle {
		display: inline-flex;
	}

	.site-nav {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		margin: 0 0 8px;
	}

	.site-nav.is-open,
	.no-js .site-nav {
		display: flex;
	}

	.site-nav ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.region-jump {
		justify-content: center;
	}
}

@media (max-width: 1100px) {
	.home .download-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.wrap {
		width: min(var(--wrap), calc(100% - 32px));
	}

	.home .hero {
		grid-template-columns: 1fr;
		gap: 24px;
		padding-top: 16px;
	}

	.home .filters {
		flex-direction: column;
		align-items: stretch;
	}

	.home .search-field {
		flex-basis: auto;
		width: 100%;
	}

	.home .on-this-page-panel {
		display: none;
	}

	.home .on-this-page-jump {
		display: block;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		background: var(--card);
		padding: 4px 16px 8px;
	}

	.home .on-this-page-jump summary {
		display: flex;
		align-items: center;
		min-height: 48px;
		font-weight: 700;
		cursor: pointer;
	}

	.home .on-this-page-jump .on-this-page-links {
		flex-direction: column;
		align-items: flex-start;
		padding-bottom: 8px;
	}

	.home .section {
		padding: var(--section-sm) 0;
	}

	.footer-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

@media (max-width: 640px) {
	.home .download-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 420px) {
	.home .region-card {
		padding: 16px;
	}

	.home .region-tiles a {
		gap: 4px;
		padding: 8px 6px;
	}

	.home .region-tiles .tile-icon {
		width: 16px;
		height: 16px;
	}

	.home .region-tiles .tile-arrow {
		width: 12px;
		height: 12px;
	}

	.home .tile-name {
		font-size: 0.875rem;
	}
}

@media (max-width: 340px) {
	.menu-toggle {
		position: relative;
		width: 44px;
		padding: 0;
		justify-content: center;
	}

	.menu-label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
}

@media (max-width: 400px) {
	.home .actions {
		flex-direction: column;
		align-items: stretch;
	}

	.home .actions .button,
	.home .actions .button-secondary {
		flex: none;
		width: 100%;
		min-width: 0;
		min-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
