/* ====================================================================
   MODERN DOLOOP DIGITAL STYLESHEET
   Improved version with modern CSS practices
   ==================================================================== */

/* ====================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ==================================================================== */
:root {
  /* Colors */
  --color-primary: #000;
  --color-primary-light: #5d4489;
  --color-primary-dark: #2f1f4f;
  --color-secondary: #f8c954;
  --color-accent: #f69b23;
  --color-accent-2: #fad02c;
  
  /* Text Colors */
  --color-text: #1a1a1a;
  --color-text-light: #4a4a4a;
  --color-text-muted: #6a6a6a;
  --color-text-inverse: #ffffff;
  
  /* Background Colors */
  --color-bg: #ffffff;
  --color-bg-dark: #000;
  --color-bg-light: #f8f9fa;
  --color-bg-section: #fafbfc;
  
  /* Typography Scale */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-display: 'Montserrat', 'League Spartan', sans-serif;
  
  /* Fluid Typography */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --font-size-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --font-size-3xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --font-size-4xl: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
  --font-size-5xl: clamp(3rem, 2.5rem + 2.5vw, 6rem);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  
  /* Layout */
  --container-max-width: 1200px;
  --container-padding: var(--space-lg);
  --section-padding: var(--space-4xl);
  
  /* Borders & Radius */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Z-index scale */
  --z-dropdown: 1000;
  --z-modal: 1050;
  --z-overlay: 1100;
}

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

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

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

/* ====================================================================
   TYPOGRAPHY
   ==================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat", var(--font-family-display);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

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

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

strong {
  font-weight: 600;
}

/* ====================================================================
   LAYOUT UTILITIES
   ==================================================================== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

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

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

.section-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
  color: var(--color-text-inverse);
}

/* ====================================================================
   CONTENT GRID SYSTEM
   ==================================================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 300px;
  }
  
  .content-grid-reverse {
    grid-template-columns: 300px 1fr;
  }
  
  .content-grid-reverse .content-image {
    order: 1;
  }
  
  .content-grid-reverse .content-text {
    order: 2;
  }
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-4xl);
  }
  
  .content-grid-reverse {
    grid-template-columns: 1fr 2fr;
  }
}

/* ====================================================================
   ACCESSIBILITY
   ==================================================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* ====================================================================
   NAVIGATION
   ==================================================================== */
.main-header {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: var(--z-dropdown);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar {
  padding: 0.75rem 0;
}

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

.logo img {
  max-height: 40px;
  width: auto;
}

.navbar-nav {
  display: none;
  list-style: none;
  gap: var(--space-xl);
  margin: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .navbar-nav {
    display: flex;
  }
}

.nav-link {
  color: var(--color-text);
  text-decoration: none;
  font-family: "Montserrat", var(--font-family-primary);
  font-weight: 600;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  z-index: var(--z-dropdown);
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition-fast);
  border-radius: 2px;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu overlay */
@media (max-width: 767px) {
  .navbar-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    z-index: calc(var(--z-dropdown) - 1);
  }
  
  .navbar-menu.is-active {
    transform: translateX(0);
  }
  
  .navbar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    text-align: center;
  }
  
  .nav-link {
    font-size: var(--font-size-xl);
    font-weight: 600;
  }
}

/* ====================================================================
   HERO SECTION - Exact Copy of Original CSS Classes
   ==================================================================== */

/* Banner content margins with modern touch */
.mil-banner-content {
  margin-top: 100px;
  margin-bottom: 100px;
  position: relative;
  min-height: 700px; /* Ensure space for all elements */
  overflow: visible;
}

/* Container for positioned elements */
.col-xl-12.col-sm-12 {
  position: relative;
  min-height: 600px;
}

.mil-banner-content::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(67, 45, 112, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 4s ease-in-out infinite;
}

/* Hero images with modern effects */
.hero-logo {
  width: 80%;
  max-width: 600px;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.1));
  animation: float 6s ease-in-out infinite;
  position: relative;
  z-index: 1; /* Behind text elements which have z-index: 10 */
}

.hero-logo2 {
  width: 15%;
  opacity: 0;
  animation: fadeInDown 1s ease-out 0.2s forwards;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}

/* Modern animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.1;
    transform: translateX(-50%) scale(1.1);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bottom left text - subtitle */
