.innovation-hero {
  width: 100%;
  height: 800px;
  min-height: 500px;
  position: relative;
  background: #000;
}

.innovation-hero .hero-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  z-index: 0;
}

.innovation-hero .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.innovation-hero .hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.hero-floating-img {
  position: absolute;
  right: 0;
  bottom: -80px;
  width: 374px;
  height: 272px;
  z-index: 10;
  border-radius: 8px;
  overflow: hidden;
}

.hero-floating-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

.page-spacing {
  height: 120px;
  width: 100%;
}

.innovation-main {
  width: 100%;
}

.innovation-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  text-align: center;
  background-image: url("../assets/images/innovation/section_bg.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  background-color: rgba(255, 255, 255, 0.98);
}

.innovation-intro-title {
  color: #131d45;
  font-family: "Source Sans Pro";
  font-size: 48px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  margin: 0;
}

.innovation-intro-summary {
  width: 909px;
  color: #515050;
  text-align: center;
  font-family: "Merriweather";
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: 48px;
  margin: 32px 0 0 0;
}

.innovation-masonry-grid {
  width: 100%;
  max-width: 1400px;
  padding: 60px 0 100px;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background-image: url("../assets/images/innovation/section_bg_pattern.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: overlay;
  background-color: rgba(255, 255, 255, 0.98);
}

.masonry-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* Base styles for cards */
.card-black,
.card-white {
  width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Tablet/Mobile sequence fix */
@media (max-width: 1024px) {
  .innovation-masonry-grid {
    flex-direction: column;
  }
  .masonry-column {
    display: contents; /* Flattens cards into the parent flex container */
  }
}

/* Explicit order to ensure B-W alternation on mobile */
.card-order-1 {
  order: 1;
}
.card-order-2 {
  order: 2;
}
.card-order-3 {
  order: 3;
}
.card-order-4 {
  order: 4;
}
.card-order-5 {
  order: 5;
}
.card-order-6 {
  order: 6;
}
.card-order-7 {
  order: 7;
}
.card-order-8 {
  order: 8;
}

.white-cards-container {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.white-cards-container .card-white {
  align-self: stretch;
  height: auto;
}

.card-black {
  width: 100%;
  max-width: 681px;
  min-height: 384px;
  flex-shrink: 0;
  border-radius: 8px;
  background-color: #212121;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.card-white {
  width: 100%;
  min-height: 384px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid rgba(33, 33, 33, 0.25);
  background: #fff;
  padding: 32px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.card-black::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  background-image: url("../assets/images/innovation/section_bg_pattern.webp");
  background-blend-mode: overlay;
  opacity: 0.6;
  z-index: 1;
}

.card-black > * {
  position: relative;
  z-index: 2;
}

.card-black.card-emergency-bg {
  background-image: url("../assets/images/innovation/card_rural.webp");
}
.card-black.card-trust-bg {
  background-image: url("../assets/images/innovation/card_trust.webp");
}
.card-black.card-community-bg {
  background-image: url("../assets/images/innovation/card_community.webp");
}
.card-black.card-women-bg {
  background-image: url("../assets/images/innovation/card_women.webp");
}

.card-black .quote-icon {
  width: 64.216px;
  height: 64.216px;
  flex-shrink: 0;
  background: url("../assets/images/innovation/icon_quote_gray_6.webp")
    center/contain no-repeat;
}

.card-black .card-header {
  display: flex;
  align-items: center;
  gap: 32px;
}

.card-black .card-title {
  color: #f1f1f1;
  font-family: "Source Sans Pro";
  font-size: 40px;
  font-weight: 700;
  line-height: normal;
  margin: 0;
}

.card-black .card-text {
  color: #c4c4c4;
  font-family: "Merriweather";
  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
  margin: 0;
}

.card-white.card-full {
  width: 100%;
  max-width: 681px;
  align-self: stretch;
}

.card-white.card-compact {
  padding: 21px;
}

.card-h-super {
  min-height: 658px;
}
.card-h-large {
  min-height: 547px;
}
.card-h-medium {
  min-height: 508px;
}
.card-h-small {
  min-height: 384px;
}

.card-white .quote-icon {
  width: 38.953px;
  height: 38.953px;
  flex-shrink: 0;
  background: url("../assets/images/innovation/icon_quote_gray.webp")
    center/contain no-repeat;
  opacity: 0.25;
  margin-bottom: 12px;
}

.card-white .card-title {
  color: #212121;
  font-family: "Source Sans Pro";
  font-size: 40px;
  font-weight: 600;
  line-height: 48px;
  margin: 0 0 24px 0;
}

.card-white .card-text {
  color: #515050;
  font-family: "Merriweather";
  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
  margin: 0;
}

@media (max-width: 1440px) {
  .hero-content,
  .innovation-masonry-grid {
    width: 100%;
    padding-left: 60px;
    padding-right: 60px;
  }
}

@media (max-width: 1024px) {
  .hero-content,
  .innovation-masonry-grid {
    padding-left: 40px;
    padding-right: 40px;
  }
  .hero-title {
    font-size: 48px;
  }
  .hero-floating-img {
    width: 280px;
    height: 200px;
    bottom: -50px;
  }
  .innovation-intro-title {
    font-size: 36px;
  }
  .innovation-intro-summary {
    width: 100%;
    padding: 0 40px;
    font-size: 20px;
    line-height: 36px;
  }

  .innovation-masonry-grid {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .card-black,
  .card-white,
  .card-white.card-full {
    width: 100%;
    max-width: 100%;
    min-height: auto;
  }

  .card-h-super,
  .card-h-large,
  .card-h-medium,
  .card-h-small {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .hero-floating-img {
    display: none;
  }
  .page-spacing {
    height: 60px;
  }
  .innovation-intro {
    padding: 40px 20px;
    background-position: center;
  }
  .innovation-intro-title {
    font-size: 26px;
  }
  .innovation-intro-summary {
    font-size: 15px;
    line-height: 28px;
    padding: 0;
    margin-top: 20px;
  }
  .innovation-masonry-grid {
    padding: 40px 20px;
    background-position: center;
  }
  .card-black,
  .card-white {
    padding: 24px 20px;
  }
  .card-black .card-title,
  .card-white .card-title {
    font-size: 22px;
    line-height: 32px;
  }
  .card-black .card-header {
    gap: 16px;
  }
  .card-black .quote-icon {
    width: 40px;
    height: 40px;
  }
  .card-white .card-title {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .hero-title,
  .innovation-intro-title {
    font-size: 22px;
  }
  .innovation-intro-summary,
  .card-text {
    font-size: 14px;
  }
  .card-title {
    font-size: 18px;
  }
}
