/*
Theme Name: Collywobbles
Theme URI: https://collywobbles.net
Author: Collywobbles
Author URI: https://collywobbles.net
Description: Retro arcade gaming theme for Collywobbles.net — CRT scanlines, pixel fonts, synthwave vibes.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: collywobbles
Tags: blog, gaming, retro, custom-header, featured-images, one-column, two-columns
*/

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Share+Tech+Mono&display=swap');

/* ── VARIABLES ── */
:root {
  --cyan:    #00fff7;
  --magenta: #ff00cc;
  --yellow:  #ffe600;
  --green:   #39ff14;
  --red:     #ff3c3c;
  --dark:    #05050f;
  --mid:     #0d0d2b;
  --panel:   #0a0a1e;
  --border:  rgba(0,255,247,0.3);
  --text:    #c8e6f5;
  --muted:   rgba(200,230,245,0.5);
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt:    'VT323', monospace;
  --font-mono:  'Share Tech Mono', monospace;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--dark);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* star field bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at  8% 12%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 22%  5%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 37% 18%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 51%  9%, rgba(0,255,247,0.6)   0%, transparent 100%),
    radial-gradient(1px 1px at 67% 22%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 79%  4%, rgba(255,0,204,0.5)   0%, transparent 100%),
    radial-gradient(1px 1px at 91% 16%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 14% 40%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 44% 35%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 38%, rgba(0,255,247,0.4)   0%, transparent 100%),
    radial-gradient(1px 1px at  3% 65%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 56% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 58%, rgba(255,230,0,0.4)   0%, transparent 100%),
    radial-gradient(1px 1px at 95% 62%, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* global scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.15s, text-shadow 0.15s; }
a:hover { color: var(--yellow); text-shadow: 0 0 8px var(--yellow); }

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

/* ── LAYOUT ── */
.site-wrapper {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── SITE HEADER ── */
.site-header {
  position: relative;
  width: 100%;
  background: var(--dark);
  border-bottom: 2px solid var(--cyan);
  box-shadow: 0 0 30px rgba(0,255,247,0.2), 0 4px 60px rgba(0,0,0,0.6);
  overflow: hidden;
  margin-bottom: 40px;
}

.header-inner {
  position: relative;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* retro sun in header */
.header-inner::before {
  content: '';
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px; height: 70px;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--yellow) 0%, var(--magenta) 55%, var(--cyan) 100%);
  border-radius: 140px 140px 0 0;
  box-shadow: 0 0 40px var(--magenta), 0 0 80px rgba(255,0,204,0.3);
  -webkit-mask: repeating-linear-gradient(
    to bottom,
    black 0px, black 6px,
    transparent 6px, transparent 10px
  );
  mask: repeating-linear-gradient(
    to bottom,
    black 0px, black 6px,
    transparent 6px, transparent 10px
  );
}

/* perspective grid */
.header-inner::after {
  content: '';
  position: absolute;
  bottom: 0; left: -30%; right: -30%;
  height: 60px;
  background:
    repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), rgba(0,255,247,0.15) calc(10% - 1px), rgba(0,255,247,0.15) 10%),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), rgba(0,255,247,0.1) calc(25% - 1px), rgba(0,255,247,0.1) 25%);
  transform: perspective(120px) rotateX(40deg);
  transform-origin: bottom center;
}

.site-branding {
  position: relative;
  z-index: 2;
  text-align: center;
}

.site-title {
  font-family: var(--font-pixel);
  font-size: clamp(18px, 3.5vw, 36px);
  color: var(--cyan);
  text-shadow:
    3px 3px 0 var(--magenta),
    0 0 20px var(--cyan),
    0 0 40px rgba(0,255,247,0.4);
  letter-spacing: 2px;
  animation: flicker 8s infinite;
  line-height: 1.4;
}
.site-title a { color: inherit; text-shadow: inherit; }
.site-title a:hover { color: var(--cyan); text-shadow: 3px 3px 0 var(--magenta), 0 0 30px var(--cyan); }

.site-description {
  font-family: var(--font-vt);
  font-size: 18px;
  color: var(--yellow);
  letter-spacing: 6px;
  text-shadow: 0 0 10px var(--yellow);
  margin-top: 6px;
  animation: pulse-text 2s infinite alternate;
}

