/*
Theme Name: Games Choices v2
Theme URI: https://gameschoices.com/
Author: Haseeb Ali
Description: Fast, SEO-first theme for Games Choices. SEO, schema, ads and social settings are all controlled from the theme, with light and dark modes.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: games-choices
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #f3f4f7;
	--surface: #ffffff;
	--ink: #141821;
	--muted: #566074;
	--line: #d9dee7;
	--brand: #c8102e;
	--link: #1c4ed8;
	--focus: #1c4ed8;
	--radius: 6px;
	--wrap: 1180px;
	--read: 720px;
	--font-head: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f131b;
		--surface: #171c27;
		--ink: #eceff5;
		--muted: #a3adbf;
		--line: #2a3345;
		--brand: #ff5a70;
		--link: #8aa8ff;
		--focus: #8aa8ff;
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0f131b;
	--surface: #171c27;
	--ink: #eceff5;
	--muted: #a3adbf;
	--line: #2a3345;
	--brand: #ff5a70;
	--link: #8aa8ff;
	--focus: #8aa8ff;
	color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: 0.005em; }
p { margin: 0 0 1em; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 0.5rem; top: -4rem; z-index: 100;
	background: var(--surface); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.wrap--article { max-width: calc(var(--read) + 2rem); }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-top: 3px solid var(--brand); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header__bar { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.brand { flex: 0 0 auto; display: flex; align-items: center; }
.brand .custom-logo { display: block; max-height: 42px; width: auto; }
.site-title { font: 800 1.4rem/1 var(--font-head); color: var(--ink); text-decoration: none; }
.primary-nav { margin-left: auto; }
.primary-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.primary-nav a { display: block; padding: 0.55rem 0.8rem; color: var(--ink); text-decoration: none; font-weight: 600; border-radius: var(--radius); }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-cat > a { background: var(--bg); color: var(--brand); }
.primary-nav .menu-item-has-children { position: relative; }
.primary-nav .sub-menu {
	list-style: none; margin: 0; padding: 0.4rem; position: absolute; left: 0; top: 100%; min-width: 12rem;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: none; z-index: 60;
}
@media (min-width: 861px) {
	.primary-nav .menu-item-has-children:hover > .sub-menu,
	.primary-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
}
.submenu-toggle { display: none; }
.header-actions { display: flex; align-items: center; gap: 0.25rem; }
.icon-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem;
	border: 0; background: transparent; color: var(--ink); border-radius: var(--radius); cursor: pointer; list-style: none;
}
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
	:root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.search-details { position: relative; }
.search-details[open] .search-panel { display: block; }
.search-panel {
	display: none; position: absolute; right: 0; top: 100%; width: min(22rem, 90vw); margin-top: 0.5rem; padding: 0.75rem;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] { flex: 1; min-width: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], textarea {
	width: 100%; padding: 0.6rem 0.75rem; font: inherit; color: var(--ink); background: var(--bg);
	border: 1px solid var(--line); border-radius: var(--radius);
}
.button, button[type="submit"], input[type="submit"] {
	padding: 0.6rem 1rem; font: 700 1rem var(--font-body); color: #fff; background: var(--brand);
	border: 0; border-radius: var(--radius); cursor: pointer;
}
:root[data-theme="dark"] .button, :root[data-theme="dark"] button[type="submit"], :root[data-theme="dark"] input[type="submit"] { color: #1a0b0e; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
	.menu-toggle { display: inline-flex; }
	.primary-nav { position: absolute; left: 0; right: 0; top: 100%; margin: 0; background: var(--surface); border-bottom: 1px solid var(--line); display: none; padding: 0.5rem 1rem 1rem; }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .menu-item-has-children { display: flex; flex-wrap: wrap; align-items: center; }
	.primary-nav .menu-item-has-children > a { flex: 1 1 auto; }
	.submenu-toggle {
		display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
		width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: var(--radius);
		background: transparent; color: var(--ink); font: 400 1.6rem/1 var(--font-body); cursor: pointer;
	}
	.submenu-toggle:hover { background: var(--bg); color: var(--brand); }
	.submenu-toggle::before { content: "+"; }
	.submenu-toggle[aria-expanded="true"]::before { content: "\2212"; }
	.primary-nav .sub-menu { position: static; display: none; flex: 0 0 100%; border: 0; padding: 0 0 0.25rem 1rem; }
	.primary-nav .menu-item-has-children.is-open > .sub-menu { display: block; }
	.header-actions { margin-left: auto; }
}

/* ---------- Main ---------- */
.site-main { padding: 1.5rem 0 3rem; min-height: 60vh; }
.breadcrumbs { margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }
.breadcrumbs a { color: var(--muted); }

.home-intro { margin-bottom: 1.25rem; }
.home-intro__title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.25rem; }
.home-intro__text { color: var(--muted); margin: 0; max-width: 60ch; }

