/*
Theme Name: WordGrid
Description: Modern tactile puzzle game theme built for Wordle Unlimited, featuring instant dark/light theme sync, high-contrast typography, and clean editorial post layouts.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wordgrid
*/

:root {
	--bg: #f8fafc;
	--surface: #ffffff;
	--surface-2: #f1f5f9;
	--text: #0f172a;
	--muted: #475569;
	--line: #e2e8f0;
	--accent: #16a34a;
	--accent-dark: #15803d;
	--amber: #d99b06;
	--accent-soft: rgba(22, 163, 74, 0.1);
	--amber-soft: rgba(217, 155, 6, 0.12);
	--header-bg: rgba(248, 250, 252, 0.85);
	--shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.06);
	--shadow-md: 0 18px 40px -16px rgba(15, 23, 42, 0.12);
	--width: 1120px;
	--narrow: 760px;
}

html[data-theme="dark"] {
	--bg: #0b0f17;
	--surface: #111827;
	--surface-2: #1e293b;
	--text: #f8fafc;
	--muted: #94a3b8;
	--line: #1f2937;
	--accent: #22c55e;
	--accent-dark: #16a34a;
	--amber: #eab308;
	--accent-soft: rgba(34, 197, 94, 0.14);
	--amber-soft: rgba(234, 179, 8, 0.14);
	--header-bg: rgba(11, 15, 23, 0.86);
	--shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
	--shadow-md: 0 22px 48px -16px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 16px/1.65 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	transition: background-color 200ms ease, color 200ms ease;
}

img, video { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
	font-family: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
	line-height: 1.2;
	margin: 1.4em 0 0.5em;
	color: var(--text);
}

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }
.skip-link:focus { position: static !important; width: auto; height: auto; clip: auto; display: inline-block; padding: 0.6rem 1rem; background: var(--text); color: var(--bg); z-index: 9999; }

.wrap { width: min(100% - 2rem, var(--width)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, var(--narrow)); margin-inline: auto; }

/* Sticky Glass Header */
.wg-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--header-bg);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--line);
}

.wg-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 62px;
}

.wg-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	text-decoration: none;
	font-family: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
	font-weight: 700;
	font-size: 1.2rem;
	letter-spacing: -0.02em;
}
.wg-brand:hover { text-decoration: none; }

.wg-brand-tiles {
	display: inline-flex;
	gap: 3px;
}

.wg-brand-tile {
	width: 22px;
	height: 22px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
	color: #ffffff;
}
.wg-brand-tile.t-g { background: var(--accent); }
.wg-brand-tile.t-y { background: var(--amber); }
.wg-brand-tile.t-s { background: #64748b; }

.wg-brand-tag {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
}

.wg-nav-group {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.wg-main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.wg-main-nav a {
	display: inline-flex;
	align-items: center;
	padding: 7px 12px;
	border-radius: 9px;
	color: var(--muted);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: color 140ms ease, background-color 140ms ease;
}

.wg-main-nav a:hover,
.wg-main-nav .current-menu-item > a {
	color: var(--text);
	background: var(--surface-2);
	text-decoration: none;
}

.wg-theme-btn,
.wg-nav-toggle {
	appearance: none;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 140ms ease, transform 120ms ease;
}
.wg-theme-btn:hover,
.wg-nav-toggle:hover { background: var(--surface-2); }
.wg-theme-btn:active,
.wg-nav-toggle:active { transform: scale(0.95); }
.wg-nav-toggle { display: none; }

html[data-theme="dark"] .wg-icon-moon { display: none; }
html:not([data-theme="dark"]) .wg-icon-sun { display: none; }

/* Front Page Game Arena */
.wg-hero-arena {
	position: relative;
	padding: 20px 16px 36px;
	background:
		radial-gradient(640px 320px at 22% 10%, var(--accent-soft), transparent 70%),
		radial-gradient(560px 300px at 80% 15%, var(--amber-soft), transparent 70%);
}

.wg-arena-intro {
	max-width: 620px;
	margin: 0 auto 14px;
	text-align: center;
}

.wg-arena-intro h1 {
	margin: 0 0 4px;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	letter-spacing: -0.025em;
}

.wg-arena-intro p {
	margin: 0;
	color: var(--muted);
	font-size: 14px;
}

/* Landing Sections */
.wg-section {
	padding: 48px 0;
}

.wg-section-muted {
	background: var(--surface-2);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.wg-section-head {
	text-align: center;
	max-width: 620px;
	margin: 0 auto 30px;
}

.wg-eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 6px;
}

.wg-section-head h2 {
	margin: 0 0 8px;
	font-size: clamp(1.5rem, 3vw, 2rem);
	letter-spacing: -0.02em;
}

.wg-section-head p {
	margin: 0;
	color: var(--muted);
	font-size: 15px;
}

/* Feature Mode Grid */
.wg-modes-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.wg-mode-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 20px;
	box-shadow: var(--shadow-sm);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 14px;
	transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.wg-mode-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: var(--accent);
}

.wg-mode-icon {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--accent-soft);
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
}

.wg-mode-card h3 {
	margin: 10px 0 6px;
	font-size: 1.05rem;
}

.wg-mode-card p {
	margin: 0;
	font-size: 14px;
	color: var(--muted);
	line-height: 1.5;
}

.wg-card-cta {
	appearance: none;
	border: 1px solid var(--line);
	background: var(--surface-2);
	color: var(--text);
	font: 700 13px/1 inherit;
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	text-align: center;
	transition: all 140ms ease;
}
.wg-card-cta:hover {
	background: var(--accent);
	border-color: var(--accent);
	color: #ffffff;
}

/* Guide & Openers */
.wg-guide-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 24px;
	align-items: stretch;
}

