/* Global Variables */
:root {
  --primary-dark: #000e17;
  --primary-medium: #00385c;
  --primary-light: #004776;
  --primary-lighter: #005a94;
  --primary-highlight: #0072bc;
  --text-light: #d4e6f2;
  --text-medium: #b4d1e8;
  --text-bright: #7db9dc;
  --container-width: 1100px;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  --nav-height: 52px;
  --section-padding: 20px 20px 40px; /* Reduced bottom padding from 60px to 45px (top, left/right, bottom) */
  --service-cards-spacing: 30px; /* New variable for service cards spacing */
  
  /* Hero section dimensions */
  --hero-padding-top: 5px; /* Reset to positive value */
  --hero-padding-sides: 10px;
  --hero-padding-bottom: 25px; /* Reduced from 40px to 20px */
  --hero-min-height: 320px;
  --hero-about-min-height: 230px; /* Further reduced for about page */
  --hero-svg-container-min-height: 200px; /* Slightly reduced */
  --hero-svg-margin-top: -20px; /* New variable to control SVG positioning */
  --hero-text-offset: -135px; /* Negative value pulls text up to overlap with logo; increase for more overlap, decrease for less */
}

/* Reset and Base Styles */
body, h1, h2, h3, p {
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-bright);
  background-color: black;
  overflow-y: scroll;
}

/* Page Layout */
.page-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-bright);
  font-weight: bold;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; margin-bottom: 20px; margin-top: 0; } /* Reduced top margin */
h3 { font-size: 1.5em; }
h4 { font-size: 1.2em; color: var(--text-bright); margin-bottom: 8px; }

p { margin-bottom: 15px; }

a {
  color: var(--text-medium);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-highlight);
}

ul { margin: 15px 0; padding-left: 20px; }
li { margin-bottom: 8px; }

/* Layout Components */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px;
}

section {
  padding: var(--section-padding);
}

/* Navigation */
.nav-bar {
  background-color: var(--primary-dark);
  padding: 15px 0;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  box-sizing: border-box;
}

.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: flex-start;
}

.nav-link {
  color: var(--text-medium);
  margin-right: 20px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

.nav-link:hover {
  background-color: var(--primary-medium);
  color: white;
}

.nav-link.active {
  background-color: var(--primary-light);
  color: white;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to left, var(--primary-medium), var(--primary-dark));
  color: white;
  padding: var(--hero-padding-top) var(--hero-padding-sides) var(--hero-padding-bottom);
  position: relative;
  overflow: visible;
  min-height: var(--hero-min-height);
}

.hero .svg-container {
  max-width: 500px;
  width: 100%;
  margin-bottom: 0;
  margin-top: var(--hero-svg-margin-top); /* Apply the new variable here */
  z-index: 1;
  text-align: center;
  display: flex;
  justify-content: center;
  min-height: var(--hero-svg-container-min-height);
  padding-left: 40px;
  padding-right: 40px;
  overflow: visible;
}

.hero .svg-container img,
.hero .svg-container object {
  width: 100%;
  height: auto;
}

.hero-text {
  text-align: center;
  margin-top: var(--hero-text-offset);
  padding-top: 0;
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 800px;
}

.hero-text h1 {
  margin: 0;
  line-height: 1.1;
}

.hero-text p {
  font-size: 1.1em;
  margin: 5px 0;
  line-height: 1.3;
}

.hero-text .cta-button {
  margin-top: 15px;
  display: inline-block;
}

/* Hero Section Variations */
.about-hero {
  min-height: var(--hero-about-min-height);
  padding-bottom: 20px;
}

.contact-hero, .home-hero {
  background: linear-gradient(to left, var(--primary-medium), var(--primary-dark));
  min-height: var(--hero-min-height);
}

/* Buttons */
.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--primary-lighter);
  color: white;
  font-weight: bold;
  border-radius: var(--border-radius);
  transition: background-color 0.3s;
}

.cta-button:hover {
  background-color: var(--primary-medium);
  color: white;
}

.cta-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

/* Section Variations */
.about-section {
  background-color: var(--primary-dark);
  padding: var(--section-padding);
}

.team-section {
  background-color: #00293e;
  padding: var(--section-padding);
}

.services {
  background-color: var(--primary-dark);
  padding: var(--section-padding);
}

.detail {
  background-color: #00293e;
}

.contact {
  background: linear-gradient(to right, var(--primary-light), var(--primary-highlight));
  color: white;
  padding: var(--section-padding);
  text-align: center;
}

