/*==================================
  GLOBAL STYLES & VARIABLES
==================================*/
:root {
  --primary-color: #0F172A;   /* Midnight Navy */
  --secondary-color: #334155; /* Slate Gray */
  --accent-color: #0D9488;    /* Precision Teal */
  --dark-color: #1E293B;      /* Deep Charcoal */
  --light-color: #FFFFFF;
  --bg-light: #F8FAFC;       
  --font-family-sans: 'Inter', sans-serif;
  --font-family-serif: 'Montserrat', serif;
}

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

body {
  font-family: var(--font-family-sans);
  color: var(--dark-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Keeps footer at bottom of viewport */
}

main {
  flex: 1; /* Pushes footer down */
}

/* --- GLOBAL IMAGE FIX --- */
img {
  max-width: 100%;    
  height: auto;       
  display: block;     
  border-radius: 8px; 
}

/*==================================
  HEADER & NAVIGATION
==================================*/
.site-header {
  background: var(--light-color);
  padding: 0.75rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1250px; 
  width: 95%;
  margin: 0 auto;
}

.solvit-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;    
  align-items: flex-start; 
  line-height: 1;          
}

.solvit-logo span {
  font-size: 0.65em;       
  color: var(--accent-color);
  font-weight: 900;
  margin-left: 2px;
  vertical-align: baseline; 
  line-height: 1;
  position: relative;
  top: -1px;               
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem; 
  align-items: center;
  margin: 0;
}

.main-nav a {
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.has-dropdown { position: relative; }

.main-nav .dropdown {
  display: none; 
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--light-color);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  padding: 1rem 0;
  min-width: 240px;
  z-index: 1001;
  flex-direction: column;
  gap: 0;
  border-radius: 4px;
}

.has-dropdown:hover .dropdown { display: flex; }
.dropdown li { width: 100%; }
.dropdown a { padding: 0.6rem 1.2rem; display: block; font-size: 0.85rem; }
.dropdown a:hover { background-color: var(--bg-light); color: var(--accent-color); }
.main-nav a:hover, .main-nav .active a { color: var(--accent-color); }

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

/* --- Menu Toggle Fix --- */
.menu-toggle {
  display: none; /* Hidden on desktop */
  background: none;
  border: 1px solid #E2E8F0;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--primary-color);
}

/*==================================
  HERO & PAGE HEADER
==================================*/
.page-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  padding: 6rem 0;
  text-align: center;
  position: relative;
}

.page-header h1 {
  color: white !important;
  font-family: var(--font-family-serif);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
}

/* Fixed subtext visibility for darker headers */
.page-header p {
  color: rgba(255, 255, 255, 0.8) !important;
}

.page-header::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

/*==================================
  TRUST BAR
==================================*/
.trust-bar {
  background: white;
  padding: 3rem 0;
  border-bottom: 1px solid #E2E8F0;
}

.trust-label {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
}

.logo-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  font-weight: 800;
  color: #cbd5e1;
}