.wg-panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 24px;
	box-shadow: var(--shadow-sm);
}

.wg-panel h3 {
	margin-top: 0;
	font-size: 1.2rem;
}

.wg-color-legend {
	display: grid;
	gap: 14px;
	margin-top: 16px;
}

.wg-legend-item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.wg-mini-tile {
	width: 42px;
	height: 42px;
	border-radius: 10px;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 18px;
	color: #ffffff;
}
.wg-mini-tile.is-g { background: var(--accent); }
.wg-mini-tile.is-y { background: var(--amber); }
.wg-mini-tile.is-s { background: #64748b; }

.wg-legend-item strong { display: block; font-size: 15px; }
.wg-legend-item span { font-size: 13px; color: var(--muted); }

.wg-openers-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-top: 14px;
}

.wg-opener-card {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--surface-2);
	border: 1px solid var(--line);
}

.wg-opener-word {
	font-family: "Space Grotesk", monospace;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.14em;
	color: var(--accent);
}

.wg-opener-note {
	font-size: 12px;
	color: var(--muted);
	margin-top: 3px;
}

/* Blog Cards */
.wg-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.wg-post-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 12px;
	box-shadow: var(--shadow-sm);
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.wg-post-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.wg-post-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
}

.wg-cat-pill {
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 700;
}

.wg-post-card h3 {
	margin: 8px 0;
	font-size: 1.08rem;
}

.wg-post-card h3 a {
	color: var(--text);
	text-decoration: none;
}
.wg-post-card h3 a:hover { color: var(--accent); }

.wg-post-card p {
	margin: 0;
	font-size: 14px;
	color: var(--muted);
}

.wg-read-more {
	font-size: 13px;
	font-weight: 700;
	color: var(--accent);
}

/* FAQ */
.wg-faq-list {
	max-width: 760px;
	margin: 0 auto;
	display: grid;
	gap: 10px;
}

.wg-faq-item {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 16px 20px;
}

.wg-faq-item summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 15px;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.wg-faq-item summary::-webkit-details-marker { display: none; }
.wg-faq-item summary::after {
	content: "+";
	font-size: 18px;
	color: var(--muted);
	transition: transform 150ms ease;
}
.wg-faq-item[open] summary::after {
	content: "−";
	color: var(--accent);
}

.wg-faq-item p {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 14px;
}

/* Editorial Pages & Single Posts */
.wg-page-wrap {
	padding: 36px 0 64px;
}

.wg-article-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 22px;
	padding: clamp(22px, 4vw, 40px);
	box-shadow: var(--shadow-sm);
}

.wg-article-card .entry-title {
	margin-top: 0;
	font-size: clamp(1.65rem, 3.2vw, 2.25rem);
}

.entry-meta {
	color: var(--muted);
	font-size: 14px;
	margin-bottom: 1.5rem;
}

.entry-content {
	font-size: 16px;
	line-height: 1.75;
}

.entry-content input,
.entry-content textarea,
.entry-content select {
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	max-width: 100%;
}

.entry-content button,
.entry-content input[type="submit"] {
	background: var(--accent);
	color: #ffffff;
	border: 0;
	border-radius: 10px;
	padding: 11px 20px;
	font: 700 14px/1 inherit;
	cursor: pointer;
}
.entry-content button:hover,
.entry-content input[type="submit"]:hover { background: var(--accent-dark); }

/* Archive / Index list */
.page-header { margin-bottom: 24px; }
.page-title { margin-top: 0; }
.wg-archive-stack { display: grid; gap: 18px; }
.pagination, .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	margin-top: 28px;
}

/* Comments */
.comments-area {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }

/* 404 Tiles */
.wg-404 {
	text-align: center;
	padding: 64px 16px;
}
.wg-404-tiles {
	display: inline-flex;
	gap: 10px;
	margin-bottom: 20px;
}
.wg-404-tile {
	width: 58px;
	height: 58px;
	border-radius: 14px;
	font-size: 28px;
	font-weight: 800;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wg-cta-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--accent);
	color: #ffffff;
	font-weight: 700;
	padding: 12px 22px;
	border-radius: 12px;
	text-decoration: none;
	margin-top: 14px;
}
.wg-cta-btn:hover { background: var(--accent-dark); text-decoration: none; }

/* Footer */
.wg-site-footer {
	background: var(--surface);
	border-top: 1px solid var(--line);
	padding: 40px 0 28px;
	color: var(--muted);
	font-size: 14px;
}

.wg-footer-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr;
	gap: 28px;
	margin-bottom: 28px;
}

.wg-footer-col h4 {
	margin: 0 0 10px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text);
}

.wg-footer-links {
	display: grid;
	gap: 8px;
}

.wg-footer-links a {
	color: var(--muted);
	text-decoration: none;
}
.wg-footer-links a:hover { color: var(--accent); }

.wg-footer-bottom {
	padding-top: 20px;
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
}

/* Responsive */
@media (max-width: 960px) {
	.wg-modes-grid { grid-template-columns: repeat(2, 1fr); }
	.wg-posts-grid { grid-template-columns: repeat(2, 1fr); }
	.wg-guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
	.wg-nav-toggle { display: inline-flex; }
	.wg-main-nav {
		display: none;
		position: absolute;
		top: 62px;
		left: 0;
		right: 0;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
		padding: 12px 16px;
		box-shadow: var(--shadow-md);
	}
	.wg-main-nav.is-open { display: block; }
	.wg-main-nav ul { flex-direction: column; align-items: stretch; }
	.wg-main-nav a { padding: 10px 12px; }
	.wg-modes-grid,
	.wg-posts-grid,
	.wg-footer-grid { grid-template-columns: 1fr; }
}
