/*
Theme Name: STEAM.ONL
Theme URI: https://example.com/steam-onl
Author: Theme Developer
Author URI: https://example.com
Description: A pixel-perfect WordPress clone of the STEAM.ONL interface — dark glassmorphism UI, violet/cyan accent system, and a 5-column game card grid. Cards are driven by the native WordPress post data (featured image + permalink).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: steam-onl
Tags: dark, custom-colors, custom-menu, featured-images, translation-ready, responsive-layout
*/

/* ==========================================================================
   1. DESIGN TOKENS  —  extracted 1:1 from the reference site
   ========================================================================== */

:root {
	--bg-dark: #050505;
	--bg-card: #0e0e0e;
	--accent-primary: #8b5cf6;   /* Violet */
	--accent-secondary: #06b6d4; /* Cyan   */
	--text-main: #ffffff;
	--text-muted: #94a3b8;
	--border: rgba(255, 255, 255, 0.08);
	--card-radius: 14px;

	/* Extended tokens derived from the original values (not invented — factored out of the source CSS) */
	--nav-height: 70px;
	--container-max: 1250px;
	--content-max: 1250px;
	--ease-out-expo: cubic-bezier(0.25, 0.8, 0.25, 1);
	--ease-standard: cubic-bezier(0.25, 0.46, 0.45, 0.94);
	--ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

body {
	font-family: 'Plus Jakarta Sans', sans-serif;
	background-color: var(--bg-dark);
	color: var(--text-main);
	background-image:
		radial-gradient(circle at 20% 0%, rgba(139, 92, 246, 0.15), transparent 40%),
		radial-gradient(circle at 80% 10%, rgba(6, 182, 212, 0.1), transparent 40%),
		linear-gradient(to bottom, #020202 0%, #050505 100%);
	min-height: 100vh;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

a {
	color: inherit;
}

button,
input {
	font-family: inherit;
}

/* Accessible focus ring — keyboard users only. */
a:focus-visible,
input:focus-visible,
button:focus-visible {
	outline: 2px solid var(--accent-primary);
	outline-offset: 3px;
	border-radius: 4px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #fff;
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ==========================================================================
   3. NAVIGATION / SITE HEADER
   ========================================================================== */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--nav-height);
	background: rgba(5, 5, 5, 0.8);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border);
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nav-container {
	width: 90%;
	max-width: var(--container-max);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* --- Brand --- */

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	flex-shrink: 0;
}

.logo-box {
	width: 38px;
	height: 38px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: 0.3s ease;
	flex-shrink: 0;
}

.brand:hover .logo-box {
	background: rgba(255, 255, 255, 0.07);
	border-color: var(--accent-primary);
}

.logo-img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.brand-text {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #fff;
	text-transform: uppercase;
	white-space: nowrap;
}

.brand-text .brand-accent {
	background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: var(--accent-primary); /* graceful fallback for no background-clip support */
}

/* --- System status --- */

.system-status {
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 1px;
	text-align: right;
	color: var(--accent-secondary);
	white-space: nowrap;
}

/* --- Optional nav menu (appears only when assigned) --- */

.nav-menu {
	display: flex;
	align-items: center;
	gap: 26px;
	margin-left: auto;
	margin-right: 26px;
	list-style: none;
}

.nav-menu li {
	margin: 0;
}

.nav-menu a {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
	color: #fff;
}

/* Hide the menu below tablet width, matching the reference's clean 2-item bar. */
@media (max-width: 767px) {
	.nav-menu {
		display: none;
	}
}

/* Compact nav on very small screens. */
@media (max-width: 400px) {
	.nav-container {
		width: 94%;
	}

	.brand-text {
		font-size: 0.85rem;
	}

	.logo-box {
		width: 34px;
		height: 34px;
	}
}

/* ==========================================================================
   4. HERO
   ========================================================================== */

.hero {
	padding: 140px 20px 50px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.hero__inner {
	align-items: center;
	display: flex;
	flex-direction: column;
	width: 100%;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: #ccc;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 1px;
	border-radius: 100px;
	margin-bottom: 20px;
	text-transform: uppercase;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.badge-dot {
	width: 6px;
	height: 6px;
	background: var(--accent-secondary);
	border-radius: 50%;
	box-shadow: 0 0 10px var(--accent-secondary);
	flex-shrink: 0;
}

.hero__title {
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.03em;
	margin-bottom: 20px;
	color: #fff;
}

.hero__subtitle {
	font-size: 0.9rem;
	color: var(--text-muted);
	font-weight: 500;
	max-width: 500px;
	margin-bottom: 40px;
	line-height: 1.6;
}

.hero-search-container {
	width: 100%;
	max-width: 500px;
	position: relative;
}

.hero-search-input {
	width: 100%;
	padding: 18px 25px 18px 50px;
	font-size: 0.9rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: 100px;
	color: #fff;
	font-weight: 600;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	outline: none;
	transition: all 0.3s var(--ease-out-expo);
	box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
	/* Kill the iOS zoom-on-focus without shrinking the field. */
	font-size: 16px;
}

.hero-search-input::placeholder {
	color: #64748b;
	opacity: 1;
}

.hero-search-input:focus {
	background: rgba(20, 20, 20, 0.9);
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.hero-search-icon {
	position: absolute;
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #64748b;
	pointer-events: none;
	transition: 0.3s;
}

.hero-search-input:focus ~ .hero-search-icon {
	color: var(--accent-primary);
}

/* Live-region for the search result count. */
.search-feedback {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-top: 16px;
	min-height: 1em;
}

.search-feedback:empty {
	display: none;
}

@media (max-width: 767px) {
	.hero {
		padding: 110px 16px 40px;
	}
}

@media (max-width: 400px) {
	.hero-search-input {
		padding: 15px 18px 15px 44px;
	}

	.hero-search-icon {
		left: 16px;
	}
}

/* ==========================================================================
   5. ANIMATION
   ========================================================================== */

@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.fade-in {
	animation: fadeUp 0.7s var(--ease-soft) forwards;
}

/* Respect users who ask the OS to reduce motion. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   6. MAIN / GRID
   ========================================================================== */

.site-main {
	width: 95%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding-bottom: 100px;
}

.bar {
	margin-bottom: 30px;
	margin-top: 10px;
	border-bottom: 1px solid var(--border);
}

/* 2 columns on mobile -> 3 on tablet -> 5 on desktop. */
.game-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
	.game-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1200px) {
	.game-grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* Tighten the gutter slightly on the smallest screens so 2 columns
   never fall below a comfortable tap target. */
@media (max-width: 400px) {
	.game-grid {
		gap: 14px;
	}
}

/* ==========================================================================
   7. CARD
   ========================================================================== */

.card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--card-radius);
	overflow: hidden;
	transition: all 0.4s var(--ease-standard);
	display: flex;
	flex-direction: column;
	position: relative;
	height: 100%;
}

.card:hover {
	transform: translateY(-6px);
	border-color: var(--accent-primary);
	box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8);
}

.card:focus-within {
	border-color: var(--accent-primary);
}

/* --- Image: fixed 2:3 portrait so every card is the same height --- */

.card-img-wrap {
	position: relative;
	display: block;
	aspect-ratio: 2 / 3;
	width: 100%;
	overflow: hidden;
	background: #111;
	line-height: 0;
}

.card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.card:hover .card-img {
	transform: scale(1.08);
}

/* --- Body --- */

.card-body {
	padding: 15px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.card-title {
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	margin-bottom: 12px;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- Button --- */

.btn-card {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 10px 0;
	text-align: center;
	background: transparent;
	color: #fff;
	text-decoration: none;
	font-size: 0.75rem;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border-radius: 8px;
	border: 1px solid var(--accent-primary);
	position: relative;
	overflow: hidden;
	transition: all 0.3s ease;
	box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
	z-index: 0;
}

.btn-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: -1;
}

.btn-card:hover {
	border-color: transparent;
	box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
	transform: translateY(-2px);
}

.btn-card:hover::before {
	opacity: 1;
}

/* Grid gap is 14px below 400px — keep the button from feeling cramped. */
@media (max-width: 400px) {
	.card-body {
		padding: 12px;
	}

	.card-title {
		font-size: 0.78rem;
		margin-bottom: 10px;
	}

	.btn-card {
		font-size: 0.65rem;
		letter-spacing: 0.06em;
		padding: 9px 0;
	}
}

/* --- Empty state --- */

.notice {
	max-width: 640px;
	margin: 0 auto;
	padding: 22px 24px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--card-radius);
	color: var(--text-muted);
	font-size: 0.85rem;
	line-height: 1.6;
	text-align: center;
}

/* ==========================================================================
   8. PAGINATION
   ========================================================================== */

.pagination {
	margin-top: 40px;
	display: flex;
	justify-content: center;
}

.pagination .nav-links {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--text-muted);
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
	border-color: var(--accent-primary);
	color: #fff;
}

.pagination .page-numbers.current {
	background: rgba(139, 92, 246, 0.15);
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */

.site-footer {
	border-top: 1px solid var(--border);
	padding: 40px 20px;
	text-align: center;
	color: var(--text-muted);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
}

.site-footer p {
	margin: 0;
}

/* Strip the default WP "proudly powered by" line unless explicitly kept. */
.site-info {
	margin-top: 10px;
	font-size: 0.65rem;
	letter-spacing: 0.05em;
}

.site-info a {
	color: var(--text-muted);
	text-decoration: none;
}

.site-info a:hover {
	color: #fff;
}

/* ==========================================================================
   10. ARCHIVE / SEARCH HEADER
   ========================================================================== */

.archive-hero {
	text-align: center;
	padding: 130px 20px 26px;
}

.archive-hero__title {
	font-size: clamp(1.6rem, 4vw, 2.4rem);
	font-weight: 900;
	letter-spacing: -0.03em;
	color: #fff;
	word-break: break-word;
}

/* ==========================================================================
   11. SINGLE POST
   ========================================================================== */

.single .site-main,
.page .site-main {
	width: 100%;
	max-width: 820px;
	padding-bottom: 60px;
}

.single-hero {
	text-align: center;
	padding: 130px 20px 26px;
}

.single-hero__title {
	font-size: clamp(1.8rem, 4.5vw, 3rem);
	font-weight: 900;
	line-height: 1.1;
	letter-spacing: -0.03em;
	margin-bottom: 14px;
	color: #fff;
	word-break: break-word;
}

.single-hero__meta {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
}

/* --- Featured image ---
   Mirrors the homepage card: the same 2:3 portrait box and the same visual
   scale, so the cover never dominates the article. */

.single-thumbnail {
	/* Same proportions as .card-img-wrap in the grid. */
	aspect-ratio: 2 / 3;
	/* Same rendered width as one grid column, capped so it never feels
	   oversized next to the text column. */
	width: 100%;
	max-width: 340px;
	margin: 0 auto 32px;
	border-radius: var(--card-radius);
	overflow: hidden;
	border: 1px solid var(--border);
	background: #111;
	line-height: 0;
}

.single-thumbnail img {
	width: 100%;
	height: 100%;
	/* Fill the portrait box exactly like a card cover does. */
	object-fit: cover;
	object-position: center;
}

/* Small screens: use more of the available width, keep the 2:3 ratio. */
@media (max-width: 768px) {
	.single-thumbnail {
		max-width: 300px;
	}
}

@media (max-width: 480px) {
	.single-thumbnail {
		max-width: 240px;
		margin-bottom: 26px;
	}

	.single-hero {
		padding: 110px 16px 22px;
	}
}

/* --- Body copy --- */

.entry-content {
	color: var(--text-muted);
	font-size: 0.95rem;
	line-height: 1.8;
	overflow-wrap: break-word;
}

.entry-content > * + * {
	margin-top: 18px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	color: #fff;
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 32px 0 14px;
	line-height: 1.25;
}

.entry-content h2 {
	font-size: 1.5rem;
}

.entry-content h3 {
	font-size: 1.2rem;
}

.entry-content a {
	color: var(--accent-primary);
}

.entry-content img {
	border-radius: 10px;
	max-height: 520px;
	object-fit: contain;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 18px 22px;
}

.entry-content li + li {
	margin-top: 8px;
}

.entry-content blockquote {
	border-left: 3px solid var(--accent-primary);
	padding: 4px 0 4px 18px;
	margin: 22px 0;
	color: var(--text-muted);
	font-style: italic;
}

.entry-content code {
	background: rgba(255, 255, 255, 0.06);
	padding: 2px 6px;
	border-radius: 5px;
	font-size: 0.88em;
	color: var(--accent-secondary);
}

.entry-content pre {
	background: #0a0a0a;
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 16px;
	overflow-x: auto;
}

.entry-content pre code {
	background: none;
	padding: 0;
	color: var(--text-muted);
}

.page-links {
	margin-top: 28px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
}

/* --- CTA + back link --- */

.post-cta {
	margin: 36px 0 0;
}

.post-cta .btn-card {
	padding: 16px 0;
	font-size: 0.9rem;
}

.post-nav {
	margin-top: 40px;
	padding-top: 28px;
	border-top: 1px solid var(--border);
	text-align: center;
}

.post-nav a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.3s ease;
}

.post-nav a:hover {
	color: var(--accent-primary);
}

/* No hero on singles, so the fixed header needs less clearance. */
.single .site-main,
.page .site-main {
	margin-top: 0;
}

	max-width: 640px;
	margin: 0 auto;
	padding: 22px 24px;
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--card-radius);
	color: var(--text-muted);
	font-size: 0.85rem;
	line-height: 1.6;
	text-align: center;
}
