/**
 * Ultimate Consistency Fix
 * Forces ALL pages to have consistent layout and styling
 */

/* ========================================
   FORCE NAVIGATION TO BE FIXED
   ======================================== */

/* Remove any conflicting rules */
.main-nav {
  position: static !important;
}

/* Then force fixed position with maximum specificity */
html body .main-nav,
html body nav.main-nav,
html body header .main-nav,
body .main-nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background: white !important;
  z-index: 99999 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  height: 70px !important;
  display: block !important;
}

/* Ensure body has proper padding */
body {
  padding-top: 70px !important;
  margin: 0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Ensure main content doesn't overlap */
main,
.main-content,
section:first-of-type {
  margin-top: 0 !important;
}

/* ========================================
   ADD HERO SECTIONS WHERE MISSING
   ======================================== */

/* Default page header for pages without hero */
.page-header,
.practice-hero,
.service-hero,
.location-hero,
.blog-hero,
.contact-hero,
.about-hero,
.case-studies-header,
.contact-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%) !important;
  color: white !important;
  padding: 60px 0 !important;
  margin-bottom: 40px !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Pattern overlay for hero sections */
.page-header::before,
.practice-hero::before,
.service-hero::before,
.location-hero::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat !important;
  opacity: 0.1 !important;
}

/* Ensure all hero text is white */
.page-header *,
.practice-hero *,
.service-hero *,
.location-hero *,
.blog-hero *,
.contact-hero *,
.about-hero *,
.case-studies-header *,
.contact-header * {
  color: white !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Specific about hero text fixes */
.about-hero h1,
.about-hero .title,
.about-hero .lead,
.about-hero p {
  color: white !important;
}

.page-header h1,
.practice-hero h1,
.service-hero h1,
.location-hero h1,
.blog-hero h1,
.contact-hero h1 {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 20px !important;
  color: white !important;
}

@media (min-width: 768px) {
  .page-header h1,
  .practice-hero h1,
  .service-hero h1,
  .location-hero h1,
  .blog-hero h1,
  .contact-hero h1 {
    font-size: 3rem !important;
  }
}

/* ========================================
   CONSISTENT CONTAINER WIDTH
   ======================================== */

.container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

@media (min-width: 768px) {
  .container {
    padding: 0 40px !important;
  }
}

/* ========================================
   CONSISTENT SECTION SPACING
   ======================================== */

section {
  padding: 60px 0 !important;
}

section:nth-child(even) {
  background: #f9fafb !important;
}

/* ========================================
   CONSISTENT TYPOGRAPHY
   ======================================== */

h1 {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: #1e3a8a !important;
  margin-bottom: 20px !important;
}

h2 {
  font-size: 2rem !important;
  font-weight: 700 !important;
  color: #1e3a8a !important;
  margin-bottom: 20px !important;
}

h3 {
  font-size: 1.5rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
  margin-bottom: 15px !important;
}

p {
  color: #4b5563 !important;
  line-height: 1.8 !important;
  margin-bottom: 20px !important;
}

/* White text in hero sections */
.hero h1,
.hero h2,
.hero h3,
.hero p,
.page-header h1,
.page-header h2,
.page-header h3,
.page-header p,
.practice-hero h1,
.practice-hero h2,
.practice-hero h3,
.practice-hero p,
.service-hero h1,
.service-hero h2,
.service-hero h3,
.service-hero p {
  color: white !important;
}

/* ========================================
   CONSISTENT BUTTONS
   ======================================== */

.btn {
  display: inline-block !important;
  padding: 12px 28px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  border: none !important;
  font-size: 1rem !important;
}

.btn-primary {
  background: #1e3a8a !important;
  color: white !important;
}

.btn-primary:hover {
  background: #1e40af !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3) !important;
  color: white !important;
}

/* In hero sections, primary button is white */
.hero .btn-primary,
.page-header .btn-primary,
.practice-hero .btn-primary,
.service-hero .btn-primary {
  background: white !important;
  color: #1e3a8a !important;
}

.hero .btn-primary:hover,
.page-header .btn-primary:hover,
.practice-hero .btn-primary:hover,
.service-hero .btn-primary:hover {
  background: #f3f4f6 !important;
  color: #1e40af !important;
}

.btn-secondary {
  background: transparent !important;
  color: #1e3a8a !important;
  border: 2px solid #1e3a8a !important;
}

.btn-secondary:hover {
  background: #1e3a8a !important;
  color: white !important;
}

/* In hero sections */
.hero .btn-secondary,
.page-header .btn-secondary,
.practice-hero .btn-secondary,
.service-hero .btn-secondary {
  color: white !important;
  border-color: white !important;
}

.hero .btn-secondary:hover,
.page-header .btn-secondary:hover,
.practice-hero .btn-secondary:hover,
.service-hero .btn-secondary:hover {
  background: white !important;
  color: #1e3a8a !important;
}

/* ========================================
   CONSISTENT FOOTER
   ======================================== */

footer,
.main-footer,
.site-footer {
  background: #1f2937 !important;
  color: #9ca3af !important;
  padding: 60px 0 30px !important;
  margin-top: 0 !important;
}

footer a,
.main-footer a,
.site-footer a {
  color: #d1d5db !important;
  text-decoration: none !important;
}

footer a:hover,
.main-footer a:hover,
.site-footer a:hover {
  color: white !important;
}

/* ========================================
   CTA SECTIONS
   ======================================== */

.cta-section,
.service-cta,
.practice-cta,
.services-cta {
  background: linear-gradient(135deg, #1e3a8a, #3730a3) !important;
  color: white !important;
  padding: 80px 0 !important;
  text-align: center !important;
  margin-top: 60px !important;
}

.cta-section h2,
.service-cta h2,
.practice-cta h2,
.services-cta h2 {
  color: white !important;
  font-size: 2.5rem !important;
  margin-bottom: 20px !important;
}

.cta-section p,
.service-cta p,
.practice-cta p,
.services-cta p {
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 1.25rem !important;
  margin-bottom: 30px !important;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .main-nav {
    height: 60px !important;
  }
  
  body {
    padding-top: 60px !important;
  }
  
  .page-header,
  .practice-hero,
  .service-hero,
  .location-hero {
    padding: 40px 0 !important;
  }
  
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  section {
    padding: 40px 0 !important;
  }
}