/*==================================
  CONTENT SECTIONS & STEP CARDS
==================================*/
.section { padding: 4rem 0; }
.section-bg { background-color: #F1F5F9; }
.container { width: 90%; max-width: 1100px; margin: 0 auto; }
.text-center { text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 3rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

/* Enhanced Step Cards for "What You Get" */
.step-card {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid #E2E8F0;
  transition: transform 0.3s ease;
  height: 100%;
}

.step-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.step-number {
  background: var(--bg-light);
  color: var(--accent-color);
  width: auto; /* Fixes wrapping */
  display: inline-flex;
  padding: 0.4rem 1rem;
  height: 32px;
  border-radius: 16px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  white-space: nowrap; /* Prevents Step 1: from splitting */
}

.service-card {
  background: white;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.experience-badge {
  background: var(--bg-light);
  padding: 2rem;
  border-left: 4px solid var(--accent-color);
}

.experience-badge ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  list-style: none;
  gap: 0.5rem;
  margin-top: 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}

/*==================================
  CONTACT FORM STYLES
==================================*/
.form-container {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid #E2E8F0;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.form-group input, 
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/*==================================
  FOOTER (REARRANGED & SLIMMED)
==================================*/
.site-footer {
  background: var(--primary-color);
  color: #cbd5e1;
  padding: 3rem 0 1.5rem; 
  margin-top: auto;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  align-items: start;
}

.site-footer h4 { 
  color: white; 
  margin-bottom: 1rem; 
  font-size: 1rem;
}

.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.5rem; }

.site-footer a { 
  color: #cbd5e1; 
  text-decoration: none; 
  font-size: 0.85rem; 
  transition: color 0.3s ease;
}

.site-footer a:hover { color: white; }

.footer-bottom { 
  border-top: 1px solid #1E293B; 
  margin-top: 2rem; 
  padding-top: 1.5rem; 
  text-align: center; 
  font-size: 0.75rem; 
}

/*==================================
  MOBILE RESPONSIVENESS
==================================*/
@media (max-width: 1024px) {
  .main-nav { display: none; } 
  .menu-toggle { display: block; } /* Shows only on mobile/tablet */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; } /* 2x2 on tablet */
}

@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; } /* Stacked on mobile */
}

/* Specifically target the hero/main image on the Insights page */
.insights-hero-img {
  max-width: 900px;    /* Constrains the width to a professional size */
  width: 100%;        /* Keeps it responsive for mobile */
  margin: 0 auto;     /* Centers the image */
  display: block;     /* Removes bottom spacing/inline issues */
  border-radius: 12px; /* Optional: matches your card-style branding */
}

@media (max-width: 1024px) {
  /* This ensures the menu stays hidden until clicked */
  .main-nav { 
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  }

  /* This is the class the JavaScript adds/removes */
  .main-nav.mobile-active { 
    display: block; 
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

/* --- BLOG GRID & CARD FIX --- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  margin-top: 2rem;
}

.post-card {
  background: var(--light-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
}

.post-image {
  width: 100%;
  height: 240px;      /* This is the fix for the giant images */
  object-fit: cover;  /* This prevents the images from stretching */
  display: block;
}

.post-card-content {
  padding: 1.5rem;
}

/* Ensure the grid stacks on mobile devices */
@media (max-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr !important; /* Forces 1 column */
    gap: 1.5rem;
  }
  
  .post-card {
    max-width: 100%;
  }
}

/*==================================
  BALANCED HOME GRID ALIGNMENT
==================================*/
.grid-2-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr); 
  gap: 2.5rem;
  align-items: stretch;
  max-width: 1000px; 
  margin: 0 auto;
}

.grid-2-column .service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

.grid-2-column .service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.grid-2-column .service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: #1a1a1a;
  line-height: 1.3;
}

.grid-2-column .service-card p {
  flex-grow: 1;
  color: #555;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.read-more {
  margin-top: auto;
  font-weight: 700;
  color: #007bff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Hide hamburger on desktop */
#hamburger-toggle { display: none; }

/* Mobile Logic (Screen narrower than 1024px to match your existing media queries) */
@media screen and (max-width: 1024px) {
    #hamburger-toggle { 
        display: block !important; 
    } 

    /* Ensure the nav wrapper can hold the mobile styles */
    .main-nav {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 1.5rem;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        z-index: 1100;
    }

    /* THE FIX: When JS toggles this class, the menu shows */
    .main-nav.mobile-active { 
        display: block !important; 
    }

    /* Force the list to stack vertically when the menu is open */
    .main-nav.mobile-active ul {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem;
        padding: 0;
    }

    /* Adjust the Audit button so it doesn't break the header layout */
    .btn-audit {
        font-size: 0.8rem !important;
        padding: 0.6rem 1.2rem !important;
        margin-right: 10px;
        white-space: nowrap;
    }
}

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