/* ===== DESIGN SYSTEM ===== */
:root {
  /* Colors */
  --color-mint: #20C6B7;
  --color-gray: #A7B0BD;
  --color-graphite: #1A2230;
  --color-white: #FFFFFF;
  --color-accent: #3AA7FF;
  
  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --size-body: 1.2rem;
  --size-h3: 1.5rem;
  --size-h2: 2.25rem;
  --size-h1: 3.1rem;
  
  /* Layout */
  --max-width: 1200px;
  --gutter: 24px;
  
  /* Effects */
  --radius: 16px;
  --shadow: 0 12px 28px rgba(0,0,0,.18);
  --shadow-hover: 0 16px 36px rgba(0,0,0,.24);
  --transition: 180ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

a:hover {
  color: var(--color-mint);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: var(--size-h1);
  color: var(--color-graphite);
}

h2 {
  font-size: var(--size-h2);
  color: var(--color-graphite);
}

h3 {
  font-size: var(--size-h3);
  color: var(--color-graphite);
}

p {
  margin-bottom: 1rem;
  color: var(--color-gray);
}

/* ===== CONTAINER & GRID ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  transition: transform var(--transition);
}

header.hidden {
  transform: translateY(-100%);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-graphite);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo svg {
  width: 32px;
  height: 32px;
  color: var(--color-mint);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--color-graphite);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

nav a:hover,
nav a.active {
  color: var(--color-mint);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-mint);
  transition: width var(--transition);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* Burger Menu */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  background: none;
  border: none;
}

.burger span {
  width: 25px;
  height: 3px;
  background: var(--color-graphite);
  transition: var(--transition);
  border-radius: 2px;
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(26,34,48,0.8), rgba(32,198,183,0.6)), 
              url('../assets/images/modern_residential_solar_panels_home_roof.jpg') center/cover no-repeat;
  color: var(--color-white);
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  padding: 2rem;
  animation: fadeInUp 1s ease-out;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.95);
  margin-bottom: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.btn-primary {
  background: var(--color-mint);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(32,198,183,0.3);
}

.btn-primary:hover {
  background: #1ab3a5;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(32,198,183,0.4);
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(58,167,255,0.3);
}

.btn-secondary:hover {
  background: #2a97ef;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(58,167,255,0.4);
}

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

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

/* Focus states */
.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* ===== SECTIONS ===== */
section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

/* ===== CARDS ===== */
.card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 200ms ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--color-graphite);
}

.card-text {
  flex: 1;
  color: var(--color-gray);
  margin-bottom: 1rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(32,198,183,0.1);
  color: var(--color-mint);
}

.badge.easy {
  background: rgba(32,198,183,0.1);
  color: var(--color-mint);
}

.badge.high-savings {
  background: rgba(58,167,255,0.1);
  color: var(--color-accent);
}

.badge.diy {
  background: rgba(167,176,189,0.2);
  color: var(--color-graphite);
}

.badge.professional {
  background: rgba(255,152,0,0.1);
  color: #ff9800;
}

/* ===== STATS SECTION ===== */
.stats {
  background: linear-gradient(135deg, var(--color-graphite), #2a3544);
  color: var(--color-white);
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  color: var(--color-mint);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-mint);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
}

/* ===== FEATURES/ADVANTAGES ===== */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.advantage-item {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: rgba(32,198,183,0.03);
  transition: all var(--transition);
}

.advantage-item:hover {
  background: rgba(32,198,183,0.08);
  transform: translateX(5px);
}

.advantage-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  color: var(--color-mint);
}

.advantage-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.advantage-content p {
  font-size: 1.1rem;
}

/* ===== ARTICLES GRID ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* ===== REVIEWS/TESTIMONIALS ===== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.review-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.review-card::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 5rem;
  color: rgba(32,198,183,0.2);
  font-family: Georgia, serif;
}

.review-text {
  font-style: italic;
  margin-bottom: 1.5rem;
  color: var(--color-graphite);
}

.review-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-stars {
  color: #ffc107;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.author-name {
  font-weight: 600;
  color: var(--color-graphite);
}

.author-location {
  color: var(--color-gray);
  font-size: 0.95rem;
}

/* ===== CATEGORIES SECTION ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.category-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 200ms ease;
  text-align: center;
}

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

.category-icon {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--color-mint), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon svg {
  width: 80px;
  height: 80px;
  color: var(--color-white);
}

.category-content {
  padding: 1.5rem;
}

.category-content h3 {
  margin-bottom: 0.5rem;
}

/* ===== NEWSLETTER ===== */
.newsletter {
  background: linear-gradient(135deg, var(--color-mint), var(--color-accent));
  color: var(--color-white);
  text-align: center;
}

.newsletter h2 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.newsletter p {
  color: rgba(255,255,255,0.95);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.newsletter-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 280px;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: none;
  font-size: 1.1rem;
  outline: none;
}

.newsletter-form input:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
}

.newsletter-success {
  display: none;
  background: rgba(255,255,255,0.2);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-weight: 600;
}

/* ===== FOOTER ===== */
footer {
  background: var(--color-graphite);
  color: rgba(255,255,255,0.8);
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: rgba(255,255,255,0.8);
  display: block;
  margin-bottom: 0.5rem;
}

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

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.social-links a:hover {
  background: var(--color-mint);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.6);
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-mint);
  color: var(--color-white);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(32,198,183,0.4);
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(32,198,183,0.5);
}

.back-to-top.visible {
  display: flex;
}

/* ===== CATEGORY PAGE HERO ===== */
.category-hero {
  background: linear-gradient(135deg, var(--color-graphite), var(--color-mint));
  color: var(--color-white);
  padding: 5rem 0 3rem;
  text-align: center;
}

.category-hero h1 {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.category-hero p {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.95);
}

/* ===== FILTER CHIPS ===== */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.chip {
  padding: 0.7rem 1.5rem;
  background: rgba(32,198,183,0.1);
  border: 2px solid transparent;
  border-radius: 25px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
  color: var(--color-graphite);
}

.chip:hover,
.chip.active {
  background: var(--color-mint);
  color: var(--color-white);
  border-color: var(--color-mint);
}

/* ===== LEGAL PAGES ===== */
.legal-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.legal-content h1 {
  margin-bottom: 2rem;
}

.legal-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.legal-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content p,
.legal-content li {
  color: var(--color-gray);
  line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  :root {
    --size-h1: 2.5rem;
    --size-h2: 1.9rem;
  }
  
  .grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --size-h1: 2rem;
    --size-h2: 1.6rem;
    --size-body: 1.1rem;
  }
  
  /* Mobile navigation */
  nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--color-white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 2rem;
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }
  
  nav.active {
    transform: translateY(0);
  }
  
  nav ul {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .burger {
    display: flex;
  }
  
  .hero {
    min-height: 70vh;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.2rem;
  }
  
  section {
    padding: 3rem 0;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid,
  .advantages-grid,
  .reviews-grid,
  .categories-grid {
    grid-template-columns: 1fr;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form input {
    width: 100%;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Screen reader only */
.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;
}
