/* ==========================================================================
   CHEMICAL FEED SYSTEMS EXCLUSIVE STYLING LAYER (chem_feed_systems.css)
   ========================================================================== */

/* ==========================================================================
   1. HERO BANNER
   ========================================================================== */
.chem-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: url('../images/chem_feed_hero.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  box-sizing: border-box;
}

/* Dark semi-transparent overlay for contrast */
.chem-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
  margin: 0 auto;
  color: #ffffff;
}

.hero-content #ei2-coe-logo {
  display: block;
  width: 100%;
  max-width: 225px;
  height: auto;
  margin: 0 auto 20px;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 300;
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 1px;
  color: var(--color-secondary);
  line-height: 1.1;
}

.hero-content p {
  font-size: 1.4rem;
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
  color: var(--color-white);
  text-align: left;
}

#overview, #controls, #support {
  scroll-margin-top: 50px;
}

#overview h2 span {
  display: block;
  font-size: 2.25rem;
}

.chem-intro-txt {
  line-height: 1.6;
  margin-bottom: 30px;
}

.chem-body-txt {
  margin-top: 25px;
  line-height: 1.6;
}

/* ==========================================================================
   Environmental, Social & Governance (ESG) Pillars - Site Aesthetic Card Grid
   ========================================================================== */

/* 2x2 Grid Container */
.esg-wrapper {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Lead intro text spanning both grid columns */
.esg-lead-txt {
  grid-column: 1 / -1;
  line-height: 1.6;
  margin-bottom: 35px !important;
}

/* Individual Feature Card (.esg-row) */
.esg-row {
  background: var(--color-white);
  border: 1.5px solid var(--color-white-highlight);
  border-radius: 3px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0; /* Handled by grid gap */
  box-shadow: 0 4px 12px rgba(15, 184, 254, 0.15); 
}

/* Subtle interactive elevation on hover */
.esg-row:last-child {
  margin-bottom: 0;
}

/* Centered SVG Icon with Entry Scroll Animation */
.esg-icon {
  width: auto;
  height: 100px;
  flex-shrink: 0;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.esg-icon.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pillar Card Content Wrapper */
.esg-pillar {
  width: 100%;
  padding-left: 0;
  border-left: none; /* Removed legacy side border */
  text-align: center;
}

.esg-pillar h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center !important;
}

.esg-pillar p {
  font-size: 1.4rem;
  line-height: 1.5;
  margin: 0;
  text-align: left;
}

/* Responsive adjustments for mobile screens */
@media (max-width: 768px) {
  .esg-wrapper {
    grid-template-columns: 1fr; /* Collapses to single column on mobile */
    gap: 20px;
  }

  .esg-row {
    padding: 30px 20px;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  .esg-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }

  .esg-icon {
    width: 150px;
    align-self: center; /* Horizontally centers icon above content on mobile */
  }

  .esg-pillar {
    width: 100%;
    border-left: none;
    border-top: 3px solid var(--color-white-highlight);
    padding-left: 0;
    padding-top: 20px;
  }
  
  .esg-pillar h3 {
    text-align: center !important;
  }
}

/* ==========================================================================
   3. ANIMATED BANNER BOX DETAILS (#controls)
   ========================================================================== */
.mission-box {
  margin: 0 auto 30px auto;
  padding: 3px;
  background-color: transparent;
  
  /* 5 border layers: Top, Right, Left, Bottom-Left, Bottom-Right */
  background-image: 
    linear-gradient(var(--color-secondary), var(--color-secondary)), /* Top */
    linear-gradient(var(--color-secondary), var(--color-secondary)), /* Right */
    linear-gradient(var(--color-secondary), var(--color-secondary)), /* Left */
    linear-gradient(var(--color-secondary), var(--color-secondary)), /* Bottom-Left */
    linear-gradient(var(--color-secondary), var(--color-secondary)); /* Bottom-Right */
  
  background-repeat: no-repeat;
  background-position: 
    top center, 
    top right, 
    top left, 
    bottom left,
    bottom right;
  
  /* Initial state: all border sizes set to 0 width/height */
  background-size: 0 3px, 3px 0, 3px 0, 0 3px, 0 3px;
  will-change: background-size;
}

/* Animation triggers on viewport visibility class */
.mission-box.is-visible {
  animation: drawBorderFromCenter 4s ease-in-out forwards;
  -webkit-animation: drawBorderFromCenter 4s ease-in-out forwards;
}

.mission-container {
  background: var(--color-primary);
  padding: 30px;
  text-align: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 1px;
}

.mission-container p {
  margin-bottom: 10px!important;
}

.mission-container span {
  text-transform: uppercase;
  font-weight: 400;
  font-size: 2.5rem;
  color: var(--color-white-highlight);
  display: block;
  line-height: 1.2;
  margin-top: -15px;
}

/* Standard Animations Engine */
@keyframes drawBorderFromCenter {
    0% {
      background-size: 0 3px, 3px 0, 3px 0, 0 3px, 0 3px;
    }
    20% {
      background-size: 100% 3px, 3px 0, 3px 0, 0 3px, 0 3px;
    }
    66% {
      background-size: 100% 3px, 3px 100%, 3px 100%, 0 3px, 0 3px;
    }
    100% {
      background-size: 100% 3px, 3px 100%, 3px 100%, 51% 3px, 51% 3px;
    }
}

@-webkit-keyframes drawBorderFromCenter {
    0% {
      background-size: 0 3px, 3px 0, 3px 0, 0 3px, 0 3px;
    }
    20% {
      background-size: 100% 3px, 3px 0, 3px 0, 0 3px, 0 3px;
    }
    66% {
      background-size: 100% 3px, 3px 100%, 3px 100%, 0 3px, 0 3px;
    }
    100% {
      background-size: 100% 3px, 3px 100%, 3px 100%, 51% 3px, 51% 3px;
    }
}

/* ==========================================================================
   4. SUPPORT PILLARS WRAPPER (#support)
   ========================================================================== */
.support-pillars-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 40px;
}