/* Cards and Grids */
.service-cards {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: var(--service-cards-spacing); /* Added top spacing */
  margin-bottom: var(--service-cards-spacing); /* Added bottom spacing */
}

.service-card {
  flex: 1;
  background-color: var(--primary-light);
  padding: 20px;
  border-radius: var(--border-radius);
  color: white;
  box-shadow: var(--box-shadow);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  background-color: var(--primary-lighter);
}

.service-card.active {
  background-color: var(--primary-highlight);
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid var(--text-medium);
}

.service-card h3 {
  color: var(--text-medium);
  margin-bottom: 10px;
}

.service-card p {
  color: var(--text-light);
}

/* Details Layout */
.detail-layout {
  display: flex;
  gap: 25px;
  align-items: flex-start;
  margin-top: 30px;
}

.detail-text {
  flex: 3;
  text-align: left;
}

.detail-image {
  flex: 2;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: -60px;
  background-color: rgba(0, 41, 62, 0.1);
  border-radius: var(--border-radius);
}

/* Loading indicator for carousel */
.detail-image::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 41, 62, 0.2);
  border-top-color: var(--primary-highlight);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.detail-image.loading::before {
  opacity: 1;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.detail-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: opacity 0.5s ease-in-out;
  object-fit: contain;
  object-position: top;
}

/* Adjust heading spacing for alignment */
#details-title {
  margin-bottom: 30px;
}

/* About Page Specific */
.about-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  max-width: var(--container-width);
  margin: -20px auto 0; /* Negative top margin to pull content up */
}

.about-content {
  flex: 2;
  text-align: left;
}

.about-image {
  flex: 1;
  text-align: center;
}

.about-image img {
  max-width: 100%;
  width: 80%; /* From inline style in about.html */
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.about-image p {
  text-align: left;
  margin-top: 25px;
  padding-left: 10px;
}

/* Certification Logos */
.certification-logos {
  margin-top: 30px;
  text-align: left;
  padding-left: 10px;
}

.certification-logos h4 {
  margin-bottom: 15px;
  color: var(--text-bright);
}

.certification-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.certification-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  margin-bottom: 15px;
}

.certification-logo img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: contain;
  background-color: transparent;
  padding: 8px;
  margin-bottom: 8px;
  transition: transform 0.2s ease-in-out;
}

.certification-logo:hover img {
  transform: scale(1.1);
}

.certification-logo span {
  font-size: 0.8rem;
  color: var(--text-medium);
  text-align: center;
}

/* Team Section */
.team-content {
  max-width: var(--container-width);
  margin: -10px auto 0; /* Negative top margin to pull up */
  text-align: left;
}

.expertise-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 30px;
}

.expertise-tag {
  background-color: var(--primary-light);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.9em;
  color: var(--text-light);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  user-select: none;
  text-decoration: none;
  display: inline-block;
}

.expertise-tag:hover {
  background-color: var(--primary-highlight);
  transform: scale(1.05);
  color: white;
  text-decoration: none;
}

.expertise-tag:active {
  transform: scale(0.98);
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 30px 0;
  scroll-margin-top: 80px;
}

.expertise-item {
  background-color: rgba(0, 71, 118, 0.3);
  padding: 20px;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-highlight);
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
  scroll-margin-top: 100px;
}

.expertise-item h4 {
  margin-bottom: 10px;
}

.expertise-item p {
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--text-light);
}

