/*
Theme Name: 16-Bit World Redesign
Theme URI: https://16bitworld.com/
Author: Muse for Thomas Frangipani
Author URI: https://16bitworld.com/
Description: A dark arcade-style redesign for 16bitworld.com, the retro gaming news blog. Pixel-art touches, hero stories, filterable post grid, and review scores. No page builder or premium dependencies required.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sixteenbitworld
Tags: blog, news, dark, responsive, retro, gaming, custom-logo, featured-images
*/

/* ============================================================
   1. TOKENS & BASE
   ============================================================ */
:root {
  --bg:        #0a0e1a;   /* deep navy */
  --bg-2:      #0e1428;
  --bg-3:      #141c38;
  --line:      #1e2a52;
  --ink:       #e8ecf8;
  --ink-dim:   #9aa3c7;
  --pink:      #ff2d78;   /* hot pink */
  --cyan:      #00e5ff;   /* cyan */
  --amber:     #ffb300;   /* amber */
  --pixel:     'Press Start 2P', 'Courier New', monospace;
  --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  --radius:    10px;
  --maxw:      1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--pink); }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Accessibility: skip link + screen-reader text */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--pink); color: #fff; padding: 10px 16px;
  font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   2. HEADER
   ============================================================ */
.site-header {
  background: linear-gradient(180deg, #0d1330 0%, var(--bg) 100%);
  border-bottom: 3px solid var(--pink);
  box-shadow: 0 0 24px rgba(255, 45, 120, .25);
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 10px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.social { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }
.social a {
  display: inline-flex; width: 34px; height: 34px; border-radius: 8px;
  background: var(--bg-3); border: 1px solid var(--line);
  align-items: center; justify-content: center; color: var(--ink-dim);
  transition: transform .15s ease, color .15s ease, border-color .15s ease;
}
.social a:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

.header-search .search-form { display: flex; gap: 0; }
.header-search input[type="search"] {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 12px; border-radius: 8px 0 0 8px; width: 180px; font-size: 14px;
}
.header-search input[type="search"]:focus { outline: 2px solid var(--cyan); }
.header-search button {
  background: var(--pink); border: 1px solid var(--pink); color: #fff;
  padding: 8px 14px; border-radius: 0 8px 8px 0; cursor: pointer; font-weight: 700;
}
.header-search button:hover { background: #d61f63; }

.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 18px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo svg.cartridge { width: 56px; height: 62px; flex: none;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, .45)); }
.wordmark { font-family: var(--pixel); font-size: 22px; letter-spacing: 1px;
  color: var(--ink); text-shadow: 3px 3px 0 var(--pink); line-height: 1.4; }
.tagline { display: block; font-family: var(--sans); font-size: 12px;
  letter-spacing: 3px; text-transform: uppercase; color: var(--ink-dim);
  text-shadow: none; margin-top: 6px; }

.menu-toggle {
  display: none; background: var(--bg-3); color: var(--cyan);
  border: 2px solid var(--cyan); border-radius: 8px; font-size: 22px;
  padding: 6px 12px; cursor: pointer;
}

.main-nav { border-top: 1px solid var(--line); }
.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.main-nav a {
  display: block; padding: 14px 18px; color: var(--ink);
  font-family: var(--pixel); font-size: 11px; letter-spacing: 1px;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.main-nav .current-menu-item a,
.main-nav .current-category-ancestor a { color: var(--pink); border-bottom-color: var(--pink); }

/* ============================================================
   3. HEADLINES TICKER
   ============================================================ */
.ticker {
  display: flex; align-items: stretch; background: #070b16;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ticker-label {
  flex: none; display: flex; align-items: center; padding: 0 18px;
  background: var(--amber); color: #1a1200;
  font-family: var(--pixel); font-size: 10px; z-index: 2;
}
.ticker-viewport { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker-track {
  display: inline-flex; gap: 48px; padding: 10px 24px; white-space: nowrap;
  animation: ticker-scroll 36s linear infinite; will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track a { color: var(--ink-dim); font-size: 14px; }
.ticker-track a:hover { color: var(--cyan); }
.ticker-track .tick-dot { color: var(--pink); margin-right: 8px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   4. HERO
   ============================================================ */
.hero {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
  padding-top: 28px; padding-bottom: 8px;
}
.hero-main, .hero-side article {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.hero-main:hover, .hero-side article:hover {
  transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 229, 255, .15);
}
.hero-main .post-art { aspect-ratio: 16 / 8; }
.hero-side { display: grid; gap: 20px; align-content: start; }
.hero-side .post-art { aspect-ratio: 16 / 8; }
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 20, .92) 70%);
}
.hero-text h2, .hero-text h3 { margin: 8px 0 6px; }
.hero-text h2 { font-size: 26px; }
.hero-text h3 { font-size: 17px; }
.hero-text h2 a, .hero-text h3 a { color: #fff; }
.hero-text h2 a:hover, .hero-text h3 a:hover { color: var(--cyan); }
.hero-text p { color: var(--ink-dim); font-size: 14px; margin: 0; }

.cat-tag {
  display: inline-block; font-family: var(--pixel); font-size: 9px;
  letter-spacing: 1px; text-transform: uppercase;
  background: var(--pink); color: #fff; padding: 6px 10px; border-radius: 4px;
}
.cat-tag.alt { background: var(--cyan); color: #062b33; }

/* Deterministic CSS/SVG/emoji post art — no external images */
.post-art {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.post-art::after { /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, .16) 0 2px, transparent 2px 6px);
}
.post-art-glyph {
  font-size: 64px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45));
  transform: rotate(-6deg);
}
.hero-main .post-art-glyph { font-size: 110px; }

/* ============================================================
   5. LAYOUT, SECTIONS, POST GRID
   ============================================================ */
.layout {
  display: grid; grid-template-columns: 3fr 1fr; gap: 28px;
  padding-top: 26px; padding-bottom: 10px; align-items: start;
}
.section-title {
  font-family: var(--pixel); font-size: 16px; color: var(--ink);
  border-left: 6px solid var(--pink); padding-left: 14px; margin: 26px 0 18px;
  text-shadow: 2px 2px 0 rgba(255, 45, 120, .35);
}
.section-title.cyan { border-left-color: var(--cyan); text-shadow: 2px 2px 0 rgba(0, 229, 255, .3); }
.section-title.amber { border-left-color: var(--amber); text-shadow: 2px 2px 0 rgba(255, 179, 0, .3); }

/* Filter bar */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  font-family: var(--pixel); font-size: 10px; letter-spacing: 1px;
  background: var(--bg-3); color: var(--ink-dim);
  border: 2px solid var(--line); border-radius: 8px; padding: 10px 14px;
  cursor: pointer; transition: all .15s ease;
}
.filter-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-btn.active { background: var(--pink); border-color: var(--pink); color: #fff;
  box-shadow: 0 0 14px rgba(255, 45, 120, .5); }