.section-title { font-size: 1.25rem; margin: 2rem 0 1rem; padding-left: 0.7rem; border-left: 4px solid var(--brand); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-title a { color: var(--ink); text-decoration: none; }
.section-title .more { font: 600 0.9rem var(--font-body); color: var(--link); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__media { display: block; aspect-ratio: 16 / 9; background: var(--line); overflow: hidden; }
.card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--line), var(--bg)); }
.card__body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.card__title { font-size: 1.1rem; margin: 0; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--brand); text-decoration: underline; }
.card__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.85rem; color: var(--muted); }
.card__cat a { color: var(--brand); font-weight: 700; text-decoration: none; }
.card__cat a:hover { text-decoration: underline; }
.card__excerpt { margin: 0; color: var(--muted); font-size: 0.98rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* Lead story: the one bold moment */
.lead-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .lead-grid { grid-template-columns: 2fr 1fr; } }
.card--lead { border: 0; background: transparent; }
.card--lead .card__media { border-radius: var(--radius); }
.card--lead .card__body { padding: 0.9rem 0 0; }
.card--lead .card__title { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.08; }
.card--lead .card__excerpt { font-size: 1.1rem; max-width: 60ch; }
.lead-grid__side { display: flex; flex-direction: column; gap: 0.75rem; }
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 5.5rem; }
.card--row .card__body { padding: 0.6rem 0.8rem; gap: 0.2rem; }
.card--row .card__title { font-size: 1rem; }

/* ---------- Single ---------- */
.entry__header { margin-bottom: 1.25rem; }
.entry__cat a { color: var(--brand); font-weight: 700; text-decoration: none; }
.entry__title { font-size: clamp(1.9rem, 5vw, 2.9rem); font-weight: 800; line-height: 1.08; margin: 0.3rem 0 0.6rem; }
.entry__deck { font-size: 1.2rem; color: var(--muted); margin: 0 0 0.8rem; }
.entry__meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; color: var(--muted); font-size: 0.92rem; }
.entry__meta a { color: var(--ink); font-weight: 600; }
.entry__figure { margin: 0 auto 1.5rem; max-width: 1000px; }
.entry__img { display: block; width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.entry__figure figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.entry__content { font-size: 1.125rem; line-height: 1.75; max-width: var(--read); margin: 0 auto; overflow-wrap: break-word; }
.entry__content h2 { font-size: 1.7rem; margin: 2rem 0 0.6rem; }
.entry__content h3 { font-size: 1.35rem; margin: 1.6rem 0 0.5rem; }
.entry__content img { border-radius: var(--radius); }
.entry__content figure { margin: 1.5rem 0; }
.entry__content figcaption { font-size: 0.85rem; color: var(--muted); }
.entry__content blockquote { margin: 1.5rem 0; padding: 0.2rem 1rem; border-left: 4px solid var(--brand); color: var(--muted); }
.entry__content table { width: 100%; border-collapse: collapse; font-size: 0.98rem; display: block; overflow-x: auto; }
.entry__content th, .entry__content td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.entry__content th { background: var(--surface); }
.entry__content pre, .entry__content code { font-size: 0.92em; background: var(--surface); border-radius: 4px; }
.entry__content pre { padding: 1rem; overflow-x: auto; }
.entry__content code { padding: 0.1em 0.3em; }
.entry__tags { max-width: var(--read); margin: 1.5rem auto 0; display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.9rem; }
.entry__tags a { padding: 0.2rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--surface); }
.author-box { max-width: var(--read); margin: 2rem auto 0; padding: 1rem; display: flex; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.author-box img { border-radius: 50%; flex: 0 0 auto; }
.author-box__name { font: 700 1.1rem var(--font-head); margin: 0 0 0.2rem; }
.author-box__name a { color: var(--ink); text-decoration: none; }
.author-box__bio { margin: 0; color: var(--muted); font-size: 0.97rem; }
.related { margin-top: 2.5rem; }

/* ---------- Archives and pages ---------- */
.archive-head { margin-bottom: 1.5rem; }
.archive-head__title { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 0.3rem; }
.archive-head__desc { color: var(--muted); max-width: 65ch; }
.archive-head__author { display: flex; gap: 1rem; align-items: center; }
.archive-head__author img { border-radius: 50%; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.pagination .page-numbers { padding: 0.45rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .pagination .page-numbers.current { color: #1a0b0e; }

/* ---------- Comments ---------- */
.comments-area { max-width: var(--read); margin: 2.5rem auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.25rem; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 0.9rem; color: var(--muted); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.comment-form p { margin-bottom: 0.9rem; }

/* ---------- Ads (space is reserved so the page never jumps) ---------- */
.ad-slot { display: block; margin: 1.5rem auto; max-width: 100%; min-height: 280px; text-align: center; }
.ad-slot--top { min-height: 120px; }
.ad-slot::before { content: attr(aria-label); display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 0.25rem; }
.ad-slot__preview { display: flex; align-items: center; justify-content: center; min-height: 6rem; border: 2px dashed var(--line); color: var(--muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 2rem 0; color: var(--muted); font-size: 0.95rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer-menu a, .footer-social a { color: var(--ink); }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }

/* ---------- Misc ---------- */
.alignwide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.wp-caption, .wp-block-image { max-width: 100%; }
.sticky .card { border-color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { animation: none !important; transition: none !important; }
}
@media print {
	.site-header, .site-footer, .ad-slot, .related, .comments-area, .author-box { display: none !important; }
	body { background: #fff; color: #000; }
}