.bottom-left {
  text-align: center;
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 90%;
  max-width: 700px;
}

/* Top left text - small logo */
.top-left {
  position: absolute;
  top: 10%; /* Moved up from 20% */
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
}

/* Bottom right text - button */
.bottom-right {
  position: absolute;
  top: 88%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* Centered text - main title */
.centered {
  width: 100%;
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* Modern Button styling */
.btn-lrn {
  background: linear-gradient(135deg, #1a1a1a 0%, #432d70 100%);
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  font-weight: 700;
  font-family: "Montserrat", var(--font-family-primary);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeInUp 1s ease-out 1s forwards;
}

.btn-lrn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-lrn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(67, 45, 112, 0.4);
  background: linear-gradient(135deg, #432d70 0%, #5d4489 100%);
}

.btn-lrn:active {
  transform: translateY(-1px) scale(1.02);
}

/* Typography with Modern Effects */
.banner-head {
  font-size: 117px !important;
  font-family: "Montserrat", "League Spartan", var(--font-family-display);
  font-weight: 800 !important;
  line-height: 1;
  text-align: center;
  color: #1a1a1a;
  /* Removed gradient that was causing text cutoff */
  position: relative;
}

/* Removed ::after that was causing overlap issues */

.banner-head2 {
  font-size: 22px !important;
  font-family: "Montserrat", "Inter", var(--font-family-primary);
  font-weight: 600 !important;
  line-height: 2.5rem !important;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

/* Modern animations */
@keyframes textShimmer {
  0%, 100% {
    background-position: -200% center;
  }
  50% {
    background-position: 200% center;
  }
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0;
    transform: translateX(-100%);
  }
  50% {
    opacity: 1;
    transform: translateX(100%);
  }
}

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

/* Mobile responsive */
@media screen and (max-width: 768px) {
  .mil-banner-content {
    margin-top: 0px !important;
    margin-bottom: 100px;
  }
  
  .banner-head {
    font-size: 50px !important;
  }
}

/* ====================================================================
   SECTIONS
   ==================================================================== */
.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.1;
  font-family: "Montserrat", var(--font-family-display);
}

.section-lead {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-xl);
  font-weight: 600;
  font-family: "Montserrat", var(--font-family-primary);
}

.section-content {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
  font-family: "Montserrat", var(--font-family-primary);
}

.section-dark .section-content {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
}

.section-image {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Image Animation Effects */
.parallax-image {
  transform: translateY(0);
  transition: transform 0.8s ease-out;
}

.parallax-image:hover {
  transform: translateY(-10px);
}

.rotate-image {
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotate-image:hover {
  transform: rotate(2deg) scale(1.05);
}

.hover-scale {
  transition: transform 0.5s ease;
}

.hover-scale:hover {
  transform: scale(1.08);
}

.tilt-image {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.tilt-image:hover {
  transform: perspective(1000px) rotateY(5deg) rotateX(-5deg) scale(1.05);
}

/* Scroll animations */
[data-aos="fade-right"] {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s ease;
}

[data-aos="fade-left"] {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease;
}

.aos-animate [data-aos="fade-right"],
.aos-animate [data-aos="fade-left"] {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive Images */
.desktop-image {
  display: none;
}

.mobile-image {
  display: block;
}

@media (min-width: 768px) {
  .desktop-image {
    display: block;
  }
  
  .mobile-image {
    display: none;
  }
}

/* ====================================================================
   BUTTONS
   ==================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-base);
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  min-height: 48px; /* Touch target */
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  font-weight: 600;
}

.section-dark .btn-outline {
  color: var(--color-text-inverse);
  border-color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline:hover,
.btn-outline:focus {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 45, 112, 0.3);
}

.section-dark .btn-outline:hover {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.btn-large {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-lg);
}

/* ====================================================================
   CALL TO ACTION SECTION
   ==================================================================== */
.cta-section {
  padding: var(--space-5xl) 0;
  background: var(--color-bg-light);
  text-align: center;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.cta-main-image {
  max-width: 300px;
  margin-bottom: var(--space-xl);
}

.cta-title {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-light);
  margin-bottom: var(--space-2xl);
}

/* ====================================================================
   FOOTER
   ==================================================================== */
.main-footer {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2xl) 0;
  text-align: center;
  margin-top: var(--space-4xl);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  align-items: center;
}

.copyright {
  font-family: "Montserrat", var(--font-family-primary);
  font-weight: 500;
  margin: 0;
}

.privacy-notice {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: var(--space-lg);
  width: 100%;
  max-width: 600px;
}

.gdpr-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  font-size: var(--font-size-sm);
  opacity: 0.9;
  font-family: "Montserrat", var(--font-family-primary);
  line-height: 1.6;
}

.privacy-icon {
  flex-shrink: 0;
}

/* ====================================================================
   UTILITY CLASSES
   ==================================================================== */
.highlight-text {
  color: var(--color-secondary);
  font-weight: 600;
}

.accent-color {
  color: var(--color-accent);
}

.section-cta {
  margin-top: var(--space-xl);
}

/* ====================================================================
   INNER PAGES
   ==================================================================== */

/* Page Header */
.page-header {
  background: #000;
  padding: var(--space-5xl) 0 var(--space-3xl);
  color: var(--color-text-inverse);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

.page-header-content {
  position: relative;
  z-index: 2;
}

.page-title {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  margin-bottom: var(--space-md);
  font-family: "Montserrat", var(--font-family-display);
}

/* Breadcrumb */
.breadcrumb-nav {
  margin-top: var(--space-lg);
}

.breadcrumb {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item::after {
  content: '/';
  margin-left: var(--space-sm);
  opacity: 0.5;
}

.breadcrumb-item:last-child::after {
  display: none;
}

.breadcrumb-item a {
  color: var(--color-text-inverse);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.breadcrumb-item a:hover {
  opacity: 1;
}

.breadcrumb-item.active {
  opacity: 1;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

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

.stat-number {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--color-primary);
  font-family: "Montserrat", var(--font-family-display);
}

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

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
}

.service-card {
  background: var(--color-bg);
  padding: var(--space-2xl);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all var(--transition-base);
}

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

.service-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--space-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--color-text-inverse);
}

.service-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
  font-family: "Montserrat", var(--font-family-display);
}

.service-description {
  color: var(--color-text-light);
  line-height: 1.6;
}

/* Section variations */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-light);
  margin-top: var(--space-md);
}

