/*
Theme Name: G31Zone
Theme URI: https://g31zone.local
Author: G31Zone Team
Description: Custom WordPress theme for G31Zone
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: g31zone
*/

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #1a1a2e;
  --color-secondary: #16213e;
  --color-accent: #0f3460;
  --color-highlight: #e94560;
  --color-text: #eaeaea;
  --color-text-muted: #9a9a9a;
  --color-bg: #0d0d1a;
  --color-surface: #1a1a2e;
  --color-border: #2a2a4a;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
  --container: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--color-highlight); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ff6b7a; }
img { max-width: 100%; height: auto; display: block; }

/* ===== Layout ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding: 3rem 0; }

/* ===== Header ===== */
.site-header {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}

.site-branding { display: flex; align-items: center; gap: 0.75rem; }

.site-logo {
  width: 36px;
  height: 36px;
  background: var(--color-highlight);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.site-title { font-size: 1.25rem; font-weight: 700; color: var(--color-text); letter-spacing: -0.02em; }
.site-title:hover { color: var(--color-highlight); }

/* ===== Navigation ===== */
.main-navigation ul { display: flex; list-style: none; gap: 0.25rem; }

.main-navigation a {
  color: var(--color-text-muted);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
  color: var(--color-text);
  background: var(--color-border);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(233,69,96,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero h1 span { color: var(--color-highlight); }

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary { background: var(--color-highlight); color: #fff; }
.btn-primary:hover { background: #ff2d4e; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(233,69,96,0.4); }

.btn-outline { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn-outline:hover { background: var(--color-border); color: var(--color-text); }

/* ===== Posts Grid ===== */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; margin-top: 2rem; }

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.post-card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--color-accent); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-body { padding: 1.25rem; }

.post-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.625rem; }

.post-category {
  background: rgba(233,69,96,0.15);
  color: var(--color-highlight);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-title { font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.post-card-title a { color: var(--color-text); }
.post-card-title a:hover { color: var(--color-highlight); }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Sidebar Layout ===== */
.content-area { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; align-items: start; }

.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.widget ul { list-style: none; }
.widget ul li { padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.widget ul li:last-child { border-bottom: none; }

/* ===== Single Post ===== */
.entry-header { margin-bottom: 2rem; }

.entry-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.entry-content { line-height: 1.8; font-size: 1.0625rem; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 2rem 0 0.75rem; font-weight: 700; letter-spacing: -0.02em; }
.entry-content p { margin-bottom: 1.25rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.25rem 1.5rem; }
.entry-content li { margin-bottom: 0.375rem; }

.entry-content blockquote {
  border-left: 3px solid var(--color-highlight);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(233,69,96,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

.entry-content code {
  font-family: var(--font-mono);
  background: var(--color-border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}

.entry-content pre {
  background: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.entry-content pre code { background: none; padding: 0; font-size: 0.875rem; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 3rem; }

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--color-highlight);
  border-color: var(--color-highlight);
  color: #fff;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-secondary);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }

.footer-brand p { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 0.75rem; max-width: 280px; line-height: 1.6; }

.footer-heading { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); margin-bottom: 1rem; }

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--color-text); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ===== Search Form ===== */
.search-form { display: flex; gap: 0.5rem; }

.search-field {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  color: var(--color-text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.search-field:focus { border-color: var(--color-highlight); }

.search-submit {
  background: var(--color-highlight);
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  transition: background var(--transition);
}

.search-submit:hover { background: #ff2d4e; }

/* ===== Comments ===== */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border); }
.comments-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.5rem; }

.comment { display: flex; gap: 1rem; padding: 1.25rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); margin-bottom: 1rem; }
.comment-avatar img { width: 44px; height: 44px; border-radius: 50%; }
.comment-meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.comment-author { font-weight: 600; color: var(--color-text); }

/* ===== Google Ads ===== */
.g31zone-ad {
  display: block;
  width: 100%;
  overflow: hidden;
  margin: 1.5rem auto;
  max-width: 100%;
  text-align: center;
}

.g31zone-ad::after {
  content: '';
  display: block;
  clear: both;
}

.g31zone-ad--header_below,
.g31zone-ad--footer_above,
.g31zone-ad--homepage_after_hero,
.g31zone-ad--archive_top {
  padding: 0 1.5rem;
  max-width: var(--container);
}

.g31zone-ad--header_below {
  clear: both;
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 0;
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  background: rgba(26, 26, 46, 0.5);
}

.g31zone-ad--footer_above {
  margin-bottom: 0;
  padding-bottom: 1.5rem;
}

.g31zone-ad--sidebar {
  margin: 0 0 1.5rem;
  flex-direction: column;
}

.g31zone-ad--single_before,
.g31zone-ad--single_after {
  margin: 1.5rem 0;
}

.g31zone-ad ins,
.g31zone-ad iframe {
  display: block;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Prevent AdSense floats from squeezing page content beside the ad */
main,
.site-wrapper > .container,
.site-main .content-area {
  clear: both;
}

.entry-content .vtgames-arcade {
  clear: both;
  width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .main-navigation {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
  }

  .main-navigation.is-open { display: block; }
  .main-navigation ul { flex-direction: column; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .hero { padding: 3rem 0; }
}
