/*
Theme Name: GameWire
Description: Lightweight, dense video game news theme — featured hero grid, platform badges, popular & upcoming-release sidebar, dark mode.
Version: 1.0.7
Requires PHP: 8.0
Text Domain: gamewire
*/

:root {
	--bg: #f4f5f7;
	--surface: #ffffff;
	--text: #16181d;
	--muted: #5d6470;
	--line: #e3e6eb;
	--accent: #e4002b;
	--accent-ink: #ffffff;
	--accent-text: #d10027; /* red for small text: passes WCAG AA 4.5:1 (brand --accent stays for fills) */
	--header: #111318;
	--header-ink: #f2f3f5;
	--sub: #1c1f26;
	--radius: 6px;
	--wrap: 1240px;
	--ps: #0050d9; --xbox: #107c10; --nintendo: #e60012; --pc: #4b5563; --mobile: #7c3aed; --other: #0f766e;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0e1014; --surface: #171a20; --text: #e8eaee; --muted: #9aa1ad; --line: #272b33;
		--header: #08090c; --sub: #12151a; --accent-text: #ff4060; color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #0e1014; --surface: #171a20; --text: #e8eaee; --muted: #9aa1ad; --line: #272b33;
	--header: #08090c; --sub: #12151a; --accent-text: #ff4060; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px 12px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }

/* Header */
.site-header { background: var(--header); color: var(--header-ink); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.header-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { flex: none; }
.site-title { font-weight: 800; font-size: 24px; letter-spacing: -.02em; color: #fff; }
.site-title::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 3px; background: var(--accent); border-radius: 2px; }
.custom-logo { max-height: 40px; width: auto; }
.primary-nav { flex: 1; min-width: 0; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 8px 12px; font-weight: 600; font-size: 14px; border-radius: var(--radius); white-space: nowrap; color: var(--header-ink); }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { background: rgba(255,255,255,.08); color: #fff; }
.primary-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 200px; background: var(--header); padding: 6px; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.35); flex-direction: column; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: flex; }
.header-tools { display: flex; gap: 4px; margin-left: auto; }
.icon-btn { background: none; border: 0; color: var(--header-ink); padding: 8px; border-radius: var(--radius); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.nav-toggle { display: none; }
.header-search { background: var(--sub); padding: 12px 0; }
.sub-nav { background: var(--sub); border-top: 1px solid rgba(255,255,255,.05); }
.sub-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; }
.sub-nav a { display: block; padding: 9px 0; font-size: 13px; font-weight: 500; color: #b8bdc7; white-space: nowrap; }
.sub-nav a:hover { color: #fff; }

/* Search form */
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field { width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.search-submit, .comment-form .submit { padding: 10px 16px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }

/* Hero */
.hero { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; margin-top: 20px; }
.hero-item { position: relative; border-radius: var(--radius); overflow: hidden; background: #222; min-height: 200px; }
.hero-lead { grid-row: span 2; min-height: 420px; }
.hero-item a { display: block; height: 100%; color: #fff; }
.hero-item img, .hero-item .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.hero-item:hover img { transform: scale(1.03); }
.hero-text { position: absolute; inset: auto 0 0 0; padding: 16px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6) 30%, rgba(0,0,0,.9)); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.hero-text h2 { margin: 6px 0 0; font-size: 17px; line-height: 1.3; font-weight: 700; }
.hero-lead .hero-text { padding: 24px; }
.hero-lead .hero-text h2 { font-size: 30px; letter-spacing: -.01em; }
.hero-lead .hero-text p { margin: 8px 0 0; color: #d4d7dd; font-size: 15px; max-width: 60ch; }
.ph { display: block; background: linear-gradient(135deg, #2a2f3a, #1a1d24); aspect-ratio: 16/9; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; margin-top: 28px; margin-bottom: 48px; }
.section-head { border-bottom: 3px solid var(--text); margin-bottom: 4px; }
.section-head h1 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; font-weight: 800; }
.section-head h1 span { color: var(--accent-text); }
.archive-desc { color: var(--muted); font-size: 14px; margin-bottom: 8px; }

/* Story list */
.story { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.story-media img, .story-media .ph { border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.story-title { margin: 4px 0 6px; font-size: 20px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.story-excerpt { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.meta { color: var(--muted); font-size: 13px; }
.meta a { color: inherit; }
.meta-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kicker { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; background: var(--other); color: #fff !important; line-height: 1.6; }
.badge[class*="badge-ps"], .badge[class*="playstation"] { background: var(--ps); }
.badge[class*="xbox"] { background: var(--xbox); }
.badge[class*="switch"], .badge[class*="nintendo"] { background: var(--nintendo); }
.badge[class*="pc"], .badge[class*="steam"] { background: var(--pc); }
.badge[class*="ios"], .badge[class*="android"], .badge[class*="mobile"] { background: var(--mobile); }
.badge[class*="badge-vr"] { background: #c2410c; }

.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.page-numbers { padding: 8px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Sidebar */
.sidebar .widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.widget-title { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; border-left: 3px solid var(--accent); padding-left: 8px; }
.widget ul, .widget ol { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; line-height: 1.4; }
.widget li:first-child { border-top: 0; padding-top: 0; }
.popular { counter-reset: pop; }
.popular li { counter-increment: pop; display: grid; grid-template-columns: 28px 1fr; }
.popular li::before { content: counter(pop); font-weight: 800; font-size: 18px; color: var(--accent-text); line-height: 1.1; }
.releases li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.rdate { text-align: center; font-size: 11px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 0; line-height: 1.2; }
.rdate b { display: block; font-size: 17px; color: var(--text); }
.releases-more { display: block; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--accent-text); }
.releases-more:hover { text-decoration: underline; }

/* Single */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; }
.entry-title { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 8px 0 10px; font-weight: 800; }
.entry-hero { margin: 20px -32px; }
.entry-hero img { width: 100%; }
.entry-hero figcaption { font-size: 12px; color: var(--muted); padding: 6px 32px 0; }
.entry-content { font-size: 17px; line-height: 1.75; }
.entry-content a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.entry-content h2, .entry-content h3 { line-height: 1.3; margin-top: 1.6em; }
.entry-content blockquote { margin: 1.5em 0; padding: 4px 18px; border-left: 4px solid var(--accent); color: var(--muted); }
.entry-content figure { margin: 1.5em 0; }
.entry-content .wp-block-embed iframe, .entry-content iframe[src*="youtube"] { width: 100%; aspect-ratio: 16/9; height: auto; border-radius: var(--radius); }
.entry-content .wp-block-image figcaption { font-size: 13px; color: var(--muted); text-align: center; }
.entry-content .wp-block-gallery { gap: 6px; }
/* Tables (articles, guides, hubs): framed, tinted header, zebra rows; scroll sideways on phones instead of squashing. */
.entry-content table { width: 100%; margin: 1.6em 0; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.entry-content th, .entry-content td { padding: 10px 14px; text-align: left; vertical-align: top; }
.entry-content thead th { background: color-mix(in srgb, var(--text) 7%, var(--surface)); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--accent); }
.entry-content tbody td { border-top: 1px solid var(--line); }
.entry-content tbody tr:first-child td { border-top: 0; }
.entry-content tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.entry-content tbody td:first-child { font-weight: 600; }
.entry-content th[style*="right"], .entry-content td[style*="right"] { text-align: right; }
@media (max-width: 640px) {
	.entry-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 14px; }
	.entry-content th, .entry-content td { padding: 9px 12px; }
}
.entry-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-weight: 500; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.share span { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.share a { padding: 5px 12px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }

.block-title { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; border-bottom: 3px solid var(--text); padding-bottom: 8px; margin: 0 0 14px; }
.related, .comments { margin-top: 32px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.related-item { font-size: 14px; font-weight: 600; line-height: 1.35; }
.related-item img, .related-item .ph { border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; width: 100%; margin-bottom: 6px; }

.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.comment-author img { float: left; margin-right: 10px; border-radius: 50%; }
.comment-meta { font-size: 13px; color: var(--muted); }
.comment-form input:not([type=checkbox]):not([type=submit]), .comment-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }

/* Footer */
.site-footer { background: var(--header); color: #a7adb8; padding: 32px 0; font-size: 14px; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.footer-widgets .widget-title { color: #fff; }
.footer-widgets li { border-color: rgba(255,255,255,.08); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; }
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom a:hover { color: #fff; }
.footer-login { margin-left: 12px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); font-size: 12px; color: #7d8491; }

/* Responsive */
@media (max-width: 1000px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
	.hero-lead { grid-column: span 2; grid-row: auto; min-height: 360px; }
	.related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
	.nav-toggle { display: grid; }
	.header-row { gap: 8px; }
	.primary-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--header); padding: 8px 16px 16px; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
	.primary-nav .sub-menu { display: flex; position: static; box-shadow: none; padding: 0 0 0 12px; }
	.story { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 14px 0; }
	.story-title { font-size: 16px; }
	.story-excerpt { display: none; }
	.hero { grid-template-columns: 1fr; }
	.hero-lead { grid-column: auto; min-height: 280px; }
	.hero-item:not(.hero-lead) { min-height: 170px; }
	.hero-lead .hero-text h2 { font-size: 22px; }
	.hero-lead .hero-text p { display: none; }
	.entry { padding: 20px 16px; border-radius: 0; border-left: 0; border-right: 0; margin: 0 -16px; }
	.entry-hero { margin: 16px -16px; }
	.entry-title { font-size: 26px; }
}

@media (max-width: 480px) {
	.header-row { gap: 12px; }
	.custom-logo { max-height: 30px; }
}
