/* ============================================
   HOME PAGE - Service Areas Section
   ============================================

   Creative, engaging component highlighting
   H&C Construction's presence in MD, VA, and DC
   with SEO-optimized content and modern UX/UI
   ============================================ */

/* ========= SERVICE AREAS SECTION ========= */

.service-areas-section {
  position: relative;
  padding: clamp(48px, 6vw, 90px) 0;
  background: #f7f9fd;
  overflow: hidden;
  box-sizing: border-box;
}

/* Background Pattern */
.service-areas-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(26, 67, 191, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 121, 24, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Container Layout - Two Columns */
.service-areas-container {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto clamp(24px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

/* Left Column: Header + Navigation + Map */
.service-areas-left-col {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Section Header */
.service-areas-header {
  text-align: left;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

.service-areas-section .section-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 8px; /* Reduced from 20px for harmonic composition */
  font-weight: 600;
}

.service-areas-section .section-label::before,
.service-areas-section .section-label::after {
  content: '';
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-orange));
}

.service-areas-section .section-label::after {
  background: linear-gradient(90deg, var(--brand-orange), transparent);
}

.service-areas-section .section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 12px;
  margin-top: 0;
  color: var(--dark-alt);
}

.service-areas-section .section-title span {
  color: var(--brand-blue);
  font-style: italic;
}

.service-areas-section .section-subtitle {
  color: #4c4c4c;
  font-size: 18px;
  max-width: 100%;
  margin: 0;
  font-weight: 400;
  line-height: 1.7;
}

/* Container Layout - Two Columns */
.service-areas-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

/* Left Column: Header + Navigation + Map */
.service-areas-left-col {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* Section Header */
.service-areas-header {
  text-align: left;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
}

/* Right Column: State Cards (Centered) */
.service-areas-right-col {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center the card horizontally */
  justify-content: flex-start; /* Align to top */
  width: 100%;
}

/* Region Navigation Buttons (After Map) */
.service-areas-nav {
  display: flex;
  flex-direction: column;
  gap: 10px; /* Reduced gap for compact layout */
  margin-bottom: 0;
  width: 100%;
}

.region-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.region-nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-orange));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.region-nav-btn > * {
  position: relative;
  z-index: 1;
}

.region-nav-btn:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(26, 67, 191, 0.2);
}

.region-nav-btn.region-nav-active {
  background: var(--brand-blue);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 20px rgba(26, 67, 191, 0.4);
}

.region-nav-btn.region-nav-active::before {
  opacity: 0;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-label {
  font-weight: 600;
}

.nav-badge {
  background: rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.region-nav-btn.region-nav-active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
}

/* Compact Interactive Map Visualization (First in Column, After Header) */
.service-areas-map {
  position: relative;
  width: 100%;
  height: 220px; /* Slightly reduced for better space usage */
  margin-bottom: 0;
  background: #ffffff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 92% 80%;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(15, 27, 61, 0.12);
  border: 1px solid rgba(15, 27, 61, 0.06);
}

.service-areas-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 22% 35%, rgba(26, 67, 191, 0.12), transparent 48%),
    radial-gradient(circle at 78% 65%, rgba(255, 121, 24, 0.12), transparent 52%);
  z-index: 0;
  pointer-events: none;
}

.service-areas-map::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(26, 67, 191, 0.14);
  border-radius: 16px;
  z-index: 0;
  pointer-events: none;
}

.service-areas-map-img,
.service-areas-map-svg {
  position: absolute;
  inset: 6px 12px;
  width: calc(100% - 24px);
  height: calc(100% - 12px);
  opacity: 0.92;
  filter: drop-shadow(0 14px 26px rgba(15, 27, 61, 0.12));
  z-index: 1;
  pointer-events: none;
}

/* Right Column: State Cards */
.map-region {
  position: absolute;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
  outline: none;
  z-index: 2;
}

.map-region:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 4px;
  border-radius: 50%;
}

.map-region-md {
  top: 42%;
  left: 72%;
  transform: translate(-50%, -50%);
}

.map-region-va {
  top: 55%;
  left: 69%;
  transform: translate(-50%, -50%);
}

.map-region-dc {
  top: 48%;
  left: 74%;
  transform: translate(-50%, -50%);
}

.map-region-dc.map-region-active {
  transform: translate(-50%, -50%) scale(1.1);
}

