/* EngineeringXYZ website styles
   A modern, clean, responsive design matching the new brand colours. */

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

/* Colour palette derived from the new logo */
:root {
  --primary-color: #0a304e;       /* dark navy for headers and navigation */
  --secondary-color: #3f5e7b;     /* softer navy used for accents */
  --accent-color: #cba65a;        /* golden beige for buttons and highlights */
  --background-color: #f4f1e8;    /* light beige page background */
  --surface-color: #ffffff;       /* white for cards and panels */
  --text-color: #333333;          /* dark grey for body text */
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Restore the original padding so the header has more height */
  padding: 1rem 2rem;
  height: auto;
  /* Light header background to contrast with dark logo */
  background-color: var(--surface-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Subtle bottom border to separate the header from page content on a light background */
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-wrapper img {
  /* Increase the logo height so the word‑mark appears more prominent. The width
     will scale automatically since the SVG preserves its aspect ratio. */
  height: 56px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.main-nav a {
  /* Restore padding to provide vertical space around navigation links */
  padding: 0.5rem 0.75rem;
  /* Dark links on the light header */
  color: var(--primary-color);
  font-weight: bold;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--accent-color);
}

/* Navigation toggle button (hamburger icon) */
.nav-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: 0;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  color: var(--primary-color);
}

/* Language selector */
.language-select select {
  padding: 0.25rem;
  font-size: 0.9rem;
}

/* Header call‑to‑action button
   A prominent button in the header encouraging visitors to schedule a free consultation. */
.header-cta {
  margin-left: 1rem;
  background-color: var(--accent-color);
  color: var(--background-color);
  padding: 0.5rem 1rem;
  font-weight: bold;
  border-radius: 4px;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.header-cta:hover {
  background-color: var(--secondary-color);
}

/* On narrow screens stack the CTA below the navigation for better spacing */
@media (max-width: 600px) {
  .header-cta {
    margin-top: 0.5rem;
    margin-left: 0;
    display: block;
    text-align: center;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Hero section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 2rem;
  background-color: var(--background-color);
}

.hero-content {
  flex: 1 1 350px;
  max-width: 550px;
  margin-right: 1.5rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--background-color);
  padding: 0.75rem 1.25rem;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.cta-button:hover {
  background-color: var(--secondary-color);
}

.hero-image {
  flex: 1 1 300px;
  max-width: 500px;
  text-align: center;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Generic section styling */
section {
  padding: 3rem 2rem;
}

h1,
h2,
h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Apply same styling to generic service items and service cards */
.service-item,
.service-card {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.service-item img,
.service-card img {
  height: 120px;
  width: auto;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.services-more {
  margin-top: 1rem;
  text-align: right;
}

.more-link {
  color: var(--primary-color);
  font-weight: bold;
}

/* Portfolio preview (home page) */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.portfolio-item {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Testimonials preview (home page) */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.testimonial-item {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.testimonial-item .quote {
  font-style: italic;
  margin-bottom: 0.5rem;
}

.testimonial-item .author {
  font-size: 0.9rem;
  color: #555;
}

.testimonials-more {
  margin-top: 1rem;
  text-align: right;
}

/* Testimonials page */
.testimonials-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.testimonial-entry blockquote {
  margin-bottom: 0.5rem;
  quotes: "\201C" "\201D" "\2018" "\2019";
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-color);
}

.testimonial-entry blockquote:before {
  content: open-quote;
  font-size: 2rem;
  line-height: 0;
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-color);
}

.testimonial-entry cite {
  font-style: normal;
  font-size: 0.9rem;
  color: #555;
}

/* Portfolio page */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.project-card {
  background-color: var(--surface-color);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.project-card-content {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card-content h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 1.1rem;
}

.project-card-content p {
  color: var(--text-color);
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.project-card-content .project-result {
  font-size: 0.9rem;
  margin-top: auto;
}

/* About page */
.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.about-text {
  flex: 1 1 350px;
  min-width: 300px;
}

/* Improve readability for paragraphs on the About page */
.about-text p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.about-image {
  flex: 1 1 300px;
  text-align: center;
}

.about-image img {
  max-width: 300px;
  height: auto;
  border-radius: 8px;
}

/* Contact page */
.contact-info {
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.contact-form button {
  background-color: var(--primary-color);
  color: var(--background-color);
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.contact-form button:hover {
  background-color: var(--secondary-color);
}

/* Contact page layout with map */
.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.contact-left {
  flex: 1 1 300px;
  max-width: 500px;
}

.contact-map {
  flex: 1 1 300px;
  /* Maintain a pleasant aspect ratio for the embedded map */
  aspect-ratio: 16/9;
  height: auto;
  min-height: 250px;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--primary-color);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--background-color);
  font-size: 0.85rem;
}

/* Social media icons styling added for footer */
.site-footer .social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.site-footer .social-icons img {
  width: 24px;
  height: 24px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }
  .hero-content {
    margin-right: 0;
  }
  .hero-image {
    margin-top: 2rem;
  }
  /* Adjust header height and padding on small screens to prevent layout shift */
  .site-header {
    padding: 0.5rem 1rem;
    height: 56px;
  }
  /* Scale down the logo on small screens */
  .logo-wrapper img {
    height: 36px;
  }
  /* Show the hamburger button on mobile */
  .nav-toggle {
    display: inline-block;
  }
  /* Convert the nav to an overlay that does not push content */
  .main-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background-color: var(--surface-color);
    display: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 90;
  }
  .main-nav.open {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem 1rem;
  }
  .main-nav a {
    padding: 0.75rem 0.5rem;
    line-height: 1.2;
  }
  /* Ensure the language selector fits in the compact header */
  .language-select select {
    height: 32px;
    font-size: 0.95rem;
  }

  /* Stack the contact form and map vertically on small screens */
  .contact-grid {
    flex-direction: column;
  }
  /* Adjust the map’s aspect ratio to avoid an overly wide appearance on phones */
  .contact-map {
    aspect-ratio: 4 / 3;
    min-height: 200px;
  }
}

/* Medium tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .site-header {
    padding: 0.75rem 1.25rem;
  }
  .logo-wrapper img {
    height: 48px;
  }
  .main-nav a {
    padding: 0.5rem 0.6rem;
  }
}

/* Custom card styles for privacy and resume pages */
.privacy-card,
.resume-card {
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  margin: 0 auto;
}

/* Ensure embedded forms fit their container */
.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}