/*
Theme Name: GAM47 Blog
Theme URI: https://gam47.com/blog/
Author: GAM47
Description: Editorial theme for the GAM47 blog: handheld gaming gear guides, tools and deals.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: gam47
*/

:root {
  --bg: #07080c;
  --bg-soft: #0b0d14;
  --panel: #0f131d;
  --panel-2: #151b29;
  --line: #242c40;
  --line-soft: #1a2132;
  --text: #eef1f7;
  --muted: #9aa5bb;
  --lime: #c8f751;
  --lime-dark: #0d1205;
  --violet: #8b5cf6;
  --amz: #ffb020;
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --font-head: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .6em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.42rem, 2.4vw, 1.95rem); margin-top: 2em; }
h3 { font-size: 1.2rem; margin-top: 1.6em; }
p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
strong { color: #fff; }
blockquote {
  margin: 1.6em 0;
  padding: 1em 1.3em;
  border-left: 3px solid var(--lime);
  background: var(--panel);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}
code { background: var(--panel-2); padding: .15em .4em; border-radius: 6px; }
pre { background: var(--panel); border: 1px solid var(--line-soft); padding: 1em; border-radius: var(--radius-sm); overflow: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2.2em 0; }
figure { margin: 1.6em 0; }
figcaption { color: var(--muted); font-size: .88rem; margin-top: .5em; }
table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem; }
th, td { text-align: left; padding: .7em .8em; border-bottom: 1px solid var(--line-soft); }
th { color: #fff; background: var(--panel); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--lime); color: #000; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 8, 12, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-weight: 700; font-size: 1.22rem; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand em { color: var(--lime); font-style: normal; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-size: .94rem; padding: 9px 12px; border-radius: 999px; }
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.is-active { color: var(--text); background: var(--panel-2); }
.nav .nav-cta { color: var(--lime-dark); background: var(--lime); font-weight: 600; margin-left: 6px; }
.nav .nav-cta:hover { background: #d6ff6e; color: var(--lime-dark); }

/* Hero */
.blog-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--line-soft); position: relative; overflow: hidden; }
.blog-hero::before {
  content: ""; position: absolute; inset: -40% 30% auto -10%; height: 460px; pointer-events: none;
  background: radial-gradient(45% 55% at 30% 35%, rgba(139,92,246,.18), transparent 70%),
              radial-gradient(40% 50% at 70% 20%, rgba(200,247,81,.10), transparent 70%);
}
.blog-hero .wrap { position: relative; }
.eyebrow { display: inline-block; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--lime); margin-bottom: 14px; }
.blog-hero h1 { margin-bottom: .35em; }
.blog-hero p.lede { color: var(--muted); font-size: 1.08rem; max-width: 60ch; margin: 0; }

/* Cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 34px 0 64px; }
.post-grid .card--wide { grid-column: span 2; }
.card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card a.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16 / 9; background: var(--panel-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.chip { align-self: flex-start; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--lime); background: rgba(200,247,81,.08); border: 1px solid rgba(200,247,81,.22); padding: 4px 9px; border-radius: 999px; }
.card h2, .card h3 { margin: 0; font-size: 1.18rem; }
.card p { color: var(--muted); font-size: .93rem; margin: 0; }
.card-meta { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: .8rem; display: flex; gap: 10px; flex-wrap: wrap; }
.pagination { padding: 0 0 56px; display: flex; gap: 10px; justify-content: center; }
.pagination .page-numbers { padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.pagination .current { background: var(--lime); color: var(--lime-dark); border-color: var(--lime); font-weight: 600; }

/* Single */
.article { max-width: 760px; margin: 0 auto; padding: 48px 22px 40px; }
.article-header { margin-bottom: 28px; }
.article-header h1 { margin: 12px 0 16px; }
.article-dek { color: var(--muted); font-size: 1.12rem; margin: 0 0 20px; }
.article-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.article-meta .author { color: var(--text); font-weight: 500; }
.article-hero { margin: 0 0 32px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); }
.article-body { font-size: 1.06rem; }
.article-body h2 { padding-top: .2em; }
.article-body a { text-decoration: underline; text-decoration-color: rgba(200,247,81,.35); text-underline-offset: 3px; }
.article-body img { border-radius: var(--radius-sm); }
.article-body li { margin-bottom: .55em; }
.disclosure {
  margin: 34px 0 0; padding: 14px 18px; border: 1px solid var(--line);
  background: var(--panel); border-radius: var(--radius-sm); color: var(--muted); font-size: .86rem;
}
.author-box { display: flex; gap: 16px; align-items: flex-start; margin: 40px 0 0; padding: 22px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.author-box img { width: 56px; height: 56px; border-radius: 50%; }
.author-box h3 { margin: 0 0 6px; font-size: 1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .9rem; }
.related { max-width: var(--wrap); margin: 0 auto; padding: 10px 22px 56px; }
.related h2 { font-size: 1.3rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* Comments */
.comments-area { max-width: 760px; margin: 0 auto; padding: 0 22px 64px; }
.comments-title, .comment-reply-title { font-size: 1.3rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { border: 1px solid var(--line-soft); background: var(--panel); border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 16px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; }
.comment-author img { border-radius: 50%; }
.comment-metadata { color: var(--muted); font-size: .82rem; margin: 4px 0 10px; }
.comment-content { color: var(--text); font-size: .96rem; }
.comment-content p:last-child { margin-bottom: 0; }
.reply a { font-size: .86rem; }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; color: var(--muted); font-size: .86rem; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font: inherit;
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .submit, button[type="submit"], .wp-block-button__link {
  background: var(--lime); color: var(--lime-dark); border: 0; border-radius: 999px;
  padding: 12px 22px; font: inherit; font-weight: 600; cursor: pointer;
}
.comment-form .submit:hover { background: #d6ff6e; }
.comment-notes, .logged-in-as { color: var(--muted); font-size: .86rem; }
.comment-list .bypostauthor > .comment-body { border-color: rgba(200,247,81,.35); }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-soft); padding: 44px 0 36px; margin-top: 0; }
.footer-grid { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 44ch; }
.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-links h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text); font-size: .92rem; }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* 404 / search */
.page-shell { max-width: 720px; margin: 0 auto; padding: 72px 22px 96px; text-align: center; }
.search-form { display: flex; gap: 10px; margin-top: 20px; }
.search-form input[type="search"] { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px 14px; font: inherit; }

@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .post-grid .card--wide { grid-column: span 2; }
  .related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .header-inner { min-height: 60px; }
  .nav a { padding: 8px 10px; font-size: .88rem; }
  .nav .nav-cta { display: none; }
  .post-grid, .related-grid { grid-template-columns: 1fr; }
  .post-grid .card--wide { grid-column: span 1; }
  .article { padding-top: 32px; }
  .footer-grid { flex-direction: column; }
}

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.alignwide { margin-left: calc(50% - 50vw + 22px); margin-right: calc(50% - 50vw + 22px); }

/* Consent banner */
#gam47-consent-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  font-size: .9rem;
  color: var(--muted);
}
#gam47-consent-banner p { margin: 0; max-width: 60ch; }
#gam47-consent-banner a { color: var(--lime); text-decoration: underline; }
.gam47-consent-actions { display: flex; gap: 10px; }
.gam47-consent-actions button {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.gam47-consent-actions .primary { background: var(--lime); color: var(--lime-dark); border-color: var(--lime); }
@media (max-width: 640px) { #gam47-consent-banner { flex-direction: column; align-items: stretch; } }
