/* Industries — see elements/industries.php, elements/industry.php and _/js/industries.js */
.industries {
  --in-din: "din-2014", "DIN 2014", "DIN Next", "Archivo", system-ui, sans-serif;
  --in-bg: #26282c;
  --in-orange: var(--mor-orange, #f47b20);
  --in-ink: #fff;
  --in-body: #c8cdd2;
  --in-nav-color: #fff;
  --in-nav-active: #4593dc;
  --in-nav-sep: var(--in-orange);
  --in-nav-h: 58px;
  --in-gutter: clamp(18px, 6vw, 88px);
  --in-media-w: 58%;
  --in-content-x: 56%;
  --in-content-w: 540px;
  --in-shift: 28px;            /* how far a pane slides as it comes and goes */
  --in-ease: cubic-bezier(.2, .7, .2, 1);
  /* pinned top: room for a fixed header (set inline from the element settings) */
  --in-top: var(--in-offset, 120px);
  --in-pin-h: calc(100vh - var(--in-top));
  position: relative;
  width: 100%;
  /* the scroll track: the panel stays pinned for one viewport plus a stretch per pane (--in-stops is set by the JS) */
  height: calc(var(--in-pin-h) * (1 + var(--in-stops, 6) * var(--in-length, 0.75)));
  background: var(--in-bg);
  color: var(--in-body);
  font-family: "Karla", system-ui, sans-serif;
}
/* phones: the small viewport height, so the panel fits with the toolbars showing */
@supports (height: 100svh) {
  .industries { --in-pin-h: calc(100svh - var(--in-top)); }
}
.industries *, .industries *::before, .industries *::after { box-sizing: border-box; }

.industries__pin {
  position: sticky;
  top: var(--in-top);
  height: var(--in-pin-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---- nav --------------------------------------------------------------- */
.industries__nav {
  position: relative;
  z-index: 3;
  flex: none;
  min-height: var(--in-nav-h);
  display: flex;
  align-items: center;
  padding-inline: var(--in-gutter);
  background: var(--in-bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.industries__nav::-webkit-scrollbar { display: none; }

.industries__nav-list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}
.industries__nav-item { display: flex; align-items: center; margin: 0; }
.industries__nav-item + .industries__nav-item::before {
  content: "";
  flex: none;
  width: 1px;
  height: 14px;
  margin-inline: 16px;
  background: var(--in-nav-sep);
}

.industries__nav-link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--in-nav-color);
  text-transform: uppercase; /* font comes from .font-button (main.scss) */
  cursor: pointer;
  transition: color .3s ease;
}
.industries__nav-link:hover,
.industries__nav-link:focus-visible,
.industries__nav-link[aria-current="true"] { color: var(--in-nav-active); }
.industries__nav-link:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

/* ---- slides ------------------------------------------------------------ */
.industries__slides { position: relative; flex: 1 1 auto; }

/* Before the JS runs the first slide and its first pane show */
.industries__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .8s ease, visibility 0s .8s;
}
.industries__slide.is-active,
.industries:not(.is-ready) .industries__slide:first-child {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity .8s ease;
}

.industries__media {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--in-media-w);
  overflow: hidden;
  /* the image fades into the background on its right */
  -webkit-mask-image: linear-gradient(to right, #000 45%, transparent);
  mask-image: linear-gradient(to right, #000 45%, transparent);
}
.industries__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.6s var(--in-ease);
}
.industries__slide.is-active .industries__img,
.industries:not(.is-ready) .industries__slide:first-child .industries__img { transform: none; }

/* pane images sit over the Industry's; the current pane's fades in (the JS sets .is-current) */
.industries__img--pane {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease, transform 1.6s var(--in-ease);
}
.industries__img--pane.is-current { opacity: 1; }
.industries__slide.is-active .industries__img--pane:not(.is-current) { transform: scale(1.06); }
.industries__img.is-instant { transition: none !important; }

/* every pane shares one grid cell on the right, centred in the panel */
.industries__panes {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--in-content-x);
  right: var(--in-gutter);
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, var(--in-content-w));
  align-items: center;
}
.industries__panes > * {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(var(--in-shift));
  transition: opacity .45s ease, transform .6s var(--in-ease), visibility 0s .6s;
}
/* panes before the current one leave upwards, the ones after wait below */
.industries__panes > .is-before { transform: translateY(calc(-1 * var(--in-shift))); }
.industries__panes > .is-active,
.industries:not(.is-ready) .industries__slide:first-child .industries__panes > :first-child {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .6s ease .2s, transform .8s var(--in-ease) .15s;
}
.industries__panes > .is-instant { transition: none !important; }