/* Highlight animation for expertise items */
@keyframes highlight-pulse {
  0% { 
    background-color: rgba(0, 71, 118, 0.3);
    transform: scale(1);
  }
  20% { 
    background-color: rgba(0, 114, 188, 0.4);
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  100% { 
    background-color: rgba(0, 71, 118, 0.3);
    transform: scale(1); 
    box-shadow: none;
  }
}

.expertise-highlight {
  animation: highlight-pulse 2s ease-out;
  border-left: 4px solid #fff;
  background-color: var(--primary-highlight) !important;
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease-out;
}

.team-images {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.team-image {
  flex: 1;
  min-width: 280px;
  max-width: 500px;
  margin-bottom: 20px;
}

.team-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 20px;
}

.footer p {
  margin: 0;
  font-size: 0.9em;
}

/* Utilities */
.hidden { display: none; }
html { scroll-behavior: smooth; }

/* Carousel Styles */
.carousel-controls {
  width: 98%;
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 5px;
  z-index: 10;
  background: linear-gradient(to top, rgba(0, 41, 62, 0.8) 0%, rgba(0,0,0,0) 100%);
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.carousel-prev,
.carousel-next {
  background-color: rgba(0, 72, 118, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: rgba(0, 114, 188, 0.9);
}

.carousel-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 11;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.carousel-dot.active {
  background-color: white;
  transform: scale(1.2);
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* Carousel image styles */
.carousel-img {
  width: 100%;
  height: 400px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  object-fit: contain;
  object-position: top;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.7s ease-in-out;
  pointer-events: none;
}

.carousel-img.active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

/* Keep existing image styles for backwards compatibility */
#details-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  object-fit: contain;
  object-position: top;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

#details-image.fading {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* Contact Form Styles */
.contact-form {
  width: 100%;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-bright);
  font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 85%;
  padding: 12px;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--primary-medium);
  color: var(--primary-dark);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--border-radius);
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--primary-medium);
  color: var(--primary-dark);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-highlight);
  box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.3);
}

.form-group textarea {
  min-height: 150px;
}

/* Additional form styles moved from inline styles */
.form-group-submit {
  margin-top: 25px;
}

#formStatus {
  margin-top: 20px; 
  padding: 15px; 
  border-radius: var(--border-radius); 
  display: none;
}

.g-recaptcha {
  margin-top: 10px;
}

.contact-info-box {
  background-color: var(--primary-medium);
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  height: 100%;
}

.contact-info-box h3 {
  margin-bottom: 20px;
  color: var(--text-bright);
}

.contact-info-box p {
  margin-bottom: 15px;
  line-height: 1.5;
}

/* Remove duplicate layout classes */
.contact-layout,
.contact-form-container,
.contact-info-container { 
  display: none; 
}

/* Admin panel styles */
.filter-link-active {
  font-weight: bold;
}

.text-center {
  text-align: center;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
  /* Navigation */
  .nav-container {
    justify-content: center;
  }
  
  /* Hero */
  .hero-text h1 {
    font-size: 2em;
  }
  
  .hero-text p {
    font-size: 1em;
  }

  /* Service Cards */
  .service-cards {
    flex-direction: column;
    gap: 15px;
  }

  .service-card {
    padding: 15px;
    margin-bottom: 15px; /* Added spacing between cards */
  }
  
  .service-card h3 {
    font-size: 1.3em; /* Slightly smaller heading */
    margin-bottom: 8px;
  }
  
  .service-card h4 {
    font-size: 1.1em;
  }
  
  .service-card p {
    font-size: 0.95em;
    line-height: 1.4;
  }
  
  /* Layout Changes */
  .detail-layout,
  .about-layout {
    flex-direction: column;
  }
  
  .detail-image,
  .about-image {
    order: -1;
    margin-bottom: 20px;
    margin-top: 0; /* Reset negative margin on mobile */
    height: 300px; /* Smaller fixed height on mobile */
  }
  
  /* Team Section */
  .team-images {
    flex-direction: column;
    align-items: center;
  }
  
  .team-image {
    max-width: 100%;
  }
  
  .expertise-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .detail-text,
  .detail-image {
    flex: none;
    width: 100%;
  }
  
  .contact-info-box {
    margin-left: 0;
  }

  /* MOBILE IMPROVEMENTS - HERO SECTION */
  :root {
    --hero-text-offset: -90px; /* Less overlap between logo and text */
  }

  .hero .svg-container {
    min-height: 170px; /* Smaller container height */
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero .svg-container img.animated-logo {
    width: 75%; /* Slightly smaller logo */
  }
  
  .hero-text {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Principles list adjustments */
  .principles-list {
    margin: 15px 0;
  }
  
  .principles-list li {
    padding: 15px 15px 15px 55px; /* Adjusted padding */
    line-height: 1.4;
  }
  
  .principles-list li b {
    font-size: 1.05em;
    margin-bottom: 4px;
  }
  
  /* Don't apply hover transform effects on mobile */
  .principles-list li:hover {
    transform: none;
  }
  
  .service-card:hover {
    transform: none;
  }
  
  .client-sector:hover {
    transform: none;
  }
  
  .client-grid span:hover {
    transform: none;
  }

  /* Detail section improvements */
  #details-title {
    font-size: 1.8em;
    margin-bottom: 15px;
    text-align: center;
  }
  
  .detail-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .detail-text,
  .detail-image {
    flex: none;
    width: 100%;
  }
  
  .detail-text p {
    font-size: 0.95em;
    line-height: 1.5;
  }
  
  .detail-text ul {
    padding-left: 15px;
  }
  
  .detail-text li {
    margin-bottom: 6px;
    font-size: 0.95em;
  }
  
  #details-image {
    object-fit: contain;
    max-height: 280px;
  }
  
  /* Carousel controls - make them more touch-friendly */
  .carousel-controls {
    padding: 10px 0;
  }
  
  .carousel-prev, 
  .carousel-next {
    width: 40px;
    height: 40px;
    font-size: 1.2em;
  }
  
  .carousel-dot {
    width: 12px;
    height: 12px;
    margin: 0 6px;
  }
}

