/* Canadian DIY Woodworking Blog - Wood-Grain Design System */

/* Design System Variables */
:root {
  /* Color Palette - Wood & Metal Inspired */
  --walnut: #6B4B3B;          /* Deep brown for accents and text */
  --birch: #E7D8B1;           /* Light wood tone for backgrounds */
  --graphite: #1A2230;        /* Dark charcoal for primary text */
  --steel: #7A8791;           /* Blue-grey for secondary elements */
  --copper: #B86E3B;          /* Warm copper for CTAs and highlights */
  
  /* Additional neutrals */
  --cream: #FAF9F6;
  --charcoal: #2D3748;
  --warm-white: #FFFDF8;
  --soft-grey: #F7F7F5;
  
  /* Typography Scale */
  --text-xs: 0.833rem;   /* 13.33px */
  --text-sm: 0.944rem;   /* 15px */
  --text-base: 1.125rem; /* 18px */
  --text-lg: 1.35rem;    /* 21.6px */
  --text-xl: 1.62rem;    /* 25.9px */
  --text-2xl: 1.944rem;  /* 31.1px */
  --text-3xl: 2.333rem;  /* 37.3px */
  --text-4xl: 2.8rem;    /* 44.8px */
  
  /* Spacing Scale */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  
  /* Border Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.22);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.25);
  
  /* Transitions */
  --transition-fast: 160ms ease;
  --transition-normal: 220ms ease;
  --transition-slow: 320ms ease;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--graphite);
  background: var(--warm-white);
  overflow-x: hidden;
}

/* Wood-grain grid background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(231, 216, 177, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184, 110, 59, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(122, 135, 145, 0.15) 0%, transparent 50%),
    linear-gradient(45deg, transparent 49%, rgba(107, 75, 59, 0.03) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(107, 75, 59, 0.02) 50%, transparent 51%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 80px 80px, 80px 80px;
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--charcoal);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-md);
  color: var(--graphite);
}

/* Links */
a {
  color: var(--copper);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.grid {
  display: grid;
  gap: var(--space-xl);
}

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

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid rgba(231, 216, 177, 0.3);
}

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

.card-header {
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card-content {
  padding: var(--space-lg);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--charcoal);
}

.card-excerpt {
  color: var(--graphite);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--steel);
  font-size: var(--text-sm);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transition: width 0.6s, height 0.6s;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--copper), #C77F3F);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #C77F3F, var(--copper));
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: #6A7580;
}

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

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

/* Header */
.header {
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(231, 216, 177, 0.3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.header.scrolled {
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--walnut);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  fill: var(--copper);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
}

.nav-link {
  color: var(--graphite);
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--copper);
}

.nav-link.active {
  color: var(--copper);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--copper);
  transition: width var(--transition-fast);
}

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

.mobile-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.mobile-menu span {
  width: 24px;
  height: 2px;
  background: var(--graphite);
  transition: all var(--transition-fast);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--birch) 0%, var(--warm-white) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../images/rich_brown_wood_grain_texture_close_up.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-4xl));
  font-weight: 800;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--charcoal), var(--walnut));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--steel);
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Stats Section */
.stats {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  margin: var(--space-3xl) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--copper);
  display: block;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--steel);
  margin-top: var(--space-xs);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.category-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--copper);
}

.category-icon {
  width: 48px;
  height: 48px;
  fill: var(--copper);
  margin: 0 auto var(--space-md);
}

.category-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
  color: var(--charcoal);
}

/* Badges */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-beginner { background: var(--birch); color: var(--walnut); }
.badge-shop { background: var(--steel); color: white; }
.badge-safety { background: var(--copper); color: white; }

/* Newsletter */
.newsletter {
  background: linear-gradient(135deg, var(--walnut), var(--charcoal));
  color: white;
  text-align: center;
  border-radius: var(--radius-xl);
  padding: var(--space-3xl);
}

.newsletter h3 {
  color: white;
  margin-bottom: var(--space-md);
}

.newsletter p {
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-xl);
}

.newsletter-form {
  display: flex;
  gap: var(--space-md);
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: var(--space-md);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

.newsletter-btn {
  background: var(--copper);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.newsletter-btn:hover {
  background: #C77F3F;
}

/* Footer */
.footer {
  background: var(--charcoal);
  color: white;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.footer-section h4 {
  color: var(--birch);
  margin-bottom: var(--space-md);
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  display: block;
  margin-bottom: var(--space-sm);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: var(--space-xl);
  text-align: center;
  color: rgba(255,255,255,0.7);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu {
    display: flex;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--soft-grey);
}

::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--walnut);
}

/* Focus Styles */
*:focus {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

button:focus,
.btn:focus {
  outline-offset: 4px;
}

/* Print Styles */
@media print {
  .header,
  .mobile-menu,
  .newsletter,
  .footer {
    display: none;
  }
  
  .hero {
    min-height: auto;
    padding: var(--space-xl) 0;
  }
  
  .section {
    padding: var(--space-lg) 0;
  }
}