/* ---- copy -------------------------------------------------------------- */
.industries h2 {
  margin: 0;
  color: var(--in-ink);
  font-family: var(--in-din);
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.005em;
  text-transform: uppercase;
}
.industries h2 span { display: block; color: var(--in-orange); }
.industries__panes p {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.75;
  text-wrap: pretty;
}
.industries__panes > * > :first-child { margin-top: 0; }

.industries .industries__eyebrow {
  margin: 0 0 6px;
  color: var(--in-orange);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.industries__list ul,
ul.industries__list { margin: 0; padding: 0; list-style: none; }
.industries__list li {
  margin: 0;
  color: var(--in-ink);
  font-family: var(--in-din);
  font-size: clamp(17px, 1.55vw, 22px);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ---- narrow screens: image on top, copy below -------------------------- */
@media (max-width: 767px) {
  /* clear the 88px sticky mobile header */
  .industries { --in-nav-h: 52px; --in-shift: 20px; --in-top: var(--in-offset-mobile, 88px); }
  .industries__media {
    inset: 0 0 auto 0;
    width: auto;
    height: 44%;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
    mask-image: linear-gradient(to bottom, #000 55%, transparent);
  }
  .industries__panes {
    top: 38%;
    bottom: 16px;
    left: 16px;
    right: 16px;
    align-items: start;
    grid-template-columns: minmax(0, 1fr);
  }
  .industries h2 { font-size: clamp(26px, 4.2svh, 34px); }
  .industries__panes p { font-size: clamp(13px, 2svh, 15px); line-height: 1.6; }
  .industries__list li { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .industries__slide,
  .industries__slide.is-active,
  .industries__img,
  .industries__panes > *,
  .industries__panes > .is-active { transition: none; }
}

/* ---- builder: every slide and pane stacked so each can be edited ------- */
.industries__builder-label,
.industries__builder-thumb { display: none; }
body.bricks-is-builder .industries,
.brx-body.iframe .industries { height: auto; }
body.bricks-is-builder .industries__pin,
.brx-body.iframe .industries__pin { position: relative; height: auto; overflow: visible; }
body.bricks-is-builder .industries__slide,
.brx-body.iframe .industries__slide {
  position: relative;
  min-height: 70vh;
  opacity: 1;
  visibility: visible;
  border-top: 1px dashed rgba(255, 255, 255, .15);
}
body.bricks-is-builder .industries__img,
.brx-body.iframe .industries__img { transform: none; }
body.bricks-is-builder .industries__panes,
.brx-body.iframe .industries__panes {
  position: relative;
  left: auto;
  right: auto;
  min-height: 70vh;
  margin-left: var(--in-content-x);
  padding: 48px var(--in-gutter) 48px 0;
  grid-template-columns: minmax(0, var(--in-content-w));
  align-content: center;
  gap: 64px;
}
body.bricks-is-builder .industries__panes > *,
.brx-body.iframe .industries__panes > * {
  grid-area: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
}
body.bricks-is-builder .industries__builder-thumb,
.brx-body.iframe .industries__builder-thumb {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 0 16px;
  object-fit: cover;
  outline: 1px dashed rgba(255, 255, 255, .4);
}
body.bricks-is-builder .industries__builder-label,
.brx-body.iframe .industries__builder-label {
  display: block;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 8px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
@media (max-width: 767px) {
  body.bricks-is-builder .industries__panes,
  .brx-body.iframe .industries__panes { margin-left: 0; padding: 45vh 16px 32px; }
}