/* Extra small devices - phones */
@media only screen and (max-width: 480px) {
  :root {
    --hero-text-offset: -65px; /* Even less overlap for very small screens */
  }
  
  .hero .svg-container {
    min-height: 140px;
  }
  
  .hero .svg-container img.animated-logo {
    width: 70%;
  }
  
  .hero-text h1 {
    font-size: 1.8em; /* Smaller heading */
  }
  
  .hero-text p {
    font-size: 0.9em; /* Smaller paragraph text */
    line-height: 1.4;
  }
  
  /* Navbar adjustments */
  .nav-container {
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 10px;
  }
  
  .nav-link {
    margin-right: 10px;
    padding: 4px 8px;
    font-size: 0.9em;
  }
  
  /* Adjust section padding */
  section {
    padding: 15px 15px 30px;
  }
  
  /* Better spacing for principles list on tiny screens */
  .principles-list li {
    padding: 12px 12px 12px 50px;
    margin-bottom: 10px;
  }
  
  .principles-list li::before {
    left: 15px;
  }
  
  .principles-list li b {
    font-size: 1em;
  }

  /* Service card adjustments for very small screens */
  .service-card {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .service-card h3 {
    font-size: 1.2em;
    margin-bottom: 6px;
  }
  
  .service-card h4 {
    font-size: 1em;
    margin-bottom: 6px;
  }
  
  .service-card p {
    font-size: 0.9em;
    margin-bottom: 10px;
  }

  /* Image container for smaller screens */
  .detail-image, 
  .about-image {
    height: 250px; /* Even smaller height on phones */
  }
  
  #details-image {
    max-height: 230px;
  }
  
  #details-title {
    font-size: 1.6em;
  }
  
  .detail-text p,
  .detail-text li {
    font-size: 0.9em;
  }
  
  /* Smaller touch targets but still accessible */
  .carousel-prev, 
  .carousel-next {
    width: 36px;
    height: 36px;
  }
  
  .carousel-dot {
    width: 10px;
    height: 10px;
    margin: 0 5px;
  }

  /* Advanced mobile optimizations for iPhone */
  /* Container adjustments */
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  /* Make text more readable */
  h2 {
    font-size: 1.7em;
    margin-bottom: 15px;
    line-height: 1.2;
  }
  
  h3 {
    font-size: 1.3em;
    line-height: 1.3;
  }
  
  p {
    line-height: 1.5;
  }
  
  /* Ensure buttons are touch-friendly */
  .cta-button {
    padding: 12px 20px;
    font-size: 1em;
    min-height: 44px; /* Minimum touch target size */
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Fix specific issues from the screenshot */
  .hero {
    min-height: var(--hero-min-height); /* Maintain minimum height */
    overflow: hidden; /* Prevent content overflow */
    padding-bottom: 20px;
  }
  
  /* Optimizations for principles list on iPhone */
  .principles-list li {
    padding: 12px 12px 12px 45px; /* Further reduce padding */
    word-break: break-word; /* Prevent text overflow */
  }
  
  .principles-list li::before {
    left: 12px;
    width: 22px;
    height: 22px;
    font-size: 1.2em;
  }
  
  /* Extra small screens - iPhone SE size */
  @media only screen and (max-width: 380px) {
    :root {
      --hero-text-offset: -55px; /* Minimum overlap for tiny screens */
    }
    
    .hero .svg-container {
      min-height: 130px;
    }
    
    .hero .svg-container img.animated-logo {
      width: 65%;
    }
    
    .hero-text h1 {
      font-size: 1.6em;
    }
    
    .nav-link {
      margin-right: 6px;
      padding: 3px 7px;
      font-size: 0.85em;
    }
  }
}