/* corner brackets */
.header-corners span {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--magenta);
  border-style: solid;
  z-index: 3;
}
.header-corners span:nth-child(1) { top: 8px; left: 8px;  border-width: 2px 0 0 2px; }
.header-corners span:nth-child(2) { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.header-corners span:nth-child(3) { bottom: 8px; left: 8px;  border-width: 0 0 2px 2px; }
.header-corners span:nth-child(4) { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

/* ── NAV ── */
.site-nav {
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(0,255,247,0.2);
  border-bottom: 1px solid rgba(0,255,247,0.2);
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-nav ul li a {
  display: block;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
  padding: 12px 16px;
  letter-spacing: 1px;
  transition: all 0.15s;
  position: relative;
}
.site-nav ul li a::before {
  content: '▶';
  color: var(--cyan);
  margin-right: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.site-nav ul li a:hover,
.site-nav ul li.current-menu-item a {
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
}
.site-nav ul li a:hover::before,
.site-nav ul li.current-menu-item a::before { opacity: 1; }

/* ── TICKER ── */
.ticker-bar {
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid var(--cyan);
  overflow: hidden;
  height: 28px;
  display: flex;
  align-items: center;
  margin-bottom: 40px;
}
.ticker-inner {
  display: flex;
  white-space: nowrap;
  animation: scroll-ticker 25s linear infinite;
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--green);
  letter-spacing: 2px;
}
.ticker-inner span { padding: 0 40px; }

/* ── POST LIST (FRONT PAGE) ── */
.posts-list { display: flex; flex-direction: column; gap: 30px; }

.post-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,247,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.post-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(0,255,247,0.15), 0 0 60px rgba(0,255,247,0.05), inset 0 0 30px rgba(0,255,247,0.03);
  transform: translateX(4px);
}

/* card number badge */
.post-card .card-number {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--dark);
  background: var(--cyan);
  padding: 3px 7px;
  z-index: 2;
  line-height: 1;
}

.post-card-image {
  position: relative;
  overflow: hidden;
  background: var(--mid);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.1) contrast(1.05);
  transition: transform 0.4s, filter 0.3s;
  min-height: 160px;
}
.post-card:hover .post-card-image img {
  transform: scale(1.06);
  filter: saturate(1.3) contrast(1.1) brightness(1.05);
}

/* no-image placeholder */
.post-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}
.post-card-image.no-image::after {
  content: '?';
  font-family: var(--font-pixel);
  font-size: 40px;
  color: var(--border);
}

/* scanline overlay on image */
.post-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0,0,0,0.25) 2px, rgba(0,0,0,0.25) 4px
  );
  pointer-events: none;
}

.post-card-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.post-category {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--dark);
  background: var(--magenta);
  padding: 3px 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(255,0,204,0.4);
}

.post-date {
  font-family: var(--font-vt);
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 2px;
}

.post-card-title {
  font-family: var(--font-pixel);
  font-size: clamp(9px, 1.5vw, 12px);
  line-height: 1.8;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,255,247,0.3);
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }

.post-excerpt {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more-btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 8px 14px;
  letter-spacing: 1px;
  transition: all 0.15s;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}
.read-more-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cyan);
  transform: translateX(-101%);
  transition: transform 0.2s;
  z-index: -1;
}
.read-more-btn:hover {
  color: var(--dark);
  text-shadow: none;
  box-shadow: 0 0 15px var(--cyan);
}
.read-more-btn:hover::before { transform: translateX(0); }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 50px 0 20px;
  font-family: var(--font-pixel);
  font-size: 9px;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,255,247,0.05); }
.pagination .current { border-color: var(--cyan); color: var(--cyan); background: rgba(0,255,247,0.1); }

/* ── SINGLE POST ── */
.single-post { max-width: 760px; margin: 0 auto; }

.single-post-header { margin-bottom: 30px; }

.single-post-title {
  font-family: var(--font-pixel);
  font-size: clamp(14px, 2.5vw, 22px);
  color: var(--cyan);
  line-height: 1.7;
  text-shadow: 3px 3px 0 var(--magenta), 0 0 20px rgba(0,255,247,0.3);
  margin-bottom: 16px;
}

