/* ==========================================================================
   EXOES - Home page sections
   File: /site/assets/css/home.css
   Loaded only by the home pages (/en/, /, /de/).
   Assisté par IA
   ========================================================================== */

/* ---------- Hero slideshow ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  background-color: var(--color-hero-bg);
  color: var(--color-white);
}

.hero__track,
.hero__slide {
  position: absolute;
  inset: 0;
}

.hero__slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.hero__slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Navy gradient at the bottom of each slide (as on the original site) */
.hero__slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 34, 94, 0) 0%, rgba(0, 34, 94, 0) 50%, rgba(0, 34, 94, 1) 100%);
}

.hero__text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: 30px 50px 100px;
}

.hero__title {
  max-width: 1920px;
  margin: 20px 100px;
  font-size: var(--size-h1);
  font-weight: var(--weight-bold);
  line-height: 60px;
  text-align: center;
}

.hero .btn--light {
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Arrows */
.slider-arrow {
  position: absolute;
  top: 75%;
  z-index: 3;
  width: 44px;
  height: 52px;
  margin-top: -26px;
  border: 0;
  background: url("../icons/arrow-left.svg") center / 26px 45px no-repeat;
}
.slider-arrow--prev { left: 40px; }
.slider-arrow--next { right: 40px; transform: rotate(180deg); }

/* Dots */
.hero__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero__dot {
  width: 20px;
  height: 20px;
  margin: 0 15px;
  padding: 0;
  border: 3px solid var(--color-primary);
  border-radius: 50%;
  background-color: var(--color-white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0);
  opacity: 0.4;
  transition: box-shadow 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.hero__dot.is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 1);
}

/* Pause button: required for accessibility (moving content) */
.hero__pause {
  position: relative;
  width: 24px;
  height: 24px;
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  opacity: 0.8;
}
.hero__pause::before,
.hero__pause::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 4px;
  height: 12px;
  background-color: var(--color-white);
}
.hero__pause::before { left: 7px; }
.hero__pause::after  { left: 13px; }
.hero__pause.is-paused::before {
  left: 8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--color-white);
  background: none;
}
.hero__pause.is-paused::after {
  display: none;
}

/* ---------- Introduction ---------- */
.intro {
  padding-top: 45px;
  padding-bottom: 55px;
  text-align: center;
}
.intro h2 {
  margin-bottom: 15px;
}
.intro p {
  margin: 0;
}

/* ---------- Target customers ---------- */
.audiences__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.audiences__images img {
  width: 100%;
}
.audiences__texts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: 100px 20px 75px;
}
.audience {
  padding-inline: 0;
  text-align: center;
}
.audience h3 {
  margin-bottom: 15px;
}
.audience p {
  margin-bottom: 25px;
}
.audience__mobile-image {
  display: none;
}

/* ---------- Data + 360° engineering (dark section) ---------- */
.engineering {
  min-height: 982px;
  padding: 50px 0 30px;
  background: var(--color-ink) url("../img/home/bg-engineering-1920.webp") center / cover no-repeat;
  color: var(--color-white);
}
.engineering__head {
  max-width: 1300px;
  margin: 0 auto 40px;
  text-align: center;
}
.engineering__head h3 {
  margin-bottom: 20px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  text-align: center;
}
.skills img {
  width: auto;
  height: 100px;
  margin: 0 auto 15px;
}

.engineering__360 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.engineering__visual img {
  width: 536px;
  max-width: 100%;
  margin-inline: auto;
}
.engineering__text {
  padding-right: 30px;
}
.engineering__text h3 {
  margin-bottom: 15px;
}

/* ---------- Thermal management solutions ---------- */
.solutions {
  padding-top: 60px;
}
.solutions .section-title {
  margin-bottom: 55px;
}
.solutions__panel {
  margin-inline: 10px;
  background-color: var(--color-panel-bg);
  color: var(--color-white);
}
.solutions__intro {
  max-width: 1000px;
  margin-left: 200px;
  padding: 60px 20px 40px;
}
.solutions__intro h3 {
  margin-bottom: 15px;
}

.flip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding: 40px;
}

/* Flip cards: turn on hover, keyboard focus, or tap (class added by main.js) */
.flip-card {
  height: 280px;
  perspective: 1000px;
}
.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}
.flip-card:hover .flip-card__inner,
.flip-card:focus-within .flip-card__inner,
.flip-card.is-flipped .flip-card__inner {
  transform: rotateX(180deg);
}
.flip-card__front,
.flip-card__back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card__front {
  background-color: #1ABC9C;
  background-position: center;
  background-size: cover;
}
.flip-card__front h3 {
  margin: 0;
  font-weight: var(--weight-semibold);
  color: var(--color-white);
}
.flip-card__front--batteries {
  background-image: url("../img/home/flip-immersion-cooled-batteries-768.webp");
}
.flip-card__front--heat-pumps {
  background-image: url("../img/home/flip-heat-pumps-768.webp");
}
.flip-card__back {
  transform: rotateX(180deg);
  background-color: var(--color-flip-back);
}
.flip-card__back p {
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 21px;
}