/* iPhone landscape optimization */
@media only screen and (max-width: 850px) and (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 230px; /* Shorter hero section in landscape */
  }
  
  .hero .svg-container {
    min-height: 120px;
  }
  
  .hero-text {
    margin-top: -75px;
  }
  
  .hero-text h1 {
    font-size: 1.7em;
  }
  
  /* Adjust nav for landscape */
  .nav-container {
    justify-content: flex-start;
  }
}

/* reCAPTCHA Styling */
.grecaptcha-badge {
  visibility: visible !important; /* Always show the badge */
  opacity: 1 !important;
  z-index: 100;
  bottom: 80px !important; /* Move it higher up from the bottom */
  right: 5px !important; /* Keep it on the right side */
}

/* Show the badge on contact page hover - Not needed anymore since always visible */
.contact-form:hover .grecaptcha-badge {
  visibility: visible;
}

/* reCAPTCHA legal notice */
.recaptcha-legal {
  font-size: 0.75rem;
  color: var(--text-bright);
  opacity: 0.85;
  margin-top: 15px;
  margin-bottom: 15px;
  text-align: center;
  padding: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.recaptcha-legal a {
  color: var(--accent-color);
  text-decoration: underline;
}

.recaptcha-legal a:hover {
  color: var(--accent-color-hover);
}

/* Client sections */
.clients {
  padding: 40px 0;
  background-color: var(--primary-dark);
}

.client-sectors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.client-sector {
  background: linear-gradient(145deg, #003152, #004776);
  border-radius: var(--border-radius);
  padding: 20px 15px;
  transition: all 0.3s ease;
  box-shadow: var(--box-shadow);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.client-sector:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  background: linear-gradient(145deg, #004776, #005a94);
}

.client-sector h3 {
  color: var(--text-bright);
  margin-bottom: 16px;
  font-size: 1.2em;
  padding-bottom: 8px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  height: 42px; /* Fixed height for all headers */
}

.client-sector h3::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50px;
  height: 2px;
  background-color: var(--primary-highlight);
}

.sector-icon {
  margin-right: 10px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-highlight);
  border-radius: 50%;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex-grow: 1;
}

.client-grid span {
  background-color: rgba(0, 60, 100, 0.4);
  padding: 6px 5px;
  border-radius: var(--border-radius);
  color: var(--text-medium);
  font-size: 0.8em;
  text-align: center;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}

.client-grid span:hover {
  background-color: var(--primary-highlight);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

@media only screen and (max-width: 768px) {
  .client-sectors {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .client-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .client-grid span {
    font-size: 0.78em;
    padding: 6px 5px;
  }
}

.clients .container {
  padding-left: 10px;
  padding-right: 10px;
  max-width: calc(var(--container-width) + 20px);
}

/* Guiding Principles Styling */
.principles-list {
  margin: 20px 0;
  list-style: none;
  padding-left: 0;
}

.principles-list li {
  position: relative;
  background: linear-gradient(to right, rgba(0, 72, 118, 0.3), rgba(0, 72, 118, 0.1));
  margin-bottom: 15px;
  padding: 15px 15px 15px 60px;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-highlight);
  transition: transform 0.2s ease, background 0.3s ease;
}

.principles-list li:hover {
  transform: translateX(5px);
  background: linear-gradient(to right, rgba(0, 114, 188, 0.3), rgba(0, 114, 188, 0.1));
}

.principles-list li b {
  color: var(--text-bright);
  font-size: 1.1em;
  display: block;
  margin-bottom: 5px;
}

.principles-list li::before {
  content: "✓";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-highlight);
  font-weight: bold;
  font-size: 1.4em;
  background: rgba(0, 114, 188, 0.2);
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.hero .svg-container img.animated-logo {
  overflow: visible;
  max-width: none;
  width: 90%;  /* Slightly smaller to give more room */
}

/* Service Detail Sections */
#service-details-sections {
  display: none; /* Keep container hidden but ensure it's available to JS */
}

.service-detail-section {
  display: block; /* Change to block so content can be accessed by JS */
  visibility: hidden; /* Use visibility instead of display to keep layout intact */
  position: absolute; /* Take it out of flow */
  left: -9999px; /* Position off-screen */
}

/* Make sure embedded images have correct paths when displayed in the carousel */
.carousel-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  object-fit: contain;
  max-height: 100%;
}

.carousel-img.active {
  opacity: 1;
  z-index: 2;
}