.single-post-meta {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.single-post-featured {
  position: relative;
  margin-bottom: 30px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.single-post-featured img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  filter: saturate(1.1);
}
.single-post-featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom, transparent 0px, transparent 3px,
    rgba(0,0,0,0.15) 3px, rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
}

/* post content typography */
.post-content { font-family: var(--font-mono); font-size: 15px; line-height: 1.9; }
.post-content p    { margin-bottom: 1.4em; }
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  font-family: var(--font-pixel);
  color: var(--cyan);
  margin: 1.8em 0 0.8em;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(0,255,247,0.2);
}
.post-content h2 { font-size: clamp(11px, 1.8vw, 14px); }
.post-content h3 { font-size: clamp(10px, 1.5vw, 12px); color: var(--yellow); }
.post-content a   { color: var(--cyan); border-bottom: 1px solid rgba(0,255,247,0.3); }
.post-content a:hover { color: var(--yellow); border-color: var(--yellow); }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.4em; }
.post-content li  { margin-bottom: 0.4em; }
.post-content li::marker { color: var(--cyan); }
.post-content blockquote {
  border-left: 3px solid var(--magenta);
  padding: 12px 20px;
  background: rgba(255,0,204,0.05);
  margin: 1.4em 0;
  color: var(--muted);
  font-style: italic;
}
.post-content code {
  font-family: var(--font-mono);
  background: rgba(0,255,247,0.08);
  border: 1px solid rgba(0,255,247,0.2);
  padding: 2px 6px;
  color: var(--cyan);
  font-size: 0.9em;
}
.post-content pre {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}
.post-content pre code { background: none; border: none; padding: 0; }
.post-content img {
  max-width: 100%;
  border: 1px solid var(--border);
  margin: 1em 0;
}

/* back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--muted);
  margin-bottom: 30px;
  letter-spacing: 1px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.back-link::before { content: '◀'; }

/* post nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.post-nav a {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.8;
  color: var(--text);
  transition: all 0.15s;
}
.post-nav a:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,255,247,0.04); }
.post-nav .nav-label { display: block; font-size: 7px; color: var(--muted); margin-bottom: 6px; }
.post-nav .nav-next  { text-align: right; }

/* ── SIDEBAR / WIDGETS ── */
.widget {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
}
.widget-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--yellow);
  text-shadow: 0 0 8px var(--yellow);
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,230,0,0.2);
}
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid rgba(0,255,247,0.06); font-family: var(--font-mono); font-size: 13px; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); }
.widget ul li a:hover { color: var(--cyan); }

/* ── FOOTER ── */
.site-footer {
  margin-top: 60px;
  border-top: 2px solid var(--cyan);
  background: var(--dark);
  box-shadow: 0 -4px 30px rgba(0,255,247,0.1);
  padding: 30px 20px;
  text-align: center;
}
.footer-title {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--cyan);
  text-shadow: 2px 2px 0 var(--magenta), 0 0 15px rgba(0,255,247,0.4);
  margin-bottom: 10px;
}
.footer-copy {
  font-family: var(--font-vt);
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 3px;
}
.footer-insert {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--magenta);
  text-shadow: 0 0 8px var(--magenta);
  margin-top: 14px;
  letter-spacing: 2px;
  animation: blink 1s steps(1) infinite;
}

/* ── ANIMATIONS ── */
@keyframes flicker {
  0%,90%,95%,100% { opacity: 1; }
  91% { opacity: 0.75; }
  93% { opacity: 0.9; }
  96% { opacity: 0.6; }
  98% { opacity: 0.95; }
}
@keyframes pulse-text {
  from { opacity: 0.75; text-shadow: 0 0 6px var(--yellow); }
  to   { opacity: 1;    text-shadow: 0 0 16px var(--yellow), 0 0 30px rgba(255,230,0,0.4); }
}
@keyframes blink {
  0%,49% { opacity: 1; } 50%,100% { opacity: 0; }
}
@keyframes scroll-ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── RESPONSIVE ── */
@media (max-width: 620px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card-image img { min-height: 180px; max-height: 220px; }
  .post-nav { grid-template-columns: 1fr; }
  .site-title { font-size: 16px; }
}
