/* contact.css */

/* Contact Hero Section */
.contact-hero {
  /* Uses inline style from service for background */
  background-size: cover;
  background-position: center;
  padding: var(--spacing-xl) 0;
  color: var(--text-light);
  text-align: center;
  position: relative;
  min-height: 350px; /* Adjust height */
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-hero::before {
  /* Optional overlay */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4); /* Consistent overlay */
  z-index: 1;
}
.contact-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}
/* Inherit page-title and hero-subtitle styles from global/hero */
.contact-hero .page-title {
  color: var(--text-light);
}
.contact-hero .hero-subtitle {
  color: var(--text-light);
  opacity: 0.9;
}

/* Contact Info Section (Uses info-card style) */
.contact-info {
  padding: var(--spacing-xl) 0;
  /* background: var(--bg-secondary); Optional alternate background */
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive */
  gap: var(--spacing-lg);
}

.info-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  text-align: center;
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
}

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

.info-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: color-mix(
    in srgb,
    var(--primary-color) 15%,
    transparent
  ); /* Light primary bg */
  border-radius: 50%;
  color: var(--primary-color);
}

.info-icon img,
.info-icon i {
  /* Handle both img and Font Awesome icons */
  width: 30px; /* Adjust size if needed */
  height: 30px;
  object-fit: contain;
  font-size: 24px; /* Adjust icon size */
  line-height: 1;
}

.info-card h3 {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--secondary-color); /* Darker title */
}

.info-card p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--spacing-xs);
}
.info-card p:last-child {
  margin-bottom: 0;
}
.info-card a {
  /* Style links within info cards */
  color: var(--primary-color);
  text-decoration: none; /* Remove default underline */
}
.info-card a:hover {
  text-decoration: underline; /* Underline on hover */
}

/* Contact Main Section (Form & Map) */
.contact-main {
  padding: var(--spacing-xl) 0;
  background-color: var(--bg-secondary); /* Alternate background */
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first */
  gap: var(--spacing-xl); /* More gap */
}

@media (min-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr; /* Two columns desktop */
    align-items: start; /* Align items top */
  }
}

/* Contact Form */
.contact-form-wrapper {
  background: var(--bg-primary);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.contact-form-wrapper .section-title {
  /* Target title within wrapper */
  text-align: left;
  font-size: var(--font-size-xl); /* Slightly smaller title for form */
  margin-bottom: var(--spacing-lg);
  color: var(--secondary-color);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

/* Form messages (defined inline in HTML but can be moved here) */
.form-message {
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}
.form-message.success {
  background-color: var(--alert-success-bg);
  color: var(--alert-success-text);
  border-color: var(--alert-success-border);
}
.form-message.error {
  background-color: var(--alert-error-bg);
  color: var(--alert-error-text);
  border-color: var(--alert-error-border);
}
#formMessageContainer {
  /* Container for spacing */
  margin-bottom: var(--spacing-md);
}

.contact-form .form-group {
  /* Inherits global styling */
  margin-bottom: var(--spacing-md);
}
.contact-form .form-group:last-of-type {
  margin-bottom: var(--spacing-lg); /* More space before button */
}

.contact-form button[type='submit'] {
  width: 100%; /* Full width button */
  padding: var(--spacing-md) var(--spacing-lg); /* Larger button */
  font-size: var(--font-size-md);
}

/* Loading spinner inside button */
.loading-spinner {
  margin-left: var(--spacing-sm);
  display: inline-block; /* Needed for spinner */
}
.loading-spinner i {
  animation: fa-spin 1s infinite linear;
}
@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Map */
/* .contact-map {
  Container for map section
} */

.contact-map .section-title {
  text-align: left;
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-lg);
  color: var(--secondary-color);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.map-container {
  width: 100%;
  height: 450px; /* Adjust height as needed */
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary); /* BG for loading */
}

.map-container iframe {
  border: 0;
  width: 100%;
  height: 100%;
  display: block; /* Remove extra space */
}

/* Office Locations Section */
.office-locations {
  padding: var(--spacing-xl) 0;
}
.office-locations .section-title {
  /* Center title if used */
  text-align: center;
}
.office-locations .section-subtitle {
  /* Center subtitle if used */
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.offices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg); /* Space below header */
}

.office-card {
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.office-card img {
  width: 100%;
  height: 220px; /* Fixed height */
  object-fit: cover;
  display: block;
}

.office-info {
  padding: var(--spacing-lg);
  flex-grow: 1; /* Allow info to take space */
}

.office-info h3 {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-md); /* More space below title */
  color: var(--secondary-color);
}

.office-info p {
  font-size: var(--font-size-md);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm); /* Space between lines */
  display: flex; /* Align icons */
  align-items: flex-start; /* Align icon top */
  gap: var(--spacing-sm);
  line-height: 1.6;
}
.office-info p i {
  color: var(--primary-color);
  width: 16px; /* Align icons */
  text-align: center;
  flex-shrink: 0;
  margin-top: 0.2em; /* Align icon slightly better */
}
.office-info p:last-child {
  margin-bottom: 0;
}
.office-info a {
  /* Style links like email/phone */
  color: var(--primary-color);
  text-decoration: none;
}
.office-info a:hover {
  text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
  .contact-grid {
    gap: var(--spacing-lg);
  }
  /* .contact-map {
    Map stays below form
  } */
  .contact-map .section-title {
    text-align: center; /* Center map title if needed */
  }
}

@media (max-width: 768px) {
  .contact-hero {
    min-height: 300px;
  }
  .info-grid {
    gap: var(--spacing-md);
  }
  .office-locations {
    padding: var(--spacing-lg) 0;
  }
  .offices-grid {
    gap: var(--spacing-md);
  }
}