.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.post-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, opacity .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, .5); }
.post-card.is-hidden { display: none; }
.post-card .post-art { aspect-ratio: 16 / 9; }
.post-card .post-art-glyph { font-size: 52px; }
.post-card-body { padding: 16px 16px 18px; }
.post-card-body h3 { font-size: 16px; margin: 10px 0 8px; }
.post-card-body h3 a { color: var(--ink); }
.post-card-body h3 a:hover { color: var(--cyan); }
.post-card-body p { color: var(--ink-dim); font-size: 14px; margin: 0 0 10px; }
.post-meta { color: var(--ink-dim); font-size: 12px; letter-spacing: .5px; }
.post-meta a { color: var(--ink-dim); }
.post-meta a:hover { color: var(--cyan); }

/* ============================================================
   6. SIDEBAR & WIDGETS
   ============================================================ */
.sidebar { display: grid; gap: 22px; align-content: start; }
.widget {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.widget-title {
  font-family: var(--pixel); font-size: 11px; color: var(--amber);
  margin: 0 0 14px; letter-spacing: 1px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }

/* Most Played list */
.most-played li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.most-played li:last-child { border-bottom: 0; }
.most-played .rank {
  font-family: var(--pixel); font-size: 14px; color: var(--pink); flex: none; width: 28px;
}
.most-played a { color: var(--ink); font-size: 14px; }
.most-played a:hover { color: var(--cyan); }
.most-played .meta { display: block; color: var(--ink-dim); font-size: 12px; }

/* System chip cloud */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cloud a {
  font-size: 13px; padding: 7px 12px; border-radius: 20px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-dim);
}
.chip-cloud a:hover { border-color: var(--cyan); color: var(--cyan); }