/* ---------- News ---------- */
.news {
  padding-top: 70px;
  padding-bottom: 50px;
}
.news .section-title {
  margin-bottom: 70px;
}
.news__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.news-card__image {
  width: 300px;
  height: 300px;
  object-fit: cover;
}
.news-card h4 {
  flex: 1;
  max-width: 340px;
  margin: 25px 0 30px;
  font-size: var(--size-h4);
}

/* Customer logos carousel */
.logo-slider {
  width: 300px;
  height: 300px;
}
.logo-slider__track,
.logo-slider__track li {
  width: 100%;
  height: 100%;
}
.logo-slider__track {
  position: relative;
}
.logo-slider__track li {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.logo-slider__track li.is-active {
  opacity: 1;
}
.logo-slider__track img {
  max-width: 260px;
  max-height: 200px;
  width: auto;
}

/* ---------- Use-case pop-ups ---------- */
.case-dialog {
  width: min(1152px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  padding: 30px 28px;
  border: 0;
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
}
.case-dialog::backdrop {
  background: rgba(0, 0, 0, 0.15);
}
.case-dialog h2 {
  margin: 0 40px 35px;
  text-align: center;
}
.case-dialog__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 26px;
  height: 26px;
  border: 2px solid var(--color-ink);
  border-radius: 50%;
  background: none;
}
.case-dialog__close::before,
.case-dialog__close::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 4px;
  width: 14px;
  height: 2px;
  background-color: var(--color-ink);
  transform: rotate(45deg);
}
.case-dialog__close::after {
  transform: rotate(-45deg);
}
.case-dialog__body {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
}
.case-dialog__images img {
  width: 300px;
  margin-bottom: 20px;
}
.case-dialog__text {
  font-size: 15px;
}
.case-dialog__text p {
  margin-bottom: 14px;
}
.case-dialog__text a {
  text-decoration: underline;
}
.case-dialog__summary {
  margin: 30px 0 0;
  font-size: var(--size-h6);
  font-weight: var(--weight-bold);
  text-align: center;
}

/* ---------- Tablet (768px to 1024px) ---------- */
@media (max-width: 1024px) {
  .hero__title {
    margin: 20px 40px;
  }
  .solutions__intro {
    margin-left: 0;
  }
  .flip-grid {
    gap: 30px;
  }
  .engineering__360 {
    grid-template-columns: 1fr;
  }
  .engineering__visual img {
    width: 304px;
  }
}

/* ---------- Mobile (up to 767px) ---------- */
@media (max-width: 767px) {
  .hero__text {
    padding: 30px 40px 100px;
  }
  .hero__title {
    margin: 20px 0;
  }
  .slider-arrow--prev { left: 0; }
  .slider-arrow--next { right: 0; }
  .hero__dot {
    margin: 0 12px;
  }

  .intro {
    padding-inline: 20px;
  }
  .audiences__images {
    display: none;
  }
  .audiences__texts {
    grid-template-columns: 1fr;
    gap: 50px;
    padding: 20px 20px 50px;
  }
  .audience {
    padding-inline: 0;
  }
  .audience__mobile-image {
    display: block;
    width: 100%;
    margin-bottom: 25px;
  }

  .engineering {
    min-height: 0;
    background-image: url("../img/home/bg-engineering-960.webp");
  }
  .engineering__head {
    padding-inline: 10px;
  }
  .skills {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .engineering__visual img {
    width: 288px;
  }
  .engineering__text {
    padding: 0 10px;
    text-align: center;
  }

  .flip-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px 20px;
  }
  .solutions__intro {
    padding: 40px 20px 10px;
  }

  .news__grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .case-dialog__body {
    grid-template-columns: 1fr;
  }
  .case-dialog__images {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .case-dialog h2 {
    margin-inline: 30px;
    font-size: 30px;
  }
}

/* Paragraphs placed inside the heading of the data section (French version) keep the text size */
.engineering__head h3 p {
  margin-top: 20px;
  font-size: var(--size-body);
  font-weight: var(--weight-regular);
  line-height: var(--line-height-body);
}
.engineering__head h3 p strong {
  font-weight: var(--weight-bold);
}

/* ---------- German pages on mobile: smaller headings (same values as the original theme) ---------- */
@media (max-width: 767px) {
  html:lang(de-DE) .hero__title { font-size: 39px; line-height: 1.2; }
  html:lang(de-DE) h2 { font-size: 29px; }
  html:lang(de-DE) h3 { font-size: 24px; }
}

/* Mobile adjustments measured against the original home page */
@media (max-width: 767px) {
  .engineering__text { text-align: left; padding: 0 20px; }
  .solutions__intro { padding: 40px 30px 10px; }
}
