/*
Theme Name: Gsmrave
Theme URI: https://gsmrave.com
Description: High-performance tech review theme optimized for speed and mobile-first African audience. Clean, bold editorial design for smartphone reviews and gadget coverage.
Author: Gsmrave
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: gsmrave
Tags: blog, news, custom-header, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

This theme is optimized for speed with minimal dependencies and clean code.
*/

/* ========================================
   CSS VARIABLES - Easy Theme Customization
   ======================================== */
:root {
  /* Brand Colors */
  --primary: #ff6b35;
  --primary-dark: #e85a27;
  --secondary: #004e89;
  --accent: #ffd23f;
  
  /* Neutrals */
  --dark: #0a0a0a;
  --gray-900: #1a1a1a;
  --gray-800: #2a2a2a;
  --gray-700: #3a3a3a;
  --gray-300: #d4d4d4;
  --gray-200: #e5e5e5;
  --gray-100: #f5f5f5;
  --white: #ffffff;
  
  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Courier New', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Layout */
  --container-max: 1200px;
  --content-max: 720px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  
  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --text-primary: var(--gray-100);
    --text-secondary: var(--gray-300);
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: var(--space-md);
  max-width: 65ch;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

strong { font-weight: 600; }
em { font-style: italic; }

/* ========================================
   LAYOUT CONTAINERS
   ======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
}

/* ========================================
   HEADER / NAVIGATION
   ======================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-md);
  max-width: var(--container-max);
  margin: 0 auto;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.site-logo span {
  color: var(--primary);
}

.site-logo:hover {
  color: var(--primary);
}

/* Navigation */
.main-navigation {
  display: none;
}

.main-navigation ul {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  align-items: center;
}

.main-navigation a {
  color: var(--dark);
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-xs) 0;
  position: relative;
}

.main-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation a.current::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--dark);
  transition: var(--transition);
  border-radius: 2px;
}

/* Desktop Navigation */
@media (min-width: 768px) {
  .main-navigation {
    display: block;
  }
  
  .menu-toggle {
    display: none;
  }
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
  color: var(--white);
  padding: var(--space-2xl) var(--space-md);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.5; }
}

.hero-content {
  max-width: var(--content-max);
  position: relative;
  z-index: 1;
}

.hero-title {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.hero-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
}

/* ========================================
   POST CARDS / REVIEW CARDS
   ======================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.post-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--gray-200);
}

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

.post-thumbnail {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--gray-100);
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

.post-category {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: var(--primary);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-content {
  padding: var(--space-md);
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.post-title a {
  color: var(--dark);
}

.post-title a:hover {
  color: var(--primary);
}

.post-excerpt {
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.post-meta {
  display: flex;
  gap: var(--space-md);
  color: var(--gray-700);
  font-size: 0.875rem;
  border-top: 1px solid var(--gray-200);
  padding-top: var(--space-sm);
}

.post-meta svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
}

/* ========================================
   FEATURED POST
   ======================================== */
.featured-post {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--gray-200);
}

@media (min-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr 1fr;
  }
}

.featured-thumbnail {
  height: 400px;
  overflow: hidden;
  background: var(--gray-100);
}

.featured-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
  width: fit-content;
}

/* ========================================
   SINGLE POST / REVIEW PAGE
   ======================================== */
.single-post-header {
  max-width: var(--content-max);
  margin: 0 auto var(--space-xl);
  padding: var(--space-xl) var(--space-md);
}

.single-post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: var(--space-md);
}

.single-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  color: var(--gray-700);
  font-size: 0.95rem;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--primary);
}

.post-featured-image {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.post-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-sm);
  margin: var(--space-lg) 0;
}

.post-content ul,
.post-content ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.post-content li {
  margin-bottom: var(--space-sm);
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--gray-700);
}

/* ========================================
   BUTTONS & CTAs
   ======================================== */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: #003a68;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  background: var(--gray-100);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
}

.widget {
  margin-bottom: var(--space-xl);
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--primary);
}

.widget ul {
  list-style: none;
}

.widget li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--gray-200);
}

.widget li:last-child {
  border-bottom: none;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: var(--dark);
  color: var(--gray-300);
  padding: var(--space-2xl) var(--space-md) var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h3 {
  color: var(--white);
  margin-bottom: var(--space-md);
  font-size: 1.125rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--space-sm);
}

.footer-section a {
  color: var(--gray-300);
}

.footer-section a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--gray-800);
  text-align: center;
  font-size: 0.875rem;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.bg-light { background: var(--gray-100); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy Load Placeholder */
img[loading="lazy"] {
  background: var(--gray-100);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.screen-reader-text {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */
/* Reduce repaints */
.post-card,
.btn,
.menu-toggle {
  will-change: transform;
}

/* GPU acceleration for animations */
@media (prefers-reduced-motion: no-preference) {
  .post-card:hover,
  .btn:hover {
    transform: translateY(-4px) translateZ(0);
  }
}

/* Respect user preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
