.apak-expertise {
  container-type: inline-size;
  --apak-rail-bleed: max(100px, calc((100cqw - 1300px) / 2));
  --apak-extra-bleed: max(0px, calc((100cqw - 1500px) / 2));
  background: var(--apak-white);
}

.apak-expertise__row {
  column-gap: 24px;
}

.apak-expertise__copy-column {
  grid-column: span 4;
  order: 2;
  padding-block: 110px 70px;
}

.apak-expertise__copy {
  max-width: 315px;
}

.apak-expertise__symbol {
  padding: 1px 0 2px 3px;
}

.apak-expertise__symbol img {
  width: 34px;
  height: 32px;
}

.apak-expertise__title {
  margin: 0;
  font-size: 21px;
  font-weight: 300;
  line-height: 33px;
  letter-spacing: 2.1px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.apak-expertise__rule {
  position: relative;
  width: 154px;
  max-width: 100%;
  height: 1px;
  margin-top: 9px;
}

.apak-expertise__rule::before {
  content: "";
  position: absolute;
  right: 0;
  width: 364px;
  height: 1px;
  background: var(--apak-lime);
}

.apak-expertise__body {
  margin-top: 22px;
  font-size: 15px;
  line-height: 21px;
  overflow-wrap: anywhere;
}

.apak-expertise__body p {
  margin: 0;
}

.apak-expertise__body p + p {
  margin-top: 20px;
}

.apak-expertise__body strong {
  color: var(--apak-orange);
  font-weight: 700;
}

.apak-expertise__closing {
  margin: 27px 0 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.apak-expertise__rail-column {
  grid-column: span 8;
  order: 1;
}

.apak-expertise__rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 63px;
  width: calc(100% + var(--apak-rail-bleed) + 24px);
  max-width: calc(941px + var(--apak-extra-bleed));
  margin-left: calc(-1 * var(--apak-rail-bleed));
}

.apak-expertise__viewport {
  position: relative;
  z-index: 1;
  max-width: calc(878px + var(--apak-extra-bleed));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--apak-ink) #f5f5f5;
  scrollbar-width: none;
}

.apak-expertise__viewport:focus-visible {
  outline: 2px solid var(--apak-ink);
  outline-offset: -3px;
}

/* Native scrolling remains available; hide its visual bar before and after initialization. */
.apak-expertise[data-apak-expertise-ready] .apak-expertise__viewport {
  cursor: grab;
}

.apak-expertise[data-apak-expertise-ready] .apak-expertise__viewport[data-apak-expertise-dragging] {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.apak-expertise__viewport::-webkit-scrollbar {
  display: none;
}

.apak-expertise__cards {
  display: grid;
  grid-auto-columns: 293px;
  grid-template-columns: none;
  grid-template-rows: 1fr auto auto auto;
  width: max-content;
}

.apak-expertise__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  grid-row: 1 / 5;
  min-width: 0;
  position: relative;
  isolation: isolate;
  color: var(--apak-white);
  scroll-snap-align: start;
}

.apak-expertise__photo {
  grid-column: 1;
  grid-row: 1 / 5;
  display: grid;
  min-width: 0;
  position: relative;
}

.apak-expertise__photo::before {
  content: "";
  aspect-ratio: 293 / 537;
}

.apak-expertise__card:first-child .apak-expertise__photo::before {
  width: min(100%, 292px);
}

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

.apak-expertise__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--apak-ink);
  opacity: .6;
  mix-blend-mode: multiply;
}

.apak-expertise__icon {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  z-index: 1;
  margin: 0 0 15px 44px;
}

.apak-expertise__card-rule {
  grid-column: 1;
  grid-row: 3;
  z-index: 1;
  height: 1px;
  width: 180px;
  max-width: calc(100% - 74px);
  margin: 0 30px 14px 44px;
  background: var(--apak-lime);
}

.apak-expertise__card-title {
  grid-column: 1;
  grid-row: 4;
  z-index: 1;
  margin: 0 30px 48px 44px;
  font-size: 18px;
  font-weight: 700;
  line-height: 20px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

/* Keep the first card's inset within its equal-width track on wide screens. */
.apak-expertise__card:first-child .apak-expertise__card-rule {
  max-width: calc(100% - min(var(--apak-rail-bleed), 100px) - 12px);
}

.apak-expertise__card--industrial .apak-expertise__icon {
  margin-left: 41px;
}

/* Source arrows sit in the white gutter, aligned with the photo bottom.
   Normal grid flow reserves their space even when labels or copy grow. */
.apak-expertise__controls {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  display: flex;
  gap: 0;
  margin-right: 5px;
}

.apak-expertise__controls button {
  display: grid;
  place-items: center;
  padding: 13px 6px;
  border: 0;
  background: transparent;
  color: var(--apak-ink);
  cursor: pointer;
}

.apak-expertise__controls button:disabled {
  opacity: .4;
  cursor: default;
}

.apak-expertise__controls button:is(:hover,:focus-visible):not(:disabled) {
  background: var(--apak-lime);
}

.apak-expertise__controls button:focus-visible {
  outline-color: var(--apak-ink);
  outline-offset: 0;
}

/* Both controls reuse the unchanged left glyph from the exact source SVG. */
.apak-expertise__arrow {
  display: block;
  width: 12px;
  height: 18px;
  background: url("../../icons/expertise-arrows.svg") no-repeat left top / 36px 18px;
}

.apak-expertise__next .apak-expertise__arrow {
  transform: rotate(180deg);
}

/* The yellow block is a position indicator for the horizontally scrolling list. */
.apak-expertise__accent {
  position: relative;
  grid-column: 1 / -1;
  height: 13px;
  overflow: hidden;
  background: #f5f5f5;
}

.apak-expertise__accent::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: 0;
  width: min(127px, 100%);
  background: var(--apak-lime);
  transform: translateX(var(--apak-expertise-indicator-x, 0px));
  will-change: transform;
}

