/* 
==============================================
Jaywant Industries Ecosafe - Optimized Stylesheet
==============================================
- Improved contrast ratios for WCAG 2.1 AA compliance
- Standardized typography with Inter and Poppins
- Responsive layouts with CSS Grid
- Consistent spacing and visual hierarchy
*/

/* Variables */
:root {
  /* Color Palette */
  --primary-color: #008080; /* Teal */
  --primary-color-dark: #006666; /* Darker teal for hover states */
  --secondary-color: #FFFFFF; /* White */
  --accent-color: #25D366; /* WhatsApp Green */
  --text-color: #333333; /* Dark gray for text */
  --light-bg: #F8F9FA; /* Light background */
  --card-bg: #FFFFFF; /* Card background */
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Card shadow */
  
  /* Spacing System - 8pt grid */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --border-radius: 0.5rem; /* 8px */
  
  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  --base-font-size: 1rem;      /* 16px */
  --h1-font-size: 2.5rem;      /* 40px */
  --h2-font-size: 2rem;        /* 32px */
  --h3-font-size: 1.5rem;      /* 24px */
  --small-font-size: 0.875rem; /* 14px */
}

/* Basic Reset and Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--base-font-size);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

h1 { font-size: var(--h1-font-size); }
h2 { font-size: var(--h2-font-size); }
h3 { font-size: var(--h3-font-size); }

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

ul {
  list-style-position: inside;
  margin-bottom: var(--space-md);
}

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

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

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

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

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

.bg-light {
  background-color: var(--light-bg);
}

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

.text-left {
  text-align: left;
}

/* Header and Navigation */
header {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: var(--space-sm) 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 48px;
  height: 48px;
  margin-right: var(--space-sm);
  vertical-align: middle;
  border-radius: var(--border-radius);
}

.logo h1 {
  margin: 0;
  font-size: 1.75rem;
  color: #F8F9FA; /* WCAG AA compliant contrast */
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Improved readability */
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

header nav ul li {
  margin-left: 30px;
}

header nav ul li:first-child {
  margin-left: 0;
}

header nav ul li a {
  color: #F8F9FA; /* WCAG AA compliant contrast */
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: var(--space-xs) 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Improved readability */
}

header nav ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: #F8F9FA;
  transition: width 0.3s ease;
}

header nav ul li a:hover::after,
header nav ul li a:focus::after {
  width: 100%;
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #F8F9FA;
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  background: url('images/bg.jpg') no-repeat center center/cover;
  color: var(--secondary-color);
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 550px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 128, 128, 0.7); /* Teal overlay for better contrast */
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem; /* Added padding to prevent text overlap on mobile */
}

.hero h2 {
  margin-top: 0;
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  color: var(--secondary-color);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.btn:hover, .btn:focus {
  background-color: var(--primary-color-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn-whatsapp {
  background-color: var(--accent-color); /* WhatsApp green */
  margin-top: 2rem; /* Added spacing */
}

.btn-whatsapp:hover, .btn-whatsapp:focus {
  background-color: #1da851; /* Darker WhatsApp green */
}

/* Card Style */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  padding: var(--space-sm);
  margin-bottom: var(--space-md);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
  font-weight: bold; /* Enhanced title hierarchy */
}

/* Business Summary Section */
.business-summary h3 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.summary-content {
  max-width: 800px;
  margin: 0 auto;
}

.summary-content ul.list-disc {
  list-style-type: disc;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.summary-content ul.list-disc li {
  margin-bottom: var(--space-xs);
}

.summary-content ul.list-disc li strong {
  font-weight: 600;
}

/* Image Gallery Section */
.image-gallery h3 {
  text-align: center;
  margin-bottom: var(--space-lg);
}

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

.gallery-item {
  text-align: center;
  max-width: 100%;
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: var(--space-xs);
}

.gallery-item p, .gallery-caption {
  font-size: 1rem; /* Smaller caption size */
  font-weight: 600; /* Enhanced caption visibility */
  margin-top: var(--space-xs);
  margin-bottom: 0;
}

/* About Page */
.about-content p {
  margin-bottom: var(--space-md);
}

.about-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem; /* Increased spacing between columns */
  margin-top: var(--space-lg);
}

.about-section {
  margin-bottom: var(--space-lg);
}

.about-section h3 {
  margin-bottom: 1rem; /* Consistent spacing */
  display: flex;
  align-items: center;
}

.about-section h3::before {
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

.about-section:nth-child(1) h3::before {
  content: '🎯'; /* Mission icon */
}

.about-section:nth-child(2) h3::before {
  content: '🔭'; /* Vision icon */
}

.about-section:nth-child(3) h3::before {
  content: '🌱'; /* Green initiatives icon */
}

/* Services Page */
.services-list {
  margin-top: var(--space-lg);
}

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

/* Contact Page */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.contact-info ul {
  list-style-type: none;
  margin-bottom: var(--space-md);
}

.contact-info ul li {
  margin-bottom: var(--space-xs);
}

.contact-form {
  text-align: left; /* Left-aligned form elements */
}

.form-group {
  margin-bottom: 1.5rem; /* Consistent spacing between form sections */
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
}

/* Map Section */
.location-map h3 {
  text-align: center;
  margin-bottom: var(--space-md);
}

.map-embed {
  height: 400px; /* Standardized height */
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: var(--space-sm) 0;
}
footer .container {
  display: flex;
  justify-content: space-between;
  padding: 1rem 5%; /* Reduced vertical and horizontal spacing */
  flex-wrap: wrap;
}
footer p {
  margin-bottom: var(--space-sm);
  color: #F8F9FA; /* WCAG AA compliant contrast */
}
footer nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
footer nav ul li a {
  color: #F8F9FA; /* WCAG AA compliant contrast */
  text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* Improved readability */
}

/* Social Media Icons */
.social-icons {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.social-icons a {
  color: #F8F9FA;
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--accent-color);
}

/* Responsive Design */
@media (min-width: 768px) {
  /* Services page - 2 column layout on desktop */
  .services-list .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
  
  /* Contact page - 2 column layout on desktop */
  .contact-layout {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block;
  }
  
  header nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
  }
  
  header nav ul.active {
    display: flex;
  }
  
  header nav ul li {
    margin: 0.5rem 0;
  }
  
  header .container {
    flex-direction: column;
  }
  
  .logo {
    margin-bottom: 1rem;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
  }
  
  footer .container {
    flex-direction: column;
    text-align: center;
  }
  
  footer nav ul {
    justify-content: center;
    margin-top: var(--space-md);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-item img {
    height: 160px;
  }
}

/* Accessibility Enhancements */
:focus {
  outline: 3px solid rgba(0, 128, 128, 0.4);
  outline-offset: 2px;
}

.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;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}