.rounded-image {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}

.lead-text {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* Text alignment utilities */
.text-center {
  text-align: center;
}

/* ====================================================================
   RESPONSIVE DESIGN
   ==================================================================== */
@media (max-width: 767px) {
  :root {
    --container-padding: var(--space-md);
    --section-padding: var(--space-3xl);
  }
  
  .hero-section {
    padding: var(--space-4xl) 0;
    min-height: auto;
  }
  
  .content-grid {
    gap: var(--space-2xl);
  }
}

/* ====================================================================
   FOCUS STATES & ACCESSIBILITY
   ==================================================================== */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus {
  outline: 2px solid var(--color-secondary);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* ====================================================================
   BLOG STYLES
   ==================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.blog-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-image {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #f5f5f5;
}

.blog-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

.blog-card-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--color-accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.blog-author {
  font-weight: 500;
}

.blog-date {
  position: relative;
  padding-left: 1rem;
}

.blog-date::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: var(--color-text-light);
  border-radius: 50%;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
  color: var(--color-accent);
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-light);
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-read-more {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.blog-card:hover .blog-read-more {
  gap: 0.75rem;
}

/* Enhanced Footer Styles */
.main-footer {
  background: #432d70;
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-wave {
  display: none;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-brand img {
  height: 35px;
  width: auto;
  margin-bottom: 0.75rem;
  filter: brightness(0) invert(1);
}

.footer-tagline {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.footer-description {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.footer-links {
  display: contents;
}

.footer-column h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column ul li a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color 0.2s ease;
}

.footer-column ul li a:hover {
  color: var(--color-accent);
  padding-left: 5px;
}

.footer-contact {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

.btn-footer {
  background: var(--color-accent);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
  display: inline-block;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.btn-footer:hover {
  background: #f8c954;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(248, 201, 84, 0.3);
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  transition: all 0.3s ease;
  font-size: 16px;
}

.social-links a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.footer-bottom {
  padding-top: 2rem;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1rem;
}

.copyright {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: var(--color-accent);
}

.separator {
  color: rgba(255, 255, 255, 0.4);
}

.privacy-notice {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.gdpr-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.privacy-icon {
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ====================================================================
   RESPONSIVE DESIGN UPDATES
   ==================================================================== */
@media (max-width: 767px) {
  :root {
    --container-padding: var(--space-md);
    --section-padding: var(--space-3xl);
  }
  
  .hero-section {
    padding: var(--space-4xl) 0;
    min-height: auto;
  }
  
  .content-grid {
    gap: var(--space-2xl);
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-brand {
    margin-bottom: 2rem;
  }
  
  .footer-description {
    max-width: none;
    margin: 0 auto;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ====================================================================
   SIMPLE OVERRIDES FOR NAVBAR AND FOOTER
   ==================================================================== */
   
/* Fix navbar display */
@media (min-width: 768px) {
  .navbar-nav {
    display: flex !important;
    align-items: center;
  }
  
  .navbar-menu {
    display: flex !important;
  }
}

/* Simple footer override */
.main-footer {
  background: #000 !important;
  color: white !important;
  padding: 2rem 0 !important;
  text-align: center !important;
}

.footer-content {
  text-align: center !important;
}

.footer-simple,
.footer-contact,
.footer-tagline {
  margin: 0.5rem 0;
}

.footer-contact a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-contact a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-tagline {
  font-style: italic;
  opacity: 0.7;
  font-size: 0.875rem;
}

/* Hide complex footer elements */
.footer-top,
.footer-bottom,
.footer-wave,
.footer-links,
.footer-brand,
.footer-column,
.privacy-notice,
.footer-bottom-content {
  display: none !important;
}

/* ====================================================================
   SCROLL TO TOP BUTTON
   ==================================================================== */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-to-top:hover {
  background: var(--color-primary-light);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Section navigation dots */
.section-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

.section-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-nav li {
  margin: 15px 0;
}

.section-nav a {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(67, 45, 112, 0.3);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.section-nav a:hover,
.section-nav a.active {
  background: var(--color-primary);
  transform: scale(1.2);
}

@media (max-width: 1024px) {
  .section-nav {
    display: none;
  }
  
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* ====================================================================
   PRINT STYLES
   ==================================================================== */
@media print {
  .main-header,
  .mobile-menu-toggle,
  .btn {
    display: none;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .section {
    padding: 1rem 0;
  }
}

/* ====================================================================
   MOBILE RESPONSIVE FIXES
   ==================================================================== */
@media (max-width: 768px) {
  /* Hero Section Mobile */
  .hero-section {
    min-height: 80vh;
    padding: 20px;
  }
  
  .hero-content {
    padding: 0 15px;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.25rem);
    margin-top: 10px;
  }
  
  /* Navigation Mobile */
  .main-header {
    padding: 15px 0;
  }
  
  .navbar {
    padding: 0 15px;
  }
  
  .navbar-menu {
    position: fixed;
    top: 60px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 60px);
    background: white;
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .navbar-menu.active {
    left: 0;
  }
  
  .navbar-nav {
    flex-direction: column;
    padding: 20px;
  }
  
  .navbar-nav li {
    margin: 10px 0;
  }
  
  .nav-link {
    display: block;
    padding: 15px;
    font-size: 1.125rem;
    border-bottom: 1px solid #eee;
  }
  
  /* Mobile Menu Toggle */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
  }
  
  /* Content Sections Mobile */
  .section {
    padding: 60px 0;
  }
  
  .container {
    padding: 0 20px;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .content-grid-reverse {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    line-height: 1.2;
  }
  
  .section-lead {
    font-size: 1rem;
  }
  
  .section-image {
    max-height: 300px;
    width: 100%;
    object-fit: cover;
  }
  
  /* Cards Mobile */
  .service-grid,
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stat-card,
  .service-card,
  .blog-card {
    padding: 20px;
  }
  
  /* Footer Mobile */
  .main-footer {
    padding: 30px 0;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  /* Buttons Mobile */
  .btn {
    padding: 12px 24px;
    font-size: 0.875rem;
  }
  
  .section-cta {
    margin-top: 20px;
  }
  
  /* Hide desktop elements */
  .desktop-image {
    display: none;
  }
  
  .mobile-image {
    display: block;
  }
  
  /* Page Headers Mobile */
  .page-header {
    padding: 60px 0 40px;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  /* Forms Mobile */
  .contact-form input,
  .contact-form textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .hero-title {
    font-size: 1.75rem;
  }
  
  .hero-subtitle {
    font-size: 0.875rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .section {
    padding: 40px 0;
  }
  
  .stat-number {
    font-size: 2rem;
  }
}

/* Spacing overrides to fix excessive padding/margins */
/* This file should be loaded AFTER style.css and custom-style.css */

/* Global section spacing fixes */
.mil-p-60-60 { padding-top: 40px !important; padding-bottom: 40px !important; }
.mil-p-60-30 { padding-top: 40px !important; padding-bottom: 30px !important; }
.mil-p-90-60 { padding-top: 50px !important; padding-bottom: 40px !important; }
.mil-p-90-90 { padding-top: 50px !important; padding-bottom: 50px !important; }
.mil-p-90-120 { padding-top: 50px !important; padding-bottom: 60px !important; }
.mil-p-120-60 { padding-top: 60px !important; padding-bottom: 40px !important; }
.mil-p-120-90 { padding-top: 60px !important; padding-bottom: 50px !important; }
.mil-p-120-120 { padding-top: 60px !important; padding-bottom: 60px !important; }
.mil-p-120-0 { padding-top: 60px !important; }
.mil-p-0-60 { padding-bottom: 40px !important; }
.mil-p-0-90 { padding-bottom: 50px !important; }
.mil-p-0-120 { padding-bottom: 60px !important; }

/* Margin fixes */
.mil-mb-60 { margin-bottom: 40px !important; }
.mil-mb-90 { margin-bottom: 50px !important; }
.mil-mb-120 { margin-bottom: 60px !important; }
.mil-mt-60 { margin-top: 40px !important; }

/* Specific component fixes */
blockquote {
  padding: 30px !important;
}

.mil-bg {
  padding: 60px !important;
}

@media screen and (min-width: 993px) {
  .mil-bg {
    padding: 80px !important;
  }
}

/* Fix excessive header spacing */
.mil-page-banner {
  padding-top: 80px !important;
  padding-bottom: 60px !important;
}

.mil-banner {
  padding-top: 100px !important;
}

.mil-banner.mil-dark-2 {
  padding-top: 80px !important;
  padding-bottom: 40px !important;
}

/* Fix about section spacing */
.about-doloop {
  padding-top: 60px !important;
  padding-bottom: 60px !important;
}

.sec-decade {
  padding-bottom: 80px !important;
}

/* Fix blog and portfolio spacing */
.mil-blog-item {
  padding: 40px 0 !important;
}

.mil-portfolio-item {
  padding: 40px !important;
}

.mil-services-box {
  padding: 40px !important;
}

.mil-icon-box {
  padding: 40px 40px 0 !important;
}

.mil-icon-box.mil-long {
  padding-bottom: 40px !important;
}

/* Fix testimonial spacing */
.mil-testimonial {
  padding: 40px !important;
}

/* Fix pagination spacing */
.mil-pagination {
  margin-top: 50px !important;
}

/* Fix post spacing */
.mil-post-banner {
  padding-top: 100px !important;
  padding-bottom: 50px !important;
}

/* Mobile responsive fixes */
@media screen and (max-width: 992px) {
  .mil-p-60-60 { padding-top: 30px !important; padding-bottom: 30px !important; }
  .mil-p-60-30 { padding-top: 30px !important; padding-bottom: 20px !important; }
  .mil-p-90-60 { padding-top: 40px !important; padding-bottom: 30px !important; }
  .mil-p-90-90 { padding-top: 40px !important; padding-bottom: 40px !important; }
  .mil-p-90-120 { padding-top: 40px !important; padding-bottom: 50px !important; }
  .mil-p-120-60 { padding-top: 50px !important; padding-bottom: 30px !important; }
  .mil-p-120-90 { padding-top: 50px !important; padding-bottom: 40px !important; }
  .mil-p-120-120 { padding-top: 50px !important; padding-bottom: 50px !important; }
  .mil-p-120-0 { padding-top: 50px !important; }
  .mil-p-0-60 { padding-bottom: 30px !important; }
  .mil-p-0-90 { padding-bottom: 40px !important; }
  .mil-p-0-120 { padding-bottom: 50px !important; }
  
  .mil-mb-60 { margin-bottom: 30px !important; }
  .mil-mb-90 { margin-bottom: 40px !important; }
  .mil-mb-120 { margin-bottom: 50px !important; }
  .mil-mt-60 { margin-top: 30px !important; }
  
  .mil-page-banner {
    padding-top: 60px !important;
    padding-bottom: 40px !important;
  }
  
  .mil-banner {
    padding-top: 80px !important;
  }
  
  .about-doloop {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
  
  .sec-decade {
    padding-bottom: 60px !important;
  }
}

/* Fix extreme spacing values */
.mil-mt-100 { margin-top: 60px !important; }
.mil-mt-140 { margin-top: 70px !important; }
.mil-pt-140 { padding-top: 70px !important; }
.mil-pt-160 { padding-top: 80px !important; }
.mil-pt-190 { padding-top: 90px !important; }
.mil-pt-200 { padding-top: 100px !important; }
.mil-pt-220 { padding-top: 100px !important; }
.mil-pr-180 { padding-right: 90px !important; }

@media screen and (max-width: 992px) {
  .mil-mt-100 { margin-top: 50px !important; }
  .mil-mt-140 { margin-top: 60px !important; }
  .mil-pt-140 { padding-top: 60px !important; }
  .mil-pt-160 { padding-top: 70px !important; }
  .mil-pt-190 { padding-top: 80px !important; }
  .mil-pt-200 { padding-top: 80px !important; }
  .mil-pt-220 { padding-top: 80px !important; }
  .mil-pr-180 { padding-right: 30px !important; }
}

/* Fix custom style excessive spacing */
.service-section {
  padding-top: 60px !important;
}

.milestone-section {
  padding-top: 60px !important;
}

.blog-section {
  margin-top: 60px !important;
}

.portfolio-section {
  padding-bottom: 60px !important;
}

.cta-section {
  margin-top: 60px !important;
}

@media screen and (max-width: 992px) {
  .service-section,
  .milestone-section {
    padding-top: 40px !important;
  }
  
  .blog-section,
  .cta-section {
    margin-top: 40px !important;
  }
  
  .portfolio-section {
    padding-bottom: 40px !important;
  }
}

/* Urgent fixes for visibility and spacing issues */

/* Fix excessive line height */
p {
  line-height: 1.6 !important; /* Normal readable line height instead of 220-250% */
}

.mil-mb-23 {
  line-height: 1.6 !important;
}

/* Fix navigation visibility on dark backgrounds */
.mil-top-panel[style*="background: #4f4965"] .mil-navigation a,
.mil-top-panel[style*="background: #432d70"] .mil-navigation a,
.mil-top-panel[style*="background: #5d3e95"] .mil-navigation a {
  color: white !important;
}

/* Fix header.html navigation on dark backgrounds */
#header a {
  color: inherit;
}

.mil-top-panel[style*="background: #4"] #header a,
.mil-top-panel[style*="background: #5"] #header a,
.mil-top-panel[style*="background: #6"] #header a {
  color: white !important;
}

/* Fix logo on dark backgrounds */
.mil-top-panel[style*="background: #4"] .mil-logo,
.mil-top-panel[style*="background: #5"] .mil-logo,
.mil-top-panel[style*="background: #6"] .mil-logo {
  filter: brightness(0) invert(1);
}

/* Fix dark titles on dark backgrounds */
section[style*="background: #"] h1,
section[style*="background: #"] h2,
section[style*="background: #"] h3,
section[style*="background: #"] h4 {
  color: white !important;
}

/* Specific fix for "About Us" page title */
.mil-page-title h1,
.mil-banner-title h1,
.banner-title {
  color: white !important;
}

/* Fix dark background sections text color */
section[style*="background: #432d70"] p,
section[style*="background: #4f4965"] p,
section[style*="background: #5d3e95"] p,
.about-doloop[style*="background: #"] p {
  color: white !important;
}

/* Fix navigation menu colors for improved navbar */
.main-header .navbar {
  background-color: white;
}

/* Ensure navigation text is always visible */
.main-header .nav-link {
  color: #333 !important;
}

.main-header .navbar-nav a {
  color: #333 !important;
}

/* On dark backgrounds, override with white */
.main-header.dark-bg .navbar {
  background-color: transparent;
}

.main-header.dark-bg .nav-link,
.main-header.dark-bg .navbar-nav a {
  color: white !important;
}

.main-header.dark-bg .logo img {
  filter: brightness(0) invert(1);
}

/* Fix navigation on pages with inline dark backgrounds */
body:has(.mil-top-panel[style*="background: #4"]) .main-header .nav-link,
body:has(.mil-top-panel[style*="background: #5"]) .main-header .nav-link,
body:has(.mil-top-panel[style*="background: #6"]) .main-header .nav-link,
body:has(section[style*="background: #4"]:first-of-type) .main-header .nav-link,
body:has(section[style*="background: #5"]:first-of-type) .main-header .nav-link,
body:has(section[style*="background: #6"]:first-of-type) .main-header .nav-link {
  color: white !important;
}

/* Mobile menu button on dark backgrounds */
.mil-menu-btn span {
  background-color: currentColor;
}

.mil-top-panel[style*="background: #4"] .mil-menu-btn span,
.mil-top-panel[style*="background: #5"] .mil-menu-btn span,
.mil-top-panel[style*="background: #6"] .mil-menu-btn span {
  background-color: white !important;
}

/* Fix mobile menu toggle on dark backgrounds */
.main-header.dark-bg .mobile-menu-toggle .hamburger-line {
  background-color: white !important;
}

/* Additional fixes for about-us page */
.mil-dark-bg .mil-page-title h1,
.mil-dark-bg .mil-h1,
.mil-dark-bg h1 {
  color: white !important;
}

/* Fix black section text */
section.mil-dark-bg *,
section[style*="background: #000"] *,
.page-header *,
.page-header .page-title,
.page-header .breadcrumb,
.page-header .breadcrumb a {
  color: white !important;
}

/* Preserve link colors where needed */
a.mil-link,
a.mil-button {
  color: inherit !important;
}

/* Additional navigation fixes for timemachine.html and similar pages */
.navbar {
  background-color: white;
}

.navbar .nav-link,
.navbar a {
  color: #333 !important;
}

/* Fix mobile menu visibility */
.mobile-menu-toggle .hamburger-line {
  background-color: #333 !important;
}

/* On purple/dark backgrounds, ensure white text */
body[style*="background: #"] .navbar,
section[style*="background: #"] + .navbar,
.mil-wrapper:has(.mil-top-panel[style*="background: #"]) .navbar {
  background-color: transparent !important;
}

body[style*="background: #"] .navbar .nav-link,
body[style*="background: #"] .navbar a,
section[style*="background: #"] + .navbar .nav-link,
section[style*="background: #"] + .navbar a {
  color: white !important;
}

body[style*="background: #"] .mobile-menu-toggle .hamburger-line,
section[style*="background: #"] + .navbar .mobile-menu-toggle .hamburger-line {
  background-color: white !important;
}

/* Special fix for pages with gradient backgrounds like timemachine.html */
body {
  position: relative;
}

/* Ensure navbar has proper background on pages without explicit dark styling */
.main-header:not(.dark-bg) .navbar {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Fix for pages with custom purple/gradient backgrounds */
body:has(.hero):not(:has(.page-header)) .main-header .navbar,
body[class*="gradient"] .main-header .navbar,
body[style*="background: linear"] .main-header .navbar {
  background-color: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px);
}

body:has(.hero):not(:has(.page-header)) .main-header .nav-link,
body:has(.hero):not(:has(.page-header)) .main-header .navbar-nav a,
body[class*="gradient"] .main-header .nav-link,
body[class*="gradient"] .main-header .navbar-nav a,
body[style*="background: linear"] .main-header .nav-link,
body[style*="background: linear"] .main-header .navbar-nav a {
  color: #e2e8f0 !important;
}

body:has(.hero):not(:has(.page-header)) .main-header .logo img,
body[class*="gradient"] .main-header .logo img,
body[style*="background: linear"] .main-header .logo img {
  filter: brightness(0) invert(1) !important;
}

body:has(.hero):not(:has(.page-header)) .mobile-menu-toggle .hamburger-line,
body[class*="gradient"] .mobile-menu-toggle .hamburger-line,
body[style*="background: linear"] .mobile-menu-toggle .hamburger-line {
  background-color: #e2e8f0 !important;
}