.support-pillar {
  background: var(--color-white);
  border: 1.5px solid var(--color-white-highlight);
  border-radius: 3px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0; /* Handled by grid gap */
  box-shadow: 0 4px 12px rgba(15, 184, 254, 0.15); 
}

.pillar-header {
  margin-bottom: 15px;
}

.pillar-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  line-height: 1.3;
}

.pillar-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-secondary);
}

.support-pillar p {
  color: #4a5568;
  font-size: 1.3rem;
  line-height: 1.5;
  margin: 0;
  text-align: left;
}

/* ==========================================================================
   CHEMICAL FEED MANUFACTURERS CAROUSEL
   ========================================================================== */
.chem-swiper-section {
  background-color: var(--color-dark);
  padding: 40px 0 100px 0;
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

#logo-content {
  padding: 60px 20vh 40px 20vh;
}

.chem-swiper-container {
  margin: 0 auto;
  padding: 0 20vh; /* Reserved space for 36px side buttons */
  position: relative;
  box-sizing: border-box;
}

.chem-logo-swiper {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.chem-logo-swiper .swiper-wrapper {
  box-sizing: border-box;
}

.chem-logo-swiper .swiper-slide.logo-item {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  height: 90px;
  padding: 12px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.chem-logo-swiper .swiper-slide.logo-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Compact Swiper Buttons with var(--color-secondary) background */
.chem-swiper-container .swiper-button-prev.chem-swiper-prev,
.chem-swiper-container .swiper-button-next.chem-swiper-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  width: 20vh;
  height: 100%;
  background-color: var(--color-dark);
  color: var(--color-primary);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

/* Scale down Swiper arrow font icon inside 36px buttons */
.chem-swiper-container .swiper-button-prev.chem-swiper-prev::after,
.chem-swiper-container .swiper-button-next.chem-swiper-next::after {
  font-size: 30px;
  font-weight: bold;
}

/* Hover State: Smooth Transition to var(--color-primary) */
.chem-swiper-container .swiper-button-prev.chem-swiper-prev:hover,
.chem-swiper-container .swiper-button-next.chem-swiper-next:hover {
  color: var(--color-secondary);
  transition: color 0.25s ease;
}

/* Responsive adjustment for mobile screens */
@media (max-width: 768px) {
  .chem-swiper-container {
    padding: 0 40px;
  }
  
  .chem-swiper-container .swiper-button-prev.chem-swiper-prev,
  .chem-swiper-container .swiper-button-next.chem-swiper-next {
    width: 30px;
    height: 30px;
  }

  .chem-swiper-container .swiper-button-prev.chem-swiper-prev::after,
  .chem-swiper-container .swiper-button-next.chem-swiper-next::after {
    font-size: 11px;
  }
}

/* ==========================================================================
   5. CALL TO ACTION SECTION (#cta)
   ========================================================================== */
#cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
  .services-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .support-pillars-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .chem-hero {
    padding: 60px 20px;
  }

  .mission-container {
    font-size: 1.5rem;
  }

  .mission-container span {
    font-size: 1.1rem;
  }
  
  #logo-content {
    padding: 0 20px 40px 20px;
  }
}

@media (max-width: 600px) {
  .services-overview-grid {
    grid-template-columns: 1fr;
  }
}