.region-label {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.map-region-active .region-label {
  opacity: 1;
  color: var(--brand-orange);
}

.map-region:hover,
.map-region:focus {
  transform: scale(1.15);
  z-index: 10;
}

.map-region.map-region-active {
  transform: scale(1.2);
  z-index: 10;
}

.region-pin {
  width: 50px;
  height: 50px;
  background: var(--brand-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 20px rgba(26, 67, 191, 0.3);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.map-region:hover .region-pin,
.map-region:focus .region-pin {
  background: var(--brand-orange);
  box-shadow: 0 6px 25px rgba(255, 121, 24, 0.5);
  transform: scale(1.1);
}

.map-region-active .region-pin {
  background: var(--brand-orange);
  box-shadow: 0 6px 25px rgba(255, 121, 24, 0.5);
  transform: scale(1.1);
}

.region-pin svg {
  width: 24px;
  height: 24px;
}

.region-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid var(--brand-blue);
  border-radius: 50%;
  animation: pulse 2.2s infinite;
  opacity: 0.6;
}

.map-region:hover .region-pulse,
.map-region:focus .region-pulse {
  border-color: var(--brand-orange);
}

.map-region-active .region-pulse {
  border-color: var(--brand-orange);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.3;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Region Cards - Single Active Card (Centered) */
.service-areas-cards {
  position: relative;
  min-height: 500px;
  margin-bottom: 0;
  width: 100%;
  max-width: 580px; /* Optimal width for centered card display */
  margin: 0 auto; /* Center the card container horizontally */
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Cards fill container width */
}

.service-area-card {
  background: #ffffff;
  border: 1px solid rgba(15, 27, 61, 0.08);
  border-radius: 24px;
  padding: 46px;
  box-shadow: 0 20px 40px rgba(15, 27, 61, 0.12);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 140px;
}

.service-area-card.service-area-card-active {
  position: relative;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 1;
  width: 100%;
  max-width: 100%;
}

.service-area-card::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(26, 67, 191, 0.08);
  border-radius: 18px;
  pointer-events: none;
}

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

.service-area-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-area-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--brand-blue);
}

.service-area-card:hover::before {
  transform: scaleX(1);
}

.area-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}

.area-icon {
  width: 56px;
  height: 56px;
  background: var(--brand-blue);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(26, 67, 191, 0.3);
}

.area-icon svg {
  width: 28px;
  height: 28px;
}

.area-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-alt);
  margin: 0;
  flex: 1;
}

.area-badge {
  background: var(--brand-blue);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.area-content {
  flex: 1;
  margin-bottom: 24px;
}

.area-description {
  color: #4c4c4c;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.area-cities {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.area-cities li {
  color: var(--dark-base);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.2s ease;
}

.area-cities li:hover {
  background: var(--brand-blue);
  color: white;
  transform: translateY(-2px);
}

.area-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  background: var(--brand-orange);
  color: white;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: auto;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(26, 67, 191, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.area-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.area-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(26, 67, 191, 0.35);
}

.area-cta:hover svg {
  transform: translateX(4px);
}

/* SEO-Enhanced Content (Compact) - Full Width Row */
.service-areas-seo {
  background: #ffffff;
  border-radius: 22px;
  padding: 32px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
  box-shadow: 0 18px 36px rgba(15, 27, 61, 0.12);
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.seo-content {
  max-width: 1000px;
  margin: 0 auto;
}

.seo-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-base);
  margin-bottom: 24px;
  text-align: center;
}

.seo-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.seo-feature {
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  border-left: 4px solid var(--brand-blue);
  transition: all 0.3s ease;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.seo-feature:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.seo-feature strong {
  color: var(--brand-blue);
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .service-areas-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .service-areas-left-col {
    order: 1;
  }

  .service-areas-right-col {
    order: 2;
  }

  .service-areas-header {
    text-align: center;
  }

  .service-areas-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .region-nav-btn {
    flex: 0 1 auto;
    min-width: 200px;
    justify-content: center;
    text-align: center;
  }

  .service-areas-map {
    height: 200px;
  }

  .map-region {
    width: 70px;
    height: 70px;
  }

  .region-pin {
    width: 45px;
    height: 45px;
  }

  .region-pin svg {
    width: 20px;
    height: 20px;
  }

  .region-pulse {
    width: 45px;
    height: 45px;
  }

  .service-areas-cards {
    min-height: 450px;
  }

  .seo-features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .service-areas-section {
    padding: 50px 4%;
  }

  .service-areas-container {
    gap: 24px;
    margin-bottom: 30px;
  }

  .service-areas-header {
    margin-bottom: 24px;
    text-align: center;
  }

  .service-areas-nav {
    gap: 10px;
    margin-bottom: 20px;
  }

  .region-nav-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    gap: 10px;
    min-width: auto;
    width: 100%;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
  }

  .nav-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }

  .service-areas-map {
    height: 180px;
    margin-bottom: 0;
  }

  .map-region {
    width: 60px;
    height: 60px;
  }

  .map-region-md {
    top: 10%;
    left: 15%;
  }

  .map-region-va {
    bottom: 10%;
    left: 20%;
  }

  .map-region-dc {
    top: 50%;
    right: 15%;
  }

  .region-pin {
    width: 40px;
    height: 40px;
  }

  .region-pin svg {
    width: 18px;
    height: 18px;
  }

  .region-pulse {
    width: 40px;
    height: 40px;
  }

  .region-label {
    font-size: 0.65rem;
    margin-top: 6px;
  }

  .service-areas-cards {
    min-height: 350px;
    margin-bottom: 30px;
  }

  .service-area-card {
    padding: 24px;
    margin-top: -10px;
  }

  .area-cities {
    grid-template-columns: 1fr;
  }

  .service-areas-seo {
    padding: 24px 16px;
    margin-top: -20px;
  }

  .seo-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
  }

  .seo-feature {
    padding: 14px;
    font-size: 0.85rem;
  }
}
