/* =========================================================
   CORE ASSET SOLUTIONS
   SHARED SERVICE + INDUSTRY DETAIL HERO
   File: /assets/css/service-industries-pages-hero.css
   ========================================================= */

:root{
  --cas-si-hero-green: #59E00B;
  --cas-si-hero-line: rgba(255,255,255,0.30);
  --cas-si-hero-text: #FFFFFF;
  --cas-si-hero-muted: rgba(255,255,255,0.70);
  --cas-si-hero-max: 1280px;
  --cas-si-hero-gutter: 32px;
  --cas-si-hero-image-ratio: 810 / 540;
  --cas-si-hero-controls-height: 46px;
  --cas-si-hero-controls-gap: 25px;
}

/* The hero is intentionally isolated from the older service/industry hero systems. */
.cas-si-hero,
.cas-si-hero *{
  box-sizing: border-box;
}

.cas-si-hero{
  position: relative;
  width: 100%;
  margin: 0;
  padding: 50px 0 22px;
  overflow: hidden;
  background: #000000;
  color: var(--cas-si-hero-text);
  font-family: "Red Hat Text", "Red Hat Display", system-ui, sans-serif;
}

.cas-si-hero__inner{
  display: grid;
  grid-template-columns: minmax(0, 54.1%) minmax(0, 45.9%);
  grid-template-areas:
    ". controls"
    "copy media";
  column-gap: 0;
  row-gap: var(--cas-si-hero-controls-gap);
  width: calc(100% - (var(--cas-si-hero-gutter) * 2));
  max-width: var(--cas-si-hero-max);
  margin: 0 auto;
  padding-right: 32px;
  padding-left: 32px;
}

.cas-si-hero.cas-si-hero--overview.cas-si-hero--services{
  --cas-si-hero-green: #59E00B;
}

.cas-si-hero.cas-si-hero--overview.cas-si-hero--industries{
  --cas-si-hero-green: #0DB4FF;
}

.cas-si-hero__controls{
  grid-area: controls;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: var(--cas-si-hero-controls-height);
  border-left: 1px solid var(--cas-si-hero-line);
  border-right: 1px solid var(--cas-si-hero-line);
}