/* Cartridge Club newsletter */
.widget_sbw_cartridge_club { border: 2px solid var(--amber); background:
  linear-gradient(160deg, #171106 0%, var(--bg-2) 70%); }
.widget_sbw_cartridge_club p { color: var(--ink-dim); font-size: 14px; }
.sbw-newsletter-form { display: grid; gap: 10px; }
.sbw-newsletter-form input[type="email"] {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 12px; border-radius: 8px; font-size: 14px; width: 100%;
}
.sbw-newsletter-form input[type="email"]:focus { outline: 2px solid var(--amber); }
.sbw-newsletter-form button {
  font-family: var(--pixel); font-size: 10px; letter-spacing: 1px;
  background: var(--amber); color: #1a1200; border: 0; border-radius: 8px;
  padding: 12px; cursor: pointer;
}
.sbw-newsletter-form button:hover { filter: brightness(1.1); }
.newsletter-success { color: var(--amber); font-weight: 700; }

/* ============================================================
   7. FRESH REVIEWS
   ============================================================ */
.reviews { padding-bottom: 34px; }
.review-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.review-card {
  position: relative; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.review-card .post-art { aspect-ratio: 16 / 9; }
.review-card .post-art-glyph { font-size: 46px; }
.review-card-body { padding: 14px 14px 16px; }
.review-card-body h3 { font-size: 15px; margin: 0 0 6px; }
.review-card-body h3 a { color: var(--ink); }
.review-card-body h3 a:hover { color: var(--cyan); }
.score-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-family: var(--pixel); font-size: 12px; color: #1a1200;
  background: var(--amber); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 0 12px rgba(255, 179, 0, .55);
}

/* ============================================================
   8. SINGLE POST / PAGE / ARCHIVE
   ============================================================ */
.post-hero .post-art { aspect-ratio: 21 / 8; border-radius: var(--radius);
  border: 1px solid var(--line); }
.post-hero .post-art-glyph { font-size: 96px; }
.entry-header h1 { font-size: 30px; margin: 18px 0 10px; }
.entry-content { color: var(--ink); }
.entry-content p { margin: 0 0 1.2em; }
.entry-content a { border-bottom: 1px dotted var(--cyan); }
.entry-footer { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--ink-dim); font-size: 14px; }
.post-navigation { display: flex; justify-content: space-between; gap: 16px; margin: 28px 0; }
.post-navigation a {
  display: block; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 18px; color: var(--ink); font-size: 14px;
}
.post-navigation a:hover { border-color: var(--cyan); color: var(--cyan); }

.archive-header { padding: 26px 0 6px; }
.archive-header h1 { font-family: var(--pixel); font-size: 18px; color: var(--cyan); }
.archive-header p { color: var(--ink-dim); }

.pagination { margin: 28px 0; text-align: center; }
.pagination .page-numbers {
  display: inline-block; padding: 8px 14px; margin: 0 4px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 14px;
}
.pagination .page-numbers.current, .pagination .page-numbers:hover {
  background: var(--pink); border-color: var(--pink); color: #fff;
}

/* 404 */
.error-404 { text-align: center; padding: 60px 20px; }
.error-404 .glitch {
  font-family: var(--pixel); font-size: 64px; color: var(--pink);
  text-shadow: 4px 4px 0 var(--cyan); margin-bottom: 10px;
}
.error-404 h1 { font-family: var(--pixel); font-size: 18px; }
.error-404 p { color: var(--ink-dim); }

/* Comments */
.comments-area { margin-top: 34px; }
.comments-area h2 { font-family: var(--pixel); font-size: 14px; color: var(--amber); }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list li { background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.comment-list .children { list-style: none; margin: 14px 0 0 18px; padding: 0; }
.comment-meta { font-size: 13px; color: var(--ink-dim); margin-bottom: 8px; }
.comment-form label { display: block; font-size: 14px; margin: 12px 0 4px; }
.comment-form input[type="text"], .comment-form input[type="email"],
.comment-form input[type="url"], .comment-form textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.comment-form input[type="submit"] {
  font-family: var(--pixel); font-size: 11px; background: var(--cyan);
  color: #062b33; border: 0; border-radius: 8px; padding: 12px 20px;
  cursor: pointer; margin-top: 12px;
}

/* Search results header */
.search-header { padding: 26px 0 6px; }
.search-header h1 { font-family: var(--pixel); font-size: 16px; }
.search-header h1 span { color: var(--cyan); }

/* ============================================================
   9. FOOTER
   ============================================================ */
.site-footer {
  background: #070b16; border-top: 3px solid var(--cyan);
  box-shadow: 0 0 24px rgba(0, 229, 255, .18); margin-top: 10px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 26px;
}
.footer-nav ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--ink-dim); font-size: 14px; }
.footer-nav a:hover { color: var(--cyan); }
.copyright { color: var(--ink-dim); font-size: 13px; margin: 0; }
.footer-tag { font-family: var(--pixel); font-size: 9px; color: var(--pink); letter-spacing: 1px; }

/* ============================================================
   10. RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .review-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; border-top: 0; }
  .main-nav.nav-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
  .main-nav a:hover { border-left-color: var(--cyan); }
  .hero { grid-template-columns: 1fr; }
  .hero-text h2 { font-size: 21px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 560px) {
  .review-grid { grid-template-columns: 1fr; }
  .wordmark { font-size: 16px; }
  .tagline { font-size: 10px; letter-spacing: 2px; }
  .logo svg.cartridge { width: 44px; height: 49px; }
  .header-search input[type="search"] { width: 130px; }
  .hero-main .post-art-glyph { font-size: 72px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