@media (min-width: 1025px) and (max-width: 1200px) {
  .apak-expertise {
    --apak-rail-bleed: 60px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .apak-expertise {
    --apak-rail-bleed: 40px;
  }
}

@media (max-width: 767px) {
  .apak-expertise {
    --apak-rail-bleed: 20px;
  }
}

@media (max-width: 1100px) {
  .apak-expertise__copy-column, .apak-expertise__rail-column {
    grid-column: span 12;
    order: 0;
  }

  .apak-expertise__copy-column {
    padding-block: 103px 48px;
  }

  .apak-expertise__copy {
    max-width: 624px;
    margin-inline: auto;
  }

  .apak-expertise__rule::before {
    width: 154px;
  }

  .apak-expertise__rail {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  .apak-expertise__viewport {
    max-width: none;
  }

	.apak-expertise__controls {
        grid-column: 1;
        grid-row: 2;
        gap: 4px;
        margin: 0;
        padding-block: 8px;
        padding-right: 30px;
    }

  .apak-expertise__controls button {
    padding-inline: 10px;
  }

  .apak-expertise__cards {
    width: 100%;
    grid-template-columns: none;
    grid-auto-columns: max(280px, 33.333333%);
  }

  .apak-expertise__card:first-child > :is(.apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title) {
    margin-left: 30px;
  }

  .apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title {
    margin-left: 30px;
  }

  .apak-expertise__card-rule, .apak-expertise__card:first-child .apak-expertise__card-rule {
    max-width: calc(100% - 60px);
  }
}

@media (max-width: 767px) {
  .apak-expertise__copy-column {
    padding-top: 64px;
  }
  
  .apak-expertise__title {
    font-size: 20px;
    line-height: 30px;
    letter-spacing: 2px;
}

    .apak-expertise__controls {
        grid-column: 1;
        grid-row: 2;
        gap: 4px;
        margin: 0;
        padding-block: 8px;
        padding-right: 15px;
    }
    .apak-expertise__copy {
        padding: 0px 20px;
    }
}

@media (width < 767px) {
  .apak-expertise__controls button {
    font-size: 14px;
    line-height: 32px;
  }
}

@media  (min-width: 768px) and (max-width: 1024px) {.apak-section.apak-expertise .apak-container {
    width: min(calc(100% - 0px), 1080px);
    margin-inline: auto;
}}
@media  (max-width: 767px) {.apak-section.apak-expertise .apak-container {
    width: min(calc(100% - 0px), 1080px);
    margin-inline: auto;
}}

/* D48: the metal-service reveal, adapted to the narrower expertise rail.
   Both layers stay in the grid: the full description determines card height. */
@font-face {
  font-family: "Lato";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("../../metal/fonts/lato-light-italic.woff2") format("woff2");
}
.apak-expertise__card-content {
  grid-area: 1 / 1 / 5 / 2;
  z-index: 2;
  align-self: start;
  min-inline-size: 0;
  padding: 38px 24px 46px 30px;
}
.apak-expertise__detail-icon { max-inline-size: 100%; object-fit: contain; object-position: left bottom; }
.apak-expertise__detail-rule { inline-size: min(180px, 100%); block-size: 1px; margin-block: 19px 14px; background: var(--apak-lime); }
.apak-expertise__detail-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 20px; text-transform: uppercase; overflow-wrap: anywhere; }
.apak-expertise__detail-body { margin-block-start: 13px; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.apak-expertise__detail-body p { margin: 0; }
.apak-expertise__detail-body p + p { margin-block-start: 20px; }
.apak-expertise__card--details > :is(.apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title) { opacity: 0; pointer-events: none; }
.apak-expertise__card--details .apak-expertise__photo::after { opacity: .8; }
.apak-expertise__card--details:focus-visible { outline: 2px solid var(--apak-lime); outline-offset: -4px; }
@media (hover: hover) and (pointer: fine) {
  .apak-expertise__card--details > :is(.apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title) { opacity: 1; transition: opacity 250ms ease; }
  .apak-expertise__card--details .apak-expertise__photo::after { opacity: .6; transition: opacity 300ms ease; }
  .apak-expertise__card-content { opacity: 0; pointer-events: none; transition: opacity 300ms ease; }
  .apak-expertise__card--details:is(:hover, :focus-within) > :is(.apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title) { opacity: 0; }
  .apak-expertise__card--details:is(:hover, :focus-within) .apak-expertise__photo::after { opacity: .8; }
  .apak-expertise__card--details:is(:hover, :focus-within) > .apak-expertise__card-content { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .apak-expertise__card--details > *, .apak-expertise__card--details .apak-expertise__photo::after { transition: none; }
}
@media print {
  .apak-expertise__card--details > :is(.apak-expertise__icon, .apak-expertise__card-rule, .apak-expertise__card-title) { opacity: 0 !important; }
  .apak-expertise__card-content { opacity: 1 !important; }
  .apak-expertise__card--details .apak-expertise__photo::after { opacity: .8 !important; }
}

/* Home cards link to Metaalafwerking; retain the existing content-sized grid. */
.apak-expertise__card--linked > .apak-expertise__card-content {
  visibility: hidden;
  pointer-events: none;
}
.apak-expertise__card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.apak-expertise__card-link:focus-visible {
  outline: 2px solid var(--apak-lime);
  outline-offset: -4px;
}
