/*!
 * Theme Name: BlogPress Pro
 * Theme URI: https://yourdomain.com/blogpress-pro
 * Author: Mehdi
 * Author URI: https://yourdomain.com
 * Description: A modern, feature-rich WordPress theme crafted for professional bloggers, featuring stunning design, dark/light mode, and unique interactive elements.
 * Version: 1.0.0
 * License: GNU General Public License v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: blogpress-pro
 * Domain Path: /languages
 * Requires at least: 5.9
 * Requires PHP: 7.4
 * Tags: blog, dark-mode, responsive, accessibility, modern
 */

/* ============================================================================
   CSS VARIABLES & COLOR PALETTE
   ============================================================================ */

:root {
  /* Light Mode Colors */
  --bp-primary: #2563eb;
  --bp-primary-dark: #1e40af;
  --bp-primary-light: #3b82f6;
  --bp-accent: #f59e0b;
  --bp-accent-dark: #d97706;
  
  --bp-text-primary: #1f2937;
  --bp-text-secondary: #6b7280;
  --bp-text-muted: #9ca3af;
  
  --bp-bg-primary: #ffffff;
  --bp-bg-secondary: #f9fafb;
  --bp-bg-tertiary: #f3f4f6;
  
  --bp-border: #e5e7eb;
  --bp-border-light: #f3f4f6;
  
  --bp-link: #2563eb;
  --bp-link-hover: #1e40af;
  --bp-link-visited: #7c3aed;
  
  --bp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --bp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --bp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --bp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --bp-font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bp-font-body: 'Lora', Georgia, serif;
  --bp-font-mono: 'Monaco', 'Courier New', monospace;
  
  --bp-line-height-tight: 1.25;
  --bp-line-height-normal: 1.5;
  --bp-line-height-relaxed: 1.75;
  
  --bp-letter-spacing-tight: -0.02em;
  --bp-letter-spacing-normal: 0;
  --bp-letter-spacing-wide: 0.05em;
  
  /* Spacing */
  --bp-spacing-xs: 0.25rem;
  --bp-spacing-sm: 0.5rem;
  --bp-spacing-md: 1rem;
  --bp-spacing-lg: 1.5rem;
  --bp-spacing-xl: 2rem;
  --bp-spacing-2xl: 3rem;
  --bp-spacing-3xl: 4rem;
  
  /* Border Radius */
  --bp-radius-sm: 0.375rem;
  --bp-radius-md: 0.5rem;
  --bp-radius-lg: 0.75rem;
  --bp-radius-xl: 1rem;
  
  /* Transitions */
  --bp-transition-fast: 150ms ease-in-out;
  --bp-transition-base: 250ms ease-in-out;
  --bp-transition-slow: 350ms ease-in-out;
}

/* Dark Mode Color Overrides */
body.dark-mode {
  --bp-text-primary: #f3f4f6;
  --bp-text-secondary: #d1d5db;
  --bp-text-muted: #9ca3af;
  
  --bp-bg-primary: #111827;
  --bp-bg-secondary: #1f2937;
  --bp-bg-tertiary: #374151;
  
  --bp-border: #374151;
  --bp-border-light: #1f2937;
  
  --bp-link: #60a5fa;
  --bp-link-hover: #93c5fd;
  --bp-link-visited: #a78bfa;
  
  --bp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --bp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --bp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --bp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--bp-font-body);
  font-size: 1rem;
  line-height: var(--bp-line-height-normal);
  color: var(--bp-text-primary);
  background-color: var(--bp-bg-primary);
  transition: background-color var(--bp-transition-base), color var(--bp-transition-base);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--bp-font-heading);
  font-weight: 700;
  line-height: var(--bp-line-height-tight);
  letter-spacing: var(--bp-letter-spacing-tight);
  margin-bottom: var(--bp-spacing-md);
  color: var(--bp-text-primary);
}

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.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--bp-spacing-lg);
  line-height: var(--bp-line-height-relaxed);
}

a {
  color: var(--bp-link);
  text-decoration: none;
  transition: color var(--bp-transition-fast);
}

a:hover {
  color: var(--bp-link-hover);
  text-decoration: underline;
}

a:visited {
  color: var(--bp-link-visited);
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--bp-primary);
  outline-offset: 2px;
}

code, pre {
  font-family: var(--bp-font-mono);
  background-color: var(--bp-bg-tertiary);
  border-radius: var(--bp-radius-md);
}

code {
  padding: 0.125rem 0.375rem;
  font-size: 0.875em;
}

pre {
  padding: var(--bp-spacing-lg);
  overflow-x: auto;
  margin-bottom: var(--bp-spacing-lg);
}

pre code {
  padding: 0;
  background-color: transparent;
}

blockquote {
  border-left: 4px solid var(--bp-primary);
  padding-left: var(--bp-spacing-lg);
  margin-left: 0;
  margin-bottom: var(--bp-spacing-lg);
  font-style: italic;
  color: var(--bp-text-secondary);
}

/* ============================================================================
   IMAGES & MEDIA
   ============================================================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  background-color: var(--bp-bg-tertiary);
}

figure {
  margin-bottom: var(--bp-spacing-lg);
}

figcaption {
  font-size: 0.875rem;
  color: var(--bp-text-secondary);
  margin-top: var(--bp-spacing-sm);
  font-style: italic;
}

/* ============================================================================
   FORMS
   ============================================================================ */

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--bp-text-primary);
  background-color: var(--bp-bg-secondary);
  border: 1px solid var(--bp-border);
  border-radius: var(--bp-radius-md);
  padding: var(--bp-spacing-sm) var(--bp-spacing-md);
  transition: border-color var(--bp-transition-fast), background-color var(--bp-transition-fast);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--bp-primary);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--bp-primary);
  background-color: var(--bp-bg-primary);
}

button {
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--bp-radius-md);
  padding: var(--bp-spacing-sm) var(--bp-spacing-lg);
  background-color: var(--bp-primary);
  color: white;
  transition: background-color var(--bp-transition-fast), transform var(--bp-transition-fast);
}

button:hover {
  background-color: var(--bp-primary-dark);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--bp-spacing-lg);
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   WORDPRESS SPECIFIC STYLES
   ============================================================================ */

.wp-caption {
  margin-bottom: var(--bp-spacing-lg);
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--bp-text-secondary);
  margin-top: var(--bp-spacing-sm);
}

.alignleft {
  float: left;
  margin-right: var(--bp-spacing-lg);
  margin-bottom: var(--bp-spacing-lg);
}

.alignright {
  float: right;
  margin-left: var(--bp-spacing-lg);
  margin-bottom: var(--bp-spacing-lg);
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--bp-spacing-lg);
}

.wp-block-image {
  margin-bottom: var(--bp-spacing-lg);
}

.wp-block-gallery {
  margin-bottom: var(--bp-spacing-lg);
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .container {
    padding: 0 var(--bp-spacing-md);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.125rem;
  }
  
  .container {
    padding: 0 var(--bp-spacing-md);
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