.cas-si-hero__action{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #FFFFFF;
  font-family: "Red Hat Text", "Red Hat Display", system-ui, sans-serif;
  font-size: clamp(0.84rem, 0.94vw, 1rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.015em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: none;
}

.cas-si-hero__action + .cas-si-hero__action{
  border-left: 1px solid var(--cas-si-hero-line);
}

.cas-si-hero__action:hover,
.cas-si-hero__action:focus-visible{
  background: var(--cas-si-hero-green);
  color: #000000;
  text-decoration: none;
  outline: none;
  transition: none;
}

.cas-si-hero__action:focus-visible{
  box-shadow: inset 0 0 0 2px #FFFFFF;
}

.cas-si-hero__phone-icon{
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cas-si-hero__copy{
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  gap: 54px;
  min-width: 0;
  padding: 0 clamp(34px, 4.6vw, 72px) 0 0;
}

.cas-si-hero__title{
  margin: 0;
  max-width: 785px;
  color: #FFFFFF;
  font-family: "Red Hat Display", "Red Hat Text", system-ui, sans-serif;
  font-size: clamp(2.9rem, 3.95vw, 4.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.052em;
}

.cas-si-hero__subtitle-row{
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: min(100%, 680px);
  margin-top: 0;
  margin-bottom: clamp(54px, 7.2vw, 104px);
}

.cas-si-hero__subtitle-row::before{
  content: "";
  display: block;
  align-self: stretch;
  width: 3px;
  min-height: 46px;
  background: var(--cas-si-hero-green);
}

.cas-si-hero__subtitle{
  margin: 0;
  color: var(--cas-si-hero-muted);
  font-family: "Red Hat Text", "Red Hat Display", system-ui, sans-serif;
  font-size: clamp(1rem, 1.08vw, 1.16rem);
  font-weight: 500;
  line-height: 1.52;
  letter-spacing: -0.012em;
}

.cas-si-hero__media{
  grid-area: media;
  align-self: start;
  width: 100%;
  margin: 0;
  aspect-ratio: var(--cas-si-hero-image-ratio);
  overflow: hidden;
  background: #080808;
}

.cas-si-hero__media img{
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  object-position: center center;
}

.cas-si-hero__divider{
  width: 100%;
  height: 1px;
  margin: 25px 0 0;
  border: 0;
  background: rgba(255,255,255,0.24);
}

/* Prevent legacy hero rules from adding an extra line or spacing. */
body.service-detail-page.cas-service-v2 .cas-si-hero{
  border-bottom: 0;
}

/* Keep the first body section close to the new hero instead of using the old doubled gap. */
body.service-detail-page.cas-service-v2 .cas-service-utility-body > section:first-of-type{
  padding-top: clamp(3.5rem, 5vw, 5.5rem) !important;
}

@media (max-width: 1040px){
  :root{
    --cas-si-hero-gutter: 24px;
  }

  .cas-si-hero{
    padding-top: 36px;
  }

  .cas-si-hero__inner{
    grid-template-columns: minmax(0, 52.4%) minmax(0, 47.6%);
  }

  .cas-si-hero__copy{
    padding-right: 30px;
  }

  .cas-si-hero__title{
    font-size: clamp(2.2rem, 5vw, 3.15rem);
  }

  .cas-si-hero__subtitle-row{
    margin-bottom: clamp(28px, 5vw, 56px);
  }
}

@media (max-width: 760px){
  :root{
    --cas-si-hero-gutter: 16px;
    --cas-si-hero-controls-height: auto;
    --cas-si-hero-controls-gap: 14px;
    --cas-si-hero-mobile-controls-space: 146px;
  }

  .cas-si-hero{
    padding: 48px 0 18px;
  }

  .cas-si-hero__inner{
    display: flex;
    flex-direction: column;
    width: calc(100% - (var(--cas-si-hero-gutter) * 2));
    padding-right: 0;
    padding-left: 0;
  }

  /*
   * Stack the mobile controls with Request a Quote first
   * and the callable phone button directly underneath it.
   */
  .cas-si-hero__controls{
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    height: var(--cas-si-hero-mobile-controls-space);
    min-height: var(--cas-si-hero-mobile-controls-space);
    flex: 0 0 var(--cas-si-hero-mobile-controls-space);
    padding: 4px 0 24px;
    border: 0;
  }

  .cas-si-hero__action--phone{
    order: 2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: max-content;
    min-width: 0;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 20px 0 0px;
    border: 0;
    border-left: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    font-size: 21.25px;
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: 0;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition: color 180ms ease;
  }

  .cas-si-hero__action--phone .cas-si-hero__phone-icon{
    width: 30px;
    height: 30px;
    margin-right: 13px;
  }

  .cas-si-hero__action--phone:hover,
  .cas-si-hero__action--phone:focus-visible{
    background: transparent;
    color: #59E00B;
    border: 0;
    text-decoration: none;
    transform: none;
    outline: none;
    box-shadow: none;
  }

  body.industry-detail-page .cas-si-hero__action--phone:hover,
  body.industry-detail-page .cas-si-hero__action--phone:focus-visible,
  .cas-si-hero--overview.cas-si-hero--industries .cas-si-hero__action--phone:hover,
  .cas-si-hero--overview.cas-si-hero--industries .cas-si-hero__action--phone:focus-visible{
    background: transparent;
    color: #0DB4FF;
    border: 0;
  }

  /*
   * Reuse the existing Request a Quote anchor as the mobile pill.
   * Its shape and proportions match the homepage sustainability
   * button while using the primary CAS header green.
   */
  .cas-si-hero__action--quote{
    order: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    width: max-content;
    min-width: 0;
    height: 50px;
    min-height: 50px;
    margin: 0;
    padding: 0 26px;
    border: 1px solid #59E00B;
    border-radius: 999px;
    background: #59E00B;
    color: #050505;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition:
      transform 180ms ease,
      background 180ms ease,
      border-color 180ms ease;
  }

  .cas-si-hero__action--quote:hover,
  .cas-si-hero__action--quote:focus-visible{
    background: #4fc715;
    color: #050505;
    border-color: #4fc715;
    text-decoration: none;
    transform: translateY(-1px);
    transition:
      transform 180ms ease,
      background 180ms ease,
      border-color 180ms ease;
  }

  /*
   * Industry detail pages use the same blue as the
   * Schedule consultation button in the industry-page header.
   */
  body.industry-detail-page .cas-si-hero__action--quote,
  .cas-si-hero--overview.cas-si-hero--industries .cas-si-hero__action--quote{
    background: #0DB4FF;
    border-color: #0DB4FF;
    color: #050505;
  }

  body.industry-detail-page .cas-si-hero__action--quote:hover,
  body.industry-detail-page .cas-si-hero__action--quote:focus-visible,
  .cas-si-hero--overview.cas-si-hero--industries .cas-si-hero__action--quote:hover,
  .cas-si-hero--overview.cas-si-hero--industries .cas-si-hero__action--quote:focus-visible{
    background: #0DB4FF;
    border-color: #0DB4FF;
    color: #050505;
  }

  .cas-si-hero__action--quote:focus-visible{
    outline: none;
    box-shadow: 0 0 0 2px #FFFFFF;
  }

  .cas-si-hero__copy{
    order: 1;
    padding: 0;
  }

  .cas-si-hero__title{
    font-size: clamp(2.1rem, 10.5vw, 3rem);
  }

  .cas-si-hero__subtitle-row{
    width: 100%;
    margin-top: 26px;
    margin-bottom: 26px;
  }

  .cas-si-hero__media{
    order: 3;
    margin-top: clamp(22px, 4vw, 32px);
  }

  .cas-si-hero__divider{
    margin-top: 16px;
  }
}

@media (max-width: 520px){
  :root{
    --cas-si-hero-mobile-controls-space: 140px;
  }

  .cas-si-hero__title{
    font-size: clamp(1.75rem, 8.5vw, 2.4rem);
    letter-spacing: -0.035em;
  }

  .cas-si-hero__subtitle{
    font-size: clamp(0.92rem, 3.8vw, 1rem);
  }

  .cas-si-hero__subtitle-row{
    margin-top: 18px;
    margin-bottom: 18px;
    gap: 12px;
  }

  .cas-si-hero__action--quote{
    height: clamp(42px, calc(32px + 3.46vw), 50px);
    min-height: clamp(42px, calc(32px + 3.46vw), 50px);
    padding-right: clamp(20px, calc(14px + 2.3vw), 26px);
    padding-left: clamp(20px, calc(14px + 2.3vw), 26px);
    font-size: clamp(13px, calc(10px + 0.96vw), 15px);
  }
}

@media (max-width: 360px){
  :root{
    /*
     * Preserve enough height for the stacked quote and
     * callable phone controls on narrow mobile screens.
     */
    --cas-si-hero-mobile-controls-space: 140px;
  }

  .cas-si-hero{
    padding: 14px 0 14px;
  }

  .cas-si-hero__title{
    font-size: clamp(1.5rem, 7.5vw, 2rem);
  }
}

@media (min-width: 1200px){
  body.service-detail-page.cas-service-v2 .cas-si-hero__inner,
  body.industry-detail-page .cas-si-hero__inner,
  .cas-si-hero--overview .cas-si-hero__inner{
    zoom: 0.85;
  }
}

@media (prefers-reduced-motion: reduce){
  .cas-si-hero__action{
    transition: none;
  }
}