/* ============================
   BASE DESKTOP STYLES
============================ */
.industries-focus-section {
  position: relative;
  height: 100vh;
  background: url("../assets/industries-focus-bg.webp") no-repeat center
    center/cover;
  padding: 120px 0 200px;
  overflow: hidden;
}

.industries-focus-container {
  max-width: 1300px;
  margin: 70px auto 0 auto;
  text-align: center;
  align-content: center;
  justify-content: center;
  display: flex;
  padding: 0 20px;
}

.industries-focus-header {
  margin-bottom: 40px;
}

.industries-focus-title {
  font-size: 3rem;
  font-weight: 700;
  color: #a2342c;
}

.industries-focus-subtitle {
  font-size: 18px;
  color: #555;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.7;
}

.industries-focus-cards {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 30px 0;
  background-color: #a2342c;
  height: 350px;
}

.industries-focus-card {
  position: relative;
  flex: 1 1 160px;
  min-width: 160px;
  max-width: 300px;
  text-align: center;
  color: #fff;
  padding: 10px 0;
}

.industries-focus-card img {
  width: 50px;
  margin: 15px 0;
}

.industries-focus-card-title {
  font-size: 16px;
  padding: 0 10px;
  font-weight: 100;
  transition: transform 0.3s ease;
}

/* Vertical lines */
.industries-focus-line-top,
.industries-focus-line-bottom {
  position: absolute;
  left: 100%;
  transform: translateX(-50%);
  width: 0.5px;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: 0;
}

.industries-focus-line-top {
  top: -120px;
  bottom: 40px;
}

.industries-focus-line-bottom {
  top: 50px;
  bottom: -105px;
}

/* Ensure text/images above lines */
.industries-focus-card img,
.industries-focus-card-title {
  position: relative;
}
.service-card-link {
  text-decoration: none;
  display: block;
}
.industries-focus-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

/* .industries-focus-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  background-color: transparent;
} */

.industries-focus-card:hover img {
  transform: scale(1.3);
  transition: transform 0.3s ease;
}

.industries-focus-card:hover .industries-focus-card-title {
  color: #fffde3;
  transform: scale(1.1);
}

@media (max-width: 1357px) and (min-width: 1000px) {
  .industries-focus-section {
    height: auto;
    padding: 80px 0 100px;
  }

  .industries-focus-container {
    flex-direction: column;
    margin-top: 30px;
    padding: 0 30px;
  }

  .industries-focus-title {
    font-size: 2.3rem;
  }

  .industries-focus-subtitle {
    font-size: 14px;
    max-width: 90%;
    margin: 0 auto;
    line-height: 1.6;
  }

  /* Increase card width */
  .industries-focus-cards {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(340px, 1fr)
    ); /* Increased min width */
    gap: 30px;
    background-color: transparent;
    padding: 40px 20px;
    align-content: center;
    justify-content: center; /* Centers cards horizontally */
    align-items: center; /* Centers cards vertically if there's height */
  }

  .industries-focus-card {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #a2342c;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    min-height: 280px;
    max-width: 400px; /* Optional: keeps consistent width */
    margin: 0 auto; /* Center cards if there's extra space */
  }

  .industries-focus-card img {
    width: 60px;
    margin-bottom: 15px;
  }

  .industries-focus-card-title {
    font-size: 18px;
    font-weight: 400;
    margin-top: auto;
  }

  .industries-focus-line-top,
  .industries-focus-line-bottom {
    display: none;
  }
}

/* ============================
   TABLET (≤1024px)
============================ */
@media (max-width: 1024px) {
  .industries-focus-section {
    padding: 20px;
    height: auto;
  }

  .industries-focus-container {
    flex-direction: column;
    margin-top: 50px;
  }

  .industries-focus-title {
    font-size: 2rem;
  }

  .industries-focus-subtitle {
    font-size: 13px;
    max-width: 90%;
  }

  .industries-focus-cards {
    position: relative;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(340px, 1fr)
    ); /* Increased min width */
    gap: 30px;
    background-color: transparent;
    padding: 40px 20px;
    align-content: center;
    justify-content: center; /* Centers cards horizontally */
    align-items: center; /* Centers cards vertically if there's height */
  }
  .industries-focus-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* ✅ Fixed size for consistency */
    width: 100%;
    max-width: 320px;
    min-height: 300px;
    height: 100%; /* Let grid align heights */

    background-color: #a2342c;
    border-radius: 10px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin: 0 auto;
  }

  .industries-focus-card img {
    width: 60px;
    margin-bottom: 15px;
  }

  .industries-focus-card-title {
    font-size: 18px;
    margin-top: auto;
    font-weight: 400;
  }

  .industries-focus-line-top,
  .industries-focus-line-bottom {
    display: none;
  }
}

/* ============================
   MOBILE (≤768px)
============================ */
@media (max-width: 768px) {
  .industries-focus-section {
    padding: 0 15px 20px;
    height: auto;
    background-position: center top;
  }

  .industries-focus-container {
    margin-top: 30px;
    flex-direction: column;
  }

  .industries-focus-title {
    font-size: 1.5rem;
  }

  .industries-focus-subtitle {
    font-size: 12px;
    line-height: 1.6;
  }

  .industries-focus-cards {
    position: relative;

    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(280px, 1fr)
    ); /* made 280px for better mobile fit */
    gap: 30px;
    padding: 40px 20px;
    background-color: transparent;
    justify-content: center; /* centers items in grid */
    text-align: center;
    max-width: 100%; /* better for responsiveness */
    margin: 0 auto;
  }

  .industries-focus-card {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .industries-focus-card img {
    width: 55px;
    margin-bottom: 12px;
  }

  .industries-focus-card-title {
    font-size: 17px;
    font-weight: 400;
    margin-top: 10px;
  }

  .industries-focus-line-top,
  .industries-focus-line-bottom {
    display: none;
  }
}

/* Keyframes */
/* KEYFRAMES */

@keyframes expandFromLeft {
  from {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    opacity: 1;
    transform: scaleX(1);
    transform-origin: left;
  }
}

@keyframes slideFromTop {
  from {
    opacity: 0;
    transform: translateY(-100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideFromBottom {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideFromRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* INITIAL STATE */
.industries-focus-header,
.industries-focus-cards,
.industries-focus-card {
  opacity: 0;
}

/* EXPAND CONTAINER */
.industries-focus-section.visible .industries-focus-cards {
  animation: expandFromLeft 1s ease forwards;
}

/* HEADER (title and subtitle) */
.industries-focus-section.visible .industries-focus-header {
  animation: slideFromRight 1s ease-in-out forwards;
}

/* CARD CONTENT: Only animate after container expansion finishes */
.industries-focus-section.visible.animate-cards
  .industries-focus-card:nth-child(odd) {
  animation: slideFromTop 0.8s ease-out forwards;
  animation-delay: 1.1s;
}
.industries-focus-section.visible.animate-cards
  .industries-focus-card:nth-child(even) {
  animation: slideFromBottom 0.8s ease-out forwards;
  animation-delay: 1.3s;
}
